Heal Trigger
Aug 3 2008, 8:21 pm
By: Adefic  

Aug 3 2008, 8:21 pm Adefic Post #1



Hey, I can't figure out how to make this trigger properly.

[Player 1] brings [exactly 1 Marine] to [player 1 repair]
Set hit points for All Marine owned by Player 1 at 'player 1 REPAIR' to 100%.

And I also can't put my finger on how to only let it work if the player enough minerals for the repair (1 mineral)

Your help is very appreciated!!
Adefic



None.

Aug 3 2008, 8:35 pm LosTZealoT Post #2



Im confused what you mean by "work properly," what exactly do you want to happen. The following trigger should do what I think you want...

Players:
Player 1[I guess]
Conditions:
Player 1 brings exactly 1 Marine to player 1 repair.
Player 1 has accumulated at least 1 ore
(Player 1 has suffered exactly 0 deaths of "unit x")
Actions:
Preserve Trigger.
Modify resources for Player 1: Subtract 1 ore.
(Modify deaths for Player 1: Set to 10 for "unit x".)
Set hit points for All Marine owned by Player 1 at player 1 repair to 100%.

(Players:
Player 1
Conditions:
Always.
Actions:
Preserve Trigger.
Modify deaths for Player 1: Subtract 1 for "unit x.")

The parts in "()" are suggested as a way of stopping the trigger for firing continuously, giving the player time to move out of the location. You could also use a switch that is set when a player enters the location and cleared when he leaves.



None.

Aug 3 2008, 8:42 pm Brontobyte Post #3



Trigger("Player 1"){
Conditions:
Bring("Player 1", "Terran Marine", "Repair", At least, 1);
Accumulate("Player 1", At least, 1, ore);

Actions:
Set Resources("Player 1", Subtract, 1, ore);
Modify Unit Hit Points("Player 1", "Terran Marine", 100, 1, "Repair");
Preserve Trigger();
Comment("Repair");
}

//-----------------------------------------------------------------/

Variables:

Player 1 - The player who you want the trigger to work for.
Player 1 - The owner of the unit in question.
Terran Marine - Unit you want repaired/healed.
Repair - Trigger Comment. (Optional)

There is only one problem I see with this trigger. It will keep firing as long as the player in question has the correct unit inside of the location "Repair" and as long as the player in question has at least 1 ore.

To fix this, you could simply set a switch to set when the player enters the location, and have another trigger to clear it when the player brings no units in question to the location. Then simply make the trigger accordingly.



None.

Aug 3 2008, 9:58 pm NudeRaider Post #4

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Bronto's solution will work.

If you want it to work for more than one player, have the trigger owned by the respective force and replace Player 1 with Current Player.




Aug 4 2008, 3:51 am Adefic Post #5



"To fix this, you could simply set a switch to set when the player enters the location, and have another trigger to clear it when the player brings no units in question to the location. Then simply make the trigger accordingly."

Thanks for your help!

Just having a bit of trouble figuring out how to do this, don't really know how switches work.



None.

Aug 4 2008, 4:13 am Kaias Post #6



Quote from Adefic
"To fix this, you could simply set a switch to set when the player enters the location, and have another trigger to clear it when the player brings no units in question to the location. Then simply make the trigger accordingly."

Thanks for your help!

Just having a bit of trouble figuring out how to do this, don't really know how switches work.
You set or clear a switch to read in conditions.

Conditions:
Current player brings 0 men to Heal Location
Switch 1 is set
Action
Clear Switch 1

Condition:
Current Player brings 1 marine to Heal location
Current Player accumulates at least 1 gas
Switch 1 is clear
Action:
Set switch 1
Subtract 1 gas for Current Player
Modify hit points for all marine at Heal location to 100%

These two triggers would make it so that would only be able to heal again once you've stepped off the location, that way you won't waste gas from being on the beacon too long.

Further explanation: http://www.staredit.net/?p=tutorials&tut=19



None.

Aug 4 2008, 7:58 am Ryan Post #7



The easiest way to keep the trigger from firing repeatedly is to move the unit to a different location. If you really insist on making the map look professional, then yes, you could use a switch.

A switch is like, well, a light switch. When the switch is off, the light goes off. When the switch is on, the light goes on.
(Light = Trigger)




None.

Aug 4 2008, 2:39 pm Falkoner Post #8



Moving the unit might also not update Bring in time to detect that the unit is no longer there, so it might run another time.



None.

Aug 4 2008, 3:44 pm LosTZealoT Post #9



A switch is a good method if the Marine is going back and forth from the heal, but in some maps, having the heal site heal while the unit is just sitting there is preferred. If your heal site will get massed by enemies and you want a play to have the ability to sit on the heal and get healed as long as you have the minerals to do it, then a DC would be better. But, if you don't need that, a switch is the easiest way.



None.

Aug 4 2008, 3:50 pm KyleIs1337 Post #10



Trigger 1

Players:
P1

