Jump to content

scripted adding of objects in mapeditor


piras

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...