a decorate conundrum.

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
osjclatchford
Posts: 2058
Joined: Mon Feb 07, 2011 5:02 am

a decorate conundrum.

Post by osjclatchford »

so off the bat:
ok
zdoom 2.81 user.
no zscript.
no acs.
just decorate.

is it possible to: have a weapon actor that, when selected, (either using an action in a state or a set flag (or another method)) can inhibit (slow down or cease entirely) all player movement. (minus looking with mouse or whatever, just the actual movement forward, back and strafe left and right) obviously until the weapon is deselected and then it would re-instigate standard movement for the player? personally I think no but I've often been pleasantly proven wrong on several occasions... any insight welcome. but should you choose to help, please. stick to the above caveats I've mentioned. limitations are the issue here. obviously there's other ways of doing it but decorate is what I'm after here.

thanks in advance...
User avatar
Mikk-
Posts: 2274
Joined: Tue Jun 30, 2009 1:31 pm
Location: Somewhere off Kanagawa

Re: a decorate conundrum.

Post by Mikk- »

You could give a PowerSpeed powerup with infinite duration in the Select state and then remove said powerup in the Deselect state. Though it begs the question, why limit yourself so severely?

here's a quick example code I whipped up in 5 seconds

Code: Select all

actor HeavyPistol : Pistol 
    {
    weapon.SlotNumber 2
    
    states
        {
        Select: 
            TNT1 A 0 A_GiveInventory("HeavyPistolSlowness")
            goto super::Select
        
        Deselect:
            TNT1 A 0 A_TakeInventory("HeavyPistolSlowness")
            goto super::Deselect
        }
    }
    
actor HeavyPistolSlowness : PowerSpeed
    {
    Speed 0.1
    Powerup.Duration 0x7FFFFFFF
    Inventory.Icon ""
    +POWERSPEED.NOTRAIL
    }
 
osjclatchford
Posts: 2058
Joined: Mon Feb 07, 2011 5:02 am

Re: a decorate conundrum.

Post by osjclatchford »

why thank you mikk! that was quick! it does indeed work but for some reason the player now bobs up and down when attempting to move now... other than that its exactly the kinda thing i was after.

the reason for the desire of this is that it is a decorate vehicle that uses fire,hold and altfire states for acceleration and braking respectively. the ability to still move around with it seemed odd and totally broke the forth wall. this code is ok i guess as its like you're trying to literally move the vehicle (bike) around with your feet, shimmying it about via kicking off of the floor, literally walking it about. however if we can get rid of that vertical bobbing it'd be even better... (it already has the noweaponbob flag)

*edit*
scrtch that. i simply set a value of speed 0! no movement at all now! YAY. thanks again mikk
Post Reply

Return to “Scripting”