SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Editing > Editing Help

Reply
 
Thread Tools Search this Thread
Old 03-15-2011   #1
Ezer.Arch
ArchPack developer
 
Ezer.Arch's Avatar
Default Execute when the player enters the sector, and turn it off when the player leaves

This is simple, but I failed to find out a solution by myself.

That's the setup that I'm looking for: I want to execute linedef type "A" when one or more players enter a sector (anywhere in the sector). And, when all players leave the sector, linedef type "A" is turned off, or execute linedef type "B" that turns off the linedef type "A".

Example:
A corridor with 3 sectors in line, say: sector #1, sector #2, sector #3 and so on; each sector is meant to light up if there's at least one player in, and turn the light off if there are no players in.

If one or more player enter the sector #1, the light of sector #1 is turned on. While sector #1 has at least one player in, keep the light turned on. If all player leaves the sector #1 and enter the sector #2, turn off sector#1's light and turn on sector#2's light. If the sectors #1 and #2 have players in, both sectors should light up.

That's the problem: if the sector #2 is set to turn off sector #1's light, it will even if the sector #1 still has player in.

Other example:
A room with moving platforms. The room has, say, 10 sectors, each sector has a FOF or floor that rises up to a certain height if one or more player enter the said sector. If all players leave the said sector, the FOF or platform will return to its original position.

If two or three sectors have one or more players in, the FOFs or floors of said sectors rise up to a certain height.

In this case, I tried to use Linedef Type 191, but it requires that player must step on the floor, but if the player jumps straight up, the FOF will lower. I want to raise the platform even if the player is flying over, and keep the height of platform even if the player jump straight up. The platform will lower only if the player leaves the sector.
__________________
Ezer'Arch
ArchPack v2.1 level pack | EzerArch.com | YouTube | ERZ2 FTW!

Last edited by Ezer.Arch; 03-15-2011 at 05:51 AM.
Ezer.Arch is offline   Reply With Quote
Old 03-16-2011   #2
BlueZero4
 
BlueZero4's Avatar
Default

This is just a suggestion, so it might not work. I'd suggest a continuous executor in the main functioning sector (for example sector #1 with your light levels) and each time executors in the sectors surrounding that sector (which would be sector #2). With any luck, the light would turn off when a player goes in the surrounding sector, but the continuous executor would turn the light right back on.
__________________
scr_bz4pack.wad
BlueZero4 is offline   Reply With Quote
Old 03-16-2011   #3
Ricardo
Dead Guybrush in netgames
 
Ricardo's Avatar
Default

My turn. =P

First of all, I've thought it's better if each in-level sector doesn't depend on any others around it. This way, it's easier to port the "on/off executor" effect to different gimmicks.

My original approach was simple: you'd have a continuous trigger tagged to the affected in-level sector, an action that would be performed immediately (raising the sector's floor/lightning up the sector) and an action that would be executed with a certain delay (lowering the floor back to its original height/turning the sector's light off).

Here's an example of this approach: http://dl.dropbox.com/u/5117337/SRB2...version%29.wad


However this didn't work. In the example above you can see that the sectors go constantly up and down while you're inside them. The game seems to ignore new actions (sector thinkers) on target sectors with already running thinkers, it needs to finish the running one first before starting the new one, so in the example you can't interrupt the delayed action with the immediate one when it executes again (because of the continuous trigger).

...Or at least that's what I thought was happening, now I have no idea if that's still true... :S
What I know is that I found a rather strange but simple solution: have a continuous trigger and an action tagged to the target sector you want to affect (to rise its floor, for example), and have an extra out-of-level sector with the "pushable objects trigger" special and a gargoyle inside it, tagged to the affected target sector, but this time with the reversed action, that is, the action that moves the sector back to its original position.

No matter which sector or trigger linedef you create first, it always happen the same thing: first the player's action is executed and then the pushable object's one. Don't ask me why this is so, I couldn't find the reason...

Anyway, here's a working example: http://dl.dropbox.com/u/5117337/SRB2/on-off_sectors.wad


Tell me later if you could use this on the sector on/off light gimmick ;)

Last edited by Ricardo; 05-02-2011 at 07:53 PM.
Ricardo is offline   Reply With Quote
Old 03-17-2011   #4
Fred
Retired
 
