Replace TP and FP player models with only scripting?

Scripting questions, discussions, etc
  • 1
  • 2
16 posts Page 1 of 2
saindd
Posts: 220
Joined: Wed Apr 15, 2015 3:20 am
by saindd » Fri Jun 12, 2015 3:44 pm
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?
buckmaster
Steering Committee
Steering Committee
Posts: 321
Joined: Thu Feb 05, 2015 1:02 am
by buckmaster » Mon Jun 15, 2015 2:51 pm
You mean weapon images? And what do you mean by 'completely new'?
rlranft
Posts: 298
Joined: Thu Feb 05, 2015 3:11 pm
 
by rlranft » Mon Jun 15, 2015 3:25 pm
Yeah, the models are all set in the player datablock....
saindd
Posts: 220
Joined: Wed Apr 15, 2015 3:20 am
by saindd » Mon Jun 15, 2015 3:35 pm
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.
TorqueFan
Posts: 87
Joined: Thu Apr 30, 2015 5:35 am
by TorqueFan » Mon Jun 15, 2015 8:51 pm
Not images, the models.
A weapon image is the model. As an example, open up art/datablocks/weapons/Ryder.cs:

Code: Select all

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).
rlranft
Posts: 298
Joined: Thu Feb 05, 2015 3:11 pm
 
by rlranft » Tue Jun 16, 2015 1:18 am
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.
Duion
Posts: 964
Joined: Sun Feb 08, 2015 1:51 am
 
by Duion » Tue Jun 16, 2015 1:48 am
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.
buckmaster
Steering Committee
Steering Committee
Posts: 321
Joined: Thu Feb 05, 2015 1:02 am
by buckmaster » Tue Jun 16, 2015 3:47 am
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!
saindd
Posts: 220
Joined: Wed Apr 15, 2015 3:20 am
by saindd » Tue Jun 16, 2015 4:50 am
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?
rlranft
Posts: 298
Joined: Thu Feb 05, 2015 3:11 pm
 
by rlranft » Tue Jun 16, 2015 4:53 am
This is what i'm talking about. What are the required bone names?
They're in the source....
https://github.com/RichardRanft/Torque3 ... r.cpp#L514
Just 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/Torque3 ... r.cpp#L141

I do homework for $25 a page, too.
  • 1
  • 2
16 posts Page 1 of 2

Who is online

Users browsing this forum: No registered users and 1 guest