• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Trigger crashes the game

Status
Not open for further replies.
Level 4
Joined
Feb 4, 2014
Messages
50
Hello,

trough the adventures of creating a new map, I've come across this little problem that makes my map...
unplayable.

To explain what is wrong:
when I attack with a unit, the game goes into massive lag (I suspect it is due to
infinite counting operation progress but for that I do not know, I am asking here)
and won't go off. When I try to end warcraft process in the Task manager it won't let me either. Well, I am starting to stack some anger for the fact I
have to reset the computer every time I try to repair the trigger.

(it it supposted to have a 15% chance to create a unit)

Here it is (I have Czech version of Warcraft so do not get alarmed by it):
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
You have a lot of unnecessary actions inside that trigger and prolong it unnecessarily.
Conditions are using "And" by default, so there's no need to add the "And" when placing conditions.


There's no need to have multiple If/Then/Elses - instead of doing this:
  • If (All conditions are True) then do (Then actions) else do (Else actions)
    • If - Conditions
      • Level of Blade Mastery for unit1 is equal to 2
    • Then - Actions
      • Set level of Bladedance for unit2 to 2
    • Else - Actions
You can change it into this:
  • Set level of Bladedance for unit2 to (level of Blade Mastery for unit1)
This way you get rid of many unnecessary ITEs.

You also leak locations - "Position of (Attacking unit)" causes memory leak (this slow down your game reaaaalllyyyyy slowly, but if they pile up way too much, you will notice it).
You will need a point variable and do this:
  • Set Your_point_variable = Position of (Attacking unit)
  • Unit - Create your_unit at Your_point_variable...
  • Custom script: call RemoveLocation(udg_Your_point_variable)
Your idea for checking the "chance" is not really faulty, but again - you make useless comparison.
If you choose random number from 1 to 100, then the random number will never be less than 1 and never above 100. Thus the condition "BlademasterMInt is greater than or equal to 1" is unneeded as well.

I don't really see what could cause the problem, though - All you do is you calculate chance to proc the spell, if it procs, you create unit which is to follow the attacker.

Apart from some minor inefficiencies and leaks, I don't really see what could cause your game to freeze.

Maybe try to put the action at the start of your trigger
  • Trigger - Turn off (this Trigger)
...and at the end put this:
  • Wait - wait 0.01 seconds
  • Trigger - Turn on (this trigger)
While "Waits" are not really encouraged to be used, in this case it may help you to find out if the spell was looping endlessly and caused your PC to freeze or not.


In case you have more questions, you can PM me - I'm czech.
 
Last edited:
Level 4
Joined
Feb 4, 2014
Messages
50
hmm You've just made my day. Sometimes it's not about what you know, but how you think about it. Your way is goddamn easier than mine and I thank you for it
.

edit.: I meant to ask someone about how to post triggers for quite some time. Thank you deathismyfriend for initiative.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
I see nothing wrong in this part of the trigger, there is no "Attack" order there, unless the dancing blade says: "Fuck your follow, lets attack instead" to itself

edit: However, Nichilus made a good point for optimizations of the code
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
When I try to end warcraft process in the Task manager it won't let me either. Well, I am starting to stack some anger for the fact I have to reset the computer every time I try to repair the trigger.
Sounds like someone is using a single core CPU... To stop this happening on older systems you need to assign the WC3 process a lower priority so that if it does get into an infinite loop the scheduler will still give the explorer.exe process enough time to be responsive.

If you have 2 cores or more this is not a problem as WC3 is single threaded so can at most use one core at full load (leaving the other free to keep system responsiveness). Newer OS like Windows 7 have been designed to keep better responsiveness in the case of a process becoming unresponsive and using a lot of resources.

Is your dummy ability based on Shadow Strike (your WE seems to be in some strange language so I cannot tell)? Setting some fields of shadow strike to 0 (forget which, either was period or duration) causes it to enter an infinite loop state that will consume excessive resources until the unit dies.
 
Level 4
Joined
Feb 4, 2014
Messages
50
I've got a 8 core 5Ghz CPU (redisgned from the mironet ...) so the problem doesn't seem to be in insufficient CPU cs ... I wonder what's the problem but I'll surely post the result when I come up with one ... :)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
I've got a 8 core 5Ghz CPU (redisgned from the mironet ...) so the problem doesn't seem to be in insufficient CPU cs ... I wonder what's the problem but I'll surely post the result when I come up with one ... :)
I assume you have some overclocked Intel or AMD processor.

Something is seriously set up incorrectly with your system. I use an oldish i7 processor (4 cores with HT) and WC3 never manages to freeze the OS no mater how much of an infinite loop you get it into.

Try attaching the map to one of your posts. It will be easier for people to search for the error in their own localization.
 
Level 4
Joined
Feb 4, 2014
Messages
50
Heureka! I've found the problem; the ability I used for the Blademaster to learn in order to trigger the spell is Pillage. I accidentally removed (in the Object editor) the row for my ability that states on whom the effect is triggered.
It was not a loop error, it was just simply that the game didn't know what to do when Blademaster attacked and Pillage didn't have target accessibility.

(I'm sorry for not posting my map here, it's just that I had to find the problem on my own, that's a way for me to learn all this stuff. Otherwise it's easy to forget...)
 
Status
Not open for further replies.
Top