Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.

Author Topic:  waypoints  (Read 155 times)

0 Members and 1 Guest are viewing this topic.

Dolfo

« on: 01, October 2022, 15:14:14 »
I have build a small waypoint script. Currently it's using npc's for waypoints, because i am more familiar with npc lua scripting. It's a prototyp and more to test it. Also to see where we can get problems, when using it on a server.

waypoints.lua
Code: [Select]
-- waypoints_talk.lua using npc's
-- put in a npc in a map, give him a name, his name is the waypoint name
-- npc need a lua event, trigger this by talk and connect it to this script

-- TODO
-- need better sound than learning spell sound
-- do we need path or orig_path?

local pl = event.activator
local me = event.me
local waypoint_name = me.name

-- Mark this as our single action for this tick
-- So server didn't additionally action on our waypoint like "I don't now how to apply an obelisk."
event.returnvalue = 1

--if name==null or if name==nil what's better?
if waypoint_name==nil or waypoint_name=="" then
pl:Write("Error: Waypoint has no name!")
return
end

local waypoint_map = me.map
if waypoint_map==nil then
  -- this should normally not happen, do we need this check?
pl:Write("Error: Waypoint has no pointer to map! ")
return
end

local waypoint_x=me.x
local waypoint_y=me.y
-- we don't check for valid x,y here

local ds = DataStore("waypoints_global")
local waypoints = ds:Get("waypoints_global")

-- we have no waypoints?, we declare an empty waypoint array
if not waypoints then
waypoints = {}
end

-- we need to check, if current waypoint is stored in waypoints_global
local found=false
for what, data in waypoints do
if data.waypoint == waypoint_name then
-- we also check if waypoint is still at the same map at same x and y position
if data.x~=waypoint_x or data.y~=waypoint_y or data.map_path~=waypoint_map.path then
-- update the array
data.x=waypoint_x
data.y=waypoint_y
data.map_path=waypoint_map.path
-- update the DataStore
ds:Set("waypoints_global", waypoints)
end
found=true
break -- found waypoint in global list
end
end
-- if waypoint not found we insert it
if found==false then
-- waypoint is not in list, we need to write new waypoint to DataStore
local waypoint_to_insert = {waypoint = waypoint_name, x = waypoint_x, y = waypoint_y, map_path = waypoint_map.path}
table.insert(waypoints, waypoint_to_insert)
ds:Set("waypoints_global", waypoints)
end

--now check the player waypoint list, player waypoint list needs only to store the waypoint name
local ds_player = DataStore("waypoints_player", pl)
local waypoints_player = ds_player:Get("waypoints_player")

if not waypoints_player then
waypoints_player = {}
end

-- check if current waypoint is stored in waypoints_player
local found=false
for what, data in waypoints_player do
if data.waypoint == waypoint_name then
found=true
break -- found waypoint in player list
end
end

-- if waypoint not found we insert it
if found==false then
pl:Write("Found new waypoint " .. waypoint_name)
pl:Sound(0, 0, game.SOUND_LEARN_SPELL) -- TODO give player a better sound
-- waypoint is not in list, we need to write new waypoint to DataStore
local waypoint_to_insert = {waypoint = waypoint_name}
table.insert(waypoints_player, waypoint_to_insert)
ds_player:Set("waypoints_player", waypoints_player)
end


require("interface_builder")
local ib = InterfaceBuilder()

local function topic_default(waypoint_target) --(waypoint_target)
    ib:SetTitle("Waypoint")
    ib:SetMsg("\nThis is waypoint ".. waypoint_name ..".\n")
if waypoint_target~=nil then
  ib:SetMsg("\nYou used parameter  ".. waypoint_target ..".\n")
end
for what, data in waypoints_player do
ib:AddLink(data.waypoint, "waypoint ".. data.waypoint);
    end
end

-- somehow when calling this function there is an distance check to a selected npc.
-- if non npc is selected then it tries to select nearest npc.
local function topic_waypoint(waypoint_target)
-- we need to do all checks here again, because player can also use teleport command with wrong paramater by typing the command
  if waypoint_target~=nil then
