HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

How do I stop.....

08-03-2006, 09:15 AM#1
AtOmIc_PeAnUt
An integer variable, which is altered automatically and periodically via triggers going below 0? And also how would I make it so for every 30 seconds or so that the integer is at 0, the player's units lose a set amount of health? Thnx
08-03-2006, 10:08 AM#2
Wyvernoid
1) Why, 'think it easy, just add a "{Your Integer} Is Greater Than Or Equal To 0" condition the the "automatically and periodically running" trigger. Hope I didn't misunderstand you ;-)
2) Use the event "Time - Periodical Event" and condition "{Your Integer} Equal to 0", if I'm not wrong
08-03-2006, 10:48 AM#3
AtOmIc_PeAnUt
Thnx, but I dont see that working because there are several factors that effect how much the integer is decreased by every period, so it could go from say 40, down by 30 to 10, and then next time, it would still be above 0, so will still subtract 30 or more, and from then on it will just keep going into negative figures if U see what I mean :D But thnx anyways, is there not like a gameplay constant I can change or something?.

I also have another query now, lol. If I use the event "Player - Player types chat message (String((Random integer number between 10 and 1000000))) as and exact match" will the event response trigger "Integer(Entered Chat string)" recognise whatever number was entered within those boundary numbers, or will it have generated a random number between the two values and waited for a player to enter it? That probably sounds a lot more complicated than it is, but I have a knack for doing that, lol :D
08-03-2006, 11:20 AM#4
Wyvernoid
Quote:
Originally Posted by AtOmIc_PeAnUt
... and from then on it will just keep going into negative figures if U see what I mean :D But thnx anyways, is there not like a gameplay constant I can change or something?
Well now I see, would this be OK?
----------------
Event:Periodical/Condition:NONE
Actions:
Set intTemp = ThatInteger - howmuchyouwanttosubstract
if(intTemp<0)Then(Trun this trigger off)Else(Set ThatInteger=intTemp)
----------------

Quote:
Originally Posted by AtOmIc_PeAnUt
... or will it have generated a random number between the two values and waited for a player to enter it?
Yes it's this way, the number is fixed once generated.
08-03-2006, 11:43 AM#5
AtOmIc_PeAnUt
OK thnx, so how would I enable the player to type any number and get the triggers to recognise what has been entered and set a variable to the number?
08-03-2006, 02:13 PM#6
Wyvernoid
Tell the player to enter a number beginning with "-", and use the event "Player - Types chat message containing '-' as a substring". In the actions write "Set {integer} = Str2Int(Substring(StrTyped,2,LengthOf(StrTyped)))" (I wrote them in a simplified way, hope you understand)
08-03-2006, 02:30 PM#7
AtOmIc_PeAnUt
No lol, sry, could U do like a trigger tag for that? :D

OK, nvm, would this work? Sry, I dunno how to do trigger tags?

Set TradeAmount[1] = (Integer((Substring((Entered chat string), 2, (Length of (Entered chat string))))))
08-03-2006, 02:37 PM#8
Wyvernoid
Trigger:
Collapse Events
Player - Player 1 (Red) types a chat message containing - as a substring
Conditions
Collapse Actions
Set {YourInteger} = Integer(Substring(Entered chat message, 2, Length Of (Entered Chat Message)))
Many functions are used, try to find them yourself ;-)

EDIT: Saw your post, they're right.