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.

Getting started ;( Class def error

Postby Kenny_mk » Mon Dec 11, 2017 6:26 pm

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 1:30 am, edited 1 time in total.
Kenny_mk
 
Joined: 11 Dec 2017

Re: Getting started ;( Class def error

Postby Blue Shadow » Mon Dec 11, 2017 8:26 pm

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.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI/AMD (Modern GZDoom)


Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests