Nexus Skirmisher
Nexus Modding => Scripting => Topic started by: Lord_Valarian on December 11, 2010, 08:30:18
-
I want to get the EMP machine running on all missions. Now, I have to add it mission by mission. How do I do this?
Thanks.
-
Add your Machine code to a separate file like "emp.machine". Add this code to the start of the file:
RULE event SceneInit
:action
GetMachine("EMPtorpedo"):ChangeState(default,0);
:end
END
Then include that file in every campaign .mission-file:
#include "emp.machine"
-
I'm already doing that, adding the machine to each mission. ?? It looks like I can add it whole episodes(set of missions) at time. Adding one statement to a file to add to all missions at once. This is what I mean.
-
What? I'm sorry, but you're not making a lot of sense. What Arparso posted's the only way to achieve that.
-
I'm already doing that, adding the machine to each mission. ?? It looks like I can add it whole episodes(set of missions) at time. Adding one statement to a file to add to all missions at once. This is what I mean.
That's not possible, as far as I'm aware of. Not a huge drawback, though - using my method you'll ever need to change each .mission file only once ... each subsequent change in the "emp.machine"-file will automatically apply to every mission you added the #include "emp.machine" to.
IMHO the best solution would be to create a new "globals.inc" file and add #include "globals.inc" to every mission. In that globals.inc you can then include every script or file you'll ever want to apply to every mission ... like the emp torpedo machine, for example. So if you ever wanted to add a "super duper mega tazer" script, you'd only need to add that file (or script) to the globals.inc instead of every separate mission file.
-
Check this section of code from "episode_1.rules":
RULE event EpisodeStart
condition ActEpisode=1
:action
//uSetDifficultyLevel(2);
// Player fleet feltoltese
Stiletto := uGet("ship_Stiletto");
Stiletto:uSetParent(uGetPlayersFleet());
uGetNPC(#NPC_Player):uSetParent(C.Stiletto);
uGetNPC(#NPC_Dispatcher):uSetParent(C.Stiletto);
// Lathatosag
uGet("stat_OSEC"):uSetDetectionLevel(#UDET_DETAILED);
uGet("stat_OrbInv"):uSetDetectionLevel(#UDET_DETAILED);
uGet("stat_ISA"):uSetDetectionLevel(#UDET_DETAILED);
uGet("stat_Michelangelo"):uSetDetectionLevel(#UDET_DETAILED);
uGetPlayersFleet():uSetDetectionLevel(#UDET_DETAILED);
uGet("stat_Sukenja"):uSetDetectionLevel(#UDET_NONE);
uGet("nav_Jupiter1"):uSetDetectionLevel(#UDET_NONE);
uGet("nav_Jupiter2"):uSetDetectionLevel(#UDET_NONE);
uGet("astfld_Jupiter_3"):uSetDetectionLevel(#UDET_NONE);
uGet("ASTFLD_PLUTO"):uSetDetectionLevel(#UDET_NONE);
uGet("gate_Sol_Alpha"):uSetDetectionLevel(#UDET_NONE);
uGet("gate_Entity_Sol"):uSetDetectionLevel(#UDET_NONE);
uGet("GATE_NEXUS_0"):uSetDetectionLevel(#UDET_NONE);
uGet("GATE_NEXUS_1"):uSetDetectionLevel(#UDET_NONE);
uGet("GATE_NEXUS_2"):uSetDetectionLevel(#UDET_NONE);
uGet("GATE_NEXUS_3"):uSetDetectionLevel(#UDET_NONE);
uGet("nav_noah"):uSetDetectionLevel(#UDET_NONE);
uGet("Mechanoid_Entity_E2"):uSetDetectionLevel(#UDET_NONE);
uGet("Mechanoid_Entity_E2F"):uSetDetectionLevel(#UDET_NONE);
:end
END
If I add it to this section of code, it should work. I think it could done on all missions at once. Look at "common.rules". It could be the key to adding a machine to all missions I'll try them later and see what happens.
EDIT: My ideas didn't work. The method mentioned works fine.