| 08-13-2003, 11:03 PM | #1 |
Okay, I've never really used text messages that much before, but I've added some of them through triggers in a map I'm working on, and I just can't get them to work right. Here's an example of a text message trigger I'm trying to use: Code:
[b]Events[/b] Unit - A unit enters [Region Name <GEN>] [b]Conditions[/b] (Owner of (Triggering Unit)) equal to (Picked Player) [b]Actions[/b] Game - Display to (All Players) for 10.00 seconds the text: [Message] That all works good, but the problem here is that whenever the trigger fires, for example, I step on a certain region, the text message just fires rapidly until I move off the region, and it's very annoying at times. Here's another example of a text message I'm trying to do, for when a player leaves the game: Code:
[b]Events[/b] Time - Every 20.00 seconds of game time [b]Conditions[/b] ((Picked Player) slot status) Not equal to Is Playing [b]Actions[/b] Game - Display to (All Players) for 10.00 seconds the text: ((Name of (Triggering Player)) + has left the game.) That seems to work fine, but now it shows that message every 20 seconds, but I just want it to show up right when the player leaves, and only once. How would I fix it so it only does that? I know these questions are extremely noobish, but I've been wondering how to fix these for a while and I just can't seem to figure it out on my own, even though the answers are probably very simple. Thanks in advance for the help. |
| 08-13-2003, 11:09 PM | #2 |
Add the trigger action (Turn [This Trigger] Off) at the very begining of actions list. Then, if you want it to continue doing this, at the end of the actions list, do a wait X seconds trigger and the turn (this trigger) on again. |
| 08-14-2003, 01:22 AM | #3 |
I suggest you use this: function Trig_Share_Control_Actions takes nothing returns nothing ....call DisplayTextToForce( GetPlayersAll(), ( GetPlayerName(GetTriggerPlayer()) + " has left the game." ) ) endfunction //=========================================================================== function InitTrig_Share_Control takes nothing returns nothing ....set gg_trg_Share_Control = CreateTrigger( ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(0), EVENT_PLAYER_LEAVE ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(1), EVENT_PLAYER_LEAVE ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(2), EVENT_PLAYER_LEAVE ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(3), EVENT_PLAYER_LEAVE ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(4), EVENT_PLAYER_LEAVE ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(5), EVENT_PLAYER_LEAVE ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(6), EVENT_PLAYER_LEAVE ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(7), EVENT_PLAYER_LEAVE ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(8), EVENT_PLAYER_LEAVE ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(9), EVENT_PLAYER_LEAVE ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(10), EVENT_PLAYER_LEAVE ) ....call TriggerRegisterPlayerEvent( gg_trg_Share_Control, Player(11), EVENT_PLAYER_LEAVE ) ....call TriggerAddAction( gg_trg_Share_Control, function Trig_Share_Control_Actions ) endfunction It's how DotA use... |
