• 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.X+ Script Map Marks

Forkz

Well-Known Member
Joined
Jun 29, 2020
Messages
380
Solutions
1
Reaction score
89
Hello,
I'm looking for a "Map Marks" script, mark the icons on the map when a character enters the server.
 
Solution
Yeah as @Alpha already mentioned, that packet 221 converted to hexadecimal is 0xDD which is being sent here:
and the lua function:

I tried to see if there was another 8.0 engine that sent a different packet but I didn't find any. But if you use Otclient then you can add it yourself.
Yeah, must be the client.
The source / script is identical from yours to mine.

I tested with OTC and TFS 1.3.
I don't know how much of a difference OTC to the regular client makes though.
I using TFS 1.2, but I think there is no difference
Are you using just those two?

creaturescripts.xml
XML:
    <event type="login" name="mapmarks" script="mapmarks.lua" />
data/creaturescripts/scripts.mapmarks.lua
Lua:
local marks = {
    {Position(1011, 1023, 7), 3, "Temple"},
}

function onLogin(player)
        if player:getLastLoginSaved() <= 0 then -- remove if want always
            for i = 1, #marks do
                player:addMapMark(marks[i][1], marks[i][2], marks[i][3])
            end
        end -- remove if want always
    return true
end
 
I tested and it should work without any issues but anyways try this one, I had it on my server (Don't remember where I got it) works perfect for me on cipsoft 8.6 client.
Lua:
--[[--
MAPMARK_TICK = 0,
    MAPMARK_QUESTION = 1,
    MAPMARK_EXCLAMATION = 2,
    MAPMARK_STAR = 3,
    MAPMARK_CROSS = 4,
    MAPMARK_TEMPLE = 5,
    MAPMARK_KISS = 6,
    MAPMARK_SHOVEL = 7,
    MAPMARK_SWORD = 8,
    MAPMARK_FLAG = 9,
    MAPMARK_LOCK = 10,
    MAPMARK_BAG = 11,
    MAPMARK_SKULL = 12,
    MAPMARK_DOLLAR = 13,
    MAPMARK_REDNORTH = 14,
    MAPMARK_REDSOUTH = 15,
    MAPMARK_REDEAST = 16,
    MAPMARK_REDWEST = 17,
    MAPMARK_GREENNORTH = 18,
    MAPMARK_GREENSOUTH = 19,
--]]


function onLogin(player)  
    --Add Marks  
    --if player:getLastLoginSaved() <= 0 then
    marks = {
            [0] = {pos = {x = 31997, y = 32276, z = 7}, type = MAPMARK_STAR, description = "Marco Polo"},
            [1] = {pos = {x = 32480, y = 32314, z = 7}, type = MAPMARK_STAR, description = "Tibian Cortes"}
           
           
            }

        for i = 0, #marks do
            player:addMapMark(marks[i].pos, marks[i].type, marks[i].description)
        end
    --end

    return true
end
XML:
<event type="login" name="MapMarks" script="MapMarks.lua" />
 
Last edited:
I tested and it should work without any issues but anyways try this one, I had it on my server (Don't remember where I got it) works perfect for me on cipsoft 8.6 client.
Lua:
--[[--
MAPMARK_TICK = 0,
    MAPMARK_QUESTION = 1,
    MAPMARK_EXCLAMATION = 2,
    MAPMARK_STAR = 3,
    MAPMARK_CROSS = 4,
    MAPMARK_TEMPLE = 5,
    MAPMARK_KISS = 6,
    MAPMARK_SHOVEL = 7,
    MAPMARK_SWORD = 8,
    MAPMARK_FLAG = 9,
    MAPMARK_LOCK = 10,
    MAPMARK_BAG = 11,
    MAPMARK_SKULL = 12,
    MAPMARK_DOLLAR = 13,
    MAPMARK_REDNORTH = 14,
    MAPMARK_REDSOUTH = 15,
    MAPMARK_REDEAST = 16,
    MAPMARK_REDWEST = 17,
    MAPMARK_GREENNORTH = 18,
    MAPMARK_GREENSOUTH = 19,
--]]


function onLogin(player)  
    --Add Marks  
    --if player:getLastLoginSaved() <= 0 then
       
    if player:getLevel() > 1 then
        return true
    end
   
    marks = {
            [0] = {pos = {x = 31997, y = 32276, z = 7}, type = MAPMARK_STAR, description = "Marco Polo"},
            [1] = {pos = {x = 32480, y = 32314, z = 7}, type = MAPMARK_STAR, description = "Tibian Cortes"}
           
           
            }

        for i = 0, #marks do
            player:addMapMark(marks[i].pos, marks[i].type, marks[i].description)
        end
    --end

    return true
end
XML:
<event type="login" name="MapMarks" script="MapMarks.lua" />
login.lua?
Post automatically merged:

I tested and it should work without any issues but anyways try this one, I had it on my server (Don't remember where I got it) works perfect for me on cipsoft 8.6 client.
Lua:
--[[--
MAPMARK_TICK = 0,
    MAPMARK_QUESTION = 1,
    MAPMARK_EXCLAMATION = 2,
    MAPMARK_STAR = 3,
    MAPMARK_CROSS = 4,
    MAPMARK_TEMPLE = 5,
    MAPMARK_KISS = 6,
    MAPMARK_SHOVEL = 7,
    MAPMARK_SWORD = 8,
    MAPMARK_FLAG = 9,
    MAPMARK_LOCK = 10,
    MAPMARK_BAG = 11,
    MAPMARK_SKULL = 12,
    MAPMARK_DOLLAR = 13,
    MAPMARK_REDNORTH = 14,
    MAPMARK_REDSOUTH = 15,
    MAPMARK_REDEAST = 16,
    MAPMARK_REDWEST = 17,
    MAPMARK_GREENNORTH = 18,
    MAPMARK_GREENSOUTH = 19,
--]]


function onLogin(player)  
    --Add Marks  
    --if player:getLastLoginSaved() <= 0 then
       
    if player:getLevel() > 1 then
        return true
    end
   
    marks = {
            [0] = {pos = {x = 31997, y = 32276, z = 7}, type = MAPMARK_STAR, description = "Marco Polo"},
            [1] = {pos = {x = 32480, y = 32314, z = 7}, type = MAPMARK_STAR, description = "Tibian Cortes"}
           
           
            }

        for i = 0, #marks do
            player:addMapMark(marks[i].pos, marks[i].type, marks[i].description)
        end
    --end

    return true
end
XML:
<event type="login" name="MapMarks" script="MapMarks.lua" />
This script did not debug, but did not add anything to the map and there was also no error in the distro.
 
Removed the level lock, copy it and try again.
Maybe it won't debug, If it debugged try changing the mark type.
 
The client is debugging the first time of the login, and then he enters normally but the mark does not appear.

View attachment 47297
Look at the last line of the debug message, it says unknown packet type, which would lead me to believe that the 8.0 client actually doesn't support this packet yet, and that support for sending map marks to the client was added in a later version than 8.0.
 
Yeah as @Alpha already mentioned, that packet 221 converted to hexadecimal is 0xDD which is being sent here:
and the lua function:

I tried to see if there was another 8.0 engine that sent a different packet but I didn't find any. But if you use Otclient then you can add it yourself.
 
Solution
Yeah as @Alpha already mentioned, that packet 221 converted to hexadecimal is 0xDD which is being sent here:
and the lua function:

I tried to see if there was another 8.0 engine that sent a different packet but I didn't find any. But if you use Otclient then you can add it yourself.
So the problem is not with the client and not with the server?
I thank you all for trying to help me! This community is great!
 
Back
Top