Scaling and MaxStepHeight
by Netwyrm · in Torque 3D Professional · 08/24/2011 (9:59 am) · 5 replies
I have another weird issue which cropped up for me in the last few days.
I decided that the Guards I was dropping in were too short by a few "inches", so I went into the NPC datablock and added scale = "1.2 1.2 1.2", which brought them up slightly and made them match the player in height. Looking at them, I noticed that their edges looked better as well, so I proceeded to add a similar parameter to the player datablock.
This looked good, everybody was about the same height and the scale seemed "right". However, to my discomfiture, I discovered in short order that this broke the ability to climb stairs.
I went into the player.cpp file, where I had noticed a MaxStepHeight value (with a default of 1.0f), and tried increasing it slightly to match the player scale and recompiling.
This had no apparent effect, as stairs which had been previously smoothly ascended were now steadfastly unclimbable.
Then I tried increasing it a LOT, up to 5.0f, which has the effect of making a player able to hop on top of a six-foot wall but still doesn't make it possible to climb the stairs.
This morning, I backed everything out, in the datablocks, and in player.cpp. I recompiled, and I used Torsion to Delete DSOs and Recompile All scripts.
And although the NPC players are back to being short, my player is still too tall, and still can't climb the stairs.
Now, I have a full backup of everything from before Saturday, when I first decided to scale the players, and I will try reverting to that codebase, but I would like not to have to recapitulate everything I put in last weekend, so I thought it wouldn't hurt to post here and see if anyone has any ideas about what might be the issue--has anyone else had issues with adding scale via datablock to existing models? Is there some value besides MaxStepHeight which could impact stair-climbing I am not seeing?
This is the AFX+UAISK T3D B3 version of engine and script.
I decided that the Guards I was dropping in were too short by a few "inches", so I went into the NPC datablock and added scale = "1.2 1.2 1.2", which brought them up slightly and made them match the player in height. Looking at them, I noticed that their edges looked better as well, so I proceeded to add a similar parameter to the player datablock.
This looked good, everybody was about the same height and the scale seemed "right". However, to my discomfiture, I discovered in short order that this broke the ability to climb stairs.
I went into the player.cpp file, where I had noticed a MaxStepHeight value (with a default of 1.0f), and tried increasing it slightly to match the player scale and recompiling.
This had no apparent effect, as stairs which had been previously smoothly ascended were now steadfastly unclimbable.
Then I tried increasing it a LOT, up to 5.0f, which has the effect of making a player able to hop on top of a six-foot wall but still doesn't make it possible to climb the stairs.
This morning, I backed everything out, in the datablocks, and in player.cpp. I recompiled, and I used Torsion to Delete DSOs and Recompile All scripts.
And although the NPC players are back to being short, my player is still too tall, and still can't climb the stairs.
Now, I have a full backup of everything from before Saturday, when I first decided to scale the players, and I will try reverting to that codebase, but I would like not to have to recapitulate everything I put in last weekend, so I thought it wouldn't hurt to post here and see if anyone has any ideas about what might be the issue--has anyone else had issues with adding scale via datablock to existing models? Is there some value besides MaxStepHeight which could impact stair-climbing I am not seeing?
This is the AFX+UAISK T3D B3 version of engine and script.
About the author
My adventures in T3D are chronicled at http://www.worldofantra.com. Please be aware the subject is sword-and-sorcery, and the occasional bloody or bare body part may be in scope.
#2
I'm going to interpret your statement to mean scaling down from 1.0f to a value such as 0.5f, and try that out as soon as I get home tonight! Thanks again.
08/24/2011 (11:46 am)
Thank you very much for the suggestion. I'm going to interpret your statement to mean scaling down from 1.0f to a value such as 0.5f, and try that out as soon as I get home tonight! Thanks again.
#3
Reset the code to 1.0f and change the
in art/datablocks/player.cs (defaultPlayerData or whatever your custom datablock is) to
and see what happens. Then player around with this setting if it doesn't help.
08/24/2011 (12:53 pm)
Quote:
interpret your statement
interpret your
interpret
>interpret
Reset the code to 1.0f and change the
maxStepHeight = 1.5; //two meters
in art/datablocks/player.cs (defaultPlayerData or whatever your custom datablock is) to
maxStepHeight = 0.5;
and see what happens. Then player around with this setting if it doesn't help.
#5
05/14/2013 (11:15 am)
Thanks Jean-Pierre!
Associate Steve Acaster
[YorkshireRifles.com]