Grouped action specials in DECORATE

Moderator: GZDoom Developers

User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Grouped action specials in DECORATE

Post by Nash »

I can see the benefits of using #### as Gez proposed. I would Search & Replace that out in all of my mods in a heartbeat if GZDoom Builder supported it like SLADE does... but it's not really a high priority for me at this moment and I can live with it not being implemented in GZDB.
User avatar
Fishytza
Posts: 791
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Grouped action specials in DECORATE

Post by Fishytza »

Seeing that is possibly gonna happen makes me excited as hell. I can't help but wonder, is the syntax going to be something like this?

Code: Select all

CustomAF A_RebelChase
{
	if( CheckClass("SpectralMonster", AAPTR_TARGET, true) )
	{
		A_ChangeFlag("FRIGHTENED", 1);

		if( random(1,100) <= 10 )
			A_PlaySound("rebel/runforyourlives", CHAN_VOICE);

		A_Chase("", "", CHF_NOPLAYACTIVE);
	}
	else
	{
		A_ChangeFlag("FRIGHTENED", 0);
		A_Chase;
	}
}

Actor NewRebel : Rebel
{
	States
	{
	See:
		HMN1 AABBCCDD 3 A_RebelChase
		Loop
	}
}
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 »

That actually looks like something I'd expect too, Fishy. :D
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49223
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Grouped action specials in DECORATE

Post by Graf Zahl »

You won't get a 'CustomAF', of course, but the long term plan is to be able to add custom code to actors - not just action functions, but also extensions to internal methods.
User avatar
Fishytza
Posts: 791
Joined: Wed Feb 23, 2011 11:04 am
Preferred Pronouns: They/Them
Contact:

Re: Grouped action specials in DECORATE

Post by Fishytza »

Graf Zahl wrote:...but also extensions to internal methods.
Could you please elaborate what you mean by 'internal methods'? Does this include being able to, say, decide if an actor should or should not change its target to what's attacking it right now based on certain criteria (what class is the attacker, is it a player, etc) IE kind of like how OkayToSwitchTarget works?

Or am I getting my hopes up for no good reason?
User avatar
Snarboo
Posts: 2599
Joined: Tue Nov 29, 2005 4:37 am

Re: Grouped action specials in DECORATE

Post by Snarboo »

Graf Zahl wrote:You won't get a 'CustomAF', of course, but the long term plan is to be able to add custom code to actors - not just action functions, but also extensions to internal methods.
Does that mean custom functions created for an actor cannot be reused by another without inheritance, or am I reading this wrong?
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

Re: Grouped action specials in DECORATE

Post by MaxED »

Nash wrote:I can see the benefits of using #### as Gez proposed. I would Search & Replace that out in all of my mods in a heartbeat if GZDoom Builder supported it like SLADE does...
Will that do, or am I missing something?

Code: Select all

public static bool IsIgnoredSpriteName(string name) 
{
    return (name.StartsWith("TNT1A") || name.StartsWith("NULL") || name.StartsWith("----") || name.Contains("#"));
}
(current implementation only skips a sprite when it's name starts with "TNT1A0").
User avatar
Nash
 
 
Posts: 17484
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Grouped action specials in DECORATE

Post by Nash »

I guess that'll do? But I don't know too much about programming and what other implications or side effects this may cause... will only be able to find out when I actually run the program. :D
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

Re: Grouped action specials in DECORATE

Post by MaxED »

By "am I missing something?" I meant "are there some other 'special' sprite names, which should be ignored?"
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Grouped action specials in DECORATE

Post by NeuralStunner »

MaxED wrote:Will that do, or am I missing something?
With TNT1, the frame letter doesn't matter to the engine. Any frame (A-Z, [, \, ]) works the same, it's TNT1 that does the magic.

Also, NULL has no special meaning to the engine and shouldn't be ignored. Bad practices are not to be encouraged. ;)
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

Re: Grouped action specials in DECORATE

Post by MaxED »

This way then? (some refactoring was applied)

Code: Select all

// Ignore some odd ZDoom things
if (!spritename.StartsWith("TNT1") && !spritename.StartsWith("----") && !spritename.Contains("#")) 
{
    sprites.Add(spritename);
}
 
User avatar
NeuralStunner
 
 
Posts: 12328
Joined: Tue Jul 21, 2009 12:04 pm
Preferred Pronouns: No Preference
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: capital N, capital S, no space
Contact:

Re: Grouped action specials in DECORATE

Post by NeuralStunner »

Looks good to me.
User avatar
MaxED
Posts: 2246
Joined: Tue Feb 28, 2012 12:55 pm

Re: Grouped action specials in DECORATE

Post by MaxED »

OK, fixed in r2163.
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Re: Grouped action specials in DECORATE

Post by randi »

Snarboo wrote:I wonder if that DDF converter that was promised will make it in? :p
What DDF converter?
User avatar
Snarboo
Posts: 2599
Joined: Tue Nov 29, 2005 4:37 am

Re: Grouped action specials in DECORATE

Post by Snarboo »

From the [wiki=DoomScript]DoomScript[/wiki] article:
A DDF->DoomScript converter will be available so that people can both see how something done in DDF relates to something done in DoomScript, and also so that DDF mods will work with ZDoom. A DeHackEd->DoomScript converter might also be made, although doing anything with DeHackEd outside the original doom.exe is very problematic, and it might not be realistically possible to convert it to DoomScript with an automatic tool.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”