PDA

View Full Version : Trigger Help


DarkMirror
01-01-2007, 12:51 AM
I need to make a trigger so that when a unit is brought to a location a message is played every ten seconds as long as they remain there. If they leave, it resets.

DoomGaze
01-01-2007, 1:25 AM
Condition:

-Current Player brings at least 1 [Insert Unit Here] to location1
-Current Player has suffered exactly 0 deaths of Dark Swarm

Actions

-Display Message: [Insert Message Here]
-Add 1 deaths of Dark Swarm for Current Player
-Preserve Trigger


Conditions

-Current Player has suffered at least 1 death of Dark Swarm

Actions

-Add 1 deaths of Dark Swarm for Current Player
-Preserve Trigger


Conditions

-Current Player has suffered at least 7 deaths of Dark Swarm

Actions

-Set 0 deaths of Dark Swarm for Current Player
-Preserve Trigger

Those three triggers should do the trick. Test it and adjust the last trigger to more or less deaths if it's not quite close to 10 seconds.

DarkMirror
01-01-2007, 2:20 AM
Thanks!

DarkMirror
01-01-2007, 1:03 PM
Oh, but does it have to be darkswarm?

And I just realised...This wont work. I'm gonna have a LOT of rooms that need text that repets. Is there a way to do it wqith swithches?

Aqo
01-01-2007, 2:29 PM
The answer DoomGaze gave you is perfect. It uses Death counters that are much more effective than Switches. You don't have to use Dark Swarm, you can use any unit that can't be killed on your map, so just use a different one per trigger. (Resources and powerups can be used too, and they can never be killed Same for doors, etc)

DarkMirror
01-01-2007, 2:40 PM
But it'll get mixed up becausde of the fact i have LIKE 93 ROOMS to do this for. So I doubt it'll work.

DoomGaze
01-01-2007, 5:04 PM
Use a different unit for each room. There's a little over a hundred units in SC anyways. Well, it also depends on what units the player will have. If any of the player's units die, then it might accidentally set off the message. It all depends on what sort of game you're making. Switches alone can't handle it, because you'll still need a timer system in order to set off the 10 second countdown.

You could also use wait triggers, but depending on how many players the game supports, and whether you're using hypers or not, it can seriously lag the triggers in the game.

DarkMirror
01-02-2007, 11:25 AM
I'm making an RPG dungeon crawl. But I've decidedx rto just scrap the room descriptions.

Tbone
01-20-2007, 7:02 PM
I need to make a trigger so that when a unit is brought to a location a message is played every ten seconds as long as they remain there. If they leave, it resets.

Ez Trigger 1
Players:[insert player]

Conditions:Current player brings atleast 1 [insert unit]
Set switch "Text" is set(might be int actions so put this there if it is)

Actions:~Display text [insert text]
Wait 10000 milliseconds(oh and copy the text trigger above so you dont have to do it over and over again)
(then copy wait 10000 milliseconds again and again)
(then put them in order like Text wait text wait text wait)

Trigger 2
Player:[insert]

conditions:Current player brings atleast 1 [insert unit] to anywhere
Set switch "Text" is cleared

Actions:Center view current player at anywhere
------------------------this should work...-Tbone:)

matefkr
01-21-2007, 7:23 AM
Comment for trigger 2:

condition should be current player brings exectly 0 [insert unit] to this location.

advise: If you want use more triggers with wait commands and this triggers should be run "paralell" (not exactly) shall got a problem: till a wait is running, the engine will not start a wait command:

SO:
trigger1

condition:
elapsed time is at least 2 game second
action:
display message for curren player: "luafjsdfaj"
wait 10000
preserve trigger

trigger2
condition:
elapsed time is at least 6 game second
action:
display message: "jajjfdajlun"
wait 10000
preserve trigger

This two trigger might not do that, to display the first message, then four second afterdisplay the second, and it repeat this after 10 seconds after when the first message displayed.

It do: after the first two game second, it display the first, then after 4 second (while the trigger1 wait 4000 milisecond) it display the second, then wait 6 second and display the first, after 10 second it display the second, after 10 second display the first, after 10 sec display second, after....

DoomGaze
01-21-2007, 5:03 PM
You could also use wait triggers, but depending on how many players the game supports, and whether you're using hypers or not, it can seriously lag the triggers in the game.

Except that problem may occur.

BrotherGreen
01-21-2007, 6:32 PM
Use death counts over switches all day. Death counts are very exact, whereas if one switch decides to bone on you, your boned.

SilverCrusader
01-22-2007, 7:46 AM
Switches can be useful still... in random things.

BrotherGreen
01-22-2007, 12:07 PM
Mmhmm, of course. Switches are there for a reason. But if you have the choice between the two (Which you do not sometimes), pick death counts.