The below script does this very nicely for anyone else looking for something similar.
One of the other rest scripts I had trialed (which i have deleted now), allowed for time to advance by 8 hours while resting. I'd forgotten to check if this new script had this but have since realized it doesn't.
Would anyone please be able to insert into the script (wherever appropriate) the lines required to advance time forward by 8 hours.... please please pretty please
HERE IS THE SCRIPT
//A slightly modified version of the same script, with some minor adjustments to allow it to work anywhere.
//Place an ipoint (or waypoint) with a tag of "rest_ipoint".
//If you want to change the distance from 10 meters, create a float variable on it called "distance",
// and set it to the max distance away from the point the PC can be and still rest successfully.
//If you don't set it, it will use default to 10.0.
//If the ipoint doesn't exist in the current area, resting will work normally.
void main()
{
object oPC = GetLastPCRested();
if (GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED)
{
object oRestIpoint = GetNearestObjectByTag("rest_ipoint", oPC);
if (GetIsObjectValid(oRestIpoint))
{
// Check for a specific proximity tot he waypoint that the PC needs.
// If it doesn't exist, we'll assume 10 meters.
float fMax = GetLocalFloat(oRestIpoint, "distance");
if (fMax == 0.0)
fMax = 10.0;
float fDistance = GetDistanceBetween(oPC, oRestIpoint);
if (fDistance <= fMax && fDistance >= 0.0)
{
SendMessageToPC(oPC, "[You rest safely.]");
FloatingTextStringOnCreature("Time to rest.", oPC);
}
else
{
SendMessageToPC(oPC, "[You can rest in this area, just not here.]");
FloatingTextStringOnCreature("We need to find a safer place to rest.", oPC);
AssignCommand(oPC, ClearAllActions());
}
}
}
}
I eagerly await a reply. Peace.
ps- Oh my campaign is still coming along nicely. After lord knows how many hours spent on it. I'm currently polishing the intro and the first few quests that are available.
[CAMPAIGN DESCRIPTION]
TITLE: Annexation at Aramakl
SETTING: Faerun on the western coast of the Western Heartlands. (above Baldur's gate, below Waterdeep)
STORY: You and your party (of 4) have spent the past few months earning minimum wages aboard a merchants cargo ship, the Fleeing Fleece. Circumstances cause your Captain to dock at the nearest port town for repairs, which turns out to be Incavale. (I made this place up)
It isn't long before you realize that sinister forces are at work to bring about the downfall of Incavale, for a purpose which threatens to change the outcome of life itself.
Modifié par dickel, 18 avril 2011 - 10:08 .





Retour en haut






