A way to get an actor's sector
Moderator: GZDoom Developers
A way to get an actor's sector
As the title implies, there needs to be a way to get the sector an actor is currently in. It would return the sector that the thing with the specified tid and lowest number is in. This could be useful for running checks because the actor enters / leaves sector things aren't 100% foolproof.
GetActorSector(tid);
Also, dying monsters should activate actor leaves sector things.
GetActorSector(tid);
Also, dying monsters should activate actor leaves sector things.
Re: A way to get an actor's sector
I contest this on the basis that a dying actor never actually leaves the sector (exception is when the carcass goes flying out of the sector from a rocket or what have you.) They make their grave in that sector. I don't believe it should function the way you are suggesting.justin024 wrote:Also, dying monsters should activate actor leaves sector things.
Here is the idea, there is a big room with smaller sectors that light up depending on whether they are occupied. When a monster dies, the sector stays lit. It is also possible to light up a sector yourself and not have it dimmed again which goes beyond 'actor leaves sector' working with monsters. This is why I requested a get actor's sector function. Changing the thing itself isn't the best solution to my problem. I suppose that I could have that monster teleport to another sector, because using thing_remove doesn't trigger 'actor leaves sector' either. An 'actor dies' thing would help, but not as much as just getting the actor's current sector.
Edit: I did find a really roundabout way of making it work which involved making the monster tids lower than the player tids, keeping track of lower and upper tids, and lowering the light level only if the monster was in a different sector.
Edit: I did find a really roundabout way of making it work which involved making the monster tids lower than the player tids, keeping track of lower and upper tids, and lowering the light level only if the monster was in a different sector.
- MartinHowe
- Posts: 2062
- Joined: Mon Aug 11, 2003 1:50 pm
- Preferred Pronouns: He/Him
- Location: East Suffolk (UK)
Then can we at least have (G)ZDoom make Actor Enters/Leaves sector work properly? By this I mean that if a monster leaves a sector that has "actor leaves sector" and enters one with "actor enters sector", the engine needs to guarantee that the "leaves sector" triggers before the "enters sector" does. This caused me a lot of problems when trying to simulate monster-damaging areas. It would also be nice if "actor enters sector" can be set to trigger when an actor as been placed in that sector in a map editor.
- Cutmanmike
- Posts: 11351
- Joined: Mon Oct 06, 2003 3:41 pm
- Operating System Version (Optional): Windows 10
- Location: United Kingdom
- Contact:
- MartinHowe
- Posts: 2062
- Joined: Mon Aug 11, 2003 1:50 pm
- Preferred Pronouns: He/Him
- Location: East Suffolk (UK)
Thanks; I have it in mind to rewrite those scrips and this would make them simpler.Graf Zahl wrote:The exit sector action is triggered first. The problem you are having comes from ACS's inner workings. To guarantee proper order you have to do a one-tic delay at the start of the 'enter sector' script.
Not that I'd want to publicise too much at this stage, but think of nuclear reactor fuel rods being raised from their holes in the floor above the reactor core and a deep pool of opaque blue water full of spent fuel rods... heh heh heh!Cutmanmike wrote:Hmm got an example of that?MartinHowe wrote:trying to simulate monster-damaging areas.
- Anakin S.
- Posts: 1067
- Joined: Fri Nov 28, 2003 9:39 pm
- Location: A long time ago in a galaxy far, far away...
How about this:
Code: Select all
switch(lineside())
case 0:
do stuff when actor enters sector.
break;
case 1:
do stuff when actor leaves sector.
break;