Game Development Community

A player script

by perry jones · in Torque 3D Beginner · 04/02/2011 (1:49 am) · 7 replies

So, I'm working on a project ( aside from the projects we're doing in class in torque ) and I want to either completely destroy the player class(data block[?]) or expand on it so i can get rid of the rocket launcher he carries. To be honest I have a very loose grasp on how torques script/code hierarchy is set up. anyone know the specific folder path that leads to the file controlling weapon attachment? Or is it more of a deeply rooted inheritance thing? Like the player inherits its movement from another class that inherits something form another class that inherits weapon attachment from a base class.

I just want to get rid of the Rocket launcher so he has no weapon so i can continue working without shooting rockets in my fantasy RPG world. I'm going to have to present this at the GDC 2011 in Austin with my university so I want to make it as professional looking as possible. Everything else i can figure out from there(making a sword or other weapons) i just need to get down to the base :).

#1
04/02/2011 (4:59 am)
mountImage() is used for weapons,you have to disable the mounting.
This happens at the server side scripts.
#2
04/02/2011 (5:35 am)
Find function GameCore::loadOut() in scripts/server/gameCore.cs, this is what gives the player a weapon (default is rocket launcher) upon spawn.
#3
04/02/2011 (6:02 am)
... and to go a little further about what is happening:

Inside the player datablock you will find a section (usually toward the bottom) of "Allowable Inventory Items". These fields determine if a player is allowed to automatically "pick up" an item when they run over it (onCollision()). A 1 means they can have it, and greater numbers usuallyindicate things like ammo or healthkits that a player can have multiple of. The stock scripted inventory system handles the majority of this work.

The setInventory() and mountImage() methods in use by loadOut() directly give items to the player.
%playerWhoGetsIt.setInventory(DatablockNameOfItem, %amount)
%playerWhoGetsIt.mountImage(DatablockNameOfImage, $mountPoint)
#4
04/02/2011 (6:03 pm)
AHAH! thankyou! Sorry if i seem realy noob at this. I come from a different game engine(3d Game Studio) that used its own script editor, and a light version of C called lite-C. very similar to C and C++. It also didn't have a vast folder hierarchy haha. But now I'm in torque...got hooked on it because its what we use in class. Signed up for this forum for alittle extra help and then ended up buying the engine myself. 99 bucks....you cant beat that!

good engine GG.
#5
04/02/2011 (7:41 pm)
Although....i cant seem to get the particle editor to function properly. I cant create new particles...i can only edit existing ones? kind of wierd.
#6
04/03/2011 (5:22 am)
There are various cpp bug fixes for issues in the private forum, if you don't want to wait for the next release, which will be out when it's finished.
#7
04/16/2011 (8:40 pm)
im wondering can i just program my game in straight c++ and bypass torque script or is that the only way that c++ will communicate with torque?