-- search first if player have the waypoint
for whatx, datax in waypoints_player do
-- waypoint names can have uppercase letters, topicList parameters are somehow lowercase, when they come here
if string.lower(datax.waypoint) == waypoint_target then
  -- when player knows the waypoint
-- check if server knows it too and have data for it
for what, data in waypoints do
-- waypoint names can have uppercase letters, topicList parameters are somehow lowercase, when they come here
if string.lower(data.waypoint) == waypoint_target then
pl:Write("A strong force teleports you away.", 0)
pl:Sound(0, 0, game.SOUND_LEARN_SPELL)
-- OVERLAY_FIXED on waypoints we want to force the teleport on exactly this waypoint position, this looks best.
-- OVERLAY_RANDOM when fixed make trouble we can also try to teleport to the next free positions, but this looks more ugly to teleport near a free waypoint and not on it
pl:SetPosition(game:ReadyMap(data.map_path),data.x,data.y,game.OVERLAY_FIXED) -- OVERLAY_RANDOM -- OVERLAY_FIXED
ib:ShowSENTInce(0)
return
end -- if string ..
end -- for what ..
-- when we are here, player knows waypoint, but server not, this should not happen, but better launch an error here
pl:Write("Error : Global waypoint storage didn't know a waypoint " .. waypoint_target)
ib:ShowSENTInce(0)
  return
end -- if string..
end -- for what ..
pl:Write("You didn't know a waypoint " .. waypoint_target)
ib:ShowSENTInce(0)
return
end
-- if player comes here, he used the teleport command without a waypoint target
pl:Write("You wisper the teleport command without a target and nothing happens.")
ib:ShowSENTInce(0)
end

require("topic_list")

local tl = TopicList()
tl:SetDefault(topic_default)
tl:AddTopics( "waypoint (.*)", topic_waypoint)
ib:ShowSENTInce(game.GUI_NPC_MODE_NPC, tl:CheckMessage(event, true))

Next target should be, to try to build is without using npc's.
« Last Edit: 10, October 2022, 03:35:50 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #1 on: 02, October 2022, 22:27:21 »
I have tried to port this logic to a container and to an object. I also cleaned the above script. So it nearly works also with containers or objects when applying them.

But ...
... when teleport function is called there is a check somewhere what a player has selected. If player has selected and npc or mob to far away, calling the teleport function for container or objects fails. Only when player has selected himself or a nearby npc, calling the teleport function for container or objects work.
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #2 on: 03, October 2022, 15:33:01 »
Nasty. I made some more experiments. I now understand why npc's are selected. Using the npc interface and clicking the link "teleport toX" is same then typing the command "/talk teleport toX". And the talk logic search the nearest npc and targets it, if no npc is selected. That's reason you can talk to near npc's without select them before.

I also tried an obelisk as waypoint. Was inspired by the idea, that someday the obelisk before captured stronghold could be used as a waypoint. I think players would love it, to have a waypoint there at the entrance. So obelisk works so far fine, with the above npc auto target problem, but also shows another error.

Applying an obelisk with a connected script also triggers the message. "I don't know how to apply an obelisk." So this hardcoded message didn't check, if there is a lua event handling the apply logic.

I tried also some other pl:SetPosition flags for the teleport logic than game.OVERLAY_FIXED. Didn't find any new, except the two options i know, teleport straight in the position or teleport random around the target with a 3*3 target area around this.

I also have no access to the current working teleport scripts, which uses this nice teleporter sound. Would be nice if someone can give me the codeline for this teleporter sound.

I also connected the help screen to an obelisk, this works fine without targeting npc's. But help logic uses command links (/) to connect between the scripts. I dont think using command parameter for the waypoint logic would be nice.

Only problems. You solve one, you get three more.  :o
« Last Edit: 03, October 2022, 15:38:59 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #3 on: 04, October 2022, 17:19:12 »
Thanks for all your help.  :P

I changed it to global waypoints, so player only store the waypoint names they have found, and global datastore on server stores the name, x, y, and the mapname.

I also put in a sound and i have seen that only the forced teleport exactly over the waypoints looks good. Teleporting left or right of it looks ugly.

Found also the problem with the c code and the obelisk. Lua can send back a parameter and say to c code, "Don't do anything more here, i have handled it all here by script."

So the final problem is how to make this script running clean on non npc's. I think the only way is to define a command like /teleport or /waypoint and then build it in like the /help commands.  :o
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

_people_

« Reply #4 on: 05, October 2022, 17:40:51 »
Yep, sorry for all the help I've been giving - still pretty busy IRL. You've done a great job on your own, though. :)

Unfortunately as you've noticed there's no clean way to implement custom communication between the client and the server. I have a plan for this, but it's a ways down the pipeline. Basically, a single CS command which can contain any data used by different systems. In our case, the client would send "MultiCommand map stoneglow" - MultiCommand is just a placeholder for the CmdId which will be implemented, "map" tells the server that the player clicked somewhere on a map of their plane, and "stoneglow" is sent from Lua to the client when the map is sent, then client sends it back if player wants to go there.

I think rather than implementing it as a new /command (if you see the supporting code for /help, it's quite a lot) you may be better off using a magic ear on the map. Then the player simply says "stoneglow" and the script attached to the ear is activated.
-- _people_ :)

Dolfo

« Reply #5 on: 06, October 2022, 19:21:47 »
I have tried a magic ear with lua event inside. It needs a /say trigger and then it can be connected to script. But it has same problem with targeting npc's. Initial magic ear can launch the SENTInce interface, but when using links inside SENTInce it always checks for a selected npc and if no npc is selected it search the nearest and select it. Also it looks like the communication goes to npc script then? I try to look deeper in the link function of SENTInce. It would be so cool to find a way to use SENTInce also on objects, like amboss, cauldrons, shelves, waypoints, signs ...  8)
« Last Edit: 06, October 2022, 19:23:27 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

_people_

« Reply #6 on: 06, October 2022, 22:20:58 »
Sorry, I should have been more clear.

Unfortunately implementing this cleanly via SENTInce is impossible in its current state (and will be until 0.11.0). So my suggestion was to use SENTInce (or player:Write()) to show possible destinations, but ultimately the player would have to manually type in chat where they want to go.

I think for now, the best alternative would be to implement another event trigger similar to /help, but this script is implemented on a specific command like "/waypoint" (don't use /teleport - it's already in use).

Basically, you'll need to implement a server-side command (easy enough) which calls plugin_trigger_waypoint_event (you can copy and modify plugin_trigger_help_event for this). You can search the code for "plugin_script_help" (case insensitive) and it will give you most of what you need to accomplish this.

Obviously that's quite a lot of work, so it's up to you which option to choose if you want to implement this before 0.11.0 (the new client - whenever I finish it).
-- _people_ :)

Dolfo

« Reply #7 on: 07, October 2022, 15:19:54 »
I spend some more time reading client code, SENTInce interfacebuilder and topic.list and servercode.

I found the npc.auto target behavior in server talk_to_npc function (npc_communicate.c line 176)
I found the bypass for the /help system in command.c line 1262 in cs_cmd_talk function
Code: [Select]
        case GUI_NPC_MODE_NPC:
            if (strncmp(data, "/help", 5) == 0)
            {
                command_help(pl->ob, (data + 6));
                return;
            }
            talk_to_npc(pl, data);

            break;
So theoreticaly we can go in here and wrap every command sended from SENTInce to lua to a different function instead to the talk_to_npc function.

