Simple in theory, this one - extentions to GetActorProperty which return the actor's current brightness (between 0 and 255) and the tag of the sector the actor is currently standing in (returning -1 if the sector in question has no tag assigned).
The only problem I can envisage with the first one is regarding GZDoom's dynamic lights. Perhaps in a case where an actor is partially lit by a dynamic light, some kind of average could be taken to determine the returned value?
I await your thoughts, and hopefully not an immediate [No].
EDIT: finding the sector tag would probably be better suited to a separate function like GetCurrentSector or whatever, as it doesn't make much sense in the context of actor properties. Hmm.
EDIT #2: changed 'TID' to 'tag'. I was drunk when I posted this.
ACS: APROP_BrightnessLevel and GetCurrentSector
Moderator: GZDoom Developers
-
- Posts: 695
- Joined: Sun Nov 20, 2005 9:57 am
- Location: Belfast, NI
ACS: APROP_BrightnessLevel and GetCurrentSector
Last edited by Skippy on Fri Jan 05, 2007 2:44 am, edited 1 time in total.
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
The light level of a sector can already be retreived with [wiki]GetSectorLightLevel[/wiki], so if GetCurrentSector were added you could simply do:
The only problem is that it would not take dynamic or point lights into consideration, as you pointed out, however I don't see an easy fix for that.
I second the addition of GetCurrentSector. It could be used for a number of effects.
Code: Select all
GetSectorLightLevel(GetCurrentSector(TID));
I second the addition of GetCurrentSector. It could be used for a number of effects.
-
- Posts: 695
- Joined: Sun Nov 20, 2005 9:57 am
- Location: Belfast, NI
Thanks for your reply HotWax. I was aware of the GetSectorLightLevel function, however it would only become useful to me upon the implementation of the GetCurrentSector function. Even this would not be useful for what I require, though.
In short, I wish to extend the monster AI va a combination of custom states and ACS_ExecuteWithResult, and one of the effects I want to achieve is based on the 'visibility' of the player - a factor detemined by distance (already retreivable) and, hopefully, light level. And although I would love to see a GetCurrentSector function implemented (I'd love to see what you could do with it), it doesn't really fix my problem as I want to have my 'visibility check' acting across entire levels via a LOADACS lump, and the size/detail of the maps in question makes the tagging of each individual sector entirely prohibitive.
Okay, I'll admit, this is heading into Metal Gear/Splinter Cell territory, but I know that these suggestions would prove immensely useful outside of this scope. Anyone else got any ideas?
In short, I wish to extend the monster AI va a combination of custom states and ACS_ExecuteWithResult, and one of the effects I want to achieve is based on the 'visibility' of the player - a factor detemined by distance (already retreivable) and, hopefully, light level. And although I would love to see a GetCurrentSector function implemented (I'd love to see what you could do with it), it doesn't really fix my problem as I want to have my 'visibility check' acting across entire levels via a LOADACS lump, and the size/detail of the maps in question makes the tagging of each individual sector entirely prohibitive.
Okay, I'll admit, this is heading into Metal Gear/Splinter Cell territory, but I know that these suggestions would prove immensely useful outside of this scope. Anyone else got any ideas?
Last edited by Skippy on Fri Jan 05, 2007 2:45 am, edited 1 time in total.
-
- Posts: 1031
- Joined: Wed Oct 15, 2003 12:19 am
- Location: Czech Republic
-
- Posts: 695
- Joined: Sun Nov 20, 2005 9:57 am
- Location: Belfast, NI
-
- Posts: 1581
- Joined: Thu Jun 30, 2005 1:44 am
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID
-
- Posts: 695
- Joined: Sun Nov 20, 2005 9:57 am
- Location: Belfast, NI
Thanks for your suggestions guys.
I like the idea of grouping sectors under a single tag based on a light level. However, it would become problematic over a larger map due to sectors requiring unique effects such as coloured lighting (as HotWax pointed out). Also, it would fall short when trying to determine the brightness of an actor, which is what my original suggestion was, as it wouldn't account for things like fullbright sprites - like a Lost Soul in a 0-level light room, for example. And there's still the problem of GZDoom lights...
For my own purposes, I could hack around the fullbright problem by calling an ACS function from the actor's DECORATE which 'flags' it as having a light level of 255 where needed. All I need now is a big [Yes] to GetCurrentSector(tid), and I can go.
Thanks for taking an interest.
I like the idea of grouping sectors under a single tag based on a light level. However, it would become problematic over a larger map due to sectors requiring unique effects such as coloured lighting (as HotWax pointed out). Also, it would fall short when trying to determine the brightness of an actor, which is what my original suggestion was, as it wouldn't account for things like fullbright sprites - like a Lost Soul in a 0-level light room, for example. And there's still the problem of GZDoom lights...
For my own purposes, I could hack around the fullbright problem by calling an ACS function from the actor's DECORATE which 'flags' it as having a light level of 255 where needed. All I need now is a big [Yes] to GetCurrentSector(tid), and I can go.
Thanks for taking an interest.
-
-
- Posts: 10773
- Joined: Sun Jul 20, 2003 12:15 pm
-
- Posts: 695
- Joined: Sun Nov 20, 2005 9:57 am
- Location: Belfast, NI
I'm sure many people, including myself, would find it invaluable.
I'd love to hear the developers' opinion on these two suggestions.
EDIT: I've just realised you could probably get a pretty close approximation of Korax, complete with manipulation of the surrounding play area, working in DECORATE and ACS with GetCurrentSector. Better boss battles? Reason enough for inclusion in my book (then again, it's not my book )
I'd love to hear the developers' opinion on these two suggestions.
EDIT: I've just realised you could probably get a pretty close approximation of Korax, complete with manipulation of the surrounding play area, working in DECORATE and ACS with GetCurrentSector. Better boss battles? Reason enough for inclusion in my book (then again, it's not my book )
-
- Posts: 10002
- Joined: Fri Jul 18, 2003 6:18 pm
- Location: Idaho Falls, ID