Thanks
Allowed Resting Trigger
Débuté par
Snottling
, août 14 2010 02:21
#1
Posté 14 août 2010 - 02:21
Hey hey! How does the Allowed Resting Trigger work? I thought it was a simple matter of putting the trigger where you wanted PC's to rest in a no-rest area, but nope, I can't get it to work. Any ideas?
Thanks
Thanks
#2
Posté 14 août 2010 - 05:52
AFAIK there isnt "Allowed Resting" trigger in standard NWN trigger blueprints. Only X0_SAFEREST which I guess should be if you are using the x2 ambush rest system.
Anyway if you want to restrict resting to small area, you must not checked No Resting flag on area, because it dont work the way you think. Al resting system work reverse, they disallow you to rest if you are not in resting zone and the game engine hopefully do not strip boosts from you if the rest is canceled in first second.
BTW I got Allow Resting Trigger, see this code:
Trigger OnEnter
Then this code goes into OnPlayerRest event:
Anyway if you want to restrict resting to small area, you must not checked No Resting flag on area, because it dont work the way you think. Al resting system work reverse, they disallow you to rest if you are not in resting zone and the game engine hopefully do not strip boosts from you if the rest is canceled in first second.
BTW I got Allow Resting Trigger, see this code:
Trigger OnEnter
The trigger OnEnter script is not needed actually, it will work right without it, as you can see everything this trigger does is to flash rest button so player will know, he just entered resting area. However the trigger tag must be REST_ZONE !void main()
{
object oPC = GetEnteringObject();
if(GetIsPC(oPC))
{
SetPanelButtonFlash(oPC,PANEL_BUTTON_REST,TRUE);
DelayCommand(10.0,SetPanelButtonFlash(oPC,PANEL_BUTTON_REST,FALSE));
}
}
Then this code goes into OnPlayerRest event:
As you can see it just cancel the rest if player is not in allow resting triggervoid main()
{
object oRestZone, oPC = GetLastPCRested();
switch(GetLastRestEventType())
{
case REST_EVENTTYPE_REST_STARTED:
DeleteLocalInt(oPC,"PC_Damage");
oRestZone = GetNearestObjectByTag("REST_ZONE",oPC);
if(oRestZone != OBJECT_INVALID && !GetIsInSubArea(oPC,oRestZone))
{
// The resting system has objections against resting here and now
// Probably because there is an ambush already in progress
DelayCommand(0.1,FloatingTextStrRefOnCreature(84142,oPC));
AssignCommand(oPC,ClearAllActions());
}
}
}
#3
Posté 14 août 2010 - 11:59
Thanks, I will try it out.





Retour en haut






