November 10, 2024, 14:56:31

Author Topic: Machine on all missions  (Read 9576 times)

Offline Lord_Valarian

  • Specialist
  • *
  • Posts: 64
  • Karma: 0
    • View Profile
Machine on all missions
« 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.




Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
Re: Machine on all missions
« Reply #1 on: December 11, 2010, 11:02:11 »
Add your Machine code to a separate file like "emp.machine". Add this code to the start of the file:

Code: [Select]
RULE event SceneInit
:action
    GetMachine("EMPtorpedo"):ChangeState(default,0);
:end
END

Then include that file in every campaign .mission-file:

Code: [Select]
#include "emp.machine"

Offline Lord_Valarian

  • Specialist
  • *
  • Posts: 64
  • Karma: 0
    • View Profile
Machine on all missions
« Reply #2 on: December 12, 2010, 08:42:18 »
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.






Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Re: Machine on all missions
« Reply #3 on: December 12, 2010, 19:00:46 »
What? I'm sorry, but you're not making a lot of sense. What Arparso posted's the only way to achieve that.

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
Re: Machine on all missions
« Reply #4 on: December 12, 2010, 19:18:17 »
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.

Offline Lord_Valarian

  • Specialist
  • *
  • Posts: 64
  • Karma: 0
    • View Profile
Machine on all missions
« Reply #5 on: December 14, 2010, 20:48:08 »
Check this section of code from "episode_1.rules":

Code: [Select]
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.




« Last Edit: December 16, 2010, 08:43:07 by Lord_Valarian »