• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Questions About This Trigger

Status
Not open for further replies.
Level 3
Joined
Nov 24, 2011
Messages
31
  • Gamble
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • (Unit-type of (Sold unit)) Equal to Gamble
    • Actions
      • Unit - Remove (Sold unit) from the game
      • Set Gamble[1] = Nature Stone
      • Set Gamble[2] = Crown of Kings +50
      • Set Gamble[3] = Ring of Protection
      • Set Gamble[4] = Gauntlet of Atlas
      • Set Gamble[5] = Mindstaff
      • Set Gamble[6] = Tome of Experience
      • Set Gamble[7] = Gold Coins
      • Set Gamble[8] = Manual of Health
      • Set Gamble[9] = Tome of Intelligence +5
      • Set Gamble[10] = Tome of Agility +5
      • Set Gamble[11] = Tome of Strength +5
      • Set Gamble[12] = Potion of Greater Invisibility
      • Set Gamble[13] = Healing Wards
      • Set Gamble[14] = Anti-magic Potion
      • Set Gamble[15] = Ring of Regeneration
      • Set Gamble[16] = Staff of Silence
      • Hero - Create Gamble[(Random integer number between 1 and 16)] and give it to (Buying unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of items carried by (Triggering unit)) Equal to 6
        • Then - Actions
          • Set storagePoint[1] = (Center of Red Storage <gen>)
          • Set storagePoint[2] = (Center of Blue Storage <gen>)
          • Set storagePoint[3] = (Center of Teal Storage <gen>)
          • Set storagePoint[4] = (Center of Purple Storage <gen>)
          • Set storagePoint[5] = (Center of Yellow Storage <gen>)
          • Set storagePoint[6] = (Center of Orange Storage <gen>)
          • Set storagePoint[7] = (Center of Green Storage <gen>)
          • Set storagePoint[8] = (Center of Pink Storage <gen>)
          • Set storagePoint[9] = (Center of Gray Storage <gen>)
          • Set storagePoint[10] = (Center of LB Storage <gen>)
          • Set storagePoint[11] = (Center of DG Storage <gen>)
          • Set storagePoint[12] = (Center of Br Storage <gen>)
          • Item - Create Gamble[(Random integer number between 1 and 16)] at storagePoint[(Player number of (Owner of (Buying unit)))]
          • Custom script: call RemoveLocation( udg_storagePoint[(Player number of (Owner of (Buying unit)))] )
        • Else - Actions
      • Custom script: call DestroyTrigger(GetTriggeringTrigger())

What is wrong with the trigger above? I get an error from Jasshelper, saying "Synax error: "unexpected number"."
 
Last edited:
It's because you're passing a rect to the function RemoveLocation, and that function takes a location, not a rect :p

First, you should change the type of tempPoint to a "Point" type instead of a "Rect/Region" type.

Points are the kinds of leaks we're trying to address here.

This should work:

  • Enter Green Dragon
    • Events
      • Unit - A unit enters Enter Green Dragon <gen>
    • Conditions
    • Actions
      • Set tempPoint[6] = (Center of Enter Green Dragon Out <gen>)
      • Unit - Move (Triggering unit) instantly to tempPoint[6]
      • Camera - Pan camera for (Owner of (Triggering unit)) to tempPoint[6] over 0.00 seconds
      • Custom script: call RemoveLocation(udg_tempPoint[6])
That should work, and it doesn't leak :D
 
Status
Not open for further replies.
Top