A_SpawnItemEx TID flags

Moderator: GZDoom Developers

User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: A_SpawnItemEx TID flags

Post by Major Cooke »

I've got a question...

Code: Select all

Script 250 (void) // Plasma Gun
{
Thing_remove(250);
delay(10);
Thing_SpawnNoFog(10, T_CHAINGUY, 0, 402);
SetActorProperty(402, APROP_Health, (GetActorProperty(402, APROP_Health))*10);
delay(35*15);
Thing_SpawnNoFog(10, T_CHAINGUY, 0, 402);
SetActorProperty(402, APROP_Health, (GetActorProperty(402, APROP_Health))*10);
}

Code: Select all

Actor ZombieReplacerMod replaces Zombieman
{
	var int user_Type;
	Monster
	+NONSHOOTABLE
	-SHOOTABLE
	+NOINTERACTION 
	-COUNTKILL
	States
	{
	Spawn:
		TNT1 A 0
	Aliens:
	TNT1 a 0 A_Jump(256,"Al01","Al02","Al03","Al04")
	Al01:	TNT1 A 0 A_SpawnItemEx("Alien1",0,0,0,0,0,0,0,SXF_TRANSFERTID|SXF_LOSETID|SXF_SETMASTER|SXF_NOCHECKPOSITION|SXF_TRANSFERAMBUSHFLAG)	Goto End
	Al02:	TNT1 A 0 A_SpawnItemEx("Alien2",0,0,0,0,0,0,0,SXF_TRANSFERTID|SXF_LOSETID|SXF_SETMASTER|SXF_NOCHECKPOSITION|SXF_TRANSFERAMBUSHFLAG)	Goto End
	Al03:	TNT1 A 0 A_SpawnItemEx("Alien3",0,0,0,0,0,0,0,SXF_TRANSFERTID|SXF_LOSETID|SXF_SETMASTER|SXF_NOCHECKPOSITION|SXF_TRANSFERAMBUSHFLAG)	Goto End
	Al04:	TNT1 A 0 A_SpawnItemEx("Alien4",0,0,0,0,0,0,0,SXF_TRANSFERTID|SXF_LOSETID|SXF_SETMASTER|SXF_NOCHECKPOSITION|SXF_TRANSFERAMBUSHFLAG)	Goto End
.....
If I read properly somewhere, or someone told me, DECORATE usually has the last say as far as execution order goes, am I right? So would this method work or would I need to add a Delay(1) in the ACS script?

I want to spawn the monster immediately with the TID, and have it's health changed instead of the spawner itself. I take it that'd be the best assurance method?
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: A_SpawnItemEx TID flags

Post by FDARI »

Last time I asked, checked or anything like that, I think the ACS-thinker was the last event on a tick, but I could be wrong. However... I don't really see what you're trying to do. Do you launch script 250 in the end-state? If you want an ACS-operation to start immediately, the "ExecuteWithResult"-variant is for you.

Or.... Are you trying to run script 250 to change some stuff, and wanting the whole script to complete before decorate kicks in? Decorate processing does not start when the actor is spawned, but the next time the thinker runs, and you're in the ACS-thinker at the moment, so you should be home-free. You can kickstart it with SetActorState(), as that forces normal state-processing on the state you set until the first greater-than-0-duration frame.

You can run print statements and logs to check.
User avatar
FDARI
Posts: 1097
Joined: Tue Nov 03, 2009 9:19 am

Re: A_SpawnItemEx TID flags

Post by FDARI »

SXF_TRANSFERSCALE (http://forum.zdoom.org/viewtopic.php?f= ... 67#p579867) included in new submission. Untested as of right now.
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: A_SpawnItemEx TID flags

Post by Major Cooke »

I'd say bump for great justice, because these are things I very much would like to have!
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: A_SpawnItemEx TID flags

Post by Xaser »

The patch probably requires bumping the flag numbers since SXF_USEBLOODCOLOR has been added since submission, but that's probably the easiest possible edit anyhow. ;)
User avatar
Major Cooke
Posts: 8209
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: A_SpawnItemEx TID flags

Post by Major Cooke »

Indeed. Unlike some of the other code submissions, I have reason to believe this is still compatible. I just hope FDARI's willing to update the rest, those are some good decorate functions I can use.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: A_SpawnItemEx TID flags

Post by randi »

Added in r4188.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”