Static Shaps
by Jason Lee · in Torque Game Engine · 04/29/2007 (12:51 pm) · 4 replies
Basically I'm confused on the whole "staticshape" "tsshape" thing...
I understand you can't do anything with a tsshape, but when i setup the datablock for the static shapes (one that rotates and one door that opens on a keyboard trigger) they dont show up. They dont show up when i add them to the mis file, nor if i goto creator and add them as static shapes. They do however show up as tsshapes.
So what i really just want to know is how to get a staticshape to show up. is it?
Or is it something different now?
I understand you can't do anything with a tsshape, but when i setup the datablock for the static shapes (one that rotates and one door that opens on a keyboard trigger) they dont show up. They dont show up when i add them to the mis file, nor if i goto creator and add them as static shapes. They do however show up as tsshapes.
So what i really just want to know is how to get a staticshape to show up. is it?
datablock StaticShapeData(citadelcoor)
{
catagory = "Doors";
filename = "/data/shapes/door/citadeldoor.dts";
};Or is it something different now?
About the author
#2
It's in the game.cs and it executes without errors, yet the door doesn't show. It shows in the inspector as a static shape, the dot and name that represent it are there on the map, but no door. Also, it only shows in the creator as a tsshape if i go and place it on the map, when i do that, the door shows up fine with collision but does not work with the open command i have scripted.
04/30/2007 (6:00 am)
Edit: I fixed those typos now it shows up right in the creator list under shapes correctly, but when i go to add it the console says citadelDoor is not a member of the GameBase.... error adding (null) object....It's in the game.cs and it executes without errors, yet the door doesn't show. It shows in the inspector as a static shape, the dot and name that represent it are there on the map, but no door. Also, it only shows in the creator as a tsshape if i go and place it on the map, when i do that, the door shows up fine with collision but does not work with the open command i have scripted.
#3
04/30/2007 (10:23 am)
Sorry, it seems that your problem is more complex than what I though... and since I'm a beginner, I can't help more :/
#4
I'm still learning how the scripting works too, but how's your function declared? Maybe use something like what I wrote above?
05/24/2007 (8:54 pm)
datablock StaticShapeData(CitadelDoorData)
{
category = "Doors";
className = "citadelDoor";
filename = "/data/shapes/door/citadeldoor.dts";
};
function citadelDoor::Open(%this, %obj)
{
...
}I'm still learning how the scripting works too, but how's your function declared? Maybe use something like what I wrote above?
Torque Owner Yannick Lahay
I mean, if you wrote this code in a file called... say doors.cs, you have to make the game execute this file.
Added to this, you made some typos in the code:
- name of the shape (citadelDoor)
- category
- filename = "~/data/shapes/door/citadeldoor.dts";
If you check that the file containing that code is executed, and if you correct the typos, it would be ok now :)
In the case you don't know how to check if the file is executed, open the game.cs file in the server directory.
Then you'll see:
... exec("./camera.cs"); exec("./editor.cs"); exec("./player.cs"); ...Add your file to that list (exec("./doors.cs");), then delete the file game.cs.dso and start your game.