• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.2 Wave event works super weird

Tbol

Well-Known Member
Joined
Apr 7, 2019
Messages
526
Reaction score
54
This is the lib part that acting weird

and this is overall system


1. What i noticed its super weird for some reason if u stepin on a tile it doesnt teleport you to event instantly it teleports you only after some delay to a
local MW_PLAYER_TELEPORT_TO = { -- Teleport players to this area for event --
min = Position(91, 209, 7), -- Top left square of area --
max = Position(98, 213, 7) -- bottom right square of area --
}

2. Another think i noticed local MW_minPlayersToStart = 5 doesnt work at all
 
I dont see anything that would cause that in the moveevent code. Try this one instead.
Lua:
local aidEnter = 1510 -- ActionID of teleport/tile to enter the event waiting area
local aidLeave = 1511 -- ActionId of teleport/tile to leave the event waiting area

function onStepIn(creature, item, position, fromPosition)
    local player = Player(creature)
    if not player then creature:teleportTo(fromPosition) return true end

    if item.actionid == aidEnter then
        if MW_STATUS ~= 1 then
            player:teleportTo(fromPosition)
            player:sendCancelMessage("Monster wave event is not open.")
            return true
        end
  
        if player:getLevel() < MW_minLevel then
            player:teleportTo(fromPosition)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You must be level "..MW_minLevel.." to enter this event.")
            return true
        end
      
        player:teleportTo(MW_positionEnter)
        MW_PLAYERS[#MW_PLAYERS + 1] = player:getName()
    elseif item.actionid == aidLeave then
        for i = 1, #MW_PLAYERS do
            if MW_PLAYERS[i] == player:getName() then
                MW_PLAYERS[i] = nil
            end
        end
  
        player:teleportTo(MW_positionLeave)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You will no longer paticipate in the event.")
    end
    return true
end

Players should be teleported to a waiting area here:
Lua:
MW_positionEnter = Position(110, 172, 7) -- Wait area for event to start position --
MW_positionLeave = Position(108, 172, 7) -- Exit waiting area position --

Lua:
local MW_minPlayersToStart = 5

Is how many players are required to enter the event before it will start. It is used here in the lib
Lua:
if #MW_PLAYERS < MW_minPlayersToStart then
 
I dont see anything that would cause that in the moveevent code. Try this one instead.
Lua:
local aidEnter = 1510 -- ActionID of teleport/tile to enter the event waiting area
local aidLeave = 1511 -- ActionId of teleport/tile to leave the event waiting area

function onStepIn(creature, item, position, fromPosition)
    local player = Player(creature)
    if not player then creature:teleportTo(fromPosition) return true end

    if item.actionid == aidEnter then
        if MW_STATUS ~= 1 then
            player:teleportTo(fromPosition)
            player:sendCancelMessage("Monster wave event is not open.")
            return true
        end
 
        if player:getLevel() < MW_minLevel then
            player:teleportTo(fromPosition)
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You must be level "..MW_minLevel.." to enter this event.")
            return true
        end
     
        player:teleportTo(MW_positionEnter)
        MW_PLAYERS[#MW_PLAYERS + 1] = player:getName()
    elseif item.actionid == aidLeave then
        for i = 1, #MW_PLAYERS do
            if MW_PLAYERS[i] == player:getName() then
                MW_PLAYERS[i] = nil
            end
        end
 
        player:teleportTo(MW_positionLeave)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_RED, "You will no longer paticipate in the event.")
    end
    return true
end

Players should be teleported to a waiting area here:
Lua:
MW_positionEnter = Position(110, 172, 7) -- Wait area for event to start position --
MW_positionLeave = Position(108, 172, 7) -- Exit waiting area position --

Lua:
local MW_minPlayersToStart = 5

Is how many players are required to enter the event before it will start. It is used here in the lib
Lua:
if #MW_PLAYERS < MW_minPlayersToStart then
Question tho, what if u enter MW_positionEnter = Position(559, 788, 7) which is waiting area and there is not enough players for the event to start, which means it will reset event in X time right? But what i noticed it makes u stuck in the waiting area it doesnt teleport you out. Shouldnt it take the top left corner and bottom right corner and teleport everyone out of the waiting area? You would say there is feature MW_positionLeave = Position(84, 158, 4) but what if im not using waiting area and im teleporting them instantly to a event area, so using exit portal would make u leave event by accident
 
You should create another portal with the same AID inside the waiting room. It will automatically handle removing them from the event and teleport them to MW_positionLeave
 
You should create another portal with the same AID inside the waiting room. It will automatically handle removing them from the event and teleport them to MW_positionLeave
You sure MW_positionLeave will teleport someone out? Because it doesnt for me :D
 
Make sure you set the teleports action ids in map
Lua:
local aidEnter = 1510 -- ActionID of teleport/tile to enter the event waiting area
local aidLeave = 1511 -- ActionId of teleport/tile to leave the event waiting area

thats in data/movements/scripts/what_you_named_file.lua
 
Back
Top