Game Development Community

Running Script As An Editor Function

by David Vega · in iTorque 2D · 06/16/2011 (2:59 am) · 2 replies

Greetings,

is there any way for me to run a script as an editor function?

I have developed a script as a Behavior that runs in the onAdd method of a t2dSceneObject which is just fine. You just have to add the Behavior, fill in the fields, reload the project and it does the job.

However it really should be an editor add-on as the script imports a TMX formatted tile map from Tiled QT which is not really game functionality but rather a tool.

I have only been playing with iTorque for a month or so and would like some guidance as to what I can/should do about this?

It works perfectly fine as it stands, however I would like to see it get added to the editor for my workflow.


--
David V. Vega
Lead | delicious.salmon

#1
06/16/2011 (9:30 am)
You will not be able to integrate a behavior into the editor. You have to work within the system that has been set up. You will need stand alone functions or create a class that is called from an editor button.
#2
06/16/2011 (7:45 pm)
Michael,

thank you for the reply. I have developed it as standalone functions but within the Behavior structure - onAdd simply calls the functions with some parameters being filled in from the Fields.

I already know how to add buttons to the editor (and remove them) using the appropriate Script files.

So what you are telling me is that if I have the functions developed, I can just put that functionality into levelEditor.ed.cs or related file and hook up a button for it - am I on the right track there?


--
David V. Vega
Lead | delicious.salmon