PDA

View Full Version : Another silly question (No.42): submission scripts?



No601_Swallow
Mar-29-2014, 03:33
I'm curious about people's experience of submission scripts.

Since I can't write code, I'm finding I'm putting more and more mission elements into their own submissions. Until recentlly, I've been giving each submission its own script (often just the ontrigger bit, etc). Well, I'm superstitious: if it works, keep doing it.

Anyway, I've been told that the game can only run one script per at a time, so all script elements should be in the "master" script, so to speak.

But: elements in my sub-scripts seem to "show through" in the main mission. The gpHUD... messages, and - when I'm testing the (DF) mission on my own - using onTrigger to start another submission. (This starting of another submission, though, doesn't seem to work when testing online with others.) And this is usually without the onBattledStarted listener thingy.

I suppose I'm a bit confused. If a submission .cs file doesn't work, it shouldn't work. Full stop. Period. And yet certainly the HUD messages, and sometimes other bits, do. So, am I going mad, or is there a rational explanation. Or is it just CloD being CloD?

Salmo
Mar-29-2014, 03:51
I'm curious about people's experience of submission scripts.

Since I can't write code, I'm finding I'm putting more and more mission elements into their own submissions. Until recentlly, I've been giving each submission its own script (often just the ontrigger bit, etc). Well, I'm superstitious: if it works, keep doing it.

Anyway, I've been told that the game can only run one script per at a time, so all script elements should be in the "master" script, so to speak.

But: elements in my sub-scripts seem to "show through" in the main mission. The gpHUD... messages, and - when I'm testing the (DF) mission on my own - using onTrigger to start another submission. (This starting of another submission, though, doesn't seem to work when testing online with others.) And this is usually without the onBattledStarted listener thingy.

I suppose I'm a bit confused. If a submission .cs file doesn't work, it shouldn't work. Full stop. Period. And yet certainly the HUD messages, and sometimes other bits, do. So, am I going mad, or is there a rational explanation. Or is it just CloD being CloD?

I understand fully what you mean. I did extensive work on scripts in sub-mission some years ago. You're right to say that some scripts 'attached' to sub-missions work well & some don't.

What I found was that console, log, HUD display type commands in sub-mission scripts do not work, but most other script methods do work. So C# commands like GamePlay.gpHUDLogCenter or Console.WriteLine don't work from subscripts.


For eaxample, the OnPlaceEnter() event will fire in your main mission script and in your sub-mission script. Now since some C# script commands work & some don't work in sub-missions, most mission builders have taken up the practice of putting all their code in the main mission's script so as to avoid some of the obscure 'failed' c# methods called from subscripts.

There is no right or wrong way to do this. If your using submission script and they work as intended, then more power to you.

No601_Swallow
Mar-31-2014, 14:53
Thanks for the reply Salmo! At least I know I'm not going completely crazy!