So must be possible we check for a /say and then each /say SENTInce is sending goes not to /talk "/say", instead it goes the /say command. This should connect at least SENTInce GUI_NPC_MODE_NPC mode with a magic ear, so we can use /say waypoint x for the teleport as a command and also as a link from SENTInce? ???
« Last Edit: 07, October 2022, 15:30:28 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #8 on: 09, October 2022, 10:22:50 »
Wow, that took me more than an hour to get access to the say "message". Someone likes to troll and uses different names in lua. Found the conservation in plugin_lua.c line 82
Code: [Select]
static struct attribute_decl    Event_attributes[]  =
{
    {"me", FIELDTYPE_OBJECTREF, offsetof(struct lua_context, self), FIELDFLAG_READONLY, offsetof(struct lua_context, self_tag)},
    {"activator", FIELDTYPE_OBJECTREF, offsetof(struct lua_context, activator), FIELDFLAG_READONLY, offsetof(struct lua_context, activator_tag)},
    {"other", FIELDTYPE_OBJECTREF, offsetof(struct lua_context, other), FIELDFLAG_READONLY, offsetof(struct lua_context, other_tag)},
    {"message", FIELDTYPE_SHSTR, offsetof(struct lua_context, text), FIELDFLAG_READONLY, 0},
    {"options", FIELDTYPE_SHSTR, offsetof(struct lua_context, options), FIELDFLAG_READONLY, 0},
    {"parameter1", FIELDTYPE_SINT32, offsetof(struct lua_context, parm1), 0, 0},
    {"parameter2", FIELDTYPE_SINT32, offsetof(struct lua_context, parm2), 0, 0},
    {"parameter3", FIELDTYPE_SINT32, offsetof(struct lua_context, parm3), 0, 0},
    {"parameter4", FIELDTYPE_SINT32, offsetof(struct lua_context, parm4), 0, 0},
    {"returnvalue", FIELDTYPE_SINT32, offsetof(struct lua_context, returnvalue), 0, 0},
    {NULL, 0, 0, 0, 0}
};
So here are all the conversations and event.text goes to event.message.  :o
« Last Edit: 09, October 2022, 10:24:29 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #9 on: 10, October 2022, 03:47:54 »
I checked all the above parameters, if i could use it to recognize what event was launched. But didn't find a parameter to differentiate between tell, say and apply event.

So i split the waypoint.lua in waypoint_talk.lua and waypoint_say.lua.

If someone wants to build his waypoints with npc's he can use waypoint_talk.lua. I updated this above in first post.

waypoint_say.lua works with a magic ear.

using "/say waypoint X" or "waypoint X" tries to teleport the player to this waypoint if possible.
every other say will launch the "npc" gui. It is also possible to put in an obelisk and connect the waypoint_say.lua with an apply event. But using objects or containers you also need a magic ear on same spot for the command.

Next would be to check if
Code: [Select]
        case GUI_NPC_MODE_NPC:
            if (strncmp(data, "/help", 5) == 0)
            {
                command_help(pl->ob, (data + 6));
                return;
            }
    if (strncmp(data, "/say", 4) == 0)
            {
command_say(pl->ob, (data + 5)) // do we need () around data+5 ?
                return;
            }

            talk_to_npc(pl, data);

            break;

this works and make the connection between the "npc.gui" and the "/say waypoint x" command

and here is the waypoint_say.lua. im am to tired and to lazzy to upload it somewhere else, so i post here.

Code: [Select]
-- waypoints_say.lua using magic ear
-- you can use it with magic ear alone, or also with other object and a magic ear
-- put in a magic ear in a map, give it a name, it's name is the waypoint name
-- additional put in an object, you need same name here as from magic ear
-- ear need a lua event, trigger this by say and connect it to this script
-- object need a lua event, trigger this by apply and connect it to this script
-- both events can target only one initialize SENTInce, all links in SENTInce non /help non /say leads to a tell command
-- and then server is searching nearest npc and send command to this npc lua event

local pl = event.activator
local me = event.me
local waypoint_name = me.name

-- apply event has no message, so check first if we have a message
if event.message ~= nil and event.message ~= "" then
  -- then we can check if say event starts with waypoint, we don't want our magic ear to react on other say message
-- think of two player's speaking local to each other and each time SENTInce popup here.
if string.sub(event.message, 1, 8) ~= "waypoint" then
return
end
end

-- Mark this as our single action for this tick
-- So server didn't additionally action on our waypoint like "I don't now how to apply an obelisk."
event.returnvalue = 1

--if name==null or if name==nil what's better?
if waypoint_name==nil or waypoint_name=="" then
pl:Write("Error: Waypoint has no name!")
return
end

local waypoint_map = me.map
if waypoint_map==nil then
  -- this should normally not happen, do we need this check?
pl:Write("Error: Waypoint has no pointer to map! ")
return
end

