Grouped action specials in DECORATE

Moderator: GZDoom Developers

User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Grouped action specials in DECORATE

Post by Ed the Bat »

From the rifle in the file you posted:

Code: Select all

    Fire:
        TNT1 A 0 A_JumpIfInventory("RifleAmmo",1,2)
        TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        TNT1 A 0 A_PlaySound("weapons/rifle", 1)
		RIFF A 1 BRIGHT
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_AlertMonsters
		RIFF B 1 BRIGHT A_FireBullets (2, 2, -1, 8.5, "BulletPuffed")
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_Takeinventory("RifleAmmo",1)
		RIFF C 1 A_FireCustomMissile("ChaingunCasingSpawner",5,0,8,-9)
        RIFG A 2
		RIFG A 1 A_ReFire
		RIFG A 7 A_WeaponReady(1)
		Goto Ready+6
If sv_fastweapons is set to 1, there's up to six tics before the sound of the gun, which itself comes two tics before the gunflash, which ITSELF is two tics before the gun shoots, which is then ANOTHER two tics before the ammo is consumed. Our definitions of sane are apparently very different.
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Grouped action specials in DECORATE

Post by Matt »

So if this is added then how would goto and jump work within such a bracketed set, if at all?
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Grouped action specials in DECORATE

Post by edward850 »

Gez wrote:Ring! I've edited the DECORATE definitions of these weapons to use real sprites instead of TNT1 A, and now the result is sane.
That's not what I meant. ;)
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

Re: Grouped action specials in DECORATE

Post by MaxED »

Gez wrote:Now, this is what happens when the Spawn state is TNT1 A.
Spoiler:
Not in DB2/GZDB :)
Also, TNT1A0 is suggested to be used as "empty sprtite" in several wiki articles.
Last edited by MaxED on Fri Jan 02, 2015 6:38 pm, edited 1 time in total.
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Grouped action specials in DECORATE

Post by edward850 »

Well it is what happens in Slade3, which dynamically acquires sprites. :|
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

Re: Grouped action specials in DECORATE

Post by MaxED »

You should definitely fix it then. Right now. No matter the cost.
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Grouped action specials in DECORATE

Post by edward850 »

Oh maybe people can fix their mods?
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

Re: Grouped action specials in DECORATE

Post by MaxED »

People will never do that, so get to it.
Gez
 
 
Posts: 17938
Joined: Fri Jul 06, 2007 3:22 pm

Re: Grouped action specials in DECORATE

Post by Gez »

MaxED wrote:Also, TNT1A0 is suggested to be used as "empty sprtite" in several wiki articles.
Empty sprite isn't the same thing as "zero length state sprite" though.
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

Re: Grouped action specials in DECORATE

Post by MaxED »

Personally, I don't like that, unlike TNT1 or NULL, using "####" or "----" leads to misaligned text in my DECORATE code. So, unless somebody explains what's so bad in using them, I'll keep using them I'm afraid...
User avatar
edward850
Posts: 5886
Joined: Tue Jul 19, 2005 9:06 pm
Location: New Zealand
Contact:

Re: Grouped action specials in DECORATE

Post by edward850 »

"I'll keep doing the things the wrong way because I think it's right!"
User avatar
Ed the Bat
Posts: 3060
Joined: Thu May 03, 2012 1:18 pm
Graphics Processor: nVidia with Vulkan support
Location: Maryland, US
Contact:

Re: Grouped action specials in DECORATE

Post by Ed the Bat »

edward850 wrote:"I'll keep doing the things the wrong way because I think it's right!"
More like "I won't stop doing things my way because you think it's wrong."
User avatar
Major Cooke
Posts: 8206
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: Grouped action specials in DECORATE

Post by Major Cooke »

Can't wait to hear Randi's and Graf's thoughts on TNT1 vs. "####".
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: Grouped action specials in DECORATE

Post by Xaser »

Back on topic, I find this feature extremely useful. Tons of times, particularly in weapon/projectile coding, I find myself needing to do multiple actions "per state" over several frames of an animation, leading to ugliness like this:

Code: Select all

ACTOR CrazyMagicGun: Weapon
{
	...
	States
	{
	Ready:
		CMGG A 0 A_WeaponReady
		CMGG A 1 A_JumpIfInventory("IsKicking", "QuickKick")
		CMGG B 0 A_WeaponReady
		CMGG B 1 A_JumpIfInventory("IsKicking", "QuickKick")
		CMGG C 0 A_WeaponReady
		CMGG C 1 A_JumpIfInventory("IsKicking", "QuickKick")
		CMGG D 0 A_WeaponReady
		CMGG D 1 A_JumpIfInventory("IsKicking", "QuickKick")
		CMGG E 0 A_WeaponReady
		CMGG E 1 A_JumpIfInventory("IsKicking", "QuickKick")
		CMGG F 0 A_WeaponReady
		CMGG F 1 A_JumpIfInventory("IsKicking", "QuickKick")
		CMGG G 0 A_WeaponReady
		CMGG G 1 A_JumpIfInventory("IsKicking", "QuickKick")
		CMGG H 0 A_WeaponReady
		CMGG H 1 A_JumpIfInventory("IsKicking", "QuickKick")
		Loop
	...
	}
}
Bunch of annoying copypasta. Now it's just as easy as:

Code: Select all

ACTOR CrazyMagicGun: Weapon
{
	...
	States
	{
	Ready:
		CMGG ABCDEFGH 1 { A_WeaponReady A_JumpIfInventory("IsKicking", "QuickKick") }
		Loop
	...
	}
}
...Or however the syntax is. Cool stuff.
User avatar
Major Cooke
Posts: 8206
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: Grouped action specials in DECORATE

Post by Major Cooke »

Sadly, Xaser...
Graf Zahl wrote:Syntax rejected. Since this will have to be a stand-in for a scripted function each line must end with a semicolon. And the goto is a complete no-go. The scripting language won't allow a goto, it also won't allow A_Jump constructs, but real script syntax instead. In this area the main objective will be: no stopgap measures. Period.
BTW, if Randi continues his work on the scripting branch and manages to merge it this might not be so far away - but don't expect anything unless the scripting framework is in.
But on the bright side, that means its a lot more powerful.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”