Simple ZScript formatting 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
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Simple ZScript formatting error?

Post by Captain Ventris »

Trying to transfer a decorate actor over to ZSCript as cheaply as possible (for the sake of future rewrites with a wider array of options), and I keep getting this error:
zactors/doom/player.zscript" line 36: Unexpected '}' Expecting ';' or ','

Here is the actor responsible:

Line 36 has a note next to it.
Spoiler:
I guarantee it's something simple since I've never messed with ZScript before, but I've stared at it long enough that I can't figure it out.
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Simple ZScript formatting error?

Post by Jarewill »

At a first glance, Player.Weaponslot properties are lacking the ; symbol at the end of them.
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Simple ZScript formatting error?

Post by Captain Ventris »

Now it says: "zactors/doom/player.zscript, line 15-18: '@property@Int' is an unknown actor property"
Jarewill
 
 
Posts: 1853
Joined: Sun Jul 21, 2019 8:54 am

Re: Simple ZScript formatting error?

Post by Jarewill »

Actor variables should be outside any block and they don't need to be prefixed with user_ now.
So move those:

Code: Select all

	int user_nextOrder;
	int user_lastOrder;
	int user_deathCount;
	int user_simultaneousCaptures;
Outside the Default block, like so:

Code: Select all

Class DoomMarine : PlayerPawn 
{
	int nextOrder;
	int lastOrder;
	int deathCount;
	int simultaneousCaptures;
	Default
	{
User avatar
Captain Ventris
Posts: 4608
Joined: Mon Jul 31, 2006 4:25 pm
Location: San Antonio, TX

Re: Simple ZScript formatting error?

Post by Captain Ventris »

Aha! That got it. Thanks!
Post Reply

Return to “Scripting”