Extrodus
|| Blazera.net ||
This event has been modified from: https://otland.net/threads/hot-last-man-standing-event.176894/
Using: TFS 0.4, rev.3884
Basically what I have done is created a globalevent that opens the event and starts it after 5 minutes if there is more than 1 player. Now technically it does work, but not in the order it supposed to.
What the issue is:
I am using players_on_arena_count to determine how many people are in the arena.
However the information is not saving before the first check from the addEvent.
The scenario the bug occurs, is if only 1 player enters the event and waits for the event to kick him out.
When the addEvent runs, it says there is nobody in the event and the players_on_arena_count is 0.
However when the event runs again, it has the +1 storage on the player count.
So when the addEvent runs for the second time, if finally kicks the player out that joined in the previous running.
If the event runs again, it still sees +1 and continues to try and teleport players out of the area - this leads to console errors because there are no players in the arena anymore.
-------------------------------------------------------------------------
1. Event opens and player enters teleport - "player has joined event, only 4 people needed!"
2. When addEvent to start event runs, it doesn't detect player_on_arena_count +1 and say no players in arena.
3. Globalevent runs for second time, when addEvent runs it sees +1 and kicks out the player finally.
4. When globalevent runs for third time, it still has +1 storage and continues trying to kick players out of area.
5. Step 4 repeats continuously from here on out and causes console errors with each check.
--------------------------------------------------------------------------
I have tried a few different things, and realized getLMSEventPlayers() does the same thing Im doing with the players table in createTeleport.lua - and even when I use that it only teleport the player out and sees the storage during the second check. Something isn't saving it during the first run, and I just can't see what I did wrong since it worked for all my other events.
Here are the scripts:
Note: Event is set to open every 15 seconds and close every 10 seconds for testing purposes.
[Globalevents.xml]
<globalevent name="LMSGlobalStartup" type="start" event="script" value="events/lms/onstartup.lua"/>
<globalevent name="StartLMS" interval="15000" event="script" value="events/lms/createTeleport.lua"/>
[Globalevents/events/lms/onstartup.lua]
http://pastebin.com/FAEmrAtF
[Globalevents/events/lms/createTeleport.lua]
http://pastebin.com/sAhVgrqn
[Lib/lastmanstanding.lua]
http://pastebin.com/Rxw3cFYf
[Movements.xml]
<movevent type="StepIn" actionid="5556" event="script" value="events/lms/onenter.lua"/>
[Movements/events/lms/onenter.lua]
http://pastebin.com/kt6Jryk5
[Creaturescripts.xml]
<event type="target" name="LMSTarget" event="script" value="events/lms/lms.lua"/>
<event type="statschange" name="LMSAttack" event="script" value="events/lms/lms.lua"/>
<event type="login" name="LMSLogout" event="script" value="events/lms/lms.lua"/>
[Creaturescripts/events/lms/lms.lua]
http://pastebin.com/4FNAvdj2
I was planning on releasing/updating the event on OTLand when I was done; so since Im stuck - might as well ask you guys for some help!
Much appreciated to anyone who knows what's going on, cheers!
Using: TFS 0.4, rev.3884
Basically what I have done is created a globalevent that opens the event and starts it after 5 minutes if there is more than 1 player. Now technically it does work, but not in the order it supposed to.
What the issue is:
I am using players_on_arena_count to determine how many people are in the arena.
However the information is not saving before the first check from the addEvent.
The scenario the bug occurs, is if only 1 player enters the event and waits for the event to kick him out.
When the addEvent runs, it says there is nobody in the event and the players_on_arena_count is 0.
However when the event runs again, it has the +1 storage on the player count.
So when the addEvent runs for the second time, if finally kicks the player out that joined in the previous running.
If the event runs again, it still sees +1 and continues to try and teleport players out of the area - this leads to console errors because there are no players in the arena anymore.
-------------------------------------------------------------------------
1. Event opens and player enters teleport - "player has joined event, only 4 people needed!"
2. When addEvent to start event runs, it doesn't detect player_on_arena_count +1 and say no players in arena.
3. Globalevent runs for second time, when addEvent runs it sees +1 and kicks out the player finally.
4. When globalevent runs for third time, it still has +1 storage and continues trying to kick players out of area.
5. Step 4 repeats continuously from here on out and causes console errors with each check.
--------------------------------------------------------------------------
I have tried a few different things, and realized getLMSEventPlayers() does the same thing Im doing with the players table in createTeleport.lua - and even when I use that it only teleport the player out and sees the storage during the second check. Something isn't saving it during the first run, and I just can't see what I did wrong since it worked for all my other events.
Here are the scripts:
Note: Event is set to open every 15 seconds and close every 10 seconds for testing purposes.
[Globalevents.xml]
<globalevent name="LMSGlobalStartup" type="start" event="script" value="events/lms/onstartup.lua"/>
<globalevent name="StartLMS" interval="15000" event="script" value="events/lms/createTeleport.lua"/>
[Globalevents/events/lms/onstartup.lua]
http://pastebin.com/FAEmrAtF
[Globalevents/events/lms/createTeleport.lua]
http://pastebin.com/sAhVgrqn
[Lib/lastmanstanding.lua]
http://pastebin.com/Rxw3cFYf
[Movements.xml]
<movevent type="StepIn" actionid="5556" event="script" value="events/lms/onenter.lua"/>
[Movements/events/lms/onenter.lua]
http://pastebin.com/kt6Jryk5
[Creaturescripts.xml]
<event type="target" name="LMSTarget" event="script" value="events/lms/lms.lua"/>
<event type="statschange" name="LMSAttack" event="script" value="events/lms/lms.lua"/>
<event type="login" name="LMSLogout" event="script" value="events/lms/lms.lua"/>
[Creaturescripts/events/lms/lms.lua]
http://pastebin.com/4FNAvdj2
I was planning on releasing/updating the event on OTLand when I was done; so since Im stuck - might as well ask you guys for some help!
Much appreciated to anyone who knows what's going on, cheers!
Last edited: