piras Posted August 1, 2010 Share Posted August 1, 2010 Hello Im making a tool that adds objects with createObject. It only works in freeroam mode though, I want to change it so it will work in the map editor. Will I have to use createElement instead and use a special type of element the map editor uses when it creates an object ? Im not sure how to get the objects to show up in the editor. Link to comment
dzek (varez) Posted August 1, 2010 Share Posted August 1, 2010 if you want only to show them in editor (not being able to move them) - just start your resource via console (f8, "start res_name").. if you want to move them.. you have to save your objects to xml file, like map editor does.. Link to comment
Kayl Posted August 2, 2010 Share Posted August 2, 2010 https://wiki.multitheftauto.com/wiki/Res ... or/Plugins Once you created your objects, they are children of your resource root element, hence calling the "import" exported function of the editor on your root element should make your objects visible/editable in the editor. Link to comment
piras Posted August 2, 2010 Author Share Posted August 2, 2010 Kayl that is doing the job, makes it much easier to make maps now, thanks for the link. Acouple of things have emerged: 1) INFO: Cloned 'object'. When my resource creates a new object, is that normal ? 2) A warning in the debug window WARNING: Bad argument @ 'triggerClientEvent' each time my resource creates an object. 3) Cant seem to delete the objects with destroyElement() Im creating and destroying the objects from the serverside, triggered by pressing a button in a window in the client gui. Link to comment
piras Posted August 4, 2010 Author Share Posted August 4, 2010 I think I know whats happening. When you call the editors exported import() it clones the object your resource made ( hence clone message ) and when your resource addon deletes objects with destroyElement() it deletes its own ones ( hence no false return from destroyElement() ) ...but the object that was imported into the editor is still there. Im not sure what the triggerClientEvent is though, I hope its trying to send a pointer to the editors copy of the object ........ ? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now