Page 1 of 2

Make something do a 180 after touching a wall?

Posted: Thu Jun 05, 2008 6:45 am
by Cutmanmike
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?

Posted: Thu Jun 05, 2008 8:11 am
by HotWax
Lemmings Doom? :)

Re: Make something do a 180 after touching a wall?

Posted: Thu Jun 05, 2008 8:37 am
by Cutmanmike
Yeah so... help me out bro!

Re: Make something do a 180 after touching a wall?

Posted: Thu Jun 05, 2008 9:28 am
by HotWax
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.

Re: Make something do a 180 after touching a wall?

Posted: Thu Jun 05, 2008 9:33 am
by Cutmanmike
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?

Posted: Thu Jun 05, 2008 9:47 am
by HotWax
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.

Re: Make something do a 180 after touching a wall?

Posted: Thu Jun 05, 2008 11:04 am
by DoomKn1ght
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.

Re: Make something do a 180 after touching a wall?

Posted: Thu Jun 05, 2008 3:11 pm
by Cutmanmike
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?

Posted: Thu Jun 05, 2008 3:32 pm
by HotWax
If you store their position, thrust them, and then check their position again after a few tics, yes.

Re: Make something do a 180 after touching a wall?

Posted: Thu Jun 05, 2008 5:27 pm
by Cutmanmike
And would I have to give each imp a seperate TID? If so, there's no problem with that.

Re: Make something do a 180 after touching a wall?

Posted: Thu Jun 05, 2008 6:48 pm
by bagheadspidey
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.
The ACS position tracking thing is pretty obvious, but this... is freaking genius. Decorate hacks ftw.

Re: Make something do a 180 after touching a wall?

Posted: Thu Jun 05, 2008 8:57 pm
by Ghastly
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 :D.

Re: Make something do a 180 after touching a wall?

Posted: Thu Jun 05, 2008 9:46 pm
by Captain Ventris
Zlemmings.

Ah, will you guys think of next? You're like Willy Wonka.

Re: Make something do a 180 after touching a wall?

Posted: Fri Jun 06, 2008 2:34 am
by Cutmanmike
bagheadspidey wrote:
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.
The ACS position tracking thing is pretty obvious, but this... is freaking genius. Decorate hacks ftw.
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?

Re: Make something do a 180 after touching a wall?

Posted: Fri Jun 06, 2008 8:45 am
by HotWax
Cutmanmike wrote:And would I have to give each imp a seperate TID? If so, there's no problem with that.
Yes.
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?
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.

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.