A_Chase(0,0) in ZScript?

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
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

A_Chase(0,0) in ZScript?

Post by Enjay »

In docorate, it is possible to use something like:

Code: Select all

SPRI AAA 1 A_Chase (0, 0)
in the see state sequence to make an enemy keep coming after the player, but not try to attack (thereby reducing aggression in enemies using particularly short walking frames).

When I tried the same thing in ZScript...

Code: Select all

SPRI AAA 1 A_Chase (0, 0);
I got:

Code: Select all

State jumps with index cannot be used on multistate definitions
So, I changed it to

Code: Select all

SPRI A 1 A_Chase (0, 0);
SPRI A 1 A_Chase (0, 0);
SPRI A 1 A_Chase (0, 0);
and I got:

Code: Select all

State index must be positive
so now I'm using:

Code: Select all

SPRI AAA 1 A_Chase ("See", "See");
That seems to work, and I don't *think* the enemy is jumping to the first fram of the walking sequence ("See" state) every time it is called (I don't want it to - I just want it to carry on in its "See" sequence). I just wanted to check that it was the correct way to do it in ZScript.
User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: A_Chase(0,0) in ZScript?

Post by Rachael »

Have you tried "", "" as the states?
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: A_Chase(0,0) in ZScript?

Post by Enjay »

Well, I have now and...

Code: Select all

State jump to empty label.
:?
User avatar
Arctangent
Posts: 1235
Joined: Thu Nov 06, 2014 1:53 pm
Contact:

Re: A_Chase(0,0) in ZScript?

Post by Arctangent »

It's null you want. Not "Null", but null - any string is going to be converted into an state label, and apparently any integer is going to be see as a state offset. null, meanwhile, is the universal "nothing" value for any type.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: A_Chase(0,0) in ZScript?

Post by Enjay »

Code: Select all

SPRI A 1 A_Chase (null, null);
Does indeed seem to do the trick. Thank you. :)
User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: A_Chase(0,0) in ZScript?

Post by Rachael »

Yeah, sorry my idea didn't work. I guess I need to work on ZScript a bit more. :)
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: A_Chase(0,0) in ZScript?

Post by Enjay »

No problem. All suggestions gratefully received (and tried), regardless of the result. :)
Post Reply

Return to “Scripting”