Anonymous functions : error on bootup

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
Stardust
Posts: 57
Joined: Sat Jan 12, 2013 6:41 pm
Location: France

Anonymous functions : error on bootup

Post by Stardust »

Hi there and happy 2x18 :wub: :wub: :wub:

I wanted to give a try to the lambda functions (or anonymous functions are they're described on the wiki here : https://zdoom.org/wiki/Actor_states#Anonymous_functions )
Yet, simply put, even with the simpleeeest instructions, my game isn't working. It won't boot up and crash on startup.

Here is the codo :

actor Parent
{
radius 25 height 40
+nogravity +SOLID +SHOOTABLE
HEALTH 35 SCALE 2.5
states
{
Spawn:
GYRO ABCD 2
loop
Death:
NAPA D 35
{
A_ChangeFlag("NOGRAVITY", 1);
A_PlaySoundEx("weapon/sparkshock", "Weapon");
}
stop
}
}

The error I get is :
"Script error, "mymod.pk3:decorate" line 15:
Sprite names must be exactly 4 characters"


Heck, even copy-pasting the example from the link above gives the same errror... so I guess something is wrong with me or my tools.
I use SLADE3 to edit my code and my game runs on the Zandronum 3.0 engine, if that relates to the problem '^'

Sooo : 1) can this be fixed so I can play my game?
2) If it's unfixable or unsupported by Zandro engine, is there another way to do it? The feature I'm interested into from these anonymous functions, is being able to cast several Action functions on the same frame.
RaveYard
Posts: 194
Joined: Fri Apr 12, 2013 10:51 am

Re: Anonymous functions : error on bootup

Post by RaveYard »

Zandronum
There's your issue.

Simply put, Zandronum is lagging behind in terms of features that GZDoom has, by years worth. :cry:

If you're making a singleplayer mod, use GZDoom.
Stardust
Posts: 57
Joined: Sat Jan 12, 2013 6:41 pm
Location: France

Re: Anonymous functions : error on bootup

Post by Stardust »

That's sad ;~~;

Even though, it has most of the necessary functions to make a good mod and is still being updated.
I would be forced to do such :

TNT1 A 0 A_Chase
TNT1 A 0 A_SpawnItemEx(....)
TNT1 A 0 A_PlaySoundEx(..)
SPRT A 10 A_SetAngle(..)

if I wanted to have several Action functions at the same moment? or is there a cleaner way to do it - still in zandronum? :D
RaveYard
Posts: 194
Joined: Fri Apr 12, 2013 10:51 am

Re: Anonymous functions : error on bootup

Post by RaveYard »

Sadly, there is no better option other than the zero tick frames.
Stardust
Posts: 57
Joined: Sat Jan 12, 2013 6:41 pm
Location: France

Re: Anonymous functions : error on bootup

Post by Stardust »

A bit off-topic - but using Zandronum means also you can't use this ZScript thing, right? It looks like a fairly good tool, but I assume Zandronum can't use it neither :x

-plus it would help me doing several actions in a single frame and solve my problem-
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: Anonymous functions : error on bootup

Post by Blue Shadow »

Stardust wrote:A bit off-topic - but using Zandronum means also you can't use this ZScript thing, right?
No, you can't. Not yet anyway.
Post Reply

Return to “Scripting”