• 🏆 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!

Leak fix location array?

Status
Not open for further replies.
Level 5
Joined
Feb 5, 2021
Messages
89
Hey there everyone,

I have an array point that i will be spawning quite alot but i need it to be cleared aswell of course and the point itself is based on another unit variable where it selects the player number of triggering player? is there any way to do something like the one i listed below where it selects the player number of the owner of the triggering unit? or am i able to simply use the player number of triggering player one? :)

  • TP To SpellShop
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Go To Spell Zone
    • Actions
      • Custom script: call RemoveLocation (udg_HeroReturnSpot[PlayerNumberOfOwnerOfTriggeringUnit])
 
Level 5
Joined
Feb 5, 2021
Messages
89
Found it, had some help as i scrolled through the error report and found something i could use and came up with

  • call RemoveLocation (udg_HeroReturnSpot[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
#ReplyForSolution
 
Level 19
Joined
Feb 27, 2019
Messages
590
You can convert a trigger into custom text to show the jass script. I recommend doing it to a copy of the original trigger or a new trigger that you wont use and can delete after.
Select Trigger > Edit > Convert to Custom Text
It will give you an idea what the gui actions do. The guis script is not the most efficient as it has to take many things into consideration that dont need to be considered all the time but it will show how to write most of the stuff you need into custom script.
 
Status
Not open for further replies.
Top