Game Development Community

Basic Question about Scripting

by Brian Uptagrafft · in Torque Game Engine · 07/26/2002 (6:16 pm) · 8 replies

I'm extremely new at all of this, and I was hoping that people might be able to give me some pointers about how to get started in using the scripting engine. Like, what are the .dso files and how are they created? I played around with creating another weapon in 'fps', but I couldn't make it show up when I tried to add it from the list in the world editor. Anyway, hopefully one of your veterans out there can help out a n00b like me ;) Thanks!

Brian

#1
07/26/2002 (8:41 pm)
Quote:what are the .dso files and how are they created?
They are a compiled form of a script. Somewhat similar to what a Java .class is when working with Java. (Somewhat like the 'bytecode'.)

As for adding a weapon... there may be a tutorial for that. Search the resources. If not then I'll let someone answer that question for you. :-)
#2
07/27/2002 (12:07 am)
I have a scripting question that might be suited for this thread..... I have been trying to get my own gui in, nothing complicated, I just want to make a screen where I can select a character, I made the gui script characterselectGui (thats what I called it) and tried to replace the MissionStartGui with it in the MainMenuGui..... this is what it looks like

new GuiButtonCtrl() {
profile = "GuiButtonProfile";
horizSizing = "right";
vertSizing = "top";
position = "626 127";
extent = "110 20";
minExtent = "8 8";
visible = "1";
//command = "Canvas.setContent(StartMissionGui);";
command = "Canvas.setContent(characterselectGui);";
helpTag = "0";
text = "start";
groupNum = "-1";
buttonType = "PushButton";
};


for some reason, it doesnt work :(....... I looked at the canvas class in the project, it says that function setcontent should take a Gui script as input and thats exactly what I was doing.... I have no idea why it doestn work, do any of you?...... thanks for any help you can give
#3
07/27/2002 (1:57 am)
sorry guys, but I have to keep this on the top 5 or it will NEVER get answered
#4
07/27/2002 (2:34 am)
Did you push the gui into the canvas? Canvas.SetContent(YourGuiHere)??

If you need an example, take a look at my old RWTA code, its got the kind of thing your looking at.

Its in my .plan file (the link to it).

Phil.
#5
07/27/2002 (3:01 am)
yup, thats exactly where I put the gui....... is there something wrong with that?....... I'm downloading your latest RW build right now..... thanks for your help

I just thought of another newbie scripting (I think) question...... I have animations for my dts characters all finished and exported, and when I run them in the showtool they work fine, however when I try and run the game, for some reason the character still doesnt move...... I think the problem is with the script.... excpet when I load the character dts in the showtool the animation threads along with it load to, wouldnt that mean the script works though? and if so then how come it doesnt work in the game?....... oh gosh, I'm so confused...... this is way to much for just one person... oh well, what I lack in knowlege and skill I make up with in annoying determination!!!!!..... :)
#6
07/27/2002 (4:03 am)
Also make sure your exec'ing your .gui script in init.cs and that the path to the script is correct... if it is and your script contains no errors (which you would see on the console) you should get a *.gui.cs file in the same folder...
#7
07/27/2002 (6:56 am)
i did a tut on adding a basic weapon a while back, it at:
http://www.planetquake.com/noescape/

in the pwrweaponsDM (torque game engine) section
#8
07/28/2002 (9:23 pm)
I have done some basic scripting tutorials for beginners
Find them here
www.liquid.nq.net/tutorial/