Game Development Community

GuiObjectView Weapon Spawning

by Charles Scovil · in General Discussion · 03/13/2007 (8:17 am) · 4 replies

Ok there is no tutorial on this that I can find. I "think" I am very close to figuring this out but I need help. I am using this tutorial on the "Tutorial Files-PlayerSelectWithDropDownMenu" found here http://www.jamestadeo.com/Games-by-James-Tadeo/torque/Torque-Tutorials/Torque-Player-Selection/Torque-Player-Selection.php#playerpreviewer . I modified the script so that instead of the ID being called from the StartMissionGui it is called from a specific player script "loadmav.cs" so that i could also load the .dts shape into a guiwindow "hercwindow" BTW this is a mech simulation game I'm making very much like Starsiege. I have edited the script so that instead of calling a specific player datablock it calls a weapon image on a specific mount. Basically I have 4 weapon mounts on a herc. I want to be able to select what weapon will go in each mount from either a button or drop down and then spawn with that weapon. I don't get any errors in the console and it should work. I just thought maybe someone with more experience could help me out.

About the author

Recent Threads


#1
03/14/2007 (2:16 am)
If I understand correctly, you can get what you want from here and here.

edit : link
#2
03/14/2007 (11:02 am)
I need to know how to select a weapon from the gui, on a particular mount, then spawn with weapons and mount intact.. this is the clostest thing i could find to doing it but it is confusing...This guy put up the code but really didn't go into any detail and used bad syntax.

http://www.garagegames.com/mg/forums/result.thread.php?qt=2640
#3
03/14/2007 (6:06 pm)
@Charles,
You can also can take a look at these code for reference.
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=5907
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2286
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=1955

With those helps, I was able to write my code which enables players to chose 4 diffent weapons.
Instead of defining like this,
moveMap.bindCmd(keyboard, "1", "commandToServer('use',\"sword\");", "");
moveMap.bindCmd(keyboard, "2", "commandToServer('use',\"mx57\");", "");
MoveMap.bindCmd(keyboard, "3", "commandToServer('use',\"m99a\");", "");
you'll have to make gui buttons. And when the button is pressed, call the 'use' function.
#4
03/14/2007 (7:47 pm)
I give up!