Jump to content

Change player character


Razer

Recommended Posts

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.

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

This is a bit older but will get you started.

http://docs.garagegames.com/torque-3d/official/content/documentation/Artist%20Guide/Tutorials/AddPlayer.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.


More reading

https://www.garagegames.com/community/forums/viewthread/135642

Link to comment
Share on other sites

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++;
   }
}
Link to comment
Share on other sites

You replace the shape file and you are done.

That line in case you do not know where: https://github.com/GarageGames/Torque3D/blob/development/Templates/Full/game/art/datablocks/player.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.

Link to comment
Share on other sites

You replace the shape file and you are done.

That line in case you do not know where: https://github.com/GarageGames/Torque3D/blob/development/Templates/Full/game/art/datablocks/player.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);
Link to comment
Share on other sites

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.

 

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

 

%player.setActionThread("harvest");

 

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

Link to comment
Share on other sites

Torque does not work this way, yes you can play animations on press of a button, but I found this to be broken, since you have multiple animations going at the same time and if you play another one, it can be that it does not play because some other animation higher priority is playing already like walking.


What I would do is make everything a weapon, even if no weapon is equipped, so you have a harvest weapon, a fishing weapon, a mining weapon etc with a proper item and animation and when you a mining for example, the mining is done on firing the weapon and the fire animation is just the pickaxe hitting and when the pickaxe does damage to the iron ore, it is transferred into your inventory or just onto the ground where it can be picked up.


You have to use the current Torque infrastructure that is a shooter design, otherwise you have to develop new engine features,but if you use existing engine features you hardly have to do any work.

Link to comment
Share on other sites

Sure you can do that, you have the source code.

There already is a feature like that, it prevents you from sprinting when firing your weapon, you could try to extend that feature onto walking, but I don't see much reason to prevent movement when mining.

The mining is a weapon and when you move away you can no longer mine, so it forces you to stand still anyway. A melee weapon is just a gun with a projectile that does not fly very far.

Link to comment
Share on other sites

Sure you can do that, you have the source code.

There already is a feature like that, it prevents you from sprinting when firing your weapon, you could try to extend that feature onto walking, but I don't see much reason to prevent movement when mining.

The mining is a weapon and when you move away you can no longer mine, so it forces you to stand still anyway. A melee weapon is just a gun with a projectile that does not fly very far.

 

It's context actions, you start fishing and you can't move or strafe, only fishing animation is playing.

There is no binaries available for new entities ?

Link to comment
Share on other sites

The upcoming Torque 4.0 version will have a new template with modular entities, maybe you want to wait for that and do something else for your proejct in the meantime. You can already try it out in the development branch.


But I would work with what is already there. Maybe search the resources on the old Garagegames forum, since most things have been done by others before and you may find a solution there for what you need.


For example I included a resource in my game to set image states manually, I use it for reloading, so I press a button and it will set my character to reloading animation, you could use a similar system for your actions, but I would stick with using the weapons templates for what you want to do.

Link to comment
Share on other sites

the entity/component system is not really worked into the development branch yet, its still being worked on by Jeff.


In the meantime, you can push different action maps to provide context keymapping at almost any point you need to and pop them off again when you are done, there are of course design choices as well as pros and cons for each but I'm guessing you've at least covered the basics in your plans. At the very least you need an 'escape' key to interrupt your current action so that you can interact with whatever else is happening (even the most dedicated fisherman isn't going to ask an orc to stop attacking while he reels in a fresh bite)


Aso for animations, generally they are locked in until you specifically tell it to do another animation (enter stage left an entire discussion regarding blended animations).


You can tie these two things together, with context along with scheduling (for such things as mining different ores take different times to mine for example).


While entity/components are on the way these things are still possible with the engine in its current configuration, how well it works still depends on your animators' abilities to blend them in and out of each animation, and even with entity/component this is not likely to change a great deal

Link to comment
Share on other sites

the entity/component system is not really worked into the development branch yet, its still being worked on by Jeff.


In the meantime, you can push different action maps to provide context keymapping at almost any point you need to and pop them off again when you are done, there are of course design choices as well as pros and cons for each but I'm guessing you've at least covered the basics in your plans. At the very least you need an 'escape' key to interrupt your current action so that you can interact with whatever else is happening (even the most dedicated fisherman isn't going to ask an orc to stop attacking while he reels in a fresh bite)


Aso for animations, generally they are locked in until you specifically tell it to do another animation (enter stage left an entire discussion regarding blended animations).


You can tie these two things together, with context along with scheduling (for such things as mining different ores take different times to mine for example).


While entity/components are on the way these things are still possible with the engine in its current configuration, how well it works still depends on your animators' abilities to blend them in and out of each animation, and even with entity/component this is not likely to change a great deal

 

I am not sure about blending, because the engine is shooter, upper body is blending with upper animations, while i don't need this because it's not a shooting game i'm interested in. It's intern to the engine, and changing how blending works seems it could break some things.


All torque tutorials are shooter, not adventure action game. This is missing.

Link to comment
Share on other sites

the entity/component system is not really worked into the development branch yet, its still being worked on by Jeff.


In the meantime, you can push different action maps to provide context keymapping at almost any point you need to and pop them off again when you are done, there are of course design choices as well as pros and cons for each but I'm guessing you've at least covered the basics in your plans. At the very least you need an 'escape' key to interrupt your current action so that you can interact with whatever else is happening (even the most dedicated fisherman isn't going to ask an orc to stop attacking while he reels in a fresh bite)


Aso for animations, generally they are locked in until you specifically tell it to do another animation (enter stage left an entire discussion regarding blended animations).


You can tie these two things together, with context along with scheduling (for such things as mining different ores take different times to mine for example).


While entity/components are on the way these things are still possible with the engine in its current configuration, how well it works still depends on your animators' abilities to blend them in and out of each animation, and even with entity/component this is not likely to change a great deal

 

I am not sure about blending, because the engine is shooter, upper body is blending with lower animations, while i don't need this because it's not a shooting game i'm interested in. It's intern to the engine, and changing how blending works seems it could break some things.


All torque tutorials are shooter, not adventure action game. This is missing.

Link to comment
Share on other sites

I won't argue that as an engine it is far easier to build an FPS type game because of both its roots and its direction in the past, and yes the tutorials reflect that. As far as animations go I am a long way from being an expert it seems to me upper body vs lower body animations and blending seem to be the simplest and most widespread requirement regardless of the game type, that includes FPS, RPG, RTS, even action adventure, though these are fairly non-descript terms really; I'll stick to my original comment that animations are an artists domain, not a job for a coder or designer.


Tutorials notwithstanding, pretty much every game type has been done using torque in the past, so its pretty capable even if it does require tweaks here and there, but that's to be expected regardless of engine type or game type. Unless your action adventure contains some really 'out there' concepts I'm not sure you'd need to do masses of work to get the game running.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...