• 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.
here you go
Lua:
local marks = {
    [1] = {
            {Position(1000, 1000, 7), MAPMARK_EXCLAMATION, "Temple"},
    },
    [2] = {
            {Position(886, 987, 7), MAPMARK_EXCLAMATION, "Lava Golems"},
    },
    [3] = {
            {Position(994, 1085, 7), MAPMARK_EXCLAMATION, "Losts"},
    },
    [4] = {
            {Position(15386, 15197, 8), MAPMARK_EXCLAMATION, "DeathStrike"},
    },
    [5] = {
            {Position(5290, 5221, 8), MAPMARK_EXCLAMATION, "Mad Mage"},
    },
    [6] = {
            {Position(5417, 5462, 7), MAPMARK_EXCLAMATION, "Glooth Slasher"},
    },
    [7] = {
            {Position(5552, 5586, 8), MAPMARK_EXCLAMATION, "Hellflayer"},
    },
} 

 function onLogin(player)
         if player:getLastLoginSaved() <= 0 then
            for i = 1, #marks do
                   player:addMapMark(marks[i][1], marks[i][2], marks[i][3])  
            end
        end
    return true
 end
 
Last edited by a moderator:
here you go
Lua:
local marks = {
    [1] = {
            {Position(1000, 1000, 7), MAPMARK_EXCLAMATION, "Temple"},
    },
    [2] = {
            {Position(886, 987, 7), MAPMARK_EXCLAMATION, "Lava Golems"},
    },
    [3] = {
            {Position(994, 1085, 7), MAPMARK_EXCLAMATION, "Losts"},
    },
    [4] = {
            {Position(15386, 15197, 8), MAPMARK_EXCLAMATION, "DeathStrike"},
    },
    [5] = {
            {Position(5290, 5221, 8), MAPMARK_EXCLAMATION, "Mad Mage"},
    },
    [6] = {
            {Position(5417, 5462, 7), MAPMARK_EXCLAMATION, "Glooth Slasher"},
    },
    [7] = {
            {Position(5552, 5586, 8), MAPMARK_EXCLAMATION, "Hellflayer"},
    },
}
   
function onLogin(player)
         if player:getLastLoginSaved() <= 0 then
            for i = 1, #info.marks do
                   player:addMapMark(info.marks[i][1], info.marks[i][2], info.marks[i][3])
            end
        end
    return true
end
Where do I put this script?
In version 0.4 I used it in movement, but now in 1.2 I don't know how it works!
 
Where do I put this script?
In version 0.4 I used it in movement, but now in 1.2 I don't know how it works!
creaturescripts.xml
Lua:
<event type="login" name="mapmarks" script="mapmarks.lua" />
name this script mapmarks.lua and it will work for any player on his first login
 
here you go
Lua:
local marks = {
    [1] = {
            {Position(1000, 1000, 7), MAPMARK_EXCLAMATION, "Temple"},
    },
    [2] = {
            {Position(886, 987, 7), MAPMARK_EXCLAMATION, "Lava Golems"},
    },
    [3] = {
            {Position(994, 1085, 7), MAPMARK_EXCLAMATION, "Losts"},
    },
    [4] = {
            {Position(15386, 15197, 8), MAPMARK_EXCLAMATION, "DeathStrike"},
    },
    [5] = {
            {Position(5290, 5221, 8), MAPMARK_EXCLAMATION, "Mad Mage"},
    },
    [6] = {
            {Position(5417, 5462, 7), MAPMARK_EXCLAMATION, "Glooth Slasher"},
    },
    [7] = {
            {Position(5552, 5586, 8), MAPMARK_EXCLAMATION, "Hellflayer"},
    },
}
   
function onLogin(player)
         if player:getLastLoginSaved() <= 0 then
            for i = 1, #info.marks do
                   player:addMapMark(info.marks[i][1], info.marks[i][2], info.marks[i][3])
            end
        end
    return true
end
otland.png
 
Lua:
local mapMarks = {
	{pos = Position(1000, 1000, 7), type = MAPMARK_EXCLAMATION, text = "Temple"},
	{pos = Position(886, 987, 7), type = MAPMARK_EXCLAMATION, text = "Lava Golems"},
	{pos = Position(994, 1085, 7), type = MAPMARK_EXCLAMATION, text = "Losts"},
	{pos = Position(15386, 15197, 8), type = MAPMARK_EXCLAMATION, text = "DeathStrike"},
	{pos = Position(5290, 5221, 8), type = MAPMARK_EXCLAMATION, text = "Mad Mage"},
	{pos = Position(5417, 5462, 7), type = MAPMARK_EXCLAMATION, text = "Glooth Slasher"},
	{pos = Position(5552, 5586, 8), type = MAPMARK_EXCLAMATION, text = "Hellflayer"},
}

