Game Development Community

dev|Pro Game Development Curriculum

Using ACK with T3D 3.5

by Jeff Yaskus · 02/23/2014 (2:34 am) · 6 comments

This is a resource to aid those trying to use these models with recent builds of T3D.

Hopefully it will help others, if even as an example.

Where to get it


This resources requires that you already own the Advanced Characters Kit (male and/or female)
And have downloaded the associated ZIP files;
MACKT3D1.1BETA3.zip
FACKT3D1.1BETA3.zip
(last I checked, these were the only ones released)

Maybe try these guys, if you need it - as its not currently in the GG store

www.brokeassgames.com

Installing


Start by making a copy of the mit 3.5 Full template.
Either copy it over to My Projects manually or use the project manager.

Then open the ZIP files (FACK then MACK, repeat in that order if both) ...
and Copy the files
from: Templates/Full/art/shapes/ack
To: My Projects/Full/game/art/shapes/actors/ack
overwrite any files,if prompted

Rename the models


This isn't required but makes it easier to follow later, just do it.
art/shapes/actors/act/characters/advanced.dts (to) male.dts
art/shapes/actors/act/characters/advanced_female.dts (to) female.dts

Datablocks


This will create datablock for the ACK models.

create a new script: game/art/datablocks/ack.cs
datablock PlayerData(femalePlayerData :DefaultPlayerData)
{
   // Third person shape
   shapeFile = "art/shapes/actors/ack/characters/female.dts";

   // available skins (see materials.cs in model folder)
   availableSkins =  "base african asian caucasian";
};

datablock PlayerData(malePlayerData :DefaultPlayerData)
{
   // Third person shape
   shapeFile = "art/shapes/actors/ack/characters/male.dts";

   // available skins (see materials.cs in model folder)
   availableSkins =  "base african asian caucasian";
};

Open the art/datablocks/datablockExec.cs
Add at the bottom
// load ACK
exec("./ack.cs");


the actors


Navigate over to art/shapes/actors/ack/characters/

and create these new scripts to aid in loading the (renamed) ACK models.
singleton TSShapeConstructor(maleDts)
{
   baseShape = "./male.dts";
};

function maleDts::onLoad(%this)
{
   %this.addNode("cam", "Root", "0 -0.793016 2.8 1 0 0 0", "1");
   %this.setNodeTransform("eye", "0 0.285516 2.47829 1 0 0 0", "1");
  
   %this.addSequence("art/shapes/actors/ack/anims/walkFull1.dsq", "walk", "0", "-1", "1", "0");
   %this.addSequence("art/shapes/actors/ack/anims/CrouchFull_0.dsq", "crouch", "0", "27", "1", "0");
   %this.addSequence("art/shapes/actors/ack/anims/CrouchWalkFull_0.dsq", "crouch_walk", "0", "27", "1", "0");
   %this.addSequence("art/shapes/actors/ack/anims/prone_root.dsq", "prone_root", "0", "27", "1", "0");
   %this.setSequencePriority("prone_root", "0");

   %this.addSequence("art/shapes/actors/ack/anims/root.dsq", "root", "0", "8", "1", "0");
   %this.setSequencePriority("root", "0");

   %this.addSequence("art/shapes/actors/ack/anims/runFull.dsq", "run", "0", "8", "1", "0");

   for (%deathIdx=1;%deathIdx <= 19; %deathIdx++)
   {
      %deathStr = "death" @ %deathIdx;                                                   // -1 should let it use full animation / all frames //
      %this.addSequence("art/shapes/actors/ack/anims/"@ %deathStr @".dsq", %deathStr, "0", "-1", "1", "0");
      %this.setSequencePriority(%deathStr, "0");
   }
}

$mack = true;

and/or FACK
singleton TSShapeConstructor(femaleDts)
{
   baseShape = "./female.dts";
};

function femaleDts::onLoad(%this)
{
   %this.addNode("cam", "Root", "0 -0.793016 2.8 1 0 0 0", "1");
   %this.setNodeTransform("eye", "0 0.285516 2.47829 1 0 0 0", "1");

   %this.addSequence("art/shapes/actors/ack/anims/walkFull1.dsq", "walk", "0", "-1", "1", "0");
   %this.addSequence("art/shapes/actors/ack/anims/CrouchFull_0.dsq", "crouch", "0", "27", "1", "0");
   %this.addSequence("art/shapes/actors/ack/anims/CrouchWalkFull_0.dsq", "crouch_walk", "0", "27", "1", "0");
   %this.addSequence("art/shapes/actors/ack/anims/prone_root.dsq", "prone_root", "0", "27", "1", "0");
   %this.setSequencePriority("prone_root", "0");

   %this.addSequence("art/shapes/actors/ack/anims/root.dsq", "root", "0", "8", "1", "0");
   %this.setSequencePriority("root", "0");

   %this.addSequence("art/shapes/actors/ack/anims/runFull.dsq", "run", "0", "8", "1", "0");

   for (%deathIdx=1;%deathIdx <= 19; %deathIdx++)
   {
      %deathStr = "death" @ %deathIdx;                                                   // -1 should let it use full animation / all frames //
      %this.addSequence("art/shapes/actors/ack/anims/"@ %deathStr @".dsq", %deathStr, "0", "-1", "1", "0");
      %this.setSequencePriority(%deathStr, "0");
   }
}