-- path is real path -- orig_path is file path
-- we need to check if a waypoint is on a instanced map_path /dynamic generated map
-- if yes we can't store this waypoint
-- TODO perhaps we can allow a one direction only waypoint on such maps
-- but first lets launch an error here

-- TODO do we also need a savety check here for path==nil or path==""

if waypoint_map.path~=waypoint_map.orig_path then
pl:Write("Error: Waypoint could be in a player instanced map!")
return
end

local waypoint_x=me.x
local waypoint_y=me.y
-- we don't check for valid x,y here

local ds = DataStore("waypoints_global")
local waypoints = ds:Get("waypoints_global")

-- we have no waypoints?, we declare an empty waypoint array
if not waypoints then
waypoints = {}
end

-- we need to check, if current waypoint is stored in waypoints_global
local found=false
for what, data in waypoints do
if data.waypoint == waypoint_name then
-- we also check if waypoint is still at the same map at same x and y position
if data.x~=waypoint_x or data.y~=waypoint_y or data.map_path~=waypoint_map.path then
-- update the array
data.x=waypoint_x
data.y=waypoint_y
data.map_path=waypoint_map.path
-- update the DataStore
ds:Set("waypoints_global", waypoints)
end
found=true
break -- found waypoint in global list
end
end
-- if waypoint not found we insert it
if found==false then
-- waypoint is not in list, we need to write new waypoint to DataStore
local waypoint_to_insert = {waypoint = waypoint_name, x = waypoint_x, y = waypoint_y, map_path = waypoint_map.path}
table.insert(waypoints, waypoint_to_insert)
ds:Set("waypoints_global", waypoints)
end

--now check the player waypoint list, player waypoint list needs only to store the waypoint name
local ds_player = DataStore("waypoints_player", pl)
local waypoints_player = ds_player:Get("waypoints_player")

if not waypoints_player then
waypoints_player = {}
end

-- check if current waypoint is stored in waypoints_player
local found=false
for what, data in waypoints_player do
if data.waypoint == waypoint_name then
found=true
break -- found waypoint in player list
end
end

-- if waypoint not found we insert it
if found==false then
pl:Write("Found new waypoint " .. waypoint_name)
pl:Sound(0, 0, game.SOUND_LEARN_SPELL) -- TODO give player a better sound
-- waypoint is not in list, we need to write new waypoint to DataStore
local waypoint_to_insert = {waypoint = waypoint_name}
table.insert(waypoints_player, waypoint_to_insert)
ds_player:Set("waypoints_player", waypoints_player)
end

require("interface_builder")
local ib = InterfaceBuilder()

local function teleport_to_waypoint(waypoint_target)
-- if this function is called we need to make save that a probably old SENTInce dialog would be closed
ib:ShowSENTInce(0)
-- we need to do all checks here again, because player can also use teleport command with wrong paramater by typing the command
  if waypoint_target~=nil then
-- search first if player have the waypoint
for whatx, datax in waypoints_player do
-- to be compatible with waypoint_talk and also to allow players type lowercase commands
if string.lower(datax.waypoint) == string.lower(waypoint_target) then
  -- when player knows the waypoint
-- check if server knows it too and have data for it
for what, data in waypoints do
-- waypoint names can have uppercase letters, topicList parameters are somehow lowercase, when they come here
if string.lower(data.waypoint) == string.lower(waypoint_target) then
pl:Write("A strong force teleports you away.", 0)
pl:Sound(0, 0, game.SOUND_TELEPORT)
-- OVERLAY_FIXED on waypoints we want to force the teleport on exactly this waypoint position, this looks best.
-- OVERLAY_RANDOM when fixed make trouble we can also try to teleport to the next free positions, but this looks more ugly to teleport near a free waypoint and not on it
pl:SetPosition(game:ReadyMap(data.map_path),data.x,data.y,game.OVERLAY_FIXED) -- OVERLAY_RANDOM -- OVERLAY_FIXED
return
end -- if string ..
end -- for what ..
-- when we are here, player knows waypoint, but server not, this should not happen, but better launch an error here
pl:Write("Error : Global waypoint storage didn't know a waypoint " .. waypoint_target)
  return
