• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Walk through units

Status
Not open for further replies.
Level 11
Joined
Dec 8, 2006
Messages
334
Hi!
I really need to turn off the collision size of an unit in-game, so it can walk through other units but can't walk through cliffs and doodads (for example: wind-walked units move in this way)

I tried to give the unit a dummy wind-walk ability with fading time set to 999999, order the unit to use it and then remove it. This works, but it interrupts units current order, which sucks.

I'm out of ideas - Can you help? :D
 
Level 11
Joined
Dec 8, 2006
Messages
334
Save the units' order and then when you are done with the add/remove of the ability, order the saved order?

That could work - how do I order the unit to perform a saved order?

Also, if there's an alternative solution to this (excluding the wind walk ability) I'm all ear
Cuz giving a windwalk to unit etc sounds kinda fishy + it won't work with units already possesing a windwalk based spell
 
Level 11
Joined
Dec 8, 2006
Messages
334
Can you explain what you need it for? Maybe that could give us idea of an alternative solution.

Sure thing bro, though I think it won't help :S
I'm making a knockback system (well, it's actually finished, except for this part)
It's similar to the knockback Warlock has, i.e. you can still move while being knockbacked.
The difference is that there is a lot of units on the map, I made them bounce of each other at first, but it looked chaotic (since you're fighting against waves of monsters like in a hero defense)
So now, the knockbacked unit just flies through the others... I know it sounds strange, but it actually looks pretty good!
To make it fly through the others, I just turned the collision off. The problem is - if you knockback the unit against a wall, it can move through it (you need to order it to do so though, they normally bounce of them...)

And that's it, I want the unit to fly through the other units, but not through the walls C:



Aaaaanyways, so how do I order an unit to preform a saved order again? :D
Can be used as a temp. fix at least (until we think of something better)
I can't just Issue Unit to Location/Object/No Target cuz I don't know what the order was :S
 
Level 20
Joined
Jul 6, 2009
Messages
1,885
At casting trigger,use function:
  • Unit - Turn collision for (Triggering unit) Off
Then in the loop trigger use:
  • Unit Group - Pick every unit in (Units in (blablabla)) and do (Actions)
    • Loop - Actions
      • //knockback triggers
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at TempPoint of type Walkability is off) Equal to True
        • Then - Actions
        • Else - Actions
          • Unit - Move (Picked unit) instantly to Temp Point
As far as i know,Walkability will detect if there are any obstacles,including trees,cliffs and such...
If it doesn't work,you can make regions where units shouldn't be able to go through and use function
  • Or - Any (Conditions) are true
    • Conditions
      • (region 1) contains TempPoint Equal to True
      • (region 2) contains TempPoint Equal to True
If this condition is true,then unit won't get moved,else it will.
But i'm pretty sure first solution will work because i used it once and it worked properly.
 
Level 11
Joined
Dec 8, 2006
Messages
334
Thanks for concerning dude, I appreciate it!
But i fear it wont do though :(
I already have have an Is-point-walkable detection implented (to detect whenever to bounce of walls), the thing is that the unit can still be ordered to move through cliffs. That trigger would only stop it from knockbacking, but wouldn't prevent it from walking across a cliff in a normal way.

Hmmm... Noone knows how to order an unit to perform a saved order?
 
Level 11
Joined
Dec 8, 2006
Messages
334
Sure, thanks

I've also came up with something meanwhile - I could save the location of the unit at the end of every periodic loop. Then, in the next loop, I'll check if the saved point equals to the point the unit is currently standing on. If not, I'll check if the point has walkability turned off. And if it does, I'll move the unit to the original point.

It might be kinda choppy but I think it'll work - I'll try it as soon as I'll have time
 
Level 4
Joined
May 16, 2010
Messages
94
In object editor...

Pathing - collision size = 0 <--- simple as this

Trees and cliffs and such still block the units. its like wind walk so no need of dummies

You could use a morph-like ability or replace trigger to turn on/off

or this:

This trigger makes him walk through trees and cliffs though...
  • Unit - Turn collision for <Unit> Off
 
Level 11
Joined
Dec 8, 2006
Messages
334
Maybe,since unit is allowed to take orders,detect if unit is issued move,attack move,smart order or such and if the point it was ordered to is not walkable then order the unit to stop.

Nah, that wouldn't help - if you order the unit to move to a higher place or behind a doodad, it will still pass through an unpathable area, because it was ordered to a pathable point.

You could use a morph-like ability or replace trigger to turn on/off

That's a good idea, but unfortunately, it also won't do - pretty much every unit in my map can be knockbacked, so that would have me to make an unholy ammount of dummy morph abilities :S
 
Level 4
Joined
May 16, 2010
Messages
94
@Mr G W
Unit's pathing collision cant be changed with triggers except by that function that makes unit go through cliffs and obstacles thus he can't use it because units are supposed to lose collision during knockback which is probably caused by a spell.

I know, i mentioned it right above the trigger that you may have missed...

@rednek well you can use the replace trigger, but then again you would need a lot of dummy units...
 
Status
Not open for further replies.
Top