Game Development Community

Dedicated Server

by John Esenger · in Torque 3D Beginner · 06/29/2010 (7:11 pm) · 5 replies

I have the demo version and I have a quick question when I try to change weapons in the scripts, it doesn't work I only have one weapon and this is on a dedicated server, but when I click Play all the weapons are in there... I have tried deleting the DSOs....

In my gamecore.cs it says this

function GameCore::loadOut(%game, %player)
{
   //echo (%game @"c4 -> "@ %game.class @" -> GameCore::loadOut");

   %player.setInventory(RocketLauncher, 1);
   %player.setInventory(RocketLauncherAmmo, %player.maxInventory(RocketLauncherAmmo));

   %player.setInventory(Rifle, 1);
   %player.setInventory(RifleAmmo, %player.maxInventory(RifleAmmo));

   %player.setInventory(GrenadeLauncher, 1);
   %player.setInventory(GrenadeLauncherAmmo, %player.maxInventory(GrenadeLauncherAmmo));

   %player.mountImage(RocketLauncherImage, 0);
}


Please help I want to make sure this engine actually works b4 I buy the pro..

#1
06/29/2010 (8:56 pm)
Some of your participle usage makes for a bit convoluted deciphering of what you have going on, but i think %player.mountImage(RocketLauncherImage, 0); is a clue to your problem.
#2
06/29/2010 (9:13 pm)
So what just add
%player.mountImage(RifleImage, 0);
%player.mountImage(GrenadeLauncherImage, 0);
#3
06/29/2010 (9:52 pm)
what are you trying to do stuff and things so your player have say a bunch of stuff and things and like you use them

notice how the lack of punctuation adds to the confusion of what i type its stuff and things to understand when we are both being vague and sloppy with written communications most the time when stuff and things like this are posted they dont get any reply at all because who do you expect will want to try and deciphering your stuff and things it takes extra amounts of time and stuff and things

#4
06/29/2010 (10:18 pm)
I'm trying to add more weapons to a player that spawns... but they only spawn with the RocketLauncher and not the Rifle nor GrenadeLauncher...
#5
06/29/2010 (10:48 pm)
%player.mountImage(GrenadeLauncherImage, 0);

in the place of;

%player.mountImage(RocketLauncherImage, 0);

This should mount the GrenadeLauncherImage to the player.

You will want to check out the script files, rocketLauncher.cs , weapon.cs (From the game\scripts\server folder) , to get an idea of how T3D is using Mount-Image objects.
Also be sure to learn all about the datablocks by studying the scripts in the game\art\datablocks\weapons folder.

Once you have a grasp of that information you will need to construct a function of your own to switch weapons(Unless an example is already with T3D, this I am not sure about so you might look into game\scripts\client\default.bind.cs to check around for yourself).

EDIT:
I looked into it a bit, and cycleWeapon is the line of logic you will follow to learn how T3D do that bit of magic.