Conditions:
Player 1 brings at least 1 Marine to Heal Location
Player 1 accumulates at least 1 Mineral
Switch 1 is Clear


Actions:
Subtract 1 gas for Player 1
Set Switch 1
Modify hit points for 1 Marine owned by Player 1 at Heal location to 100%
Preserve Trigger




Trigger 2

Players:
P1

Conditions:
Switch 1 is Set
Player 1 brings exactly 0 Marine to Heal Location

Actions:
Clear Switch 1






None.

Aug 4 2008, 5:33 pm Brontobyte Post #11



Quote from NudeRaider
Bronto's solution will work.

Of course! ^^ :bleh:



None.

Aug 4 2008, 5:39 pm Kaias Post #12



Quote from Kaias
Conditions:
Current player brings 0 men to Heal Location
Switch 1 is set
Action
Clear Switch 1

Condition:
Current Player brings 1 marine to Heal location
Current Player accumulates at least 1 gas
Switch 1 is clear
Action:
Set switch 1
Subtract 1 gas for Current Player
Modify hit points for all marine at Heal location to 100%

These two triggers would make it so that would only be able to heal again once you've stepped off the location, that way you won't waste gas from being on the beacon too long.

Further explanation: http://www.staredit.net/?p=tutorials&tut=19

Quote from KyleIs1337
Trigger 1
Players:
P1
Conditions:
Player 1 brings at least 1 Marine to Heal Location
Player 1 accumulates at least 1 Mineral
Switch 1 is Clear
Actions:
Subtract 1 gas for Player 1
Set Switch 1
Modify hit points for 1 Marine owned by Player 1 at Heal location to 100%
Preserve Trigger




Trigger 2
Players:
P1
Conditions:
Switch 1 is Set
Player 1 brings exactly 0 Marine to Heal Location
Actions:
Clear Switch 1

You realize you just wrote up the exact same trigger as I already had?



None.

Aug 4 2008, 10:02 pm Adefic Post #13



Hey thanks for the help!

one more question: lets say I have two marines and I heal one of them, then when I try to heal the other one, why doesn't the trigger work?



None.

Aug 4 2008, 10:12 pm Falkoner Post #14



You're using the same switch, you may want to use a death count, if it's for different players, if it's for the same player, you're going to have to do a bit more, like detect when 2 come in.



None.

Aug 4 2008, 10:45 pm KyleIs1337 Post #15



Kaias, sorry I didn't read the whole topic only the 1st post. Sorry :><:



None.

Aug 4 2008, 10:48 pm Adefic Post #16



Sorry, i'm a bit new to triggers, could you be more specific?
Thanks!



None.

Aug 4 2008, 10:59 pm KyleIs1337 Post #17



Adefic are you using SCM Draft or Starforge?

Post has been edited 1 time(s), last time on Aug 4 2008, 11:00 pm by KyleIs1337. Reason: Added question mark :p



None.

Aug 4 2008, 11:01 pm Falkoner Post #18



Well, do you have two different players, or one player with two marines? The problem you're having, if it's two different players, is that they are using the same switch, so if one player moves there and sets the switch, the other moves there and the switch is already set, so nothing happens.



None.

Aug 4 2008, 11:29 pm KyleIs1337 Post #19



I attached an example map. Copy it's triggers and that's all you need. Move your marine to the beacon and it's health gets healed 100%. When you walk off it goes down to 80% so you can do it as many times as you want. You only have 50 minerals though so you can only do it 50 times. It subtracts 1 mineral each time you use it. Open it up in any editor besides StarEdit. If you need more help or information feel free to post and I will get back to you.



None.

Aug 5 2008, 12:39 am Adefic Post #20



Thank you so much! It works perfectly, thank you again!



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[03:55 pm]
Zoan -- :wob:
[10:34 am]
NudeRaider -- SEN doesn't rely on spammers initiate its sleep cycle. It hat fully automated rest and clean-up phases. Please understand that this is necessary for the smooth operation of the site. Thank you.
[03:45 am]
Sylph-Of-Space -- Does the shoutbox get disabled when there's spammers?
[2024-5-17. : 6:47 am]
NudeRaider -- lil-Inferno
lil-Inferno shouted: nah
strong
[2024-5-17. : 5:41 am]
Ultraviolet -- 🤔 so inf is in you?
[2024-5-17. : 4:57 am]
O)FaRTy1billion[MM] -- my name is mud
[2024-5-17. : 4:35 am]
Ultraviolet -- mud, meet my friend, the stick
[2024-5-16. : 10:07 pm]
lil-Inferno -- nah
[2024-5-16. : 8:36 pm]
Ultraviolet -- Inf, we've got a job for you. ASUS has been very naughty and we need our lil guy to go do their mom's to teach them if they fuck around, they gon' find out
[2024-5-16. : 5:25 pm]
NudeRaider -- there he is, right on time! Go UV! :D
Please log in to shout.


Members Online: Wing Zero