Jump to content

Home

Dropping the Saber in MP


ZeR0SyN

Recommended Posts

I changed my code to work in the same way as veregons but now I cant get the saber to turn off when it hits the ground. Even when I have it turn off it just turns on again as soon as you hit attack. I even changed it so it wouldnt do that but it still did it! Is there like something on the client side that does the saber pull out sound and animation?

Link to comment
Share on other sites

Originally posted by Veregon

I have this functionality working in my upcoming mod (Shameless Plug: http://www.styleoversubstance.net). I'm not on my machine with my code base right now but here's a quick summary of how I accomplished it.

 

In the function that checks if a thrown saber can be blocked I added in code that if the saber is blocked there is a random chance of it falling to the floor. (Obviously for testing purposes I made that chance 100%). If the saber is to fall to the floor I set the saber's trType to TR_GRAVITY, set the flag for EF_BOUNCE_HALF, and most of the other settings that are set on the entity spawned in MakeDeadSaber(). So now our real saber will bounce down to the ground. I had to set bouncecount to -5 (otherwise it would call FreeEntity on itself once bouncecount hit 0, -5 is used for items that should be able to bounce forever), and also had to do a little hack in the touch_triggers function (I don't remember the name) so that if the owner of the saber touches it it's returned to him. When knocking down the saber I set the think function to DroppedSaberThink, a function I made which simply checks for the saber owner's death, disconnection, or a press of the attack button. If the attack button is pressed we call SaberTouch which starts the saber back to the owner.

 

There are some other little hacks I did, I used one of the variables that won't be used in my mod to describe the state of the thrown saber. It marks when the saber has been knocked down and when a dropped saber is returning. This is used to set the torso animation correctly when the saber falls (don't want the Jedi running with his hand out the whole time the saber is on the ground) and to insure the saber flying back doesn't do damage to anyone (since the blade is sheathed).

 

If you guys get really stuck on this let me know and I'll try to explain in more detail from my computer where I can look at my code.

 

I hope this mod gets done because too many promising looking mods + TC`s get abandoned halfway through :(

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...