Trigger Help!

L

Lurker6569

Guest
Ok, im making a rpg. and im having a lil trouble with a trigger. I want the trigger to do this: When my "Harakim"(high templar)
"Ghost Companion"(Marine) dies i want it so when i go to the Inn it will create another one for him. please help me the trigger i have at the moment is this:

Conditions:
Current player brings exactly 1 Harakim to 'heal'.
Current player commands exactly 0 Ghost Companion.
Actions:
Create 1 Ghost Companion at 'heal' for Current Player.
Preserve trigger.


This trigger makes it so when i have 0 ghost companions and i go to heal it keeps creating them non stop. if i take preserve trigger away it only lets me create a Ghost companion once... please help me thank you
 
T

Terranator3

Guest
Yes, you must use a switch to cancel the the preserved action. An example is as follows:

CONDITION
Player commands at most 0 Marine
ACTION
Set 'Switch'
Preserve Trigger

CONDITION
Player commands at least 1 Marine
ACTION
Clear 'Switch'
Preserve Trigger

By setting and clearing the switch you are telling the game that the player either does or does not have a marine. Now that you have done that, you can make the triggers to create a marine:

CONDITION
Player brings at least 1 Templar to 'location'
Player commands at most 0 Marine
'Switch' is set
ACTION
Create 1 Marine at 'location'
Set deaths for Player: Subtract 1 for Marine
Preserve Trigger

Hope this helps
 
T

Terranator3

Guest
The Set Deaths trigger lets you modify the players death count.
In order for a preserved trigger to fire only once every time a condition is met you must oppose the 'positive' action with a 'negative' one.
In essence, by using the Set Deaths action, you are 'distracting' the games attention from creating units over and over again.
There are other methods of achieving this result, but the example I presented above is by far the easiest.
 
U

Unregistered

Guest
let me try to make this easier to understand. 'heal' will be the location where you bring the Harakim to get your ghost companion back

CONDITIONS:
'player' brings at least 1 'harakim' to 'heal
'player' commands exactly 0 'ghost companion'
switch 1 is cleared
ACTIONS:
create 1 'ghost companion' at 'location' for 'player'
set switch 1
preserve trigger

use this in combination with the previous trigger

CONDITIONS:
'player' brings exactly 0 'harakim' to 'heal'
ACTIONS:
clear switch 1
preserve trigger

this will make it so it will only make the ghost companion once and still be able to make it again if it dies
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top