Hooking into Editor
by Dee · in Torque Game Engine · 09/06/2002 (12:49 pm) · 11 replies
Hi, I'm a new Developer and looking for some coding info.
Let me re-phrase this post for clarity.
For the last 5 days now, I'm missing something along the class/object/editor lines in Torque.
I'm trying to hook a new class to the editor.
Actually, even any new derivative of an existing class
The ultimate goal is I:
- to get an object into a mission category and enable it to be dropped in the world
then II:
- ensure that object and script code will take care of it.
I can do part I, add an object to the mission category and select to place in world.
I can get part of II going, and run object commands from the console.
But for some reason, I can't get a hook going between the object placed in the mission editor, and the connection to my object code;
Is there anyone who has done this and can point me in any direction/reference?
(I've dissected the Item class and Mel's fx stuff, but I'm missing something along the way)
Let me re-phrase this post for clarity.
For the last 5 days now, I'm missing something along the class/object/editor lines in Torque.
I'm trying to hook a new class to the editor.
Actually, even any new derivative of an existing class
The ultimate goal is I:
- to get an object into a mission category and enable it to be dropped in the world
then II:
- ensure that object and script code will take care of it.
I can do part I, add an object to the mission category and select to place in world.
I can get part of II going, and run object commands from the console.
But for some reason, I can't get a hook going between the object placed in the mission editor, and the connection to my object code;
Is there anyone who has done this and can point me in any direction/reference?
(I've dissected the Item class and Mel's fx stuff, but I'm missing something along the way)
#3
Can you describe what you're trying to do, what is scripted, what is in C++, what file you based your new class off of, what isn't working, and maybe even the C++ of your modified class.
I've done what you're talking about many times, but there's so many things that you could be asking that I will not take a spend my own time doing something that might not be what you're asking for help with.
Details!
09/08/2002 (9:35 pm)
A "hook" is awfully vague.Can you describe what you're trying to do, what is scripted, what is in C++, what file you based your new class off of, what isn't working, and maybe even the C++ of your modified class.
I've done what you're talking about many times, but there's so many things that you could be asking that I will not take a spend my own time doing something that might not be what you're asking for help with.
Details!
#4
The brief is:
Similar to 'entity' creation.
1 - Create new class (done)C++
2 - Modify EditorGui and ObjectBuilderGui scripts to allow me to choose my class in the mission editor (done) Scripting
3 - From the Mission Editor, I should now be able to select and add an object from my new class. (can do)
4 - My object should now be in the world (it is, but...)
The problem is 4.
It shows up in the mission list after addition.
From the console, I can see that it's been added.
I've used a marker shape (for now) to show me where it is. (Script)
Additionally, it won't save with the mission.
And on creation in the world, it doesn't automatically run any of my actions as defined in my (create) function.
Manually, I can create the object from the console, and it runs my (create) actions.
09/09/2002 (4:12 am)
You're right Matt.The brief is:
Similar to 'entity' creation.
1 - Create new class (done)C++
2 - Modify EditorGui and ObjectBuilderGui scripts to allow me to choose my class in the mission editor (done) Scripting
3 - From the Mission Editor, I should now be able to select and add an object from my new class. (can do)
4 - My object should now be in the world (it is, but...)
The problem is 4.
It shows up in the mission list after addition.
From the console, I can see that it's been added.
I've used a marker shape (for now) to show me where it is. (Script)
Additionally, it won't save with the mission.
And on creation in the world, it doesn't automatically run any of my actions as defined in my (create) function.
Manually, I can create the object from the console, and it runs my (create) actions.
#5
Did you start from scratch, or did you grab an easily modifiable object and work from there (for ShapeBase, MissionMarker seems to be the easiest)?
Can you post (or email me at cptfallout2 AT hotmail.com) the code you're working with? There's still a lot of things that could be causing this, and I'm sure a glance at the code would let it be fixed much quicker.
I think I know what's wrong with the create function, but as I said I'd feel more comfortable trying to help if I could look at the code you're asking about.
Thanks.
09/09/2002 (1:38 pm)
What is the "main" class your object is derived from? Shapebase? Gamebase?Did you start from scratch, or did you grab an easily modifiable object and work from there (for ShapeBase, MissionMarker seems to be the easiest)?
Can you post (or email me at cptfallout2 AT hotmail.com) the code you're working with? There's still a lot of things that could be causing this, and I'm sure a glance at the code would let it be fixed much quicker.
I think I know what's wrong with the create function, but as I said I'd feel more comfortable trying to help if I could look at the code you're asking about.
Thanks.
#6
The below is what I was looking for.
>>grab an easily modifiable object ... (for ShapeBase, MissionMarker seems to be the easiest)
That did the trick, I was having a hard time finding an easy object to duplicate as a template.
Now that I have one, it was pretty simple to map the requirements and get it going.
Thanks again!
09/09/2002 (6:19 pm)
Thanks Matt,The below is what I was looking for.
>>grab an easily modifiable object ... (for ShapeBase, MissionMarker seems to be the easiest)
That did the trick, I was having a hard time finding an easy object to duplicate as a template.
Now that I have one, it was pretty simple to map the requirements and get it going.
Thanks again!
#7
I just added a few (based off of a template I made from the MissionMarker object), and will be more than happy to offer assistance if you need it.
Just drop me a line.
09/09/2002 (10:46 pm)
Wow, great. Is it working?I just added a few (based off of a template I made from the MissionMarker object), and will be more than happy to offer assistance if you need it.
Just drop me a line.
#8
Would one of you mind creating a micro-tutorial on this intersting topic, or at least making availble your 'new' code (source files) with some instruction on getting it into the editor?
Thanks!
09/09/2002 (11:12 pm)
Matt or Dee,Would one of you mind creating a micro-tutorial on this intersting topic, or at least making availble your 'new' code (source files) with some instruction on getting it into the editor?
Thanks!
#9
09/09/2002 (11:58 pm)
I'll try to get one together by the end of the week.
#10
09/10/2002 (4:07 am)
Same.
#11
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3217
09/13/2002 (4:46 pm)
This is now uneccessary as Mel has done it again and created the very doc mentioned.http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3217
Torque Owner Dee
I've tried following other examples, i can do this successfully with all other objects fine, ie. dts, diff, environment etc.
For some reason, I'm stuck on success with any new class or derivative I create.