Page 1 of 1

Psion OnRest script mod

Posted: Tue Nov 02, 2004 11:18 am
by Drakuul
The current OnRest module script will have to be modified to include

if ((GetLastRestEventType()==REST_EVENTTYPE_REST_FINISHED)
&& (GetLevelByClass(60, oPC)>=1))
SetLocalInt(GetModule(), GetPCPlayerName(oPC)+GetName(oPC)+"PSP", GetLocalInt(GetModule(), GetPCPlayerName(oPC)+GetName(oPC)+"PSPMax") );

Or something similar anyhow :) I got this direct from the riginal Psionics mod. Otherwise any psionic characters won't be able to regain used PSPs ever.

Not sure where it should go though in that script :/

Posted: Tue Nov 02, 2004 12:53 pm
by Serpentax
it can go anywhere aslong as its firing itself and not under a "if" or "else" section..

best to add right to the start or right at the very end..

either will work

Posted: Tue Nov 02, 2004 2:36 pm
by Drakuul
Tried both and neither option worked on an offline version of Hala

Posted: Tue Nov 02, 2004 3:30 pm
by teleri
Drak this code is incomplete.

It looks like there is anotehr piece missing (as I have the Psion Class disabled at the moment I was not worried about this yet.

It looks like there should be some validation of the PSP count, and you might need to validate the class.

Cheers,
teleri

Posted: Tue Nov 02, 2004 3:38 pm
by Drakuul
THat is all there is on the onrest code in the original Psionics mod, the max PSPs are determined in another script called lib_psionic.

I'll take the hint though and leave it to people who know what they are doing with scripts ;)

Posted: Tue Nov 02, 2004 4:23 pm
by Themicles

Code: Select all

            //Restore PSP for Psionicists
            if ((GetLastRestEventType()==REST_EVENTTYPE_REST_FINISHED)
            && (GetLevelByClass(60, oPC)>=1))
            SetLocalInt(GetModule(), GetPCPlayerName(oPC)+GetName(oPC)+"PSP", GetLocalInt(GetModule(), GetPCPlayerName(oPC)+GetName(oPC)+"PSPMax") );
If this matches Drak's code, then no, it's not incomplete.

Find the place in your rest script that handles the REST_EVENTTYPE_REST_FINISHED, and add it under there.

If there is no such place, just add it where all other effects are added at the end of resting in your OnRest script.

-Themicles

Posted: Tue Nov 02, 2004 6:43 pm
by teleri
Drakuul wrote:THat is all there is on the onrest code in the original Psionics mod, the max PSPs are determined in another script called lib_psionic.

I'll take the hint though and leave it to people who know what they are doing with scripts ;)
Ahh didn't see a lib_psionic called that would do it.