• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] [GUI] AoE Skill crashing

Status
Not open for further replies.
Level 2
Joined
Jul 10, 2005
Messages
9
I'm having trouble seeing the problem why my game keeps crashing from using this skill. The skill is based off Channel - Point Target

This is the trigger for when the unit casts the ability
  • Distortion Orb Z
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Distortion Orb Z
    • Actions
      • Set HayatePlayer = (Player number of (Owner of (Triggering unit)))
      • Set TempUnitPlayer[HayatePlayer] = (Triggering unit)
      • Set TempPositionPlayer[HayatePlayer] = (Target point of ability being cast)
      • Set HayateDistortionOrbSize = (175.00 + (25.00 x (Real(HayateSkills[1]))))
      • Unit - Create 1 Distortion Orb Dummy for (Owner of (Triggering unit)) at TempPositionPlayer[HayatePlayer] facing Default building facing degrees
      • Unit - Add a 30.00 second Generic expiration timer to (Last created unit)
      • Unit Group - Add (Last created unit) to HayateDistortionOrbGroup
      • Unit - Set level of Distortion Orb Slow for (Last created unit) to HayateSkills[1]
      • Animation - Change (Last created unit)'s size to (HayateDistortionOrbSize%, HayateDistortionOrbSize%, HayateDistortionOrbSize%) of its original size
      • Animation - Change (Last created unit)'s vertex coloring to (0.00%, 0.00%, 0.00%) with 0.00% transparency
This is the trigger of a timer that deals damage every 2 seconds
  • Distortion Orb AoE Damage
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Set HayateDamageDisplay[1] = (Real(((Intelligence of TempUnitPlayer[HayatePlayer] (Include bonuses)) x HayateSkills[1])))
      • Unit Group - Pick every unit in HayateDistortionOrbGroup and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is alive) Equal to True
            • Then - Actions
              • Unit Group - Pick every unit in (Units within (175.00 + (25.00 x (Real(HayateSkills[1])))) of (Position of (Picked unit)) matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of (Picked unit))) Equal to True))) and do (Actions)
                • Loop - Actions
                  • Unit - Cause TempUnitPlayer[HayatePlayer] to damage (Picked unit), dealing HayateDamageDisplay[1] damage of attack type Hero and damage type Universal
                  • Floating Text - Create floating text that reads (String((Integer(HayateDamageDisplay[1])))) at (Position of (Picked unit)) with Z offset 50.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                  • Floating Text - Change (Last created floating text): Disable permanence
                  • Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
                  • Floating Text - Change the fading age of (Last created floating text) to 0.50 seconds
                  • Floating Text - Set the velocity of (Last created floating text) to 128.00 towards 90.00 degrees
            • Else - Actions
This is a trigger for when the player learns the skill
  • Distortion Orb Z Add Points
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Distortion Orb Z
    • Actions
      • Set HayatePlayer = (Player number of (Owner of (Triggering unit)))
      • Set TempUnitPlayer[HayatePlayer] = (Triggering unit)
      • Set HayateSkills[1] = (HayateSkills[1] + 1)
Could the problem be because I didn't destroy the unit group?
And info on the variables are

HayateSkills[x] = Int Array of 6
HayatePlayer = Int
TempUnitPlayer[x] = Unit Array of 11
TempPositionPlayer[x] = Point Array of 11
HayateDamageDisplay[x] = Real Array of 6
HayateDistortionOrbSize = Real

Edit: I cannot find the source of the problem, I guess I'll have to make another skill for this hero.
 
Last edited:
Level 5
Joined
Jun 16, 2004
Messages
108
Well this might not be the cause of the crash, and you did not specify precisely in what conditions the crash occurs (is it when it hits an enemy)?

> Unit - Cause (Last restored unit) to damage (Picked unit), dealing HayateDamageDisplay[1] damage of attack type Hero and damage type Universal
Pretty sure last restored unit will be null in your map unless it is a single player map, which does not seem to be the case. Perhaps making a null unit try to damage something would crash?
 
Level 2
Joined
Jul 10, 2005
Messages
9
Well this might not be the cause of the crash, and you did not specify precisely in what conditions the crash occurs (is it when it hits an enemy)?

> Unit - Cause (Last restored unit) to damage (Picked unit), dealing HayateDamageDisplay[1] damage of attack type Hero and damage type Universal
Pretty sure last restored unit will be null in your map unless it is a single player map, which does not seem to be the case. Perhaps making a null unit try to damage something would crash?

Oh sorry I changed it to last restored unit to see if it would crash, and the crash occurs right when I use the ability. Like ( Use Ability -> Crash ).
Also it seems to work fine on Single Player but it would crash on Multiplayer. The skill isn't MUI and is hero specific and the variables to the skill are exclusive and not reused (unless you count arrays as reused).
 
Level 5
Joined
Jun 16, 2004
Messages
108
If it crashes the moment you cast it then the problem likely exists in that first trigger, or possibly to other triggers conflicting (such as destroying the unit group elsewhere).

If I had to take a guess I would say the model for the dummy missile unit may be crashing the game. Try disabling the periodic trigger and removing some parts of the cast trigger to see if it still crashes. The idea being to try to isolate the problem by finding what in particular crashes in that trigger.

I would try spawning a different unit like a footman to see if your dummy unit is the issue. If you are unlucky it might be an issue with the model used.
 
Level 6
Joined
Oct 4, 2011
Messages
226
I don't mean to discourage you, I don't think arrays are needed for this, also You do not need "Distortion Orb Z Add Points". Instead you set a global integer variable (Integer variables can be used over and over. Ex: "TempInteger") to the level of Distortion Orb for triggering unit. I had this test map for a MUI AoE skill that you can have. I recommend hashtables for abilities they made me able to make alot of MUI stuff on my own. In alot of spells alot of the important variables are set in the casting trigger, saved into a hashtable and then referred to in a Loop trigger.
 

Attachments

  • AOE%20Spell%20TEST%20MAP%20(A)[3].w3x
    43.5 KB · Views: 55
Level 2
Joined
Jul 10, 2005
Messages
9
I don't mean to discourage you, I don't think arrays are needed for this, also You do not need "Distortion Orb Z Add Points". Instead you set a global integer variable (Integer variables can be used over and over. Ex: "TempInteger") to the level of Distortion Orb for triggering unit. I had this test map for a MUI AoE skill that you can have. I recommend hashtables for abilities they made me able to make alot of MUI stuff on my own. In alot of spells alot of the important variables are set in the casting trigger, saved into a hashtable and then referred to in a Loop trigger.

I used arrays because the hero has multiple skills, it makes it easier for me. The abilities aren't meant to be MUI, but I'll try using hashtables when I am more familiar with them.
 
Status
Not open for further replies.
Top