Scripting A Character back to life?
Moderator: Admin
- origen
- Dark Sidhe Lord
- Posts: 903
- Joined: Thu Feb 10, 2005 5:54 pm
- Location: Secret League of Nirulat Headquarters
- Contact:
Scripting A Character back to life?
Is it currently supported to use a script to revive a character? I know that you can restore HP, BP, and SP, so I don't see why now. But I haven't seen anywhere where this is discussed, or even if this is possible. Just curious.
- ShadoKnight
- Nomad
- Posts: 28
- Joined: Mon Mar 21, 2005 2:05 pm
- The Wombat
- War Monger
- Posts: 150
- Joined: Thu Feb 10, 2005 12:50 am
- Location: Now in SoCal!!
- ralphtrickey
- Townie
- Posts: 20
- Joined: Tue Apr 26, 2005 6:03 pm
- Location: Colorado
* @return true, if the given party member is an NPC, or a still-living PCThe Wombat wrote:Is there someway the script file could read the characters current HP value? Then it would be a simple matter of saying:
Deduct from HP the characters [(negative) current HP], then add 1.
* false, if the given party member is a now-dead PC
I'm pretty sure it also works the other way, keep calling modifyhp, adding 1, and it should return true if the character is nowalive!!! I'd make it a loop of 1,000 or so adds. Let me know if it works.
Ralph
- HGamer
- War Monger
- Posts: 188
- Joined: Thu Feb 10, 2005 7:59 pm
- Location: Land of fruits & nuts, i.e. SoCal
- Contact:
My Rogue has over 600 HP now, and has been sent to over -150 by Stalkers more than once. And don't forget Stax' (mumble mumble ridiculous mumble) high levels. Better make that at least 2000.ralphtrickey wrote:keep calling modifyhp, adding 1, and it should return true if the character is nowalive!!! I'd make it a loop of 1,000 or so adds.
The modkit scripting tutorial says:
Was the meaning of the return value changed recently?modifyHP(eventPtr, partyIdx, amount)
...
-Returns whether or not the modification was successful, as a 0/1 truth value.
1 point 21 jigawatts!
- ralphtrickey
- Townie
- Posts: 20
- Joined: Tue Apr 26, 2005 6:03 pm
- Location: Colorado
Well, I guess that depends, This was meant to subtract hit points. The comments (and code) suggest that it returns a 1 if they are still alive after the hit points are removed and a 0 if they're dead. It was successful if you could cut off the arm but not kill them <g>HGamer wrote:My Rogue has over 600 HP now, and has been sent to over -150 by Stalkers more than once. And don't forget Stax' (mumble mumble ridiculous mumble) high levels. Better make that at least 2000.ralphtrickey wrote:keep calling modifyhp, adding 1, and it should return true if the character is nowalive!!! I'd make it a loop of 1,000 or so adds.
The modkit scripting tutorial says:Was the meaning of the return value changed recently?modifyHP(eventPtr, partyIdx, amount)
...
-Returns whether or not the modification was successful, as a 0/1 truth value.
Ralph
It's a black flag with white skull'n'crossbones.
Reset it by...uhm, preying on/to Origen?
Reset it by...uhm, preying on/to Origen?
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
- The Wombat
- War Monger
- Posts: 150
- Joined: Thu Feb 10, 2005 12:50 am
- Location: Now in SoCal!!
- ShadoKnight
- Nomad
- Posts: 28
- Joined: Mon Mar 21, 2005 2:05 pm
From my original reply: I referred to a flag indicating the character is dead. I actually don't remember if this is available in the scripting interface, but in the code, each character has a set of state flags, including poisoned, aged, withered, etc. One of those special states is 'dead'. A resurrect spell, for instance, would generally bring the hit points to exactly 1, and toggle that flag off, so that the character has positive hit points and isn't dead. In theory, you could heal a dead character to full hit points, but they'd still be dead until that flag is toggled. What I don't remember is if the scripting interface has a mechanism for toggling that flag...
SK
SK