OpenArena Message Boards

OpenArena Contributions => Development => Topic started by: sago007 on December 16, 2018, 06:59:02 AM

Title: State based doors
Post by: sago007 on December 16, 2018, 06:59:02 AM
I have worked a bit on creating triggers based on the game state.

One of the first thing I have implemented is a trigger that fires while in the active state of Elimination (or warmup).
It can be seen in action here:

This could be used for Elimination maps. You could for instance have one team start in a room that is locked while the other team can find positions.
It is also how I would implemented an objective based gametype like "Assault" if that will be relevant at some point.

If played with old VMs the doors become normal, so players are not actually trapped.

Having a door that is only open while the weapons are active is easy:

The test map:
VMs that can play it:

Title: Re: State based doors
Post by: Gig on December 17, 2018, 04:30:54 AM
Is this the same from this 2016 thread?

Back then, I did create a sort of "recap" of what I understood from that thread:
- Set "state_targetname/elimination_active" key/value pair on func_door entity (was "targetname/elimination_active" in its first version and in OAX B52, then changed to this) to make doors which are closing (can be blocked) during the "inactive" part of Elimination/CTF_elimination warmup, closed (cannot be blocked) during the "active" part of the warmup, and are open when the real round actually starts.
- Use for isolate areas of the maps during initial part of Elimination warmup (hence, usage with team-dedicated spawn points is required), to keep the two teams initially divided.
- Door will work as usual in other gametypes.
- In case the door has also got a standard "targetname" (e.g. due to being controlled by a button), that would work as expected in other gametypes, but ignored in Elimination and CTF Elimination mode (state_targetname takes precedence).
- To sum up, a door with "state_targetname/elimination active" key/value pair, in Elimination and CTFELimination modes will be closed during warmup and after that always open no matter what. Other modes are unaffected.
Uhm.... so, is it "targetname" or "state_targetname"? Is there some other difference than what I wrote above?
I haven't noticed recent changes in github about this feature... of course it's possible somehow I missed them!

Title: Re: State based doors
Post by: sago007 on December 17, 2018, 07:23:46 AM
@gig. Yes it is the same. I searched but could not find the original thread.

I was like: Did I really forget to write about this on the forum? Turned out that I did not forget to post it.

Title: Re: State based doors
Post by: Gig on December 18, 2018, 02:52:35 AM
Now that I think about it, a possible "design tip" for mappers using those:
- Considering that if "state_targetname/elimination_active" is set, the door will always be open during the actual match (in Elimination and CTF Elimination modes only), in case the door is also linked to a button (for other gametypes), one may set "!gametype/elimination" on the button, to hide the button in Elimination/CTFE, where it would have no effect.

Title: Re: State based doors
Post by: Neon_Knight on December 18, 2018, 09:32:21 AM
Func_, target_ and trigger_ entities could have new keys for the modes that require them instead of relying on targetnames. Those targetnames could already be taken and lead to unpredictable results.