Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Voros

Altfire help

Question

I have a weapon. When the player activates altfire, a small startup animation plays. When this animation is over, the weapon can fire.

What I want to do is that when the weapon's startup animation plays, I want to lock the player in his current place, like a stationary turret. Upon releasing the the altfire button, another animation plays and the player will be unlocked.

How can I achieve this?

Share this post


Link to post

7 answers to this question

Recommended Posts

  • 0

I don't know ZScript, and there might be a more sane way of doing this within it.

 

I know you can modify an actor's velocity directly, but I'm not sure guns can modify the player's speed. See: https://zdoom.org/wiki/DECORATE_expressions#Variables

 

Worst comes to worst, use one of these:

https://zdoom.org/wiki/Category:Decorate_Script_functions

Then use Thing_Stop and SetPlayerProperty to freeze him in place.

Share this post


Link to post
  • 0

How about simply slowing down then player speed.

This is all in Decorate btw.

Share this post


Link to post
  • 0

I am unsure Decorate lets you do this. My first link is the one way I know of doing this directly in Decorate, but as I said, don't know if the gun actor can change the player actor speed.

The second way I said should work, but it's definitely a workaround.

Share this post


Link to post
  • 0

It seems promising, but does it last long eg

//Normal speed here
TNT1 AA 2
//Speed change here
TNT1 A 1 A_SetSpeed(20)
// Speed stays at 20 from here
TNT1 AAAA 2 
//Speed changes to 30
TNT1 A 1 A_SetSpeed(30)
//Speed is now 30 from here
TNT1 AAAA 2 


And what's the pointer integer of the player?
Does the player even have a specific speed? That worries me the most, since the speed is controlled by the player's input. I figured lowering the momentum/velocity would suffice.

Share this post


Link to post
  • 0

Since the player doesn't move like other creatures in the game, the speed you set there is a multiplier. For instance, a value of 0.5 cuts the speed in half. For the pointer thing, don't worry about it, you can omit it.

Share this post


Link to post
  • 0
11 hours ago, Voros said:

And what's the pointer integer of the player?

> pointer: The actor to change its speed. This is an actor pointer. Default is AAPTR_DEFAULT, which corresponds to the calling actor.

 

There you go. :)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×