Trigger Crashes Game

Weyrling

New Member
Reaction score
25
The following trigger causes WC3 to close with no fatal error screen or any from of error message, I would greatly appreciate assistance.
This is the Initialization Code:
Code:
Generic Unit Takes Damage Init
    Events
        Unit - A unit enters (Playable map area)
    Conditions
    Actions
        Trigger - Add to Unit Takes Damage Event <gen> the event (Unit - (Entering unit) Takes damage)
This is the trigger that actually crashes it:
Code:
Unit Takes Damage Event
    Events
    Conditions
        ((Damage source) is A Hero) Equal to True
    Actions
    If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    If - Conditions
        AgiCritDmgBool[(Player number of (Owner of (Damage source)))] Equal to True
    Then - Actions
        Set AgiCritDmgBool[(Player number of (Owner of (Damage source)))] = False
    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Random integer number between 1 and 10000) Less than or equal to (Agility of (Damage source) (Include bonuses))
            Then - Actions
                Set AgiCritDmgBool[(Player number of (Owner of (Damage source)))] = True
                Unit - Cause (Damage source) to damage (Triggering unit), dealing ((Damage taken) x 5.00) damage of attack type Chaos and damage type Universal
                Floating Text - Create floating text that reads (String(((Damage taken) x 5.00))) at TempPt[1] with Z offset 50.00, using font size 18.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                Custom script:   call DestroyGroup (udg_TempGroup[1])
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Random integer number between 1 and 2500) Less than or equal to (Agility of (Triggering unit) (Include bonuses))
                    Then - Actions
                        Set AgiCritDmgBool[(Player number of (Owner of (Damage source)))] = True
                        Unit - Cause (Damage source) to damage (Triggering unit), dealing ((Damage taken) x 2.00) damage of attack type Chaos and damage type Universal
                        Floating Text - Create floating text that reads (String(((Damage taken) x 2.00))) at TempPt[1] with Z offset 50.00, using font size 14.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                        Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
                        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
                    Else - Actions
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Nothing pops out at me. Try taking stuff out until it does not crash, maybe?
 

Weyrling

New Member
Reaction score
25
I've been doing that for 30 minutes, I can't figure it out, so I'm asking the forums.
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
> I've been doing that for 30 minutes, I can't figure it out, so I'm asking the forums.

Ugh. Well, if I had to take a guess, I would say that you're using too big of a number in the random number picking.
 

Mapster

New Member
Reaction score
4
(Random integer number between 1 and 2500) Less than or equal to (Agility of (Triggering unit) (Include bonuses))

Where did the include bonuses come from?
 

Sim

Forum Administrator
Staff member
Reaction score
534
> Unit - Cause (Damage source) to damage (Triggering unit), dealing ((Damage taken) x 5.00) damage of attack type Chaos and damage type Universal

Try removing this line and its friend below, and tell me what happens (Yes I know the units won't get damaged anymore).
 

Kenoriga

Ultra Cool Member
Reaction score
34
Code:
Custom script:   call DestroyGroup (udg_TempGroup[1])

(Random integer number between 1 and 2500) Less than or equal to (Agility of (Triggering unit) (Include bonuses))
                    Then - Actions

I will try these if I were you but I might be wrong.
 

DL.PIGGY

New Member
Reaction score
3
Each time the cause unit dmg trigger line appears the source damages the unit again thus making the unit take damage again. so causing the target to keep on taking dmg causing the war 3 to hang and not so much crash.
 

Weyrling

New Member
Reaction score
25
I made a check that makes it so that it runs once, and set the boolean to false, then when it runs again from the damage it dealt the Bool=True condition should catch it and disable the second run, so it shouldn't be an infinite loop, Unless I messed up the code somewhere.
 

DL.PIGGY

New Member
Reaction score
3
erm so it should be somewhat like : conditions source is hero, boolean array = false

then actions blah blah set boolean array to true , cause unit to dmg, set boolean array to false.

taht should do it i guess.
 

Weyrling

New Member
Reaction score
25
Dealing the damage automatically re-runs the trigger, resetting the boolean, I shouldn't need a boolean array.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top