HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Setting Variable and referring to it in the same trigger?

01-30-2003, 07:19 PM#1
Hakujin
In a trigger for a random monster location generator, I want to make this trigger:

Set variable (integer) MonsterLoc = Rnd 1-3

If MonsterLoc = 1 create unit X in region A else do nothing
If MonsterLoc = 2 create unit X in region B else do nothing
If MonsterLoc = 3 create unit X in region C else do nothing

Can I do this all in the same trigger or will that cause a problem? The reason I want to do this in a single trigger is that if I refer to outside triggers, my work increases exponentially (i am using random monsters also) Thanks!
01-30-2003, 08:24 PM#2
Trav
I've never had a problem doing that. Out of habit though, I usually place 0.05 wait's in my triggers just for the hell of it.
01-30-2003, 09:45 PM#3
Guest
u can do it without a problem
01-30-2003, 10:39 PM#4
got_ammo
If you setting Monsterlock to a random integer, make sure you have a wait in between sets, or else it will quit wc3. Also, I found out that having an integer constantly changing througought the entire game will cause tremendous lag on unit responses. I'm not sure if the lag would still happen if you had it changing non constantly, but it still might lag. Just experiment untill it works how you want it.
01-31-2003, 03:28 AM#5
Hakujin
Are you serious that it will lag? I have about 20 integers (regional monsters, plus 3 weather effects) changing every 5 [monster] / 120 [weather] seconds. Is that gonna kill my net games?
01-31-2003, 04:20 AM#6
got_ammo
Well I don't know if it will lag for you but when I was working on Resident Evil Dark, there was a trigger that changed a location every .01 seconds and it lagged the map shïtless. I don't know if it will happen to you but just remember it might..
01-31-2003, 08:30 AM#7
Hakujin
Jeez! You were firing a trigger 10 times per second! However, after thinking about what you said I realized that I would in fact be assigning a massive 72 Variables every 5 seconds. Sounds like lag potential to me! So I found a way to reduce that 72 monster variations to 3 global variables. Just to be safe.