DECORATE Variable: SpawnHealth
Moderator: GZDoom Developers
-
amv2k9
- Posts: 2178
- Joined: Sun Jan 10, 2010 4:05 pm
- Location: Southern California
DECORATE Variable: SpawnHealth
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.
-
Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: DECORATE Variable: SpawnHealth
Can't be done as a variable. It'd have to be a function because that's what it is internally.
-
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
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.
-
Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: DECORATE Variable: SpawnHealth
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.
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.
-
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
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.)Graf Zahl wrote:An expression is not a function so I have no idea what you imagine here.
-
Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: DECORATE Variable: SpawnHealth
With real scripting and object variables that is doable.
-
randi
- Site Admin
- Posts: 7750
- Joined: Wed Jul 09, 2003 10:30 pm
-
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
Wait, what about pointers? This will do much better if it could support pointers.
-
randi
- Site Admin
- Posts: 7750
- Joined: Wed Jul 09, 2003 10:30 pm
Re: DECORATE Variable: SpawnHealth
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?
-
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
Through custominventory, I take it?
-
Gez
-

- Posts: 17946
- Joined: Fri Jul 06, 2007 3:22 pm
Re: DECORATE Variable: SpawnHealth
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
Yeah and then we should introduce null pointer checks because target may not exist...
-
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
That won't be coming until we actually have a script to work with. Right now, feels like we're getting DECORATE polished off.
-
amv2k9
- Posts: 2178
- Joined: Sun Jan 10, 2010 4:05 pm
- Location: Southern California
Re: DECORATE Variable: SpawnHealth
Thanks for adding this!