Custom @zone ports
Custom @zone ports
I am trying to find any information on how to create custom @zone Id command. where to find the file with the @pos you are ported to when using @zone id# and how to create a custom @command to make new zone ports. Any information would be greatly appreciated.
Re: Custom @zone ports
player:setPos(0, 0, 0, 0, zoneId);
in https://github.com/DarkstarProject/dark ... s/zone.lua
in https://github.com/DarkstarProject/dark ... s/zone.lua
Re: Custom @zone ports
Delaide wrote:player:setPos(0, 0, 0, 0, zoneId);
in https://github.com/DarkstarProject/dark ... s/zone.lua
Im looking specificly way to port to a @where position. When I use @zone for Chocobo Circuit, it places me inside a will with no ground in middle of the race track. Also would like to make for custom ports for experience camps ect. Thank you for your reply BTW. If this is telling me how to do it, I apologize, i am not good with programming, am I am however trying to learn and understand how these files work.
Re: Custom @zone ports
That would be the function he just showed you, just replace the zeros. They are: x, y, z, rotation, zoneId. The GM command to use them is @posdoc730 wrote:Delaide wrote:player:setPos(0, 0, 0, 0, zoneId);
in https://github.com/DarkstarProject/dark ... s/zone.lua
Im looking specificly way to port to a @where position.
@pos 51 -113 15 64 49
Would place me at x51 y-113 z15 rot64 in zone 49.
Ouside of the Gm command, you'd use object:setpos() inside your script as Delaide showed you replacing the values with what you need.
Hi, I run The Demiurge server.

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
Re: Custom @zone ports
teotwawki wrote:That would be the function he just showed you, just replace the zeros. They are: x, y, z, rotation, zoneId. The GM command to use them is @posdoc730 wrote:Delaide wrote:player:setPos(0, 0, 0, 0, zoneId);
in https://github.com/DarkstarProject/dark ... s/zone.lua
Im looking specificly way to port to a @where position.
@pos 51 -113 15 64 49
Would place me at x51 y-113 z15 rot64 in zone 49.
Ouside of the Gm command, you'd use object:setpos() inside your script as Delaide showed you replacing the values with what you need.
Ok, after I added my x, y, z, rotation, zoneId and I attempt to use the command it tells me "YOu must enter a zone id." Please tell me what I am doing wrong.
This is what I have:
---------------------------------------------------------------------------------------------------
-- func: onTrigger
-- desc: Called when this command is invoked.
---------------------------------------------------------------------------------------------------
function onTrigger(player, zoneId)
local word = "";
local i = 0;
local zone = 70;
-- Ensure a zone was given..
if (zoneId == nil) then
player:PrintToPlayer("You must enter a zone id.");
return;
end
-- Was the zone auto-translated..
if (string.sub(zoneId, 1, 2) == '\253\02' and string.byte(zoneId, 5) ~= nil and string.byte(zoneId, 6) == 0xFD) then
-- Pull the group and message id from the translated string..
local groupId = string.byte(zoneId, 4);
local messageId = string.byte(zoneId, 5);
-- Attempt to lookup this zone..
for k, v in pairs(zone_list) do
if (v[1] == groupId and v[2] == messageId) then
player:setPos(0, 0, 0, 0, v[3]);
return;
end
end
-- Zone was not found, allow the user to know..
player:PrintToPlayer('Unknown zone, could not teleport.');
return;
end
player:setPos(-320, 0, -474, 61, 70);
end
And i inputing the pos in the wrong line?
Re: Custom @zone ports
You have a local "zone" set to 70, then right after you check for zoneID.. Of course zoneID is going to be nil, you didn't set it a value first 

-- Whasf
Re: Custom @zone ports
Code: Select all
code tags
Code: Select all
function onTrigger(player, zoneId)
Code: Select all
if (zoneId == nil) then
Code: Select all
cmdprops =
{
permission = 1,
parameters = "i"
};
Hi, I run The Demiurge server.

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
DO NOT PRIVATE MESSAGE ME ABOUT BUGSPLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
Re: Custom @zone ports
whasf wrote:You have a local "zone" set to 70, then right after you check for zoneID.. Of course zoneID is going to be nil, you didn't set it a value first
Ok, lol. I am getting to where I need to be, I just want this to work where I could type in a command without having to type in a zoneid, just use the @commandname instead of @commandname 70 but I am totally lost on this. Any help is appreciated.
Re: Custom @zone ports
You can also set the enter location in the zone's Lua file, then upload the fix to DSP..
The Lua file basically says "If user comes in at 0,0,0 etc.. then put them here ->"
