### Change player character

There are no stupid questions, just stupid answers.

#### Change player character

Razer
Posts: 12
Joined: Tue Jan 10, 2017 11:29 am
Hi there

Is it possible to change the actual game character with new animation moves, new inputs and new camera control ?
The goal is to make a game that is not a shooting one.
I use the old RTS tutorial as starting point for camera control, but i didn't find player input scripts and animations change.

#### Re: Change player character

Duion
Posts: 877
Joined: Sun Feb 08, 2015 1:51 am

Let me give you some good advice: Forget the soldier and make your own character, you can completely generate a player model in makehuman, no modeling needed and you can start animating him right away.

#### Re: Change player character

Razer
Posts: 12
Joined: Tue Jan 10, 2017 11:29 am
Duion wrote:Let me give you some good advice: Forget the soldier and make your own character, you can completely generate a player model in makehuman, no modeling needed and you can start animating him right away.

I already have a new player character and other ones.
The game will have platforming elements, how about making new player script with new gameplay mechanics and new camera control ?
Can it be done ?

#### Re: Change player character

Duion
Posts: 877
Joined: Sun Feb 08, 2015 1:51 am

Of course it can be done, it is a game engine.
Replace the shape file and your player model is changed, it will of course need according animations to also look good.

#### Re: Change player character

Jason Campbell
Posts: 204
Joined: Fri Feb 13, 2015 2:51 am

This is a bit older but will get you started.
http://docs.garagegames.com/torque-3d/o ... layer.html

Remember the FPS arms are separate from the 3rd person character model. The animation is set up in the .cs file. So look at soldier_rigged.cs. If you need additional help, let me know. We could get the Boombot character working from the free assets.

#### Re: Change player character

Duion
Posts: 877
Joined: Sun Feb 08, 2015 1:51 am

You do not necessarily need separate first person arms, you can just use the same model for both, separate arms are just if you want more polished animations on them.

#### Re: Change player character

Razer
Posts: 12
Joined: Tue Jan 10, 2017 11:29 am
Duion wrote:You do not necessarily need separate first person arms, you can just use the same model for both, separate arms are just if you want more polished animations on them.

Replacing the whole character, no fps game, no fps controls and no fps weapons.

What about controls ? There is no file using "gamepadFire".
I suppose scripting we can't trigger character animations using defaulf.binds.cs

function gamepadFire(%val){   if(%val > 0.1 && !$gamepadFireTriggered) {$gamepadFireTriggered = true;      $mvTriggerCount0++; } else if(%val <= 0.1 &&$gamepadFireTriggered)   {      $gamepadFireTriggered = false;$mvTriggerCount0++;   }}

#### Re: Change player character

Duion
Posts: 877
Joined: Sun Feb 08, 2015 1:51 am

You replace the shape file and you are done.
That line in case you do not know where: https://github.com/GarageGames/Torque3D ... er.cs#L489
First person arms you can ignore, if you do not have them, but then set renderFirstPerson to true.
Your model should at least have a walk cycle otherwise it will just hover around.

#### Re: Change player character

Razer
Posts: 12
Joined: Tue Jan 10, 2017 11:29 am
Duion wrote:You replace the shape file and you are done.
That line in case you do not know where: https://github.com/GarageGames/Torque3D ... er.cs#L489
First person arms you can ignore, if you do not have them, but then set renderFirstPerson to true.
Your model should at least have a walk cycle otherwise it will just hover around.

I need new key bindings for new animations harvest, mining, fishing and talking.
There is gamepad script, can it be used to trigger above animations depending on equiped item ?

//------------------------------------------------------------------------------// Gamepad Trigger//------------------------------------------------------------------------------function gamepadFire(%val){   if(%val > 0.1 && !$gamepadFireTriggered) {$gamepadFireTriggered = true;      $mvTriggerCount0++; } else if(%val <= 0.1 &&$gamepadFireTriggered)   {      $gamepadFireTriggered = false;$mvTriggerCount0++;   }}function gamepadAltTrigger(%val){   if(%val > 0.1 && !$gamepadAltTriggerTriggered) {$gamepadAltTriggerTriggered = true;      $mvTriggerCount1++; } else if(%val <= 0.1 &&$gamepadAltTriggerTriggered)   {      $gamepadAltTriggerTriggered = false;$mvTriggerCount1++;   }}moveMap.bind(gamepad, triggerr, gamepadFire);moveMap.bind(gamepad, triggerl, gamepadAltTrigger);

#### Re: Change player character

Jason Campbell
Posts: 204
Joined: Fri Feb 13, 2015 2:51 am

The new sequences would be defined in your player's .cs file. If your character file is warrior.dts, in your warrior.cs file, add the harvest sequence.

Code: Select all

function WarriorDts::onLoad(%this){    %this.addSequence("./run.dae", "run", "0", "-1", "1", "0");   %this.addSequence("./side.dae", "Side", "0", "-1", "1", "0");   %this.addSequence("./back.dae", "back", "0", "-1", "1", "0");   %this.addSequence("./harvest.dae", "harvest", "0", "-1", "1", "0");}

then to call it, use

Code: Select all

%player.setActionThread("harvest");

I'm not certain if you could add the setActionThread to your gamepad trigger but you might be able to.

#### Who is online

Users browsing this forum: No registered users and 2 guests