function onLogin(player)
	if player:getLastLoginSaved() <= 0 then
		for _, mark in pairs(mapMarks) do
			player:addMapMark(mark.pos, mark.type, mark.text) 
		end
	end

	return true
 end

Also keep in mind that the marks will only be added if a character has never logged in before.
 
creaturescripts.xml
XML:
<event type="login" name="mapmarks" script="mapmarks.lua" />
login.lua
Lua:
player:registerEvent("mapmarks")
mapmarks.lua
Lua:
local marks = {
    [1] = {
            {Position(1011, 1023, 7), MAPMARK_EXCLAMATION, "Temple"},
    }
}

 function onLogin(player)
         if player:getLastLoginSaved() <= 0 then
            for i = 1, #marks do
                   player:addMapMark(marks[i][1], marks[i][2], marks[i][3]) 
            end
        end
    return true
 end
 
There was no error in the distribution, but it did not "create" the mark
if it wasn't new character this script works only with new chars, if it was new then in data/creaturescripts/scripts/login.lua

add this line near the end
player:registerEvent("mapmarks")
 
Lua:
local mapMarks = {
    {pos = Position(1000, 1000, 7), type = MAPMARK_EXCLAMATION, text = "Temple"},
    {pos = Position(886, 987, 7), type = MAPMARK_EXCLAMATION, text = "Lava Golems"},
    {pos = Position(994, 1085, 7), type = MAPMARK_EXCLAMATION, text = "Losts"},
    {pos = Position(15386, 15197, 8), type = MAPMARK_EXCLAMATION, text = "DeathStrike"},
    {pos = Position(5290, 5221, 8), type = MAPMARK_EXCLAMATION, text = "Mad Mage"},
    {pos = Position(5417, 5462, 7), type = MAPMARK_EXCLAMATION, text = "Glooth Slasher"},
    {pos = Position(5552, 5586, 8), type = MAPMARK_EXCLAMATION, text = "Hellflayer"},
}

function onLogin(player)
    if player:getLastLoginSaved() <= 0 then
        for _, mark in pairs(mapMarks) do
            player:addMapMark(mark.pos, mark.type, mark.text)
        end
    end

    return true
end

Also keep in mind that the marks will only be added if a character has never logged in before.
debugged client, and no error appears in the distro
I'm using this source
HTTP:
https://otland.net/threads/tfs-1-2-8-0.263797/
Post automatically merged:

Change
for i = 1, #info.marks do
to
for i = 1, #marks do
No work
 
creaturescripts.xml
XML:
<event type="login" name="mapmarks" script="mapmarks.lua" />
login.lua
Lua:
player:registerEvent("mapmarks")
mapmarks.lua
Lua:
local marks = {
    [1] = {
            {Position(1011, 1023, 7), MAPMARK_EXCLAMATION, "Temple"},
    }
}

function onLogin(player)
         if player:getLastLoginSaved() <= 0 then
            for i = 1, #marks do
                   player:addMapMark(marks[i][1], marks[i][2], marks[i][3])
            end
        end
    return true
end
Remove line 6 and 10 if you want the map mark to always appear when someone logs in, otherwise only new characters will recieve the map marks
Lua:
local marks = {
    {Position(1011, 1023, 7), MAPMARK_EXCLAMATION, "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
 
Remove line 6 and 10 if you want the map mark to always appear when someone logs in, otherwise only new characters will recieve the map marks
Lua:
local marks = {
    {Position(1011, 1023, 7), MAPMARK_EXCLAMATION, "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
The client is debugging the first time of the login, and then he enters normally but the mark does not appear.

otland.png
 
The client is debugging the first time of the login, and then he enters normally but the mark does not appear.

View attachment 47297
I really don't know..

I'll test it on my tfs 1.3 I guess.

-- and it works..

Does your client have the 'exclamation mark' available to use on the minimap?
idk what else to say
 
Only other thing I can suggest to try is to use numbers instead of direct text?
idk why that would change anything though.

{Position(1011, 1023, 7), 3, "Temple"},
Not work, debug. I'm thinking that it's something related to the client and not the script. Or maybe in version 8.0 it would have different names for these marks.
 
Not work, debug. I'm thinking that it's something related to the client and not the script. Or maybe in version 8.0 it would have different names for these marks.
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.
 
Back
Top