Fred's Avatar
Default

Quote:
Originally Posted by Ricardo View Post
No matter which sector or trigger linedef you create first, it always happen the same thing: first the player's action is executed and then the pushable object's one. Don't ask me why this is so, I couldn't find the reason...
Probably because both the player and the gargoyle are triggering it every tic, but it just so happens that the player always comes before the gargoyle in the mobj list so the gargoyle's executor never has a chance to run -- except when the player isn't in the sector.

I wanna see what happens when you load the map, then have somebody join halfway in.
Fred is offline   Reply With Quote
Old 03-17-2011   #5
Ezer.Arch
ArchPack developer
 
Ezer.Arch's Avatar
Default

Quote:
Originally Posted by Neo Chaotikal View Post
I wanna see what happens when you load the map, then have somebody join halfway in.
It'd be funny to see later-joined players trapping first-joined ones.

But okay, I saw how the gargoyle-based trigger works. Nonetheless, I'm not worried too much about this issue because this desired setup would be used in an advanced level where I want to use some tricks with lighting and platforms over chemicals, and events would be turned on and off by two-way control sectors: player enters, activate; players leaves, deactivate.

Seemed simple until you intend to play the map for co-op mode, and 2nd player could accidentally turn off a linedef executor that is helping or being used by other player.

What I could suggest would be to make a linedef flag so that a linedef type could be triggered when the player enters the sector and executed only after the player has left the sector.
__________________
Ezer'Arch
ArchPack v2.1 level pack | EzerArch.com | YouTube | ERZ2 FTW!

Last edited by Ezer.Arch; 03-17-2011 at 07:46 AM.
Ezer.Arch is offline   Reply With Quote
Old 03-17-2011   #6
Fred
Retired
 
Fred's Avatar
Default

I think we need a "No Players In Sector (Each Time)" executor.
Fred is offline   Reply With Quote
Old 03-17-2011   #7
Sergeant Brown
I am the EggMaaaaan!
 
Sergeant Brown's Avatar
Default

I think we also need something like the playerforexit command --where it doesn't execute the exit sectors until all players are on them-- except it should apply to all possible sectors.
Sergeant Brown is offline   Reply With Quote
Old 03-17-2011   #8
Ricardo
Dead Guybrush in netgames
 
Ricardo's Avatar
Default

Quote:
Originally Posted by Ezer.Arch View Post
It'd be funny to see later-joined players trapping first-joined ones.
Nope!

Nothing wrong happens, the gimmick works in Co-Op as well, just tested it.
Still have no idea why that happens, though :\
Ricardo is offline   Reply With Quote
Old 06-12-2011   #9
Ezer.Arch
ArchPack developer
 
Ezer.Arch's Avatar
Default

Quote:
Originally Posted by Ricardo View Post
Worked perfectly: http://dl.dropbox.com/u/4799936/SRB2...erInSector.wmv

Quote:
Originally Posted by Ricardo View Post
Tell me later if you could use this on the sector on/off light gimmick ;)
I simply failed at this one: http://dl.dropbox.com/u/4799936/SRB2...dor_lights.wad

Quote:
Originally Posted by Neo Chaotikal View Post
I think we need a "No Players In Sector (Each Time)" executor.
It would be good, considering no-more enemies traps, like ERZ2-laser room where players often got stuck in netgames.
__________________
Ezer'Arch
ArchPack v2.1 level pack | EzerArch.com | YouTube | ERZ2 FTW!
Ezer.Arch is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fixed First player camera sees what the second player sees. Potential camera reset bug? Flame Bug Reports (2.0.X) 10 07-05-2011 05:22 AM
Fixed Player can turn off pushers in FOFs with pushable object if standing near the FOF Ezer.Arch Bug Reports (2.0.X) 10 03-07-2011 09:55 PM
I need help to my my WAD in 1 player Dan_The_Hedgehog Editing Help 7 10-21-2008 08:42 PM
Player 2 wad sonicmario99 Editing Help 5 03-26-2008 09:45 PM
mp3 player-ogg 1-Up General Discussion 8 12-16-2006 07:00 PM


All times are GMT. The time now is 07:53 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.