Reverse Controls

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.
Locked
User avatar
peoplethought
Posts: 160
Joined: Mon Aug 25, 2008 3:38 am

Reverse Controls

Post by peoplethought »

I have a monster that has an attack that can reverse the player controls. Can I do this in Decorate or ACS?

What I mean by reverse is the left button now moves right, forward moves backward, etc.

I'm assuming I don't know which keys the player is using, so I'd have to be able to check which key they have assigned to the movement.

This is a temporary effect so I need to be able to switch back tot he original assignments.
Last edited by peoplethought on Thu Oct 30, 2008 8:35 pm, edited 1 time in total.
User avatar
Captain Ventris
Posts: 4609
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Reverse Controls

Post by Captain Ventris »

peoplethought wrote:I have a monster that has an attack that can reverse the player controls. Can I do this in Decorate or ACS?
Well actually, you don't, since you haven't made it yet. ;)

Wow, this sounds rather cruel, heh. This would definitely require ACS, of which I have no knowledge.
User avatar
peoplethought
Posts: 160
Joined: Mon Aug 25, 2008 3:38 am

Re: Reverse Controls

Post by peoplethought »

Ok I simply made the movement speed negative.
User avatar
Captain Ventris
Posts: 4609
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Reverse Controls

Post by Captain Ventris »

peoplethought wrote:Ok I simply made the movement speed negative.
...oh that's hax. It works?
User avatar
peoplethought
Posts: 160
Joined: Mon Aug 25, 2008 3:38 am

Re: Reverse Controls

Post by peoplethought »

Well, it did when I set it manually in ACS, I am having trouble getting decorate to run the script I made in ACS so that its only a temporary effect.

Code: Select all

actor Reverse
{
  Game Doom
  Radius 6
  Height 64
  Speed 10
  Damage 0
  Projectile
  +RANDOMIZE
  SeeSound "imp/attack"
  DeathSound "imp/shotx"
  damagetype "LaserBall"
  
  States
  {
    Spawn:
    PPF1 AB 2
    stop
	Death:
	PPF1 A 2 ACS_Execute(827, 0, 800)
	stop
  }
}
The script works fine when I execute it through ACS, I want it to run the script once the projectile hits the player.

Ok, I figured it out. I wasn't using the right tid in the script.
User avatar
Captain Ventris
Posts: 4609
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Reverse Controls

Post by Captain Ventris »

Yup, Space Coffin will be foreign territory. Can't wait! Seriously, I am anticipating this very much!
User avatar
peoplethought
Posts: 160
Joined: Mon Aug 25, 2008 3:38 am

Re: Reverse Controls

Post by peoplethought »

I was able to make it so that this effect only works if you are looking at the monster when he fires his attack:

Code: Select all

script 827 (int delaytime) { ///Reverse Controls Temporarily
int vision = (getactorangle(0)>>8) - (getactorangle(1000)>>8);

	if(vision <= 160)
	if(vision >= 96) //If the player is facing the Monstrosity's eyes
	{
	SetActorProperty(1000, APROP_Speed, -0.65);
	delay(delaytime);
	SetActorProperty(1000, APROP_Speed, 0.65);
	}

}
User avatar
Captain Ventris
Posts: 4609
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Reverse Controls

Post by Captain Ventris »

Awesome. So THAT'S what the monstrosity does. I assume he also has a way to hurt you? Perhaps you could call it a Gorgon?

I'll have to think of ways to make this sort of thing work in ZDoom Wars. This guy, in particular, will require a DECORATE alternative to imitate a confusion effect on monsters. He could be killer against hordes and send them all running or something.
User avatar
peoplethought
Posts: 160
Joined: Mon Aug 25, 2008 3:38 am

Re: Reverse Controls

Post by peoplethought »

Well a similar effect would be to thrust an actor in a random direction repeatedly. To an observer this might look just the same as a person dealing with reversed controls. And yes the Monstrosity has a generic projectile type attack.
User avatar
Captain Ventris
Posts: 4609
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Reverse Controls

Post by Captain Ventris »

peoplethought wrote:Well a similar effect would be to thrust an actor in a random direction repeatedly. To an observer this might look just the same as a person dealing with reversed controls. And yes the Monstrosity has a generic projectile type attack.
Awesome. That sounds like a fix, except... well, can ThrustThing be used in DECORATE like ThrustThingZ can? I mean, I assume so. I'll just have the monster tic off custom inventory items to simulate the length of the effect. Man, can't wait to see this guy (and his buddies) in action!
User avatar
peoplethought
Posts: 160
Joined: Mon Aug 25, 2008 3:38 am

Re: Reverse Controls

Post by peoplethought »

All the monsters on the Project page, plus one more (Ground Demon) are all I'm going to work on now. Once I have them finished I'll move on to level design. Then I think I'll release the game, but continue to add more monsters, make some new maps then maybe release that as Space Coffin 2. Most of the monsters have complete graphics except for death animations.
User avatar
Captain Ventris
Posts: 4609
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Reverse Controls

Post by Captain Ventris »

That'll be awesome SP. Sadly, I don't know if 6 monsters will be enough for inclusion in ZDoom Wars! That would be 2 monsters for the first 2 spawners, and then a full half of the faction would be upgadeable! XD

Nonetheless, can't wait!
User avatar
peoplethought
Posts: 160
Joined: Mon Aug 25, 2008 3:38 am

Re: Reverse Controls

Post by peoplethought »

If I can get enough people to help with maps then I can focus on making more monsters.
Locked

Return to “Editing (Archive)”