Make something do a 180 after touching a wall?

Archive of the old editing forum
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.
User avatar
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?

Post 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.
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

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

Post by HotWax »

Lemmings Doom? :)
User avatar
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?

Post by Cutmanmike »

Yeah so... help me out bro!
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

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

Post 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.
User avatar
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?

Post by Cutmanmike »

I was planning to have them constantly thrusting (no A_Chase because they try to change direction)
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

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

Post 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.
DoomKn1ght
Posts: 178
Joined: Sat Aug 25, 2007 11:43 am

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

Post 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.
User avatar
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?

Post by Cutmanmike »

I think tracking them is going to be the best option, but can you track how much an actor is being thrust?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

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

Post by HotWax »

If you store their position, thrust them, and then check their position again after a few tics, yes.
User avatar
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?

Post by Cutmanmike »

And would I have to give each imp a seperate TID? If so, there's no problem with that.
User avatar
bagheadspidey
Posts: 1490
Joined: Sat Oct 20, 2007 10:31 pm
Contact:

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

Post 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.
User avatar
Ghastly
... in rememberance ...
Posts: 6109
Joined: Fri Jul 06, 2007 2:34 pm

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

Post 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.
User avatar
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?

Post by Captain Ventris »

Zlemmings.

Ah, will you guys think of next? You're like Willy Wonka.
User avatar
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?

Post 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?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

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

Post 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.
Locked

Return to “Editing (Archive)”