Can anyone solve this odd trigger problem?

Darimus

BattleForums Addict
Joined
Oct 2, 2003
Messages
681
Reaction score
0
Website
www.spaceman.vze.com
Ok first off I have no clue what is going on with it... but I found out by trial and error that if I disable the Unit - Create (the hero) then it doesn't lag (You'll understand when you read the problem).

Now here's the problem. When anyone clicks the dialog button for the class they want to choose, if they are the first one to do it in the game, it hangs (frozen screen and mouse for all players and some lag afterwards) for about 10 seconds. The 2nd time you do it, it won't hang at all. And 3rd... and so on. Only the first time you do it, it hangs... and nothing different happens on the 2nd time or 3rd and on and on from the 1st time you do it.

Here's the trigger:

Code:
ClassConfirm
    Events
        Dialog - A dialog button is clicked for ClassConfirm
    Conditions
        (Clicked dialog button) Equal to ClassYes
    Actions
        Wait 0.50 seconds
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ConfirmClassNo[(Player number of (Triggering player))] Equal to 4
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        PlayerRace[(Player number of (Triggering player))] Equal to Avian
                    Then - Actions
                        Unit - Create 1 Avian Nightblade for (Triggering player) at (Position of Hero[(Player number of (Triggering player))]) facing (Facing of Hero[(Player number of (Triggering player))]) degrees
                        For each (Integer A) from 1 to 6, do (Actions)
                            Loop - Actions
                                Hero - Drop (Item carried by Hero[(Player number of (Triggering player))] in slot (Integer A)) from Hero[(Player number of (Triggering player))]
                                Hero - Give (Last dropped item) to (Last created unit)
                        Hero - Set (Last created unit) experience to (Hero experience of Hero[(Player number of (Triggering player))]), Hide level-up graphics
                        Unit - Remove Hero[(Player number of (Triggering player))] from the game
                        Set Hero[(Player number of (Triggering player))] = (Last created unit)
                        Skip remaining actions
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        PlayerRace[(Player number of (Triggering player))] Equal to Mazan
                    Then - Actions
                        Unit - Create 1 Mazan Nightblade for (Triggering player) at (Position of Hero[(Player number of (Triggering player))]) facing Default building facing degrees
                        For each (Integer A) from 1 to 6, do (Actions)
                            Loop - Actions
                                Hero - Drop (Item carried by Hero[(Player number of (Triggering player))] in slot (Integer A)) from Hero[(Player number of (Triggering player))]
                                Hero - Give (Last dropped item) to (Last created unit)
                        Hero - Set (Last created unit) experience to (Hero experience of Hero[(Player number of (Triggering player))]), Hide level-up graphics
                        Unit - Remove Hero[(Player number of (Triggering player))] from the game
                        Set Hero[(Player number of (Triggering player))] = (Last created unit)
                        Skip remaining actions
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        PlayerRace[(Player number of (Triggering player))] Equal to Nolath
                    Then - Actions
                        Unit - Create 1 Nolath Nightblade for (Triggering player) at (Position of Hero[(Player number of (Triggering player))]) facing Default building facing degrees
                        For each (Integer A) from 1 to 6, do (Actions)
                            Loop - Actions
                                Hero - Drop (Item carried by Hero[(Player number of (Triggering player))] in slot (Integer A)) from Hero[(Player number of (Triggering player))]
                                Hero - Give (Last dropped item) to (Last created unit)
                        Hero - Set (Last created unit) experience to (Hero experience of Hero[(Player number of (Triggering player))]), Hide level-up graphics
                        Unit - Remove Hero[(Player number of (Triggering player))] from the game
                        Set Hero[(Player number of (Triggering player))] = (Last created unit)
                        Skip remaining actions
                    Else - Actions
                        Do nothing
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        PlayerRace[(Player number of (Triggering player))] Equal to Orc
                    Then - Actions
                        Unit - Create 1 Orc Nightblade for (Triggering player) at (Position of Hero[(Player number of (Triggering player))]) facing Default building facing degrees
                        For each (Integer A) from 1 to 6, do (Actions)
                            Loop - Actions
                                Hero - Drop (Item carried by Hero[(Player number of (Triggering player))] in slot (Integer A)) from Hero[(Player number of (Triggering player))]
                                Hero - Give (Last dropped item) to (Last created unit)
                        Hero - Set (Last created unit) experience to (Hero experience of Hero[(Player number of (Triggering player))]), Hide level-up graphics
                        Unit - Remove Hero[(Player number of (Triggering player))] from the game
                        Set Hero[(Player number of (Triggering player))] = (Last created unit)
                        Skip remaining actions
                    Else - Actions
                        Do nothing
            Else - Actions
                Do nothing
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
Not actually sure..... But I'm not sure if 'Skip Remaining Actions' skips for that loop/conditional branch or the entire parent actions..... That would explain it, I suppose, because it is verifying 3 button actions, and you are invoking it 3 times using:

If (All Conditions are True) then do (Then Actions) else do (Else Actions)

So in all Warcraft is caching the instruction 9 times more than necessary. That would explain why the 2nd and 3rd times don't lag.

But I have no other theory besides this one.
 

Darimus

BattleForums Addict
Joined
Oct 2, 2003
Messages
681
Reaction score
0
Website
www.spaceman.vze.com
It's not those... I said that if I remove the unit - create stuff, it doesn't lag. even if i do it 9 times w/ all the other stuff there...

and it used to be that the only thing in the THENs were the unit creation, and the rest of the stuff moved to the bottom
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
Perhaps something is up with skins/spells/stuff thingy. I don't know, really, I don't know about FT and its Object Manager.
 

New threads

Top