HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

EASY Trigger Question (Or so I think...)

04-28-2003, 09:13 PM#1
Tearsong
I only want a message to display ONCE!

I'm using a leaderboard and keeping track of the values with varibales. Now when Variable X = 2, I want the message "bla bla" to appear. Then I want it to STOP, only appear once. But if Variable X every equals 2 again, then it should display "bla bla" ONCE, and STOP.

Why is this so difficult? I feel like such a triggering newbie... :(

I've tried a series of different methods, but none seem to work.
04-28-2003, 09:27 PM#2
ph33rb0
It's simple. For the event I assume you're using when Variable = whatever, but that probably won't matter. For the first action of your trigger, put Trigger - Turn Off (This Trigger) and it will never run again. If you want it to run When X = 2 at some time in the future, use Trigger - Turn On (name of trigger here) in an outside trigger and it will be turned on again. Hope that helped.
04-28-2003, 09:35 PM#3
Tearsong
Variable X = 2 is my Condition. That can't be my event, and the trigger will not run without the event. So my Event is Time - Every 1 seconds of Game time.
04-28-2003, 09:47 PM#4
sheepofdoom
Your problem is that by using every 1 second, the trigger will run every second, and hence if x=2 it will display the message. What you may want to do is, as fear.factor suggested, use trigger turn off this trigger after the text is displayed once. Later when you need to use it again turn it back on.

For example you could have another 1 second event that checks if x not equal to 2 and then turns the trigger back on.

If you know a time that it takes for x to chaneg you could use:

turn off this trigger
wait for y seconds
turn on this trigger

or else change the action. For example if x is a number of kills then make the action that player 1 kills a unit. If it is number of units trained use player 1 trains a unit etc.

Hope this helps,
SheepOfDoom
04-28-2003, 10:00 PM#5
Guest
you could try....

If / Then / Else

If [Integer Comparison]X equal to 2 then do [Game-Text Message(Explicitly Timed)] Game - Display to (player) for (# seconds) the text: bla bla bla else do nothing

Also instead of using another trigger put this in the leaderboard trigger then it should work perfectly. :ggani: This sometimes gets me mixed up also, but try what I just put down and I'm pretty sure it will work for you. You could try what sheep said also. The main name if you didnt know is Trigger - Turn off.

04-28-2003, 10:04 PM#6
HelpMe
NoNoNo!

Event: Every 2 Seconds of game time

Condition: NONE!

Action:

If Variable X equal to or greater than 2, text message all players bla bla..

Wait... 1 second

If Variable X equal to or greater than 2, Turn off this Trigger
04-28-2003, 10:16 PM#7
sheepofdoom
Quote:
Then I want it to STOP, only appear once. But if Variable X every equals 2 again, then it should display "bla bla" ONCE, and STOP

So he will need to turn the trigger back on afterwards. So in addition to the other suggestions you will need to detect when x is not equal to 2 so you can turn the trigger back on. Maybe when you set the value of x you could have if x not equal to 2 then turn trigger on.

In fact in the trigger where you set x you could have:
example:
set variable x = x +1
if x =2 run trigger (your x=2 trigger)

In this way you would create the x=2 trigger with no event and no condition (hence it doesnt run every 1 or 2 seconds creating lag) and it will only run when the value changes. You can add further if statments after this for example if x =3 run trigger (x=3 trigger) etc.

Hope this helps,
SheepOfDoom
04-28-2003, 10:29 PM#8
Tearsong
Could you write out your triggers? I'll write out mine with some of my own modifications. I got it to run once and stop, but am having trouble turning it back on...

Jenkins Warning System I
Events
RSniperClipJenkins becomes Equal to 2.00
Conditions
*SniperClipJenkins = 2
Actions
Trigger - Turn off this Trigger
Trigger - Run Jenkins Warning System II
________________________________

Jenkins Warning System II
Events
None
Conditions
None
Actions
Game - Display to All Players the text: Pvt. Jenkins is low on S2 AM Sniper Rifle Rounds. Advise Reload.
If SniperClipJenkins does not equal 2 and RSniperClipJenkins does not equal 2.00 then do trigger - Turn on Jenkins Warning System I, else do nothing.
Trigger - Turn off this trigger
_____________________________________________

I'm pretty sure that having the If/Then/Else statement is my problem since it isnt always checking, but I'm no sure how to fix it.
*Pretty sure this condition isnt needed

For RSniperClipJenkins; There is another trigger that ever .01 seconds of game time sets the value of the Real Variable RSniperClipJenkins to the value of SniperClip Jenkins.

Thanks for the help.
04-29-2003, 12:08 AM#9
sheepofdoom
Your problem is that the sniperclip warning trigger is only run when the variable =2. This means that it will never get to "if variable not equal to 2 turn on this trigger".

Instead I don't think you need to turn off the trigger because the action is "becomes 2" since it only becomes two once there should not be a problem. - so remove the turn off this trigger

If this still doesnt work try adding this to your trigger that reduces the variable (I guess its the firing trigger etc)


if (RSniperClipJenkins = 2) then do run trigger Jenkins Warning System II else do nothing.

this would sit after the Rsniperclipjenkis = Rsniperclipjenkins -1 line.

Hope this helps, let me know if you want more info,
SheepOfDoom
04-29-2003, 05:53 PM#10
Tearsong
I fixed it shortly after my previous post, but couldnt tell you how since I dont have the WE open atm. Thanks for your help!

Now on to another question:

how would I make it so a rifleman, or any ranged unit, can no longer shoot? I tried setting acquisition range but that didnt help.