Help with player classes! Please!

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!)
i6g9o5r1
Posts: 4
Joined: Sat Dec 24, 2022 2:36 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10

Help with player classes! Please!

Post by i6g9o5r1 »

I need to make a script that checks the player's class and, depending on the class, changes the monster to another (for example, Zombieman to shotgunguy). But I can't make such a script, can you help please? :(
(I'm scripting in decorate)
Gez
 
 
Posts: 17840
Joined: Fri Jul 06, 2007 3:22 pm

Re: Help with player classes! Please!

Post by Gez »

I'm sorry to say, that's going to be quite difficult to make in pure DECORATE. Probably possible with some hacks and kludges and calling ACS... But I think this kind of things is where ZScript will shine.
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support

Re: Help with player classes! Please!

Post by Player701 »

Always mind the multiplayer scenario. What if there is more than one player, and they have different classes? Unless you have a total or partial conversion complete with a map pack where you can always control how many player starts are available, assume people will be playing your mod in coop (or even deathmatch, if applicable).

I suppose you could try leveraging RandomSpawner for this, see here for some example code which spawns items based on the player classes currently in-game. Contrary to RandomSpawner's name, it does not actually have to be random - it depends on the exact code you put in there. But this is ZScript and not DECORATE - the latter is simply not suitable for such tasks.
i6g9o5r1
Posts: 4
Joined: Sat Dec 24, 2022 2:36 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10

Re: Help with player classes! Please!

Post by i6g9o5r1 »

I dont know how to use ACS, i'm new at modding

Return to “Scripting”