Scripts affecting custom player classes

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
User avatar
Grey-Wolf
Posts: 179
Joined: Sun Jul 15, 2018 4:59 pm
Graphics Processor: nVidia (Modern GZDoom)

Scripts affecting custom player classes

Post by Grey-Wolf »

How should I do it?

My goal is to create a player class that loses weapons everytime he advances from a map to another
User avatar
m8f
 
 
Posts: 1445
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Manjaro Linux
Location: Siberia (UTC+7)
Contact:

Re: Scripts affecting custom player classes

Post by m8f »

ACS: ClearInventory + CheckClass.

ZScript: this + operator A is "B"

Edit: ACS is wrong! To get player's class, use https://zdoom.org/wiki/GetActorClass
Last edited by m8f on Thu Feb 14, 2019 5:00 am, edited 1 time in total.
User avatar
Grey-Wolf
Posts: 179
Joined: Sun Jul 15, 2018 4:59 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Scripts affecting custom player classes

Post by Grey-Wolf »

Check class only lets me check if the class is valid, how do I actually check if the player is currently using a specific class?
Last edited by Grey-Wolf on Wed Feb 13, 2019 1:19 pm, edited 2 times in total.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Scripts affecting custom player classes

Post by Blue Shadow »

If we're talking about ACS, then you want [wiki]CheckActorClass[/wiki].
User avatar
Grey-Wolf
Posts: 179
Joined: Sun Jul 15, 2018 4:59 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Scripts affecting custom player classes

Post by Grey-Wolf »

Actually, I solved it like this:

if(GetPlayerInfo(PlayerNumber(), PLAYERINFO_PLAYERCLASS) == 4)
{

By the way this was an old question, didn't really want to put anyone's attentiont to this right now. :-(
Post Reply

Return to “Scripting”