Author Topic: Help with falling  (Read 364 times)

Legacy_Sarcose

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Help with falling
« on: February 07, 2012, 08:38:09 am »


               I have been scripting a climb system that uses placeables as climbnodes with half a dozen variables to determine modular properties of the climbcheck - number of checks on a node to a destination, whether to use STR, DEX, or STR and DEX (this is to give my players options and not to emulate the 3.5 rules precisely), set the DC, etc..

But I am having the following problem: when a player takes enough fall damage to die, he dies before jumping to the fall location. I'm currently using a bleeding death system if that explains anything. I attempted to use assigncommand(oPC, actionwait()) and I tried to put the jump after the damage was dealt (since the bleeding system keeps them alive, I thought it would work), but neither option worked.

I am turning here as a last resort after rewriting my code twice. This is my first script and I am positive it has some optimization issues. I've never scripted before this game so I'm a bit embarassed to post it. But I'm out of options.

Could anyone provide input as to how I can get the PC to wait to die until he's already fallen?
(apologies for wrapping comments. Look for the offset //Injury Calculation and Application// spots)

http://pastebin.com/pnAx9Mk8
               
               

               


                     Modifié par Sarcose, 07 février 2012 - 08:44 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Help with falling
« Reply #1 on: February 07, 2012, 12:46:38 pm »


               I am currently at work and don't have a lot of time.  But lets see if this will get you on the right track. 

When you assign a command to a object,  that object does the command as soon as its turn comes back around.   What you need to do is get the command turned into an action so it gets added to the action que.  So the statments you have like.  :

AssignCommand(oPC, ApplyEffectToObject(nDType, eInjury, oPC, 180.0f))
AssignCommand(oPC, JumpToLocation(lFall));

Need to look more like.

AssignCommand(oPC, ActionDoCommand(ApplyEffectToObject(nDType, eInjury, oPC, 180.0f)));
AssignCommand(oPC, ActionDoCommand(JumpToLocation(lFall)));

Hope that helps
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Help with falling
« Reply #2 on: February 07, 2012, 01:08:32 pm »


               just switch those assigncommands and it should work fine
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Help with falling
« Reply #3 on: February 07, 2012, 01:21:43 pm »


               Just a secondary note:

in your statements.

AssignCommand(oPC, FloatingTextStringOnCreature(sLFailMSG, oPC));

Should simply be.
FloatingTextStringOnCreature(sLFailMSG, oPC);
There is no reason to assign that unless you are also looking for it to be added to the action que for timming. In that case use the assign and the ActionDOCommand.
               
               

               


                     Modifié par Lightfoot8, 07 février 2012 - 01:22 .
                     
                  


            

Legacy_Sarcose

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Help with falling
« Reply #4 on: February 07, 2012, 02:43:51 pm »


               Thanks all, I'll give it a try. I appreciate the timely replies.

Update: Putting all the suggestions to work (flipping the assigncommands was what I originally had it at, and I was testing whether putting the jump after the command would work, thinking maybe death was aborting the actions, then the bleeding script taking over and keeping the character alive, allowing me to give the PC actions again), and the script performs exactly as desired. When the PC is weak enough to die from the fall, he first jumps to the fall location and then falls dead.

Thanks again, folks. I didn't realize the solution would be so simple.
               
               

               


                     Modifié par Sarcose, 07 février 2012 - 03:08 .