$fack = true;

Now the models should load and have animations, "auto-magically"
We are getting close ...

server scripts


Now navigate over to scripts/server/aiPlayer.cs
and add in these functions
(just a couple examples, there are lots more combinations)
function PlayerGetNaked(%obj)
{
      %obj.setAllMeshesHidden(true);
      %obj.setmeshhidden("base_head_one", false);
      %obj.setmeshhidden("base_eyes_one", false);
      %obj.setmeshhidden("base_mouth_one", false);
      %obj.setmeshhidden("base_neck_one", false);
      %obj.setmeshhidden("base_collar_one", false);
      %obj.setmeshhidden("base_chest_one", false);
      %obj.setmeshhidden("base_chest2_one", false);
      %obj.setmeshhidden("base_abdomen_one", false);
      %obj.setmeshhidden("base_abdomen2_one", false);
      %obj.setmeshhidden("base_abdomen3_one", false);
      %obj.setmeshhidden("base_hip_one", false);
      %obj.setmeshhidden("base_hip2_one", false);
      %obj.setmeshhidden("base_thighs_one", false);
      %obj.setmeshhidden("base_knees_one", false);
      %obj.setmeshhidden("base_shins_one", false);
      %obj.setmeshhidden("base_shins2_one", false);
      %obj.setmeshhidden("base_ankles_one", false);
      %obj.setmeshhidden("base_soles_one", false);
      %obj.setmeshhidden("base_heels_one", false);
      %obj.setmeshhidden("base_feet_one", false);
      %obj.setmeshhidden("base_toes_one", false);
      %obj.setmeshhidden("base_shoulders_one", false);
      %obj.setmeshhidden("base_biceps_one", false);
      %obj.setmeshhidden("base_elbows_one", false);
      %obj.setmeshhidden("base_forearms_one", false);
      %obj.setmeshhidden("base_wrists_one", false);
      %obj.setmeshhidden("base_hands_one", false);
      %obj.setmeshhidden("base_fingers_one", false);
      %obj.setmeshhidden("base_hip_one", false);
}

function wearDress(%obj)
{
   // first get naked
   PlayerGetNaked(%obj);
   
   // then put on some clothes 
   %obj.setmeshhidden("base_hair11_one", false);  
   %obj.setmeshhidden("base_longskirt_one", false);  
   %obj.setmeshhidden("base_bustier_one", false);  
}

function wearArmy(%obj)
{
   // first get naked
   PlayerGetNaked(%obj);
   
   // then put on some clothes  
   %obj.setmeshhidden("base_armyhelmet_one", false);  
   %obj.setmeshhidden("base_boots_one", false);
   %obj.setmeshhidden("base_uniformpants1_one", false);
   %obj.setmeshhidden("base_uniformshirt1_one", false);
   %obj.setmeshhidden("base_vestpack_one", false);
}

See in action


Now, you should have every thing in place.
Make sure it all compiles with no errors.

Open scripts/server/gameCore.cs
function GameCore::loadOut(%game, %player)
and add this at the end, before the final "}"
wearArmy(%player);

jyaskus.com/misc/screenshot_FACK.png

#1
02/23/2014 (8:44 am)
Awesome, thanks for this.
#2
02/23/2014 (9:29 pm)
May be U can try This Kit.
http://www.951gl.com/kits/index.html
SO good...
#3
02/24/2014 (4:07 am)
Nice work! Thanks for posting this.
#4
02/24/2014 (1:46 pm)
Thankyou Jeff,

Unfortunately, I feel like I am the only one that is still about most days from brokeass, I havent seen ari or chris online in ages, and jon's rarely on though I can understand that since having a baby...

I'm not a coder i just play around with various art related bits... Thanks for persevering with getting the mack work with the git release and for releasing this update.

@Szzg... words almost escape me... would you appreciate someone going into your threads and posting a link to their own packs bigging up their own work with statements like "SO good..." Yes your pack is newer, but it is also a static pack, the mack pack is more aimed at rpg's i guess you could say, coming with mesh hiding capabilities to create various different outfits and animations from the single base model(Granted, by today's terms for graphics, the mack is pretty outdated, but it has also been about for a fair few years now too... the general functionality of the pack however is still useful to most torque projects)
#5
02/24/2014 (3:06 pm)
Thanks, Jeff, for extending the shelf life of that product....!! There has been many questions regarding how to integrate the Pack with the later code bases and what worked.

The functionality was seemingly 'ahead' of it's time, at the time, lol; now it's 'stock'.

The real value is the number of meshes and animations provided, in my opinion.

Best regards!
#6
03/02/2014 (9:35 am)
@Rex & @Andy

Soooo, are these packs still for sale?