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

AAC Problems with towns with Znote or other thing.

Eduardo170

Well-Known Member
Joined
Jan 7, 2014
Messages
422
Solutions
3
Reaction score
66
Location
Caracas, Venezuela
I have AAC @Znote but the cities are not recognizing me and when I create a character it starts somewhere else.
1- I try with other version of RME and still.
2- I create Odisea with Town 2 and added to Znote and still.
3- It is as if forcing position of new players as if there was something that prevented it, but I made sure and there is none.(check image).
I have 2 towns
Francfort Town Id 1
Odisea Town Id 2 (This was a test in step 2)
fdgnz1L.png

xtB9eUa.png



O7lJR9g.png




D42gwHP.png

VZPKk3n.png

my config.php

Code:
// Leave on black square in map and player should get teleported to their selected town.
    // If chars get buggy set this position to a beginner location to force players there.
    $config['default_pos'] = array(
        'x' => 990,
        'y' => 997,
        'z' => 7,
    );
Code:
// Available towns (specify town ids, etc: (1, 2, 3); to display 3 town options (town id 1, 2 and 3).
    $config['available_towns'] = array(1, 2); //(1, 2, 3, 4); for more towns
Code:
// Town ids and names: (In RME map editor, open map, click CTRL + T to view towns, their names and their IDs.
    // townID => 'townName' etc: ['3'=>'Thais']
    $config['towns'] = array(
        1 => 'Francfort',
        2 => 'Odisea',
    );


Code:
// health, mana cap etc are calculated with $config['vocations_gain'] and 'base' values of $config['player']
        'create' => array(
            'level' => 8,
            'novocation' => array( // vocation id 0 (No vocation) special settings
                'level' => 1, // Level
                'forceTown' => false,
                'townId' => 1
            ),
Here
Code:
 'forceTown' => true,
and change to
Code:
 'forceTown' => false,
but still continues.
 
Last edited:
Solution
forceTown will only force the townid if you are no vocation. (rook player).

Change default_pos coordinate to a location you cannot spawn, and the player position should be reset to the town temple position when he logs in.

You tried to do the command /town Putalaquelolea, but you don't have a town with that name. (but you have a character with that name).

If you try to instead do /town Francfort, it should work. Because your RME is configured with those towns.
forceTown will only force the townid if you are no vocation. (rook player).

Change default_pos coordinate to a location you cannot spawn, and the player position should be reset to the town temple position when he logs in.

You tried to do the command /town Putalaquelolea, but you don't have a town with that name. (but you have a character with that name).

If you try to instead do /town Francfort, it should work. Because your RME is configured with those towns.
 
Solution
forceTown will only force the townid if you are no vocation. (rook player).

Change default_pos coordinate to a location you cannot spawn, and the player position should be reset to the town temple position when he logs in.

You tried to do the command /town Putalaquelolea, but you don't have a town with that name. (but you have a character with that name).

If you try to instead do /town Francfort, it should work. Because your RME is configured with those towns.
Work, thank you. I set.
Code:
$config['default_pos'] = array(
        'x' => 0,
        'y' => 0,
        'z' => 0,
    );
You have idea how I do when I want a player teleport to temple
example: /t Name
Code:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

    local town = Town(param) or Town(tonumber(param))
    if town then
        player:teleportTo(town:getTemplePosition())
    else
        player:sendCancelMessage("Town not found.")
    end
    return false
end
 
Teleport a player to whatever town that player is set for:
Lua:
player:teleportTo(player:getTown():getTemplePosition())
 
Teleport a player to whatever town that player is set for:
Lua:
player:teleportTo(player:getTown():getTemplePosition())
Mmm. It doesnt work. Give me an idea, I'm a newbie in this.
Code:
function onSay(player, words, param)
    local target = Player(split[1])

    if target == nil then
        player:sendCancelMessage("A player with that name is not online.")
        return false
    end

    if target then
        player:teleportTo(player:getTown():getTemplePosition())
    end

    return false
end
 
Lua:
-- Teleport player (specified in param) to their own temple. 
function onSay(player, words, param)
    local target = Player(param)

    if not target then
        player:sendCancelMessage("A player with that name is not online.")
        return false
    else
        local target_town = target:getTown()
        local temple_position = target_town:getTemplePosition()

        target:teleportTo(temple_position)

        player:sendTextMessage(MESSAGE_INFO_DESCR, "You just teleported [".. target:getName() .."] to [".. target_town:getName() .."] temple!")
    end

    return false
end
 
Lua:
-- Teleport player (specified in param) to their own temple.
function onSay(player, words, param)
    local target = Player(param)

    if not target then
        player:sendCancelMessage("A player with that name is not online.")
        return false
    else
        local target_town = target:getTown()
        local temple_position = target_town:getTemplePosition()

        target:teleportTo(temple_position)

        player:sendTextMessage(MESSAGE_INFO_DESCR, "You just teleported [".. target:getName() .."] to [".. target_town:getName() .."] temple!")
    end

    return false
end
It doesnt work. Dont show me any message. I try this in different ways, but I never got it.
 
It should either show you a cancel message, or a green info message in-game.
OR an error message in console. (Either during startup, or when you execute the code).

If none of the above, it is a linking issue and the script hasn't loaded properly.

How is the script connected? Are you using TFS 1.3 with revscriptsys enabled? I might just convert it to revscriptsys as xml is just bothersome.
 
It should either show you a cancel message, or a green info message in-game.
OR an error message in console. (Either during startup, or when you execute the code).

If none of the above, it is a linking issue and the script hasn't loaded properly.

How is the script connected? Are you using TFS 1.3 with revscriptsys enabled? I might just convert it to revscriptsys as xml is just bothersome.
Yes I use TFS 1.3.
Edit: I forget separator=" " in xml .Thank you. revscriptsys its no bad idea.
 
Last edited:
Added GM check so only GM+ account types can execute talkaction, and revscriptified it.

data/scripts/talkaction/temple.lua
Lua:
local talk_temple = TalkAction("/temple")

function talk_temple.onSay(player, words, param)
    if player:getAccountType() <= ACCOUNT_TYPE_TUTOR then
        player:sendCancelMessage("You don't have access to teleport players to their temple.")
        return true
    end

    local target = Player(param)
    if not target then
        player:sendCancelMessage("A player with that name is not online.")
        return false
    end
 
    local target_town = target:getTown()
    local temple_position = target_town:getTemplePosition()
 
    target:teleportTo(temple_position)

    -- Inform target which GM teleported him to temple
    target:sendTextMessage(MESSAGE_INFO_DESCR, "You got teleported by [".. player:getName() .."] to [".. target_town:getName() .."] temple!")
 
    -- Inform the GM which temple he teleported target to
    player:sendTextMessage(MESSAGE_INFO_DESCR, "You just teleported [".. target:getName() .."] to [".. target_town:getName() .."] temple!")
 
    return false
end

talk_temple:separator(" ")
talk_temple:register()

/temple playername
 
Back
Top