Getting started ;( Class def error

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
Kenny_mk
Posts: 1
Joined: Mon Dec 11, 2017 5:19 pm

Getting started ;( Class def error

Post by Kenny_mk »

Hey im trying to get started on decorate/zscript

Im trying to create a default player class
i include in a decorate.txt my file #include script.txt

But my file consist of copy/paste of defaut doomplayer with name changed (reported in mapinfo)
mapinfo works as far as i have tested.

GameInfo
{
PlayerClasses = "DoomPlayer2","DoomPlayer"
}

but even if i rename my script.txt classes to DoomPlayer 2 i get :

Script error, "mod2.zip:doomplayer2.txt" line 1:
Expected '{', got 'Doomplayer2'.



my script.txt is a copy paste of zscript/doomplayer.txt (or something like that) with just the name changed.

I've tried Class DoomPlayer2: DoomPlayerr {
default{
health=75}
}

i get the same error no matter what i do

i know it's basic but i can't find what's wrong , thanks for help : x
Last edited by Kenny_mk on Tue Dec 12, 2017 12:30 am, edited 1 time in total.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Getting started ;( Class def error

Post by Blue Shadow »

Kenny_mk wrote:i include in a decorate.txt my file #include script.txt
my script.txt is a copy paste of zscript/doomplayer.txt (or something like that) with just the name changed.
You're including ZScript code in DECORATE, which it cannot parse. Only include DECORATE code in DECORATE, and ZScript code in ZScript. So what you want to do is rename your decorate.txt file to zscript.txt.
Post Reply

Return to “Scripting”