June 21, 2021, 02:24:25

Author Topic: Nexus skirmish permission  (Read 5197 times)

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
Nexus skirmish permission
« on: April 26, 2009, 14:24:44 »
arpaso, do we have your permission to perform a little change on your tool?
'cause we're changing a few things in stargate that require a few changes in the script to work correctly, and we thought of adding a few lines to the mission your tool does.

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
(No subject)
« Reply #1 on: April 26, 2009, 15:27:10 »
Sure, change the script as you see fit. What are the necessary changes, though? Just curious ;)

If you're going to change the AI or objectives code, then consider introducing a new mission type instead of changing the existing ones. Create two new files in the modsNEXUS Skirmisher_templates-folder and name them XXX_ai.mach_ and XXX_obj.mach_, where XXX is the name of the new mission type. Put a MACHINE called "AI" in the first file and a MACHINE called "Objectives" in the second. Check the predefined mission types for reference. There's also some information about that topic in the otherwise rather outdated help file modsNEXUS Skirmisher_docNEXUS SKIRMISHER.HLP.

The Skirmisher should pick up the new mission type and allow you to use it for creating new missions.

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
(No subject)
« Reply #2 on: April 26, 2009, 21:07:04 »
great! I'll see what I can do.
I want to add these lines:

SelectShips(1, s.race=#race_player);
Execlist(1, S.this:shieldIntegrity:=4500000;);

SelectShips(2, s.race=#race_goauld);
Execlist(2, S.this:shieldIntegrity:=4500000;);

The scene init would be best, but any working rule should do.

Offline Arparso

  • Administrator
  • Lieutenant
  • *****
  • Posts: 558
  • Karma: 14
  • I can see you...
    • View Profile
    • http://arparso.de/nexus
(No subject)
« Reply #3 on: April 26, 2009, 22:29:39 »
Ah, that should be pretty easy. Just copy the default_ai.mach_ and default_obj.mach_, rename them to whatever you like (stargate_ai.mach_ for example) and add these lines to the first rule in the AI or Objectives MACHINE:
Code: [Select]
SelectShips(1, s.race=@race0@);
Execlist(1, S.this:shieldIntegrity:=4500000;);

SelectShips(2, s.race=@race1@);
Execlist(2, S.this:shieldIntegrity:=4500000;);
@race0@ and @race1@ are placeholders for whatever the player chooses as his or the enemy's race.

Actually you could shorten this a bit, if you're going to set shield integrity to identical values for both fleets. I'd also suggest giving the list a more meaningful name or you may risk colliding with other lists in the AI/Objectives script ;)

For example:
Code: [Select]
SelectShips(MoreShieldIntegrity, 1);
ExecList(MoreShieldIntegrity, S.this:shieldIntegrity:=4500000;);
Haven't tested it, but it should work. If you're going to select all ships anyway, you don't even need a condition, since SelectShips() already does that for you. (SelectShips(, ) is actually the same as Select(, S.ship & ))

To avoid list collisions or other problems, you can even move these lines of code into their own MACHINE and start this new MACHINE with the usual GetMachine()-command from the AI or Objectives MACHINE. ;)

Offline Mularac

  • Lieutenant
  • ***
  • Posts: 531
  • Karma: 11
    • View Profile
(No subject)
« Reply #4 on: April 26, 2009, 23:50:44 »
oh well, thank you. I'll test the last code, seems like the one.