Converting the Stryker IAV pack to T3D
by Sean Rice · 03/11/2010 (1:00 pm) · 10 comments
In order to convert these over to T3D some manual processes will need to occur. First, extract a fresh copy of the Stryker IAV packs.
Then copy the files from
StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/common/lighting/lights
and paste them in the game/core/art/datablocks folder
and then add these lines to the core/art/datablocks/datablockExec.cs
Edit each one of these files and replace this line
With this line
Copy the files from StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/scriptsAndAssets/data/shapes to game/art/shapes
Copy the files from StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/scriptsAndAssets/data/ParticleLibrary to game/art/ParticleLibrary
Copy the files from
StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/scriptsAndAssets/client/scripts/actionmaps to game/scripts/client/actionmaps
Copy all the files EXCEPT game.cs, commands.cs,vehicle.cs and players/player.cs files from
StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/scriptsAndAssets/server/server/scripts to game/scripts/server
edit game/scripts/client/client.cs and add these functions at the end
Don't forget to exec your scripts in the action maps by editting
/game/scripts/client/init.cs and addign this to the function InitClient.
We are done with the client mods. Let's move onto the server mods now. We will exec the server side action maps now and add in the exec for the rest of the files that we will be loading up later.
Edit game/scripts/server/game.cs and in the function onServerCreated lets add the exec for the files.
NOTE: Actual function has been removed, I am only providing the function name for you to reference. This is to prevent license issues.
At the top of game/scripts/server/commands.cs add the following functions from StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/scripts/server/commands.cs
Then in the same files copy these functions to the bottom of the commands.cs file.
Now, copy all of the functions from StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/T3D/game/scripts/server/vehicle.cs and paste it in the bottom of game/scripts/server/vehicle.cs
Now we need to correct the Stryker files themselves so that T3D knows where to load the files.
In all cs files that came with the system, replace
To set the correct actionmap based on the seat you are in, edit game/scripts/server/vehicle.cs and in the function function findNextFreeSeat
add the following to the top of the function.
Then in the same file, in function function setActiveSeat add the following before the last closing }
Then, replace the functions function Armor::onMount,function Armor::onUnmount and function Armor::onCollision in game/scripts/server/player.cs with this one.
When you are done, you should be able to... Open T3D beta, place a Stryker IAV, jump in it, drive it, fire it and exit it. Check out the video to see the work in progress.
Pending...
Hiding the player, vehicle lights(seems to be an issue for vehicles in t3D?), sounds and weapons Hud and corrected mounting position based on seat position.
Then copy the files from
StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/common/lighting/lights
and paste them in the game/core/art/datablocks folder
and then add these lines to the core/art/datablocks/datablockExec.cs
exec("./StrykerLeftBrakeLight.cs");
exec("./StrykerLeftHeadLight.cs");
exec("./StrykerRightBrakeLight.cs");
exec("./StrykerRightHeadLight.cs");Edit each one of these files and replace this line
FlareBitmap = "~/lighting/corona";
With this line
FlareBitmap = "core/art/special/corona";
Copy the files from StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/scriptsAndAssets/data/shapes to game/art/shapes
Copy the files from StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/scriptsAndAssets/data/ParticleLibrary to game/art/ParticleLibrary
Copy the files from
StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/scriptsAndAssets/client/scripts/actionmaps to game/scripts/client/actionmaps
Copy all the files EXCEPT game.cs, commands.cs,vehicle.cs and players/player.cs files from
StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/scriptsAndAssets/server/server/scripts to game/scripts/server
edit game/scripts/client/client.cs and add these functions at the end
function clientCmdPushActionMap(%map)
{
echo("Pushing Player action map " @ %map );
%map.push();
}
function clientCmdPopActionMap(%map)
{
echo("Popping Player action map " @ %map );
%map.pop();
}Don't forget to exec your scripts in the action maps by editting
/game/scripts/client/init.cs and addign this to the function InitClient.
// STRYKER IAV CONTENT PACK - additions start
// Vehicle Action Maps //
exec("./actionmaps/IAVDriverMap.cs");
exec("./actionmaps/IAVPassengerMap.cs");
exec("./actionmaps/IAVGunnerMap.cs");
exec("./actionmaps/wheeledVehicleDriverMap.cs");
exec("./actionmaps/wheeledVehiclePassengerMap.cs");
// STRYKER IAV CONTENT PACK - additions endWe are done with the client mods. Let's move onto the server mods now. We will exec the server side action maps now and add in the exec for the rest of the files that we will be loading up later.
Edit game/scripts/server/game.cs and in the function onServerCreated lets add the exec for the files.
// Stryker IAV Content Pack- additions start
exec("./vehicle.cs");
exec("./wheeledVehicle.cs");
exec("./ArtillaryShell.cs");
exec("./Machinegun.cs");
exec("./StrykerIAV.cs");
// Stryker IAV Content Pack - additions endNOTE: Actual function has been removed, I am only providing the function name for you to reference. This is to prevent license issues.
At the top of game/scripts/server/commands.cs add the following functions from StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/TGEA_1_7_1/game/scripts/server/commands.cs
// START IAV COMMANDS function serverCmdToggleBrake(%client, %lightState) function serverCmdToggleHLights(%client, %lightState) function serverCmdToggleIAVHatch(%client, %hatchState, %animation, %slot) // END IAV COMMANDS
Then in the same files copy these functions to the bottom of the commands.cs file.
// START IAV SPECIFIC FUNCTIONS function serverCmdDismountVehicle(%client) function serverCmdFindNextFreeSeat(%client) function serverCmdStopFiring(%client, %weaponTriggerIndex) function serverCmdSetFireState(%client, %firestate) function serverCmdFireVehicleWeapon( %client, %weaponTriggerIndex ) // END IAV COMMANDS
Now, copy all of the functions from StrykerIAVPack_Indie_1_1_0/StrykerIAVPack/T3D/game/scripts/server/vehicle.cs and paste it in the bottom of game/scripts/server/vehicle.cs
Now we need to correct the Stryker files themselves so that T3D knows where to load the files.
In all cs files that came with the system, replace
~/data/ [b]WITH[/b] art/
To set the correct actionmap based on the seat you are in, edit game/scripts/server/vehicle.cs and in the function function findNextFreeSeat
add the following to the top of the function.
// Check the next seat // HNG %tempseat = %client.player.mSeat; CommandToClient(%client, 'PopActionMap', %vehicle.getDatablock().actionMapForMountPoint[%tempseat]); // HNG %seat = %client.player.mSeat + 1;
Then in the same file, in function function setActiveSeat add the following before the last closing }
// HNG CommandToClient(%client, 'PushActionMap', %vehicle.getDatablock().actionMapForMountPoint[%seat]); %client.player.setCloaked(%vehicle.getDatablock().mountCloaked[%seat]); %client.player.setActionThread(%vehicle.getDatablock().mountPose[%seat], true, true); // HNG
Then, replace the functions function Armor::onMount,function Armor::onUnmount and function Armor::onCollision in game/scripts/server/player.cs with this one.
function Armor::onMount(%this, %obj, %vehicle, %node)
{
// Here I use the required fields that should be in any vehicle datablock
// This way I don't need to know anything about what type of vehicle it is
// and this code should not need to be touched when adding a vehicle.
// One last time, I'll check the node number, but this is the first time it
// actually checks against the number of nodes set in the datablock.
// Make sure we have a valid node(seat) number and that this value
// does not exceed the max number of mount points defined in this vehicle's
// datablock
if(%node >= 0 && %node < %vehicle.getDatablock().numMountPoints)
{
%obj.setTransform(%vehicle.getDatablock().mountPointTransform[%node]);
// Client commands to drop and load correct actionMap
CommandToClient(%obj.client, 'PopActionMap', moveMap);
CommandToClient(%obj.client, 'PushActionMap', %vehicle.getDatablock().actionMapForMountPoint[%node]);
// Use our vehicle specific, mountNode specific setup options
%obj.setCloaked(%vehicle.getDatablock().mountCloaked[%node]);
%obj.setActionThread(%vehicle.getDatablock().mountPose[%node], true, true);
// Set the player's mSeat variable to match our mount node
%obj.mSeat = %node;
}
else
echo("Player::OnMount: FAILURE! Invalid vehicle mount point!");
}
//DSC This is the end of the unmount chain server side
// This function mounts the player's weapon
// Changes the action map
// And uncloaks the player
// after they dismount from the vehicle.
function Armor::onUnmount(%this, %obj, %vehicle, %node)
{
// remount our weapon on unmount
%obj.mountImage(%obj.lastWeapon, $WeaponSlot);
// make sure our crosshair isn't hidden
unhideCrossHair();
// Pop off old actionMap and pop on player's
CommandToClient(%obj.client, 'PopActionMap', %vehicle.getDatablock().actionMapForMountPoint[%node]);
CommandToClient(%obj.client, 'PushActionMap', moveMap);
// Make sure we aren't cloaked on dismount
%obj.setCloaked(false);
}function Armor::onCollision(%this, %obj, %col)
{
if (!isObject(%col) || %obj.getState() $= "Dead")
return;
// Try and pickup all items
if (%col.getClassName() $= "Item")
{
%obj.pickup(%col);
return;
}
// Mount vehicles
if (%col.getType() & $TypeMasks::GameBaseObjectType)
{
// Find an empty seat
%node = findEmptySeat(%col, %col.getDataBlock());
// If we have a valid node (seat)
if(%node > -1)
{
// Start the mount
%col.mountObject(%obj, %node);
// Set the player's mVehicle variable
// to the vehicle we are mounting
%obj.mVehicle = %col;
// Are we going to be driving this vehicle?
// If so set the vehicle as the control object
// otherwise set player as control object
if (%node == 0)
%obj.client.setControlObject(%col);
else
%obj.client.setControlObject(%obj);
// Make sure crosshair is hidden if requested no mounted weapon
// for player at this node.
if(%col.getDatablock().unmountWeaponOnMount[%node])
{
// Hide the crosshair
hideCrossHair();
// Get our mounted image (weapon)and store this
// in lastWeapon so we can remount it on dismount
%obj.lastWeapon = %obj.getMountedImage($WeaponSlot);
// Unmount it
%obj.unmountImage($WeaponSlot);
}
}
else
echo("Player::onCollision() Invalid mount node (seat)");
}
else
echo("Player::onCollision(). Sorry, this vehicle is not mountable.");
}When you are done, you should be able to... Open T3D beta, place a Stryker IAV, jump in it, drive it, fire it and exit it. Check out the video to see the work in progress.
Pending...
Hiding the player, vehicle lights(seems to be an issue for vehicles in t3D?), sounds and weapons Hud and corrected mounting position based on seat position.
About the author
http://www.hngamers.com
#2
03/12/2010 (7:50 am)
Great job! Many Thanks....."You Go Sean".
#3
03/12/2010 (7:56 am)
Keep an eye out here, I went through some more of this last night and was able to correct a few things in the scripts. Changing seats, some sound effects, changing over the control maps and a bit more. There are still a few bugs left after this and I will update this resource later today with some of the corrections.
#4
03/12/2010 (9:35 am)
You're a machine Sean! :)
#5
03/12/2010 (8:19 pm)
Updated top post with additional corrections for mounting the vehicle and mapping the correct actionmaps based on seat position.
#6
edit: Ok, I see where keyboard "q" finds next empty seat. Still nothing I can find on rotating turrent however.
03/13/2010 (4:55 pm)
Again, great job! What about being able to rotate the turrent, and maybe being able to change seats, even if you're the only one that's mounted the vehicle?edit: Ok, I see where keyboard "q" finds next empty seat. Still nothing I can find on rotating turrent however.
#7
03/13/2010 (8:15 pm)
Yeah, I am having that issue as well, still pounding away at it, although those quests in Guild Wars keep distracting me. After slashing mental bits I had to start slashing some digital bits!
#8
03/15/2010 (1:08 pm)
I just put these things into 1.5.2, 1.7.1 and tried the supplied demo to see how they were "supposed" to act when mounted. The turrets do not move in any of these demos either, so I am not sure that rotation was working there. Currently the only difference I am seeing between all of the versions is the players seating position and the lights on vehicle now. I do see a picture in the documentation that talks about swivel points.
#9
just a quick question:
Does anyone know where to get the stryker pack from? I know it is gone for a while now but could not find it in the web.
kind regards
Greg
04/20/2011 (8:02 am)
Hi there,just a quick question:
Does anyone know where to get the stryker pack from? I know it is gone for a while now but could not find it in the web.
kind regards
Greg
#10
Unfortunately the striker pack is no longer for sale. Garagegames took the item off of the site since it doesn't work with the current engine (and possibly because the new owners didn't have rights to sell it with the original creator). Again unfortunately the old owners used to make the pack makers sign an agreement that only allowed them to sell the packs via GarageGames. This is usually why you do not see the packs out on the web for sale. This pretty much means you have to either a) get it from someone who has it already, b) get it from a download source, or c) contact the original creator of the pack. In a and b, you do not have a license to run it and run the risk of potential lawsuits. The original creators are these guys.
21st Century Systems, Inc.
6285 Pine Street, Suite 141
Omaha, NE 68106
Tel: (402) 505-7881
Email: support@21csi.com
Web: http://www.21csi.com/aedge-3d/
04/20/2011 (8:44 am)
Greg,Unfortunately the striker pack is no longer for sale. Garagegames took the item off of the site since it doesn't work with the current engine (and possibly because the new owners didn't have rights to sell it with the original creator). Again unfortunately the old owners used to make the pack makers sign an agreement that only allowed them to sell the packs via GarageGames. This is usually why you do not see the packs out on the web for sale. This pretty much means you have to either a) get it from someone who has it already, b) get it from a download source, or c) contact the original creator of the pack. In a and b, you do not have a license to run it and run the risk of potential lawsuits. The original creators are these guys.
21st Century Systems, Inc.
6285 Pine Street, Suite 141
Omaha, NE 68106
Tel: (402) 505-7881
Email: support@21csi.com
Web: http://www.21csi.com/aedge-3d/

Torque Owner Paula Renee Francis
Default Studio Name