Path Speed Boost

Status
Not open for further replies.
Level 4
Joined
Aug 22, 2014
Messages
54
How would I implement a speed boost for any unit on a path (tile set) ? Simply put, I want a unit to be able to receive a speed boost while moving on a path. Tried messing with the tornado abilities but there are issues with that and it doesn't work right. Any method suggestions or tutorials already out there?
 
Level 12
Joined
May 22, 2015
Messages
1,051
I think you can check the tile type on the ground at a point. I haven't done anything like that, so I could be wrong. Basically, you would have to check the tile each unit is standing on and modify their speed.
 
Level 10
Joined
Jun 6, 2007
Messages
392
You could periodically check what's the terrain at every unit's position. If it's correct type, then add the unit an ability based on item speed bonus, else remove that ability.

EDIT: Example code
  • Untitled Trigger 001
    • Events
      • Time - Every 0.30 seconds of game time
    • Conditions
    • Actions
      • Set TempGroup = (Units in (Playable map area))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Set TempPoint = (Position of (Picked unit))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Terrain type at TempPoint) Equal to Lordaeron Summer - Dirt
            • Then - Actions
              • Unit - Add CustomSpeedBonusAbility to (Picked unit)
            • Else - Actions
              • Unit - Remove CustomSpeedBonusAbility from (Picked unit)
          • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: call DestroyGroup(udg_TempGroup)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,272
For every cell on the map above your "path" tile type add it to a region. When a unit enters that region give it a movement speed bonus (hidden endurance/unholy aura?). When a unit leaves that region you remove the hidden ability.

This refers to regions in a JASS context. These are not regions in a GUI context as those are actually rects in a JASS context.
 
Level 4
Joined
Aug 22, 2014
Messages
54
For every cell on the map above your "path" tile type add it to a region. When a unit enters that region give it a movement speed bonus (hidden endurance/unholy aura?). When a unit leaves that region you remove the hidden ability.

This refers to regions in a JASS context. These are not regions in a GUI context as those are actually rects in a JASS context.

Sounds legit! I'm just not sure what you mean by "add it to a region"?
Wait, so regions are only JASS? Dang, idk JASS though- could you give me a step by step of what to do in WE?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,272
I'm just not sure what you mean by "add it to a region"?
The following natives.
JASS:
native RegionAddCell takes region whichRegion,real x,real y returns nothi
native RegionAddCellAtLoc takes region whichRegion,location whichLocation returns nothing
Wait, so regions are only JASS?
Yes. Since the "region" type in GUI is actually a "rect". The "Region" palette as such creates rects.

Wait whats GUI?
The graphic approach to making triggers which gets compiled to JASS automatically on map save. JASS is when you write the triggers in text directly.

How do I go into the Jass context and edit the regions?
Something like "Convert to text" in one of the menus.
 
Status
Not open for further replies.
Top