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

Units being gates

Status
Not open for further replies.
Level 2
Joined
Aug 9, 2011
Messages
6
Hello.
I want to make a gate which can be closed and opened, and destroyed. But this gate is a unit (like in AWLR or DAOW) ik how to make it with pathings, animation triggers and replace, but when i replace the opened gate with a closed one, and there is a unit "inside" the gate, the gate moves, cause it cant be placed on top of the unit. But i want the units inside the gate to move a little bit instead of the gate moving. I saw AWLR editable version, and there was no move trigger for units inside the gate, but i have no idea how to do it otherwise. Please help!!!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
JASS:
native SetTerrainPathable takes real x,real y,pathingtype t,boolean flag returns nothing
constant pathingtype PATHING_TYPE_AMPHIBIOUSPATHING=ConvertPathingType(7)
constant pathingtype PATHING_TYPE_ANY=ConvertPathingType(0)
constant pathingtype PATHING_TYPE_BLIGHTPATHING=ConvertPathingType(5)
constant pathingtype PATHING_TYPE_BUILDABILITY=ConvertPathingType(3)
constant pathingtype PATHING_TYPE_FLOATABILITY=ConvertPathingType(6)
constant pathingtype PATHING_TYPE_FLYABILITY=ConvertPathingType(2)
constant pathingtype PATHING_TYPE_PEONHARVESTPATHING=ConvertPathingType(4)
constant pathingtype PATHING_TYPE_WALKABILITY=ConvertPathingType(1)
These natives should work in pathing pixels (a farm is 2*2 pixels).

The idea is that clicking the open/close button does not actually change the unit, it purly changes the unit's animation to appear open and then uses the above natives to alter the pathing at the gate. If the gate is thin enough the no units will get stuck in unpathable terrain. As the building does not change, it will not need to be placed so can not move. This is entirly theretical, it might not actually work.

Alternativly, you could just now allow the game to change when units are near (like heroes and empires). You could also try using script to move the building back to its proper position when it gets displaced while changing.
 
Level 2
Joined
Aug 9, 2011
Messages
6
But how can i make it universal? i have thousands of gates and i dont want to make a new trigger for all of them.How could i store the gates original location? (universal, which works for all gates)
 
Status
Not open for further replies.
Top