|
Sollie Villota
Registered User
Join date: 22 Jun 2007
Posts: 46
|
08-21-2007 00:49
In the past week I have been piecing together a new combat system/hud for the sim i work. Well, the thing works good until death. the script i have for dying is based taken from the Super Collider v2.1, which detects which way you are shot from and you fall in that direction and die. I don't totally udnerstand the math equation it uses, but i do know that half of the time it kills you. And when you don't die it doesn't play either animation. I am wondering if any experienced scripter could take a peak at this script and let me know why sometimes it works and other times it doesn't, and what work arounds do I have? So here's the script from my whole dead state: state dead { state_entry() { llSetTimerEvent(deathtime); if (speed > 3.5 && llVecMag(detvel) > 3.5 && (animation == "Standing" || animation == "Walking" || animation == "Running" || animation == "Jumping")) { llMoveToTarget(llGetPos() + <0.0, 0.0, (2.0 - size.z) / 3.5>, 0.05); if (llRot2Fwd(llGetRot()) * llVecNorm(detvel) <= 0.0) { llStartAnimation(fall_anim_back); llSay(0, "Dead!"); // forward = FALSE; } else { llStartAnimation(fall_anim_fwd); llSay(0, "Dead!"); // foward = TRUE; } } } timer() { llStopAnimation(fall_anim_fwd); llStopAnimation(fall_anim_back); llStopMoveToTarget(); llSay(0, "You're alive!"); state default; } }
Help is very much appreciated!
|
|
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
|
08-21-2007 11:33
Does it always yell out the dead and sometimes just not go through with the death animations? In that case, you're running into an instance where the PERMISSION_TRIGGER_ANIMATION is not set (since it is granted automatically if someone is wearing an attachment, I generally ask for the permission just before starting the animation to avoid such issues). If it's not always dying, then this line: if (speed > 3.5 && llVecMag(detvel) > 3.5 && (animation == "Standing" || animation == "Walking" || animation == "Running" || animation == "Jumping"  ) Isn't working. I'm not sure why you would want to check for those four animation states...why not just: if (speed > 3.5 && llVecMag(detvel) > 3.5)
_____________________
--AeonVox--Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
|
|
Sollie Villota
Registered User
Join date: 22 Jun 2007
Posts: 46
|
08-21-2007 13:52
Oh dangit, that makes SO much more sense. Thank you so so so so SO much. It works perfectly now
|