Sitting Titan collision problem, fixed ?

Tutorials and discussions about Mapping - Introduce your own ones!
Post Reply
Red_Fist
Godlike
Posts: 2166
Joined: Sun Oct 05, 2008 3:31 am

Sitting Titan collision problem, fixed ?

Post by Red_Fist »

So the code tells it to go back to default after it stands and the Titan sinks into the ground.

So all I did was make a new Titan and right clicked and changed the "defaults" to my collision size.

Now the code points to my new defaults.
Just wanted to check in and see if is ok, seemed to work on my first try. :D
Binary Space Partitioning
User avatar
Barbie
Godlike
Posts: 2808
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: Sitting Titan collision problem, fixed ?

Post by Barbie »

Hmm, according to Titan's code the collision is changed when Titan goes up:

Code: Select all

state Sitting {
	ignores SeePlayer, HearNoise, Bump, TakeDamage;

	function Trigger( actor Other, pawn EventInstigator ) {…}
	
	function BeginState() {
		bProjTarget = false;
	}

GetUp:
	bProjTarget = true;
	PlayAnim('TGetUp');
	FinishAnim();
	SetCollisionSize(0, Default.CollisionHeight);
	SetPhysics(PHYS_Walking);
	DesiredSpeed = 1.0;
	Acceleration = vector(Rotation) * AccelRate;
	PlayAnim('TWalk001');
	FinishAnim();
	SetCollisionSize(Default.CollisionRadius, Default.CollisionHeight);
	GotoState('Attacking');
	
Begin:
	TweenAnim('TSit', 0.05);
	SetPhysics(PHYS_None);
}
I see a problem here when DrawScale is not default, because then the default collision does not match the DrawScale.
Fix: Don't use default collision values but store the current ones and set them after changes:

Code: Select all

	OldCollisionRadius = CollisionRadius;
	SetCollisionSize(0, CollisionHeight);
…
	SetCollisionSize(OldCollisionRadius, CollisionHeight);
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Red_Fist
Godlike
Posts: 2166
Joined: Sun Oct 05, 2008 3:31 am

Re: Sitting Titan collision problem, fixed ?

Post by Red_Fist »

Ok, what I did was it's 2.9 % scaled up, and collision has to be 334 I used 336, width was 80.

So on the new Titan those are the new,,collision defaults, I did not, change the default scale in the actor, only the placed one.
And it works perfectly

Is that code just , paste-able ? I like things contained to itself and just work right.

I think just changing the default is ok since I would have to make a new actor anyway, I see a larger Titan, and it stands up walking On the floor. I am in Unreal Gold right now, wish some of that stuff could run on UT.

Thanks, you are correct about the scale thing, so I left it as 1 on the new actor, since 1 would be the new un-scaled of my new collision defaults. So stand or sit, collision stays the same. Yes you would have to make a new actor default collision from the scale used each time. This is just one Titan.
Binary Space Partitioning
Post Reply