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

[Trigger] I removed leaks, but in wrong way?

Status
Not open for further replies.
Level 20
Joined
Oct 21, 2006
Messages
3,231
  • Boost loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set BoostGroup = (Units in (Playable map area) matching (((Matching unit) has buff Boost ) Equal to True))
      • Unit Group - Pick every unit in BoostGroup and do (Actions)
        • Loop - Actions
          • Set Point[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
          • Set Point_2[(Player number of (Owner of (Picked unit)))] = (Point[(Player number of (Picked player))] offset by 35.00 towards (Facing of Player_Car[(Player number of (Owner of (Picked unit)))]) degrees)
          • Unit - Move Player_Car[(Player number of (Owner of (Picked unit)))] instantly to Point_2[(Player number of (Owner of (Picked unit)))]
      • Custom script: call RemoveLocation(udg_Point[1])
      • Custom script: call RemoveLocation(udg_Point[2])
      • Custom script: call RemoveLocation(udg_Point[3])
      • Custom script: call RemoveLocation(udg_Point[4])
      • Custom script: call RemoveLocation(udg_Point[5])
      • Custom script: call RemoveLocation(udg_Point[6])
      • Custom script: call RemoveLocation(udg_Point[7])
      • Custom script: call RemoveLocation(udg_Point[8])
      • Custom script: call RemoveLocation(udg_Point[9])
      • Custom script: call RemoveLocation(udg_Point[10])
      • Custom script: call RemoveLocation(udg_Point[11])
      • Custom script: call RemoveLocation(udg_Point[12])
      • Custom script: call RemoveLocation(udg_Point_2[1])
      • Custom script: call RemoveLocation(udg_Point_2[2])
      • Custom script: call RemoveLocation(udg_Point_2[3])
      • Custom script: call RemoveLocation(udg_Point_2[4])
      • Custom script: call RemoveLocation(udg_Point_2[5])
      • Custom script: call RemoveLocation(udg_Point_2[6])
      • Custom script: call RemoveLocation(udg_Point_2[7])
      • Custom script: call RemoveLocation(udg_Point_2[8])
      • Custom script: call RemoveLocation(udg_Point_2[9])
      • Custom script: call RemoveLocation(udg_Point_2[10])
      • Custom script: call RemoveLocation(udg_Point_2[11])
      • Custom script: call RemoveLocation(udg_Point_2[12])
Duh?
 
  • Boost loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set BoostGroup = (Units in (Playable map area) matching (((Matching unit) has buff Boost ) Equal to True))
      • Unit Group - Pick every unit in BoostGroup and do (Actions)
        • Loop - Actions
          • Set Point[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
          • Set Point_2[(Player number of (Owner of (Picked unit)))] = (Point[(Player number of (Picked player))] offset by 35.00 towards (Facing of Player_Car[(Player number of (Owner of (Picked unit)))]) degrees)
          • Unit - Move Player_Car[(Player number of (Owner of (Picked unit)))] instantly to Point_2[(Player number of (Owner of (Picked unit)))]
          • Custom script: call RemoveLocation (udg_Point[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
          • Custom script: call RemoveLocation (udg_Point_2[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
      • Custom script: call DestroyGroup (udg_BoostGroup)
Duh! Jass knowledge ftw :D
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Well, it more or less looks correct (although buggy: why are you using "pick every unit" rather than "pick every player"?), but

Duh! Jass knowledge ftw :D
is obviously "cleaner".

yeah i don't think you're supposed to use arrays for temporary points...

Sure, why not? But there's no need for any in this case anyway.

The best solution however does not use arrays anyway.

  • Boost loop
  • Events
    • Time - Every 0.05 seconds of game time
  • Conditions
  • Actions
    • Set BoostGroup = (Units in (Playable map area) matching (((Matching unit) has buff Boost ) Equal to True))
    • Unit Group - Pick every unit in BoostGroup and do (Actions)
      • Loop - Actions
        • Set Point = (Position of (Picked unit))
        • Set Point_2 = (Point offset by 35.00 towards (Facing of Picked unit) degrees)
        • Unit - Move Picked unit instantly to Point_2
        • Custom script: call RemoveLocation (udg_Point)
        • Custom script: call RemoveLocation (udg_Point_2)
    • Custom script: call DestroyGroup (udg_BoostGroup)
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
No, it doesn't, for god's sake.

Your unit group contains units as follows:

unit1,unit2,unit3,unit4.

You loop through them and do all your actions:

Do stuff for unit1
Do stuff for unit2
Do stuff for unit3
Do stuff for unit4

And that's it. It has NOTHING TO DO WITH FREAKING PLAYERS.
 
Level 24
Joined
Jun 16, 2008
Messages
1,939
  • Boost loop
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set BoostGroup = (Units in (Playable map area) matching (((Matching unit) has buff Boost ) Equal to True))
      • Unit Group - Pick every unit in BoostGroup and do (Actions)
        • Loop - Actions
          • Set Point[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
          • Set Point_2[(Player number of (Owner of (Picked unit)))] = (Point[(Player number of (Picked player))] offset by 35.00 towards (Facing of Player_Car[(Player number of (Owner of (Picked unit)))]) degrees)
          • Unit - Move Player_Car[(Player number of (Owner of (Picked unit)))] instantly to Point_2[(Player number of (Owner of (Picked unit)))]
          • Custom script: call RemoveLocation (udg_Point[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
          • Custom script: call RemoveLocation (udg_Point_2[GetConvertedPlayerId(GetOwningPlayer(GetEnumUnit()))])
      • Custom script: call DestroyGroup (udg_BoostGroup)
Duh! Jass knowledge ftw :D


yep ur right, JASS ftw!! are u gonna move to JASS? u said so in one of ur spellmaps

gl
 

Cokemonkey11

Spell Reviewer
Level 30
Joined
May 9, 2006
Messages
3,554
what looks like a picture of a trigger isn't, it's just a colorized code.

use the [ trigger ] and [ trigger /] (without the extra spaces) tags and paste your trigger as text into it - voila it looks just like in the editor when you submit the post.

right click your trigger and click "copy as text" to get the formatting and spacing correct.
 
Status
Not open for further replies.
Top