Make something do a 180 after touching a wall?
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Make something do a 180 after touching a wall?
Can anyone think of a hacky way to make a moving actor know if it reaches a solid wall and then turns around? Keep in mind that there's going to be a bunch of them clumped together too.
Re: Make something do a 180 after touching a wall?
Lemmings Doom? 

- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Re: Make something do a 180 after touching a wall?
Yeah so... help me out bro!
Re: Make something do a 180 after touching a wall?
Well, first off, how are you making the actor perpetually walk forward?
Are you making custom maps for these where the "lemmings" can have a more or less set route, or do you need this to work on all maps?
2D or 3D?
The most obvious method that leaps out at me is a script that monitors their rate of movement, and reverses them when they slow below a certain threshold (to account for sliding along walls). If you're doing all custom maps, you could also use some type of a goal system.
Are you making custom maps for these where the "lemmings" can have a more or less set route, or do you need this to work on all maps?
2D or 3D?
The most obvious method that leaps out at me is a script that monitors their rate of movement, and reverses them when they slow below a certain threshold (to account for sliding along walls). If you're doing all custom maps, you could also use some type of a goal system.
- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Re: Make something do a 180 after touching a wall?
I was planning to have them constantly thrusting (no A_Chase because they try to change direction)
Re: Make something do a 180 after touching a wall?
Well, again you could use ACS to track their movement. If you want to keep this to Decorate, I can think of a hacky method to do so... possibly.
It would involve firing a short-range invisible projectile that gives an inventory item to its master in its death state. If the projectile hits something solid and explodes, this would give the inventory item and the master would reverse direction based on that.
It would involve firing a short-range invisible projectile that gives an inventory item to its master in its death state. If the projectile hits something solid and explodes, this would give the inventory item and the master would reverse direction based on that.
-
- Posts: 178
- Joined: Sat Aug 25, 2007 11:43 am
Re: Make something do a 180 after touching a wall?
I think you 'll have to deal with SetActorAngle in acs reguarding what angle is the objet at that time.
If a 3D lemming like maybe you can randomize the angle a bit.
If a 3D lemming like maybe you can randomize the angle a bit.
- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Re: Make something do a 180 after touching a wall?
I think tracking them is going to be the best option, but can you track how much an actor is being thrust?
Re: Make something do a 180 after touching a wall?
If you store their position, thrust them, and then check their position again after a few tics, yes.
- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Re: Make something do a 180 after touching a wall?
And would I have to give each imp a seperate TID? If so, there's no problem with that.
- bagheadspidey
- Posts: 1490
- Joined: Sat Oct 20, 2007 10:31 pm
- Contact:
Re: Make something do a 180 after touching a wall?
The ACS position tracking thing is pretty obvious, but this... is freaking genius. Decorate hacks ftw.HotWax wrote:If you want to keep this to Decorate, I can think of a hacky method to do so... possibly.
It would involve firing a short-range invisible projectile that gives an inventory item to its master in its death state. If the projectile hits something solid and explodes, this would give the inventory item and the master would reverse direction based on that.
Re: Make something do a 180 after touching a wall?
A bit off-topic, I'm not sure how to do this. I have about a meg of .mids and .mods of Lemmings music, if you'd like to use them. A few are remixed, unfortunately, but it'd add a good nostalgic feel
.

- Captain Ventris
- Posts: 4608
- Joined: Mon Jul 31, 2006 4:25 pm
- Location: San Antonio, TX
Re: Make something do a 180 after touching a wall?
Zlemmings.
Ah, will you guys think of next? You're like Willy Wonka.
Ah, will you guys think of next? You're like Willy Wonka.
- Cutmanmike
- Posts: 11353
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
Re: Make something do a 180 after touching a wall?
I tried this but with a short range hitscan instead, but couldn't get it working. Is there a Give to master function or what?bagheadspidey wrote:The ACS position tracking thing is pretty obvious, but this... is freaking genius. Decorate hacks ftw.HotWax wrote:If you want to keep this to Decorate, I can think of a hacky method to do so... possibly.
It would involve firing a short-range invisible projectile that gives an inventory item to its master in its death state. If the projectile hits something solid and explodes, this would give the inventory item and the master would reverse direction based on that.
Re: Make something do a 180 after touching a wall?
Yes.Cutmanmike wrote:And would I have to give each imp a seperate TID? If so, there's no problem with that.
See, this is why I don't usually try to suggest Decorate solutions. I had just assumed there would be such a function. Silly me.Cutmanmike wrote:I tried this but with a short range hitscan instead, but couldn't get it working. Is there a Give to master function or what?
However, isn't there a way to have a projectile set its spawner as the target (In fact, I thought that was the default)? So, you could just use A_GiveToTarget in the death state. Maybe.