What is the problem?
by Lee-Orr Orbach · in Torque Game Engine · 10/25/2005 (10:56 pm) · 27 replies
Hello!!!
I have been trying to make an object (in script). for some reason, the script code I wrote didn't work. I wanted to know if anyone could tell me what the problem with my script is, in his oppinion.
here is the script:
I have been trying to make an object (in script). for some reason, the script code I wrote didn't work. I wanted to know if anyone could tell me what the problem with my script is, in his oppinion.
here is the script:
function onMissionLoaded()
{
// Called by loadMission() once the mission is finished loading.
%grid_obj = new ItemData(Grid_1) {
position = "12.193 -402.531 158.094";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
};
MissionCleanup.add(%grid_obj)
%grid_obj = new ItemData(Grid_2) {
position = "15.3199 -402.277 158.294";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
%grid_obj = new ItemData(Grid_3) {
position = "18.9596 -401.742 157.894";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
%grid_obj = new ItemData(Grid_4) {
position = "14.1596 -404.142 157.894";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
%grid_obj = new ItemData(Grid_5) {
position = "17.7596 -403.542 157.894";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
%grid_obj = new ItemData(Grid_6) {
position = "12.3596 -406.142 157.894";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
%grid_obj = new ItemData(Grid_7) {
position = "16.3596 -405.542 157.894";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
%grid_obj = new ItemData(Grid_8) {
position = "19.5596 -404.942 157.894";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
%grid_obj = new ItemData(Grid_10) {
position = "17.9596 -407.142 157.894";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
%grid_obj = new ItemData(Grid_9) {
position = "14.5596 -407.742 157.894";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
%grid_obj = new ItemData(Grid_13) {
position = "19.7596 -408.742 157.894";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);About the author
#2
this code is from game.cs in the server in the tutorial.base. I added this, as a practice, since something similar didn't work, but this doesn't work as well.
can you tell me what I missed?
thanks in advance,
Lee-Orr
10/25/2005 (10:57 pm)
%grid_obj = new ItemData(Grid_under13) {
position = "19.7596 -408.742 151";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
%grid_obj = new ItemData(Grid_under12) {
position = "16.5596 -409.142 151";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
%grid_obj = new ItemData(Grid_under11) {
position = "12.9596 -409.342 151";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; MissionCleanup.add(%grid_obj);
}this code is from game.cs in the server in the tutorial.base. I added this, as a practice, since something similar didn't work, but this doesn't work as well.
can you tell me what I missed?
thanks in advance,
Lee-Orr
#3
Did you see any errors in the console (press ~)?
10/25/2005 (11:01 pm)
What happened? What didn't happen?Did you see any errors in the console (press ~)?
#4
here is the error:
hope this helps, but it didn't help me :(
thanks again,
Lee-Orr
10/26/2005 (12:10 am)
The items weren't created. I checked if there was an error now, forgot about that, but I don't really understand the error.here is the error:
Quote:
tutorial.base/server/game.cs Line: 47 - Syntax error.
>>> Advanced script error report. Line 93.
>>> Some error context, with ## on sides of error halt:
shapeName = "~/data/shapes/markers/octahedron.dts";
};
MissionCleanup.add(%grid_obj)
%grid_obj ##=## new ItemData(Grid_2) {
position = "15.3199 -402.277 158.294";
>>> Error report complete
hope this helps, but it didn't help me :(
thanks again,
Lee-Orr
#5
10/26/2005 (12:35 am)
You are missing a ; at the end of MissionCleanup.add(%grid_obj)
#6
one less bug!!!
but it still doesn't build ANY object. there is nothing in the console, and the only edit to the code that I did was added the ";" at the end of MissionCleanup.add(%grid_obj).
I don't understand it :(!!!
thanks for the help,
Lee-Orr
10/26/2005 (4:18 am)
Thanks : )!!!one less bug!!!
but it still doesn't build ANY object. there is nothing in the console, and the only edit to the code that I did was added the ";" at the end of MissionCleanup.add(%grid_obj).
I don't understand it :(!!!
thanks for the help,
Lee-Orr
#7
ItemData holds generic formation about an item.
Item is the actual object.
try this instead
btw, I checked into game.cs in tutorial.base and I dont see where you got your sample.
10/26/2005 (7:42 am)
Your only creating the item data, your NOT creating the actual objects.ItemData holds generic formation about an item.
Item is the actual object.
try this instead
new ItemData(GridItem)
{
mass = 1;
friction = 1;
elasticity = 0.3;
category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
};
// Create the Grid object
%gridObj = new Item(Grid_1) {
dataBlock = GridItem;
position = "12.193 -402.531 158.094";
rotation = "1 0 0 0";
scale = "1 1 1";
};
MissionCleanup.add(%gridObj);
// Create the Grid object
%gridObj = new Item(Grid_2) {
dataBlock = GridItem;
position = "15.3199 -402.277 158.294";
rotation = "1 0 0 0";
scale = "1 1 1";
};
MissionCleanup.add(%gridObj);btw, I checked into game.cs in tutorial.base and I dont see where you got your sample.
#8
now I understand my problem!!!!!
@Simon - thanks!!! and about the btw - I think I said it, but I might have forgoten, I added this to game.cs in tutorial.base, that's where I got this from.
Have a good week,
Lee-Orr
10/27/2005 (8:05 am)
Thanks Alot!!!now I understand my problem!!!!!
@Simon - thanks!!! and about the btw - I think I said it, but I might have forgoten, I added this to game.cs in tutorial.base, that's where I got this from.
Have a good week,
Lee-Orr
#9
[qoute]
tutorial.base/server/game.cs (45): Register object failed for object Grid_1 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (52): Register object failed for object Grid_2 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (58): Register object failed for object Grid_3 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (64): Register object failed for object Grid_4 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (70): Register object failed for object Grid_5 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (76): Register object failed for object Grid_6 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (82): Register object failed for object Grid_7 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (88): Register object failed for object Grid_8 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (94): Register object failed for object Grid_10 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (100): Register object failed for object Grid_9 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (106): Register object failed for object Grid_13 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (112): Register object failed for object Grid_12 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (118): Register object failed for object Grid_11 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (124): Register object failed for object Grid_under1 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (130): Register object failed for object Grid_under2 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (136): Register object failed for object Grid_under3 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (142): Register object failed for object Grid_under4 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (148): Register object failed for object Grid_under5 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (154): Register object failed for object Grid_under6 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (160): Register object failed for object Grid_under7 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (166): Register object failed for object Grid_under8 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (172): Register object failed for object Grid_under10 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (178): Register object failed for object Grid_under9 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (184): Register object failed for object Grid_under13 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (190): Register object failed for object Grid_under12 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (196): Register object failed for object Grid_under11 of class Item.
Set::add: Object "0" doesn't exist
[/qoute]
please help!:(
Lee-Orr
edit: just so you know, lines 40-45 look like so:
10/27/2005 (8:13 am)
I just checked it, and for some reason, I get the following error in the console:[qoute]
tutorial.base/server/game.cs (45): Register object failed for object Grid_1 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (52): Register object failed for object Grid_2 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (58): Register object failed for object Grid_3 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (64): Register object failed for object Grid_4 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (70): Register object failed for object Grid_5 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (76): Register object failed for object Grid_6 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (82): Register object failed for object Grid_7 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (88): Register object failed for object Grid_8 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (94): Register object failed for object Grid_10 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (100): Register object failed for object Grid_9 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (106): Register object failed for object Grid_13 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (112): Register object failed for object Grid_12 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (118): Register object failed for object Grid_11 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (124): Register object failed for object Grid_under1 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (130): Register object failed for object Grid_under2 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (136): Register object failed for object Grid_under3 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (142): Register object failed for object Grid_under4 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (148): Register object failed for object Grid_under5 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (154): Register object failed for object Grid_under6 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (160): Register object failed for object Grid_under7 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (166): Register object failed for object Grid_under8 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (172): Register object failed for object Grid_under10 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (178): Register object failed for object Grid_under9 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (184): Register object failed for object Grid_under13 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (190): Register object failed for object Grid_under12 of class Item.
Set::add: Object "0" doesn't exist
tutorial.base/server/game.cs (196): Register object failed for object Grid_under11 of class Item.
Set::add: Object "0" doesn't exist
[/qoute]
please help!:(
Lee-Orr
edit: just so you know, lines 40-45 look like so:
%grid_obj = new Item(Grid_1) { //line 40
position = "12.193 -402.531 158.094";
rotation = "1 0 0 0";
scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}; //line 45
#11
now I get this error:
[qoute]
tutorial.base/server/game.cs Line: 48 - Syntax error.
>>> Advanced script error report. Line 95.
>>> Some error context, with ## on sides of error halt:
// Called by loadMission() once the mission is finished loading.
%grid_obj ##=## new Item(Grid_1) {
position = "12.193 -402.531 158.094";
>>> Error report complete.
[/qoute]
and the lines before are:
Help!!
thanks,
Lee-Orr
edit:
I added a ";" after the ItemData - and I Torque had an internal error that forced shutdown, and now I can't load the mission no matter what I do!!!
I simpley don't understand it
10/27/2005 (9:30 am)
Thanks, but I still don't understand whats happening.now I get this error:
[qoute]
tutorial.base/server/game.cs Line: 48 - Syntax error.
>>> Advanced script error report. Line 95.
>>> Some error context, with ## on sides of error halt:
// Called by loadMission() once the mission is finished loading.
%grid_obj ##=## new Item(Grid_1) {
position = "12.193 -402.531 158.094";
>>> Error report complete.
[/qoute]
and the lines before are:
new ItemData(grid_object)
{
mass = 1;friction = 1;elasticity = 0.3;category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
}
// Called by loadMission() once the mission is finished loading.I don't understand this!!!Help!!
thanks,
Lee-Orr
edit:
I added a ";" after the ItemData - and I Torque had an internal error that forced shutdown, and now I can't load the mission no matter what I do!!!
I simpley don't understand it
#12
Let me make 2 suggestions
1) Take baby Steps, Don't try creating all your objects. Get one created, once you have one and you see it, then you can create the rest.
2) What you changed your code to, is not what I gave you. I bascialy pasted in what I had shown you, and it worked.
Now with that said, there is a bug in what I showed you. But I know you did not even get to that point so I'm not worried.
Copy the following AS SHOWN replacing your onMissionLoaded
Also please notice the datablock for the ItemData is NOT in the function. This is because it is static data that defines what your item is going to be when you create it.
The above code was copied from my own Sandbox and is proved to be working.
10/27/2005 (10:31 am)
Lee-OrrLet me make 2 suggestions
1) Take baby Steps, Don't try creating all your objects. Get one created, once you have one and you see it, then you can create the rest.
2) What you changed your code to, is not what I gave you. I bascialy pasted in what I had shown you, and it worked.
Now with that said, there is a bug in what I showed you. But I know you did not even get to that point so I'm not worried.
Copy the following AS SHOWN replacing your onMissionLoaded
// NOTE the [b]new ItemData[/b] has been changed to the following
datablock ItemData(GridItem)
{
mass = 1;
friction = 1;
elasticity = 0.3;
category = "Objects";
shapeName = "~/data/shapes/markers/octahedron.dts";
};
function onMissionLoaded()
{
// Create the Grid object
%gridObj = new Item(Grid_1)
{
dataBlock = GridItem;
position = "12.193 -402.531 158.094";
rotation = "1 0 0 0";
scale = "1 1 1";
};
MissionCleanup.add(%gridObj);
}Also please notice the datablock for the ItemData is NOT in the function. This is because it is static data that defines what your item is going to be when you create it.
The above code was copied from my own Sandbox and is proved to be working.
#13
I even tried to check if I was mistaking about the position it was supposed to be in, and I wasn't, so I don't understand what the problem is(especially since it worked on you'r computer).
thanks anyway,
lee-orr
10/27/2005 (12:45 pm)
@Simon - I copied what you wrote now, pasted it insted of the former onMissionLoaded, and it still didn't show anything. I guess there is a problem with my copy of Torque or something, or it would have worked.I even tried to check if I was mistaking about the position it was supposed to be in, and I wasn't, so I don't understand what the problem is(especially since it worked on you'r computer).
thanks anyway,
lee-orr
#14
[Edit: Realy check to see if the dts exists where it think it should.]
Here is a trick, how many spawn points do you have for your player in the mission file? Remove all but one.
Now, copy the position of that spawn point, and past it in place of the item position.
Start your application, once running, move the player back wards a little. If everything worked, you should see the DTS infront of you.
Another trick. Press F11, this will get you into the editor mode. Look around to see if you see the name of your object.
Last trick, press ~ to start the console. Type tree(); this brings up two list boxes, look though the one of the right.
Look for
If you see this, then your item is created, but you are not where it is or the DTS does not exist.
10/27/2005 (1:01 pm)
Is the path to the DTS valid? The log will not say its missing.[Edit: Realy check to see if the dts exists where it think it should.]
Here is a trick, how many spawn points do you have for your player in the mission file? Remove all but one.
Now, copy the position of that spawn point, and past it in place of the item position.
Start your application, once running, move the player back wards a little. If everything worked, you should see the DTS infront of you.
Another trick. Press F11, this will get you into the editor mode. Look around to see if you see the name of your object.
Last trick, press ~ to start the console. Type tree(); this brings up two list boxes, look though the one of the right.
Look for
ServerGroup - SimGroup
MissionCleanup - SimGroup
Grid_1 - ItemIf you see this, then your item is created, but you are not where it is or the DTS does not exist.
#15
thanks,
Lee-Orr
10/28/2005 (3:48 am)
@Simon - I don't know why, but I didn't see what you said I should see when I used tree(); in the console. the DTS is there, so that I have no idea what the problem is.( I tried every trick you said, and I didn't find it, it wasn't created)thanks,
Lee-Orr
#16
There are no errors in the log?
Lets try something, add the following after the MissionCleanup.add(%gridObj);
Run the application, then check the log to see if either of these messages show up. If they dont show up, then your not running that onMissionLoaded somehow. If the first one shows then we need to figure out why you dont see it.
BTW: What we are doing here are things you will need to develop as a programmer, its called Problem Solving Skills. If you do not develop them, you will not get far as a programmer.
10/28/2005 (7:00 am)
You don't see an Item called Grid_1 in the tree? That means it was not created.There are no errors in the log?
Lets try something, add the following after the MissionCleanup.add(%gridObj);
if (isObject(%gridObj))
{
echo("*** GRID OBJECT CREATED ***");
}
else
{
echo("*** DID NOT CREATE GRID OBJECT ***");
}Run the application, then check the log to see if either of these messages show up. If they dont show up, then your not running that onMissionLoaded somehow. If the first one shows then we need to figure out why you dont see it.
BTW: What we are doing here are things you will need to develop as a programmer, its called Problem Solving Skills. If you do not develop them, you will not get far as a programmer.
#17
[edit]
I forgot to mention, it worked like this only when I turned the %gridObj = new Item(Grid_1) into %gridObj = new ItemData(Grid_1)
[/edit]
here is a copy of what I found:
[qoute]
Object 'GridItem' is not a member of the 'GameBaseData' data block class
tutorial.base/server/game.cs (55): Register object failed for object Grid_1 of class Item.
Set::add: Object "0" doesn't exist
*** DID NOT CREATE GRID OBJECT ***
[/qoute]
I am looking for a way to solve this at the moment(edit: without turning the new Item into new ItemData, because when I don't change it, I get the same error as before).
thanks for the help, and I'm trying to develop problem solving skills all the time. I'm simply quite new to actually trying some scripting with Torque.
thanks alot,
Lee-Orr
10/28/2005 (7:34 am)
@ Simon - The grid object wasn't created. I looked all thru the log and found out that, for some reason, Torque doesn't consider the GridObject as a part of the GameBaseData datablock.[edit]
I forgot to mention, it worked like this only when I turned the %gridObj = new Item(Grid_1) into %gridObj = new ItemData(Grid_1)
[/edit]
here is a copy of what I found:
[qoute]
Object 'GridItem' is not a member of the 'GameBaseData' data block class
tutorial.base/server/game.cs (55): Register object failed for object Grid_1 of class Item.
Set::add: Object "0" doesn't exist
*** DID NOT CREATE GRID OBJECT ***
[/qoute]
I am looking for a way to solve this at the moment(edit: without turning the new Item into new ItemData, because when I don't change it, I get the same error as before).
thanks for the help, and I'm trying to develop problem solving skills all the time. I'm simply quite new to actually trying some scripting with Torque.
thanks alot,
Lee-Orr
#18
10/28/2005 (8:43 am)
Can you post the code around datablock itemData and the item creation as YOU have it. I want to see if anything is different and I want to see where you put the code in relation to other bits of code.
#19
but I A) couldn't see the object
B) couldn't use (objectnumberfoundby tree();).getTransform() to get the transform of the object. this is what I got:
[qoute]
==>echo(1242.getTransform());
(0): Unknown command getTransform.
Object Grid_1(1242) Grid_1 -> ItemData -> ShapeBaseData -> GameBaseData -> SimDataBlock -> SimObject
[/qoute]
I am going to check out more, but I still need help,
Thanks alot!!!
Lee-Orr
10/28/2005 (8:45 am)
@Simon - well, now it did work, almost. I got the "*** GRID OBJECT CREATED ***" messege, but I A) couldn't see the object
B) couldn't use (objectnumberfoundby tree();).getTransform() to get the transform of the object. this is what I got:
[qoute]
==>echo(1242.getTransform());
(0): Unknown command getTransform.
Object Grid_1(1242) Grid_1 -> ItemData -> ShapeBaseData -> GameBaseData -> SimDataBlock -> SimObject
[/qoute]
I am going to check out more, but I still need help,
Thanks alot!!!
Lee-Orr
#20
this is it.
thanks alot!!!
Lee-Orr
10/28/2005 (8:56 am)
I left the datablock code unchanged:datablock ItemData(GridItem)
{
mass = 1;
friction = 1;
elasticity = 0.3;
category = "Objects";
shapeName = "~/data/shapes/markers/obj.dts";
};and I changed the onMissionload just a bit:function onMissionLoaded()
{
// Create the Grid object
echo("before %gridObj = new Item(Grid_1)");
%gridObj = new Item(Grid_1)
{
dataBlock = GridItem;
position = "12.193 -402.531 158.094";
rotation = "1 0 0 0";
scale = "1 1 1";
};
echo("after %gridObj = new Item(Grid_1)");
echo("before MissionCleanup.add(%gridObj)");
MissionCleanup.add(%gridObj);
echo("after missioncleanup");
if (isObject(%gridObj))
{
echo("*** GRID OBJECT CREATED ***");
}
else
{
echo("*** DID NOT CREATE GRID OBJECT ***");
}
}this is it.
thanks alot!!!
Lee-Orr
Torque Owner Lee-Orr Orbach
%grid_obj = new ItemData(Grid_12) { position = "16.5596 -409.142 157.894"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj); %grid_obj = new ItemData(Grid_11) { position = "12.9596 -409.342 157.894"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj); %grid_obj = new ItemData(Grid_under1) { position = "12.193 -402.531 151"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj); %grid_obj = new ItemData(Grid_under2) { position = "15.3199 -402.277 151.294"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj); %grid_obj = new ItemData(Grid_under3) { position = "18.9596 -401.742 151"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj); %grid_obj = new ItemData(Grid_under4) { position = "14.1596 -404.142 151"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj); %grid_obj = new ItemData(Grid_under5) { position = "17.7596 -403.542 151"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj); %grid_obj = new ItemData(Grid_under6) { position = "12.3596 -406.142 151"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj); %grid_obj = new ItemData(Grid_under7) { position = "16.3596 -405.542 151"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj); %grid_obj = new ItemData(Grid_under8) { position = "19.5596 -404.942 151"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj); %grid_obj = new ItemData(Grid_under10) { position = "17.9596 -407.142 151"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj); %grid_obj = new ItemData(Grid_under9) { position = "14.5596 -407.742 151"; rotation = "1 0 0 0"; scale = "1 1 1";mass = 1;friction = 1;elasticity = 0.3;category = "Objects"; shapeName = "~/data/shapes/markers/octahedron.dts"; }; MissionCleanup.add(%grid_obj);