Aller au contenu

Photo

Help with falling


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
Sarcose

Sarcose
  • Members
  • 17 messages
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 .


#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
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

#3
Shadooow

Shadooow
  • Members
  • 4 474 messages
just switch those assigncommands and it should work fine

#4
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
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 .


#5
Sarcose

Sarcose
  • Members
  • 17 messages
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 .