saindd Posted June 12, 2015 Share Posted June 12, 2015 I've noticed that there is a lot of hardcoded stuff in player.cpp. Is it possible to create a completely new TP and FP player models with only script changes? Quote Link to comment Share on other sites More sharing options...
buckmaster Posted June 15, 2015 Share Posted June 15, 2015 You mean weapon images? And what do you mean by 'completely new'? Quote Link to comment Share on other sites More sharing options...
rlranft Posted June 15, 2015 Share Posted June 15, 2015 Yeah, the models are all set in the player datablock.... Quote Link to comment Share on other sites More sharing options...
saindd Posted June 15, 2015 Author Share Posted June 15, 2015 Not images, the models. They are referenced in the player datablock, OK. I can just switch that, but the code inside the player class expects some bones and tags to exist, that's what i mean by hardcoded. Quote Link to comment Share on other sites More sharing options...
TorqueFan Posted June 15, 2015 Share Posted June 15, 2015 Not images, the models. A weapon image is the model. As an example, open up art/datablocks/weapons/Ryder.cs: datablock ShapeBaseImageData(RyderWeaponImage) { // Basic Item properties shapeFile = "art/shapes/weapons/Ryder/TP_Ryder.DAE"; shapeFileFP = "art/shapes/weapons/Ryder/FP_Ryder.DAE"; emap = true; ... } Here the 'RyderWeaponImage' datablock uses the 'shapeFile' field to designate where the new weapon model is located. Is this what you are after, just trying to import a new model for a weapon? If you were to change that above to point to another .DAE file, when the Soldier tried to equip the Ryder weapon it would instead equip the new weapon model. There are optional nodes that can be added to the model's art for things like the muzzlepoint, ejectpoint, etc. but none of that is required and nothing in the player code will prevent any shape from being used as a weapon.Otherwise, if you are needing to implement an entirely new weapon class that has a different functionality you would need to create a new weapon class in source (probably based off of ShapeBaseImageData). Quote Link to comment Share on other sites More sharing options...
rlranft Posted June 15, 2015 Share Posted June 15, 2015 The Player class expects a model that uses the 3DS MAX Biped naming convention more or less. You can rig your player models (or other models) in any way you like, but certain bones are expected to have particular names.Once your model is rigged just export it to COLLADA and then get it imported. Someone posted a basic walkthrough on that somewhere on the old GG forums if I recall....So, I guess actually the answer is "NO," you cannot create new models purely in script - you have to use a modelling application to make and export them. But switching between models is done in script. Quote Link to comment Share on other sites More sharing options...
Duion Posted June 15, 2015 Share Posted June 15, 2015 It does not matter what your model is like, you just need to follow some conventions for LOD levels if you want to use them and the names for the nodes like eye, mount etc. Quote Link to comment Share on other sites More sharing options...
buckmaster Posted June 16, 2015 Share Posted June 16, 2015 Which particular bones are giving you trouble? I thought a lot of those hardcoded bone names were actually unused currently. AFAIR all the spine nodes are unused. Things like eye and cam are still used, but they make sense! Quote Link to comment Share on other sites More sharing options...
saindd Posted June 16, 2015 Author Share Posted June 16, 2015 The Player class expects a model that uses the 3DS MAX Biped naming convention more or less. You can rig your player models (or other models) in any way you like, but certain bones are expected to have particular names.Once your model is rigged just export it to COLLADA and then get it imported. Someone posted a basic walkthrough on that somewhere on the old GG forums if I recall....So, I guess actually the answer is "NO," you cannot create new models purely in script - you have to use a modelling application to make and export them. But switching between models is done in script. This is what i'm talking about. What are the required bone names? Quote Link to comment Share on other sites More sharing options...
rlranft Posted June 16, 2015 Share Posted June 16, 2015 This is what i'm talking about. What are the required bone names?They're in the source....https://github.com/RichardRanft/Torque3D/blob/development/Engine/source/T3D/player.cpp#L514Just take a quick look - I figured you had already found this or you wouldn't have brought it up earlier....Also - should name anim sequences like these to get them to automatically work when moving:https://github.com/RichardRanft/Torque3D/blob/development/Engine/source/T3D/player.cpp#L141I do homework for $25 a page, too. Quote Link to comment Share on other sites More sharing options...
TorqueFan Posted June 16, 2015 Share Posted June 16, 2015 This is what i'm talking about. What are the required bone names? Gosh, my bad man, totally misread your OP and thought you were interested in weapons... The bones go like this: -Bip01 -Bip01 Pelvis -Bip01 Spine -Bip01 Spine1 -Bip01 Spine2 -Bip01 Neck -Bip01 Head Bip01 HeadNub -Bip01 L Clavicle -Bip01 L UpperArm -Bip01 L Forearm -Bip01 L Hand -Bip01 R Clavicle -Bip01 R UpperArm -Bip01 R Forearm -Bip01 R Hand -Bip01 L Thigh -Bip01 L Calf -Bip01 L Foot -Bip01 L Toe0 -Bip01 L ToeNub -Bip01 R Thigh -Bip01 R Calf -Bip01 R Foot -Bip01 R Toe0 -Bip01 R ToeNub That's pretty much the basic layout, I didn't include finger bones which are unimportant for the example anyways. Some of the nodes are rarely used but here's a list of those as well in case:AltEye -GunCamEye -Cam -FollowCammount0I've heard of an 'ear' node as well but haven't ever seen it in any of the source art.The important bones deal with the player code resolving the spine - in player.cpp: // Resolve spine spineNode[0] = mShape->findNode("Bip01 Pelvis"); spineNode[1] = mShape->findNode("Bip01 Spine"); spineNode[2] = mShape->findNode("Bip01 Spine1"); spineNode[3] = mShape->findNode("Bip01 Spine2"); spineNode[4] = mShape->findNode("Bip01 Neck"); spineNode[5] = mShape->findNode("Bip01 Head"); These bones are important for the player's 'look' animation, which you can define in the player model's .cs file. Hope this is helpful. Quote Link to comment Share on other sites More sharing options...
Hodo33 Posted March 10, 2018 Share Posted March 10, 2018 @TorqueFan I was interested in changing the weapon, I have a pistol with silencer but I can't just put it in. It wont show up properly in first person view. How would I just change the weapon? Quote Link to comment Share on other sites More sharing options...
Jason Campbell Posted March 11, 2018 Share Posted March 11, 2018 Hey Hodo33, if your talking about keeping the FPS arms and replacing the weapon, the only way I found is by using 3DStudio Max 2010-2011 to import the Lurker or Ryder and replace the model but keep the animations. The animations for the arms are contained within the weapons in default Torque3D. It is unfortunate really because without 3Dmax it seems impossible. Probably the easiest way to learn more is to download the source for Ubergame by Duion and look at how he does his paintball gun. Another way, if you are decent at animation and modeling, you could create your own arms and animations. Sorry I'm not much help here but I have no way of using 3dMax anymore and therefore can not make custom weapons with the existing arms. Quote Link to comment Share on other sites More sharing options...
Duion Posted March 11, 2018 Share Posted March 11, 2018 The paintball player is a new model I made from scratch, it does not have FP hands or weapons or animations, it's all in the TP model. I did not release the source for him yet, since he is not complete, but I can send the file if someone is interested. Quote Link to comment Share on other sites More sharing options...
Hodo33 Posted March 24, 2018 Share Posted March 24, 2018 Thanks for all the info... my artist uses Maya, dont suppose there is a skeleton out there for the character that comes with game? Quote Link to comment Share on other sites More sharing options...
Duion Posted March 24, 2018 Share Posted March 24, 2018 @Hodo33The official garagegames asset packs got leaked, since they stopped paying for Github, don't know if they are legal to use.https://github.com/GarageGames/ContentPacksBut I would recommend doing your own characters, don't bother with the default soldier, will save you stress in the long run. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.