So, Im trying to create my own rest system just using marking areas as no rest and the X0_SAFEREST trigger. In the trigger’s comments it mentions that I need X1 resting enabled. I’ve never worked with the default bioware X1 resting system and in fact havent played the HotU main campaign past the start so I dont know how the rest system works other than guessing.
I can assume that I need to set the variable MODULE_SWITCH_USE_XP2_RESTSYSTEM on the module - if the X1 resting comment is the same as pointed out in this default bioware script:
//::///////////////////////////////////////////////
//:: Name: x2_onrest
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
The generic wandering monster system
*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: June 9/03
//:://////////////////////////////////////////////
//:: Modified By: Deva Winblood
//:: Modified Date: January 28th, 2008
//:://////////////////////////////////////////////
#include "x2_inc_restsys"
#include "x2_inc_switches"
#include "x3_inc_horse"
void main()
{
object oPC = GetLastPCRested();
object oMount;
if (!GetLocalInt(GetModule(),"X3_MOUNT_NO_REST_DISMOUNT"))
{ // make sure not mounted
/* Deva, Jan 17, 2008
Do not allow a mounted PC to rest
*/
if (HorseGetIsMounted(oPC))
{ // cannot mount
if (GetLocalInt(oPC,"X3_REST_CANCEL_MESSAGE_SENT"))
{ // cancel message already played
DeleteLocalInt(oPC,"X3_REST_CANCEL_MESSAGE_SENT");
} // cancel message already played
else
{ // play cancel message
FloatingTextStrRefOnCreature(112006,oPC,FALSE);
SetLocalInt(oPC,"X3_REST_CANCEL_MESSAGE_SENT",TRUE); // sentinel
// value to prevent message played a 2nd time on canceled rest
} // play cancel message
AssignCommand(oPC,ClearAllActions(TRUE));
return;
} // cannot mount
} // make sure not mounted
if (!GetLocalInt(GetModule(),"X3_MOUNT_NO_REST_DESPAWN"))
{ // if there is a paladin mount despawn it
oMount=HorseGetPaladinMount(oPC);
if (!GetIsObjectValid(oMount)) oMount=GetLocalObject(oPC,"oX3PaladinMount");
if (GetIsObjectValid(oMount))
{ // paladin mount exists
if (oMount==oPC||!GetIsObjectValid(GetMaster(oMount))) AssignCommand(oPC,HorseUnsummonPaladinMount());
else { AssignCommand(GetMaster(oMount),HorseUnsummonPaladinMount()); }
} // paladin mount exists
} // if there is a paladin mount despawn it
if (GetModuleSwitchValue(MODULE_SWITCH_USE_XP2_RESTSYSTEM) == TRUE)
{
/* Georg, August 11, 2003
Added this code to allow the designer to specify a variable on the module
Instead of using a OnAreaEnter script. Nice new toolset feature!
Basically, the first time a player rests, the area is scanned for the
encounter table string and will set it up.
*/
object oArea = GetArea (oPC);
string sTable = GetLocalString(oArea,"X2_WM_ENCOUNTERTABLE") ;
if (sTable != "" )
{
int nDoors = GetLocalInt(oArea,"X2_WM_AREA_USEDOORS");
int nDC = GetLocalInt(oArea,"X2_WM_AREA_LISTENCHECK");
WMSetAreaTable(oArea,sTable,nDoors,nDC);
//remove string to indicate we are set up
DeleteLocalString(oArea,"X2_WM_ENCOUNTERTABLE");
}
/* Brent, July 2 2003
- If you rest and are a low level character at the beginning of the module.
You will trigger the first dream cutscene
*/
if (GetLocalInt(GetModule(), "X2_G_LOWLEVELSTART") == 10)
{
AssignCommand(oPC, ClearAllActions());
if (GetHitDice(oPC) >= 12)
{
ExecuteScript("bk_sleep", oPC);
return;
}
else
{
FloatingTextStrRefOnCreature(84141 , oPC);
return;
}
}
if (GetLastRestEventType()==REST_EVENTTYPE_REST_STARTED)
{
if (!WMStartPlayerRest(oPC))
{
// The resting system has objections against resting here and now
// Probably because there is an ambush already in progress
FloatingTextStrRefOnCreature(84142 ,oPC);
AssignCommand(oPC,ClearAllActions());
}
if (WMCheckForWanderingMonster(oPC))
{
//This script MUST be run or the player won't be able to rest again ...
ExecuteScript("x2_restsys_ambus",oPC);
}
}
else if (GetLastRestEventType()==REST_EVENTTYPE_REST_CANCELLED)
{
// No longer used but left in for the community
// WMFinishPlayerRest(oPC,TRUE); // removes sleep effect, etc
}
else if (GetLastRestEventType()==REST_EVENTTYPE_REST_FINISHED)
{
// No longer used but left in for the community
// WMFinishPlayerRest(oPC); // removes sleep effect, etc
}
}
}
The exact wording of the comment on the standard X0_SAFEREST trigger is this:
“Paint this trigger down into any XP1 area that is rest restricted. Paint it in such a way that it encloses a small room and contains one door. That door has to exist for the rest to work and be closed otherwise the player will get a “This area is not secure” messag eand be prevented from resting.”
So, do I need to do more than set the module variable and lay out the trigger as described? I’m also considering making an item called iron spikes if I can find a miscellaneous object model that looks like iron spikes, and giving them a property of increased weight to further limit resting by either using the old method of laying a trigger over a trigger to activate a trigger or directly modifiying the rest script (so that in addition to needing to find a safe room, you need iron spikes to spike the door shut like old skool DnD). I also dont plan to have ambush encounters occur, so am I correct assuming that all I need to do is not make a wandering monster table? Also, am I correct in assuming you also need to check the area as no rest? Because the way I am planning it, you can just rest as much as you like in some areas like non-dangerous wilderness and inn rooms. Its the dungeon crawls and dangerous wilderness you need to find a small room to spike shut - and well, its not smart to just nap on some city street so Im just going to keep it simple and check the no rest box.
Also, which is the default include that contains the actual switch scripting for the X1 rest system switch mentioned above?