DECORATE Variable: SpawnHealth

Moderator: GZDoom Developers

User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

DECORATE Variable: SpawnHealth

Post by amv2k9 »

Pretty much what it says; the health the monster had at spawn, respecting any multipliers made by the current skill.
Last edited by amv2k9 on Tue Feb 23, 2016 6:06 pm, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: DECORATE Variable: SpawnHealth

Post by Graf Zahl »

Can't be done as a variable. It'd have to be a function because that's what it is internally.
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

Re: DECORATE Variable: SpawnHealth

Post by NeuralStunner »

Out of curiosity, are [wiki=DECORATE_expressions]decorate expressions[/wiki] going to become functions, or will they be superceded by proper member access? In either case, SpawnHealth might as well be checkable by the sane means.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: DECORATE Variable: SpawnHealth

Post by Graf Zahl »

An expression is not a function so I have no idea what you imagine here.

As for SpawnHealth - there is no corresponding property. Internally it's a function that is calculating a value from a few different sources, so it will forever have to be a function.
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

Re: DECORATE Variable: SpawnHealth

Post by NeuralStunner »

Graf Zahl wrote:An expression is not a function so I have no idea what you imagine here.
Something like self.health or target.z, basically. (I wouldn't argue with having to explicitly put "self", since it would be more clear/readable.)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: DECORATE Variable: SpawnHealth

Post by Graf Zahl »

With real scripting and object variables that is doable.
User avatar
randi
Site Admin
Posts: 7750
Joined: Wed Jul 09, 2003 10:30 pm

Re: DECORATE Variable: SpawnHealth

Post by randi »

User avatar
Major Cooke
Posts: 8221
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

Re: DECORATE Variable: SpawnHealth

Post by Major Cooke »

Wait, what about pointers? This will do much better if it could support pointers.
User avatar
randi
Site Admin
Posts: 7750
Joined: Wed Jul 09, 2003 10:30 pm

Re: DECORATE Variable: SpawnHealth

Post by randi »

Do we really need to keep adding that crap to every function that can operate on an actor and be forced to carry that baggage around forever, even when they're no longer needed?
User avatar
Major Cooke
Posts: 8221
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

Re: DECORATE Variable: SpawnHealth

Post by Major Cooke »

Through custominventory, I take it?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: DECORATE Variable: SpawnHealth

Post by Gez »

I'd much rather have something like target->spawnhealth() than spawnhealth(AAPTR_TARGET).
Edward-san
Posts: 1774
Joined: Sat Oct 17, 2009 9:40 am

Re: DECORATE Variable: SpawnHealth

Post by Edward-san »

Yeah and then we should introduce null pointer checks because target may not exist...
User avatar
Major Cooke
Posts: 8221
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

Re: DECORATE Variable: SpawnHealth

Post by Major Cooke »

That won't be coming until we actually have a script to work with. Right now, feels like we're getting DECORATE polished off.
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: DECORATE Variable: SpawnHealth

Post by amv2k9 »

Thanks for adding this!

Return to “Closed Feature Suggestions [GZDoom]”