Scripts affecting custom player classes

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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.

Scripts affecting custom player classes

Postby Grey-Wolf » Sun Feb 03, 2019 6:35 pm

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
Grey-Wolf
 
Joined: 15 Jul 2018
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Scripts affecting custom player classes

Postby m8f » Wed Feb 13, 2019 3:03 am

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 6:00 am, edited 1 time in total.
User avatar
m8f
 
 
 
Joined: 29 Dec 2017
Discord: m8f#0629
Github ID: mmaulwurff

Re: Scripts affecting custom player classes

Postby Grey-Wolf » Wed Feb 13, 2019 1:26 pm

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 2:19 pm, edited 2 times in total.
User avatar
Grey-Wolf
 
Joined: 15 Jul 2018
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia (Modern GZDoom)

Re: Scripts affecting custom player classes

Postby Blue Shadow » Wed Feb 13, 2019 1:45 pm

If we're talking about ACS, then you want CheckActorClass.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Scripts affecting custom player classes

Postby Grey-Wolf » Wed Feb 13, 2019 2:19 pm

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. :-(
User avatar
Grey-Wolf
 
Joined: 15 Jul 2018
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia (Modern GZDoom)


Return to Scripting

Who is online

Users browsing this forum: Void Weaver and 1 guest