• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] Why makes this the game crash?

Status
Not open for further replies.
Level 17
Joined
Jun 12, 2007
Messages
1,261
As soon as this trigger is used, the game will crash.
Why is that? I don't see anything special about it that could drain all the memory.

  • Fake Crystal
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Fake |c000042ffC|rrystal |c007ebff1[Spell]|r
    • Actions
      • Set P_FakeCrystal[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Special Effect - Create a special effect at P_FakeCrystal[(Player number of (Owner of (Triggering unit)))] using AImaTarget.mdx
      • Special Effect - Destroy (Last created special effect)
      • Item - Create Red Crystal at P_FakeCrystal[(Player number of (Owner of (Triggering unit)))]
      • Custom script: call RemoveLocation(udg_P_FakeCrystal[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
 
Hm, the only thing I can see from that script, is that it is a mess. One thing that can make a game crash is if you create/move something out of map bounds.

I suggest you clean the code by adding an integer variable representing the number of the triggering unit so you don't have to state that in all actions.
And as Justify pointed out, there is no actual need for an array in this case, as it isn't using a timer.
 
Found it out, error on my side.
I forgot to edit the dummy items spell. It still was Intelligence gain. And because units can't become smarter the game goes WTF BOOM and crashes.

Still thanks though.

EDIT: And the array is needed for multiple players right.
If player 1 triggers it, the location will be set to the location of that player, if player 2 uses it, the location will be overwritten. If 2 players do it at the same time it wont clean the leak? =/

I'm confused now.
 
wow dude yeah, you definately dont need those arrays, since your destroying the location anyways. Also the arrays your using dont work for MUI, trust me i started off doing the eexact same thing u did. U were worried about 2 units triggering this at the same time, what if its 2 unis of the same player?? See.... BAM!! I know right. Check out sopme MUI approved spells and take a look at their indexing systems. Hope I helped you with your other 250 triggers. :D
 
Status
Not open for further replies.
Back
Top