Stupid decorate / A_Jump question

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
gramps
Posts: 300
Joined: Thu Oct 18, 2018 2:16 pm

Stupid decorate / A_Jump question

Post by gramps »

I'm sure I'm doing something stupid here, but not sure what.

I have four different tuft-of-grass sprites, and an actor for each. Here are the first two:

Code: Select all

Actor G_Grass1 20401
{
	Radius 8
	Height 8
	States
	{
	Spawn:
		GRS1 A -1
		Stop
	}
}
Actor G_Grass2 20402
{
	Radius 8
	Height 8
	States
	{
	Spawn:
		GRS2 A -1
		Stop
	}
}
These work fine. I wanted to make a new actor that randomly displays one of the frames:

Code: Select all

Actor G_Grass 20400
{
	Radius 8
	Height 8
	States
	{
	Spawn:
		GRS1 A 0 A_Jump(256, 1, 2, 3, 4)
		GRS1 A -1
		GRS2 A -1
		GRS3 A -1
		GRS4 A -1
		Stop
	}
}
But this always shows the GRS1 sprite. Have tried several variations (named states, adding some non-zero-length frames, etc.) and always end up with either the first sprite or no sprite at all. What am I doing wrong here?

Using decorate instead of zscript for Slade compat, btw.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Stupid decorate / A_Jump question

Post by Blue Shadow »

On the state with the A_Jump call, put the [wiki=Actor_states#NoDelay]NoDelay[/wiki] state keyword.
gramps
Posts: 300
Joined: Thu Oct 18, 2018 2:16 pm

Re: Stupid decorate / A_Jump question

Post by gramps »

Sweet, lemme try that. Should this be on wiki?

Just tried it, works fine. Not sure I understand what it's doing exactly, why didn't this work after a delay? I guess the A_Jump examples are meant to be partial state blocks and that's why they don't have that NoDelay thing on the first line...
Last edited by gramps on Tue Dec 11, 2018 7:39 am, edited 1 time in total.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Stupid decorate / A_Jump question

Post by Blue Shadow »

The "NoDelay" in my post is a link to the relevant page on the wiki.
gramps
Posts: 300
Joined: Thu Oct 18, 2018 2:16 pm

Re: Stupid decorate / A_Jump question

Post by gramps »

Right, I meant on the wiki page for A_Jump, which I was referencing when I wrote the thing and has several things on the first line with no NoDelay.

Incidentally I don't particularly care if there's a (one tic?) delay or not, and still don't quite understand why not having a delay makes this work, while it doesn't work after a delay.

What exactly is NoDelay doing (besides not delaying) that makes this work when it doesn't work without it?
Post Reply

Return to “Scripting”