• 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!

Flying mount system TFS 1.2

Did you modify the Game.createItem function/sources?
By default you can't create an item (the walkable id 460) if theres no floor already
 
Did you modify the Game.createItem function/sources?
By default you can't create an item (the walkable id 460) if theres no floor already
All you have to do is creating a new tile so you can place items on it later (including grounds).
Code:
// Game.createTile(x, y, z[, isDynamic = false])
// Game.createTile(position[, isDynamic = false])

in 0.4 it was possible too, by a little glitch (which probably still works because @MatheusMkalo used it in this system)
Code:
doAreaCombatHealth(0, 0, self, 0, 0, 0, CONST_ME_NONE)
 
All you have to do is creating a new tile so you can place items on it later (including grounds).
Code:
// Game.createTile(x, y, z[, isDynamic = false])
// Game.createTile(position[, isDynamic = false])

in 0.4 it was possible too, by a little glitch (which probably still works because @MatheusMkalo used it in this system)
Code:
doAreaCombatHealth(0, 0, self, 0, 0, 0, CONST_ME_NONE)
There's no createTile in OTHire, but the doAreaCombatHealth seems to be bugged too and it works.

When i first looked at the code i thought doAreaCombatHealth was supposed to get the player in battle so he couldn't logout lol
 
RIP PvP, Otherwise a cool system.

4r99HEz.png
 
Here you go:
Code:
function Game.createTile(pos)
    doAreaCombatHealth(0,0,pos,0,0,0,255)
    return true
end
lol
RIP PvP, Otherwise a cool system.

4r99HEz.png
This actually adds another layer of difficulty to pvp and makes it kinda interesting, i made this so instead of outfits you use a broom with duration, dragons can fly and you can make raids in the air, etc

EDIT: exani hur needs to be fixed tho, since flying in a tile close to an edge removes the posibility of levitating there
 
There is bug, when we are flying we can change our mount to any :)
 
Last edited:
English (bad) If the player assembles and up a ladder, it is fixed (before using talk! Up) and gives the following error in the console
portuguese: Se o personagem montar e subir uma escada ele fica imovel (antes de usar a talk !up) e da o seguinte erro no console

erroo.png


how fix?
 
Bump, can someone help edit to it create 3x3 tile around instead 1 tile each step?
 
Hello,

Applying patch Flying patch.

Im trying to find:
Code:
--- a/a/creatureevent.cpp
in creatureevent.cpp, but it is not there...

patch.PNG

and i dont know where to set it:
Code:
+++ b/b/creatureevent.cpp

How to do that ? :D

Im using this server.
 
Last edited:
in 1.3 you are unable to move, you can go up and down but not walk around, no errors.
 
in 1.3 you are unable to move, you can go up and down but not walk around, no errors.
okay turns out its just my local connection xd

However does anyone know how to make the tiles create be 3x3 instead of 1, so players can move diagonally and player can just walk off roofs(if they can't do that by default)
 
You can use that piece of code:
Lua:
local creatreFlyFloorHelperData = {
    {x =  0, y =  0},
    {x = -1, y = -1},
    {x = -1, y =  0},
    {x = -1, y =  1},
    {x =  0, y =  1},
    {x =  1, y =  1},
    {x =  1, y =  0},
    {x =  1, y = -1},
    {x =  0, y = -1},
}

function createFlyFloor(pos)
    for i,deltaPos in ipairs(creatreFlyFloorHelperData) do
        local currPos = {x = pos.x + deltaPos.x, y = pos.y + deltaPos.y, z = pos.z}
        local toTile = Tile(currPos)
        if (not toTile) or (not toTile:getItems()) or (not toTile:getGround()) then
            doAreaCombatHealth(0, 0, currPos, 0, 0, 0, 0)
            Game.createItem(ID_FLYING_GROUND, 1, currPos)
        end
    end
end

function removeFlyFloor(pos)
    for i,deltaPos in ipairs(creatreFlyFloorHelperData) do
        local currPos = {x = pos.x + deltaPos.x, y = pos.y + deltaPos.y, z = pos.z}
        local fromTile = Tile(currPos)
        local fromFlyItem = fromTile:getItemById(ID_FLYING_GROUND)
        if fromFlyItem then
            fromFlyItem:remove()
        end
    end
end
 
You can use that piece of code:
Lua:
local creatreFlyFloorHelperData = {
    {x =  0, y =  0},
    {x = -1, y = -1},
    {x = -1, y =  0},
    {x = -1, y =  1},
    {x =  0, y =  1},
    {x =  1, y =  1},
    {x =  1, y =  0},
    {x =  1, y = -1},
    {x =  0, y = -1},
}

function createFlyFloor(pos)
    for i,deltaPos in ipairs(creatreFlyFloorHelperData) do
        local currPos = {x = pos.x + deltaPos.x, y = pos.y + deltaPos.y, z = pos.z}
        local toTile = Tile(currPos)
        if (not toTile) or (not toTile:getItems()) or (not toTile:getGround()) then
            doAreaCombatHealth(0, 0, currPos, 0, 0, 0, 0)
            Game.createItem(ID_FLYING_GROUND, 1, currPos)
        end
    end
end

function removeFlyFloor(pos)
    for i,deltaPos in ipairs(creatreFlyFloorHelperData) do
        local currPos = {x = pos.x + deltaPos.x, y = pos.y + deltaPos.y, z = pos.z}
        local fromTile = Tile(currPos)
        local fromFlyItem = fromTile:getItemById(ID_FLYING_GROUND)
        if fromFlyItem then
            fromFlyItem:remove()
        end
    end
end
now i can't walk
TFS 1.3
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/flyevent.lua:onMove
data/creaturescripts/scripts/flyevent.lua:13: attempt to call method 'createFlyFloor' (a nil value)
stack traceback:
        [C]: in function 'createFlyFloor'
        data/creaturescripts/scripts/flyevent.lua:13: in function <data/creaturescripts/scripts/flyevent.lua:2>
 
now i can't walk
TFS 1.3
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/flyevent.lua:onMove
data/creaturescripts/scripts/flyevent.lua:13: attempt to call method 'createFlyFloor' (a nil value)
stack traceback:
        [C]: in function 'createFlyFloor'
        data/creaturescripts/scripts/flyevent.lua:13: in function <data/creaturescripts/scripts/flyevent.lua:2>
server says: attempt to call method 'createFlyFloor' (a nil value)
I can not help you without yours script - looks, that your script can not see createFlyFloor function
 
server says: attempt to call method 'createFlyFloor' (a nil value)
I can not help you without yours script - looks, that your script can not see createFlyFloor function

Did you add the lib file?
A tip in the future is to check the function name (in this case createFlyFloor), it's located in the lib files so (nil = not found) means your server didn't load that file / function.
 
Back
Top