Jump to content

[CK]Help regarding collision with Arrok custom animations


metall87

Recommended Posts

Posted

Hi guys, this's my first post in the forums, I hope I've put this in the right place.

 

I've searched all over the web on this topic, but no luck.

 

Ok, here's my problem,

I'm making a mod involving the player and another npc in a scene with custom animations, basically the two actors get close to each other, perform the animation and then they split up (something similar to ssl framework, but much more simple). That's ok, but the problem is that when this two actors perform the animation, one of them falls to the floor; more specifically, the function Debug.ToggleCollisions() doesn't seem to work properly.

 

I tried to set the Z position of the npc, but -even with ToggleCollisions called- no success.

I tried to put a Collision box under the npc to even the two of them, didn't work.

 

To be more specific in this matter, if I try to raise the npc, say, 30 units from the floor, it works, the npc stays in the air (obviously the animation looks weird, a actor in the floor, and the other mid air, both trying to hug each other :P ). but if I try to raise the actor only 5 units from the floor, it falls, as if the ground were attracting the npc down.

 

Ok, here's the function that I'm working on, this is called from the scene.

 

 

 

;============================================

Function BeginPreparationsForAnim()

actor  pPlayer = Alias_Player.GetActorRef()
actor  pTarget = Alias_Target.GetActorRef()

Pval = pPlayer.GetScale()
Tval = pTarget.GetScale()

pPlayer.SetScale(1.0)
pTarget.SetScale(1.0)

Debug.ToggleCollisions()

Game.DisablePlayerControls(true, true, true, false, false, true, true)

Game.ForceThirdPerson()
Game.SetPlayerAIDriven()

;pPlayer.SetRestrained(true)
;pPlayer.SetDontMove(true)
pTarget.SetRestrained(true)
pTarget.SetDontMove(true)

Debug.SendAnimationEvent(pTarget, "Arrok_StandingForeplay_A1_S1")
Debug.SendAnimationEvent(pPlayer, "Arrok_StandingForeplay_A2_S1")

pTarget.MoveTo(pPlayer, 100.0 * Math.Sin(pPlayer.GetAngleZ()), 100.0 * Math.Cos(pPlayer.GetAngleZ()), pPlayer.GetHeight() - 120.0)

;TPosX = pTarget.GetpositionX() <<<
;TPosY = pTarget.GetpositionY() <<< This was just a test
;TPosZ = pTarget.GetpositionZ() <<<
;pTarget.SetPosition(TposX, TPosY, TposZ +5) <<<

EndFunction

;=========================================

 

 

 

After 20 secs, another function is called to return the actors to normal state and regain their current Scale values.

 

Here's a pic of what I'm talking about.

 

 

mlo47a.jpg

 

 

I've tried to avoid using the ssl framework for two reasons. First, It is a much more advanced programming than I can understand :D. Second, this scene is just a hug and kiss animation (no moaning and such), performed with one of the Arrok animation events. IIRC, the ssl framework uses 4 different stages of animations and I just need 1.

 

If anyone can help me, or point me in the right direction, It will be much appreciated ;) , so I can stop hitting the wall with this.

 

Thanks in advance.

 

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...