end -- if string..
end -- for what ..
pl:Write("You didn't know a waypoint " .. waypoint_target)
return
end
-- if player comes here, he used the waypoint command without a waypoint target
-- this can't be happen here, because we a logic above launching SENTInce default topic on empty waypont commands
pl:Write("You wisper the teleport command without a target and nothing happens.")
end

local message = event.message
if message ~= nil then
if string.sub(event.message, 1, 9) == "waypoint " then
  teleport_to_waypoint(string.sub(message,10))
  return
end
end

local function topic_default(waypoint_target) --(waypoint_target)
    ib:SetTitle("Waypoint")
    ib:SetMsg("\nThis is waypoint ".. waypoint_name ..".\n")
if waypoint_target~=nil then
  ib:SetMsg("\nYou used parameter  ".. waypoint_target ..".\n")
end
for what, data in waypoints_player do
ib:AddLink(data.waypoint, "/say waypoint ".. data.waypoint);
    end
end

require("topic_list")

local tl = TopicList()
tl:SetDefault(topic_default)
ib:ShowSENTInce(game.GUI_NPC_MODE_NPC, tl:CheckMessage(event, true))
« Last Edit: 14, October 2022, 16:02:19 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #10 on: 13, October 2022, 14:20:26 »
I compiled the "talk say" hack and it works fine. I tested also waypoints on different maps. Need only to find out, where to put ib:ShowSENTInce(0) to close SENTInce after clicking a link and the hi button should also be removed there. For my test i used obelisk with apply event plus the extra magic ear same spot.

So both works. Opening the SENtInce dialog with apply obelisk or say something different from "waypoint x" command or use the direct teleport with say "waypoint x".

I think it would be better that magic ear only reacts on "waypoint(s)" or "waypoint x". I fix this.

Can't say if the way i teleport is best. Would be cool if someone can check the current working teleport logics on priest scripts, if my solution is clean here.

Finally its time to think for the places where waypoints would be nice to have.
I want one at Stonehaven Crossing and one at Captured Stronghold Entrance.   :P
Also each city could have a waypoint.  8)
« Last Edit: 13, October 2022, 14:25:12 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

Dolfo

« Reply #11 on: 14, October 2022, 15:51:08 »
Ok it looks better and better. Script uses learning sound when player found a new waypoint. It uses teleport sound when player is teleporting. SENTence is now closing when player teleports. Magic ear is now filtering.

saying

waypoint or waypoints opens SENTence default window on client with all the waypoint links
waypoint x tries to teleport to x when possible without opening SENTence
all other say commands stop the script.

Now i also know the differents between path and orig_path. This is important, if we have a temporary instance of a map, we can't allow to store a waypoint there. So script checks this and launch an error. Later it could be possible to allow a one way teleport from such a waypoint.

So mostly the script is clean against players. But this script is a learning logic. It should also help mappers and server admins to have less work with waypoints. So it must also check bad behavior from mappers.

For now
- mapper can put in a new waypoint. Script will learn the new waypoint.
- mapper can change x, y position of a waypoint or put waypoint in a different map. Script will learn the new position of the waypoint.
- mapper can put in waypoints in instanciated maps, like PR. Script will ignore this for now.

Script is missing a logic against deleting a waypoint. Deleting old no more used waypoints can only be done by server admins by deleting the waypoint from global data store.

So script is missing a delete waypoint logic in players datastore. We don't want server admins must to delete waypoints for x players in their datastores. I try to implement some logic here, to do this by script.  :o

I have updated only the posting with the waypoint_say.lua script.  :P
« Last Edit: 14, October 2022, 16:01:49 by Dolfo »
Don't believe the shit, you hear in mainstream. Believe your own body. Your body is speaking always the true to you. But you need to understand your body. Hear to your body, not to your ego. And when body is calling to you: "Hey something is wrong!" find the reason(s) for that. School medicine don't go for that, they don't want to heal you. They want earn money and sell you medicine, you should take rest of you life. School medicine is corrupted by bad humans, like politician, like media.

Tags:
 

Related Topics

  Subject / Started by Replies Last post
2 Replies
824 Views
Last post 15, July 2009, 17:21:13
by Lippy