vJASS & Zinc Documentation
For the latest documentation about how it works vJASS and Zinc language layers for Warcraft III, please follow these links:
Jasshelper documentation - Zinc documentation - WC3 Optimizer documentation

[HELP] A trigger that fires when game is restarted

moyack · 6749

0 Members and 1 Guest are viewing this topic.


Hello:

I was wondering if there's a trigger which runs when the game is restarted. I tried to see if game victory or game defeat runs in that moment. Thanks.


Re: [HELP] A trigger that fires when game is restarted
Reply #1 on: January 23, 2012, 06:07:11 PM

I just came up with a brilliant way to do it :D
First of all, when you restart a game, does the function config get called again? :O
If it doesn't, we can do this.
You're simply going to set a boolean that is true by default (a boolean called restarted) to false in the config function :D
I'm pretty sure config is only called when you host the map or something (probably how wc3 knows how many players there are supposed to be)
Plus, it calls SetMapDescription which is pretty useless in-game. That's more evidence as to why config would only be called while hosting the map.
If not, I have no idea :C

If I'm right, then you would depend on the value of the "restarted" boolean to know if the game is hosted for the first time or simply restarted :D



Re: [HELP] A trigger that fires when game is restarted
Reply #2 on: March 06, 2012, 07:49:07 AM

Hmmm... well, it seems complicated to have somehting like that, but I don't need it anymore, because I found the reason of the bug in my map.

*Never initialize sounds as constants*


Re: [HELP] A trigger that fires when game is restarted
Reply #3 on: March 15, 2012, 11:30:21 AM

That's why I always use SoundTools to manage my sounds :D
It's a lot easier ^_^



 

Chaos Realm - The world of Game modders and wc3 addicts     WC3JASS.com - The JASS Vault   Jetcraft - A Starcraft II mod