• 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.

[Trigger] remove leaks setting problem

Status
Not open for further replies.
Level 3
Joined
Mar 28, 2010
Messages
42
  • TP
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Mass Teleport
    • Actions
      • Set TP_point[(Player number of (Owner of (Triggering unit)))] = (Target point of ability being cast)
      • Set TPcaster[(Player number of (Owner of (Triggering unit)))] = (Casting unit)
      • Unit - Create 1 Town Portal for (Owner of (Triggering unit)) at TP_point[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
      • Set TPeffect[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
variables is TP_point[(Player number of (Owner of (Triggering unit)))]
how to set?
Custom script: call RemoveLocation (udg_TP_point[?])
is it like this?
Custom script: call RemoveLocation (udg_TP_point[(Player number of (Owner of (Triggering unit)))])
lol
 
Level 13
Joined
Mar 16, 2008
Messages
941
As its the GUI player number, it should be this:
call RemoveLocation(udg_TP_point[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
But, just a hint.
Calling this functions again and again is inefficient and it causes you to need jass.
Just store the player number into an integer. This saves you 9 calls (3 times each) and allows you to easily acces the index in jass due to the variable.
 
Level 3
Joined
Mar 28, 2010
Messages
42
As its the GUI player number, it should be this:
call RemoveLocation(udg_TP_point[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
But, just a hint.
Calling this functions again and again is inefficient and it causes you to need jass.
Just store the player number into an integer. This saves you 9 calls (3 times each) and allows you to easily acces the index in jass due to the variable.

ok....thx><~
i dun know how to use jass...><>\
 
Level 20
Joined
Jul 12, 2010
Messages
1,735
hmm...well if you could use loops you could have done something like this...
  • For each (Integer i) from 1 to 12, do (Actions)
    • Loop - Actions
      • Custom script: call RemoveLocation(udg_TP_Point[i]
but since blizzards sucks and couldn't add that you have to do it manually...

  • Custom script: call RemoveLocation(udg_TP_Point[1])
  • Custom script: call RemoveLocation(udg_TP_Point[2])
  • Custom script: call RemoveLocation(udg_TP_Point[3])
  • Custom script: call RemoveLocation(udg_TP_Point[4])
  • Custom script: call RemoveLocation(udg_TP_Point[5])
  • Custom script: call RemoveLocation(udg_TP_Point[6])
  • Custom script: call RemoveLocation(udg_TP_Point[7])
  • Custom script: call RemoveLocation(udg_TP_Point[8])
  • Custom script: call RemoveLocation(udg_TP_Point[9])
  • Custom script: call RemoveLocation(udg_TP_Point[10])
  • Custom script: call RemoveLocation(udg_TP_Point[11])
  • Custom script: call RemoveLocation(udg_TP_Point[12])
i don't think there is any other way... (in GUI atleast)
 
In that you are wrong.
  • Actions
    • Set MyPoint[0] = (Random point in (Playable map area))
    • Set MyPoint[1] = (Random point in (Playable map area))
    • Set MyPoint[2] = (Random point in (Playable map area))
    • Set MyPoint[3] = (Random point in (Playable map area))
    • Set MyPoint[4] = (Random point in (Playable map area))
    • Set MyPoint[5] = (Random point in (Playable map area))
    • For each (Integer i) from 0 to 5, do (Actions)
      • Loop - Actions
        • Custom script: call RemoveLocation( udg_MyPoint[ udg_i ] )
Also considering Justify's post, do this
  • Custom script: call RemoveLocation(udg_TP_point[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
  • ----
  • Set MyInteger = (Player number of (Owner of (Triggering unit)))
  • Custom script: call RemoveLocation(udg_TP_point[udg_MyInteger])
 
instead of using the function in this way
join.gif
set.gif
Set TPcaster[(Player number of (Owner of (Triggering unit)))] = (Casting unit)
do it like this :p
join.gif
set.gif
Set TPcaster[(Player number of (Triggering Player))] = (Triggering unit)

Also your funtion for looping point leaks you use the function(below) as you miss spelt and that is why it can't work.
if.gif
For each (Integer i) from 1 to 12, do (Actions)
joinbottomminus.gif
actions.gif
Loop - Actions
empty.gif
joinbottom.gif
page.gif
Custom script: call RemoveLocation(udg_TP_Point[udg_i])


And last if your going to use the remove location with indexes instead of this
call RemoveLocation(udg_TP_point[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
use
call RemoveLocation(udg_TP_point[GetConvertedPlayerId(GetTriggeringPlayer())])
 
Level 13
Joined
Mar 16, 2008
Messages
941
Depends on the way you use GUI. The "Number of Player" is from 1-12 and the jass-function for this is GetConvertedPlayerId. GetPlayerId is a native that returns 0-11 and will cause bugs.
And, xorkatos: The loop works. You remembered that variables in GUI are ALWAYS something else then in Jass?
Integer A is bj_forLoopIntegerA if I remember correctly. If you use custom integers, just write udg_ before.
 
Level 3
Joined
Mar 28, 2010
Messages
42
  • TP
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Mass Teleport
    • Actions
      • Set TP_point[(Player number of (Owner of (Triggering unit)))] = (Target point of ability being cast)
      • Set TPcaster[(Player number of (Owner of (Triggering unit)))] = (Casting unit)
      • Unit - Create 1 Town Portal for (Owner of (Triggering unit)) at TP_point[(Player number of (Owner of (Triggering unit)))] facing Default building facing degrees
      • Set TPeffect[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
  • Done
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Mass Teleport
    • Actions
      • Unit - Move TPcaster[(Player number of (Owner of (Triggering unit)))] instantly to TP_point[(Player number of (Owner of (Triggering unit)))]
      • Unit - Remove TPeffect[(Player number of (Owner of (Triggering unit)))] from the game
      • Custom script: call RemoveLocation(udg_TP_point[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
  • cancel
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Mass Teleport
    • Actions
      • Unit - Remove TPeffect[(Player number of (Owner of (Triggering unit)))] from the game
      • Custom script: call RemoveLocation(udg_TP_point[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
this is my tp system for my game...is it correct???will cause any bugs???
 
@OffGraphic:
Sorry was lazy and also in my opinion using triggering that was looks nice is used short:p.

@nightwalkerg
Remember to use my tip to instead of using Owner of (Triggering unit) just use triggering player as it is more officiant.
Fore the Jass/Custom Script instead of GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit())) use GetConvertedPlayerId(GetTriggeringPlayer())).
Also instead of using casting unit use Triggering unit as they are the same but with using triggering unit it is more officiant.
And last don't use the remove unit action as that leaks so instead use explode unit but if you don't want the animation hide the unit then explode and it would look the same as removing the unit but without leak:p.
For a report overall the triggers should work but only if one unit on a team at once can use the ability then it should bug free but all you need to do now is a bit of detailing to make it more officiant.
Enjoy.
 
Level 20
Joined
Jul 12, 2010
Messages
1,735
Integer A is bj_forLoopIntegerA if I remember correctly. If you use custom integers, just write udg_ before.

ok thnx for the tip ;p

Remember to use my tip to instead of using Owner of (Triggering unit) just use triggering player as it is more officiant.

dude are you sure about that? don't we use Owner of Triggering Unit when the event has to do with a unit(like casting an ability) and Triggering Player when the event has to do with a player(like skiping a cinematic)??
 
Status
Not open for further replies.
Top