HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Creating a Fire that slowly compresses an Arena - Need help

04-17-2006, 01:42 PM#1
Fulla
Ok basically the purpose of this is. In my arena I have rounds, which are meatn to be fairly short. Often players start trying to flee in circles, avoiding attacks which can make rounds last to long.

I made it so slowly fire starts spawning on the edges and slowly expanding inwards shrinking the arena overtime. So if the round lasts to long the arena becomes smaller and smaller, so there is no where to run.
If players are still alive the fire will eventually reach the center burning every1, so the guy on the higest hitpoints will survive and win.

Firstly I made lots of regions where I want the fires to spawn

Trigger 1, I set each region to a variable
Trigger:
Map initialization
Set FireRect[1] = Fire001 <gen>
Set FireRect[2] = Fire002 <gen>
Set FireRect[3] = Fire003 <gen>
etc. etc. goes on to 97

Creating The Fire trigger
Trigger:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
RoundinProgress Equal to True
Collapse Then - Actions
Collapse For each (Integer A) from 0 to 97, do (Actions)
Collapse Loop - Actions
Set tempPoint = (Center of FireRect[(Integer A)])
Unit - Create 1 Red Fire [2] for Neutral Hostile at tempPoint facing Default building facing (270.0) degrees
Custom script: call RemoveLocation(udg_tempPoint)
Wait 1.00 seconds
Collapse Else - Actions
Skip remaining actions

When a round is in progress I set RoundinProgress = true
When a round finishess I set RoundinProgress = false

The fire seems to work generally fine, but sometimes it goes funny, doesnt work some rounds, stops suddenly half way during over rounds

I have a trigger that does when a hero becomes revivable, and his whole team is dead, end the round

When round is off, after 30 seconds (time to buy stuff) it reactivates.

Is there anything wrong with these triggers? Or will I need to post the activate/deactivate rounds trigger, (They are very long)
04-17-2006, 01:54 PM#2
Captain Griffen
Shouldn't that be a game time wait? Try 'wait 1.5 game seconds', instead (1.5 because game seconds a bit shorter).

I can't see any problems, apart from maybe the wait in the loop, which I tend to avoid, but that could just be a random thing on my part.
04-17-2006, 02:26 PM#3
blu_da_noob
Are you using a 'For each Integer A' loop anywhere else in your map?
04-17-2006, 04:22 PM#4
Fulla
Quote:
Originally Posted by blu_da_noob
Are you using a 'For each Integer A' loop anywhere else in your map?

Can that cause problems??
04-17-2006, 04:32 PM#5
blu_da_noob
Yes. The 'Integer A' is a global variable, meaning that if another trigger uses an Integer A loop while your 'Compressing Arena' trigger is running, the value of Integer A will be change and may cause your loop to function incorrectly.

Edit: It's quite simple to fix with a local variable.
04-17-2006, 05:15 PM#6
Soultaker
Quote:
Originally Posted by blu_da_noob
Yes. The 'Integer A' is a global variable, meaning that if another trigger uses an Integer A loop while your 'Compressing Arena' trigger is running, the value of Integer A will be change and may cause your loop to function incorrectly.

Edit: It's quite simple to fix with a local variable.

If you look at the Warcraft engine, you will notice that only one trigger can run at a time. If that trigger runs some other trigger, the first trigger will pause until the second trigger is done or is at a "Wait" action.

So that can not likely be the problem..

- Soultaker
04-17-2006, 05:17 PM#7
Blade.dk
Yes, it can be the problem, as he is using waits inside his trigger. When a thread is running and it reaches a wait, other threads can run in the waiting time, as far as I know.
04-17-2006, 05:33 PM#8
Soultaker
Ah, yeah.. I misunderstod the point completely..

You should just make the counter a local variable then.. all through then you would properly have to remake the whole thing in JASS.

- Soultaker
04-17-2006, 10:32 PM#9
TaintedReality
There's a GUI function called 'For Each Integer Variable - Do Multiple Actions, which lets you input your own global variable in there. As long as you aren't using that variable anywhere else it would work, and you wouldn't have to mess with combining JASS and GUI in the same trigger.