Jump to content
  • 0

Altfire help


Voros

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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...