Scripting A Character back to life?

Discussion forum for Devil Whiskey 3rd Party MODS.

Moderator: Admin

Post Reply
User avatar
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?

Post by origen »

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.
User avatar
ShadoKnight
Nomad
Posts: 28
Joined: Mon Mar 21, 2005 2:05 pm

Post by ShadoKnight »

It certainly *should* be possible.... though off hand I can't guarantee it. If you bring the player's HP above zero, and you reset the flags so they're not dead (the thing I don't know for sure you can do, but I think you can), they should be fine....

SK
User avatar
Admin
Site Admin
Posts: 121
Joined: Wed Dec 31, 1969 4:00 pm

Post by Admin »

You'd have to bonus the HP maybe 10 or more ot assure that HP is restored...

Since it's numerative, there's no way to flag how far the dead char is below 0.
User avatar
HGamer
War Monger
Posts: 188
Joined: Thu Feb 10, 2005 7:59 pm
Location: Land of fruits & nuts, i.e. SoCal
Contact:

Post by HGamer »

To handle unexpectedly advanced characters like Stax', you should also push the HP up to a rather large positive value. And hope that it stops at the maximum.
If there's some sample code, please post it. Killing the characters is easy. Bringing them back isn't.
1 point 21 jigawatts!
User avatar
The Wombat
War Monger
Posts: 150
Joined: Thu Feb 10, 2005 12:50 am
Location: Now in SoCal!!

Post by The Wombat »

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.
"What kind of person WRITES a maniacal laugh?" -- Maskerade.
User avatar
ralphtrickey
Townie
Posts: 20
Joined: Tue Apr 26, 2005 6:03 pm
Location: Colorado

Post by ralphtrickey »

The 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.
* @return true, if the given party member is an NPC, or a still-living PC
* 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
User avatar
HGamer
War Monger
Posts: 188
Joined: Thu Feb 10, 2005 7:59 pm
Location: Land of fruits & nuts, i.e. SoCal
Contact:

Post by HGamer »

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.
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.

The modkit scripting tutorial says:
modifyHP(eventPtr, partyIdx, amount)
...
-Returns whether or not the modification was successful, as a 0/1 truth value.
Was the meaning of the return value changed recently?
1 point 21 jigawatts!
User avatar
ralphtrickey
Townie
Posts: 20
Joined: Tue Apr 26, 2005 6:03 pm
Location: Colorado

Post by ralphtrickey »

HGamer wrote:
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.
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.

The modkit scripting tutorial says:
modifyHP(eventPtr, partyIdx, amount)
...
-Returns whether or not the modification was successful, as a 0/1 truth value.
Was the meaning of the return value changed recently?
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>

Ralph
User avatar
origen
Dark Sidhe Lord
Posts: 903
Joined: Thu Feb 10, 2005 5:54 pm
Location: Secret League of Nirulat Headquarters
Contact:

Post by origen »

So, what is the flag for a dead character, and how would someone reset it to make them alive?
User avatar
Growler
Necrolord
Posts: 1740
Joined: Mon Feb 14, 2005 10:37 pm
Location: Sputnik
Contact:

Post by Growler »

It's a black flag with white skull'n'crossbones.

Reset it by...uhm, preying on/to Origen?
:P
No Contraries : No Progression.
Opposition is true friendship, unless one is opposed to true friendship or (try) Resisting here http://www.cafepress.com/notheresistor
User avatar
The Wombat
War Monger
Posts: 150
Joined: Thu Feb 10, 2005 12:50 am
Location: Now in SoCal!!

Post by The Wombat »

Ah...so all pirates are dead then?
"What kind of person WRITES a maniacal laugh?" -- Maskerade.
User avatar
ShadoKnight
Nomad
Posts: 28
Joined: Mon Mar 21, 2005 2:05 pm

Post by ShadoKnight »

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
Post Reply