asamy / forgottenmapeditor

Map editor written in lua for Open Tibia. Written with OtClient's framework.
Other
46 stars 20 forks source link

Load monsters #24

Closed comedinha closed 11 years ago

comedinha commented 11 years ago

In 10.10 after load map get this error on load monsters and npcs:

ERROR: protected lua call failed: LUA ERROR:
C++ call failed: cannot place creature at 1690 2880 0 65535 65535 255 1 (increment radius)
stack traceback:
    [C]: ?
    [C]: in function 'loadSpawns'
    /mapeditor_filebrowser/filebrowser.lua:126: in function 'openMap'
    /mapeditor_filebrowser/filebrowser.lua:25: in function 'v'
    /mapeditor_filebrowser/filebrowser.lua:48: in function 'openFile'
    /mapeditor_filebrowser/filebrowser.lua:68: in function </mapeditor_filebrowser/filebrowser.lua:68>

On put monsters get same error...

asamy commented 11 years ago

1690 2880 0

This is the place position

65535 65535 255

and this is the spawn's center position

1

and this is the spawn's radius

This sounds like an error with your map, displaced monster? Check to see if there's a monster appears at this place position on RME/your server

comedinha commented 11 years ago

Appears in the remeres until I thought it was a bug on my map more to put a monster in this new version it's get same error...

ERROR: protected lua call failed: LUA ERROR:
C++ call failed: cannot place creature at 496 496 7 65535 65535 255 5 (increment radius)
stack traceback:
    [C]: ?
    [C]: in function 'addCreature'
    /mapeditor_interface/uieditablemap.lua:76: in function </mapeditor_interface/uieditablemap.lua:66>
    (tail call): ?
    /corelib/mouse.lua:9: in function </corelib/mouse.lua:4>
comedinha commented 11 years ago

New error on load and put a all monsters (get errors in all monsters and npcs):

WARNING: cannot place creature at 1341 2713 15 (spawn's center position: 65535 65535 255, spawn radius: 1) (increment radius)

spawns saved file:

<?xml version="1.0" encoding="UTF-8" ?>
<spawns>
    <spawn centerx="65535" centery="65535" centerz="255" radius="1" />
</spawns>

My spawns (saved with Remere's): https://raw.github.com/BrunoDCC/Alissow/master/data/world/Xedegux-spawn.xml

asamy commented 11 years ago

That looks like it was caused because you don't have any spawns loaded. (The saved file)

Try with latest OTC, might fix it.

comedinha commented 11 years ago

Not work, same error...

comedinha commented 11 years ago

Works, need put:

    void setCenterPos(const Position& pos) { m_attribs.set(SpawnAttrCenter, pos); }
    Position getCenterPos() { return m_attribs.get<Position>(SpawnAttrCenter); }

and

        creatureNode->SetAttribute("x", c.x - placePos.x);
        creatureNode->SetAttribute("y", c.y - placePos.y);
        creatureNode->SetAttribute("z", placePos.z);
asamy commented 11 years ago

Thanks! Commited to OTClient.