• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

What is the correct script for destroying these points?

Status
Not open for further replies.
Level 7
Joined
Aug 5, 2010
Messages
147
What is the correct script for destroying these points?

  • Set OrbSword_Points[(Player number of (Owner of DamageEventSource))] = (Position of DamageEventSource)
  • Set OrbFire_Point[(Player number of (Owner of DamageEventSource))] = (Position of DamageEventTarget)
 
Level 19
Joined
Oct 7, 2014
Messages
2,208
The locations will leak so this should be followed by this:

  • Custom script: call RemoveLocation(udg_OrbSword_Points[(Player number of (Owner of DamageEventSource))])
  • Custom script: call RemoveLocation(udg_OrbFire_Point[(Player number of (Owner of DamageEventSource))])
 
Level 19
Joined
Oct 7, 2014
Messages
2,208
Store player number to a variable

  • Set PlayerID = Player number of (Owner of DamageEventSource)
  • Custom script: call RemoveLocation(udg_OrbSword_Points[udg_Player_ID])
  • Custom script: call RemoveLocation(udg_OrbFire_Points[udg_Player_ID])

Storing the player number would be more efficient and save some time.
 
The locations will leak so this should be followed by this:

  • Custom script: call RemoveLocation(udg_OrbSword_Points[(Player number of (Owner of DamageEventSource))])
  • Custom script: call RemoveLocation(udg_OrbFire_Point[(Player number of (Owner of DamageEventSource))])

That wouldn't compile. You need to replace the index with the proper JASS natives GetPlayerId() and GetOwningPlayer():


JASS:
call RemoveLocation(udg_OrbSword_Points[GetPlayerId(GetOwningPlayer(udg_DamageEventSource))])
call RemoveLocation(udg_OrbFire_Point[GetPlayerId(GetOwningPlayer(udg_DamageEventSource))])

Since JASS player indexes start at 0 (where as GUI starts at 1), he might have to increment the returned integer by 1 if he stored some important values specific to a player.
 
Status
Not open for further replies.
Top