How can I go about stopping an NPC from area transitioning?
Stop NPC from Area Transitioning
Débuté par
Chris Lefforge
, sept. 24 2010 12:55
#1
Posté 24 septembre 2010 - 12:55
#2
Posté 24 septembre 2010 - 03:53
You need to give a lot more information about when this is happening.
#3
Posté 24 septembre 2010 - 04:00
There is a module level setting that you have to set to true to allow npcs to transition areas. You may have that set to true. If your using custom transition scripts you can simply set a check in there to disallow npc using the transition.
#4
Posté 28 septembre 2010 - 12:06
ooh ..Baragg could you specify where this module setting is ?
#5
Posté 28 septembre 2010 - 04:19
The modules onmodload script there is a switch such as:
// * AI: Activating the switch below will make the creaures using the WalkWaypoint function
// * able to walk across areas
// SetModuleSwitch (MODULE_SWITCH_ENABLE_CROSSAREA_WALKWAYPOINTS, TRUE);
Is is in the default script x2_mod_def_load, your module may have a custom script in that handle so whatever is in that module level handle.
// * AI: Activating the switch below will make the creaures using the WalkWaypoint function
// * able to walk across areas
// SetModuleSwitch (MODULE_SWITCH_ENABLE_CROSSAREA_WALKWAYPOINTS, TRUE);
Is is in the default script x2_mod_def_load, your module may have a custom script in that handle so whatever is in that module level handle.
#6
Posté 28 septembre 2010 - 08:15
Just make sure that your onmodule load Event has X2_inc_switches included at the top. then add this line to the viod main.
SetModuleSwitch (MODULE_SWITCH_ENABLE_CROSSAREA_WALKWAYPOINTS, FALSE);
It should be false by default. So if that does not solve your porblem you may need to search for where it is getting set to true at in your scripts and delete it from the script.
SetModuleSwitch (MODULE_SWITCH_ENABLE_CROSSAREA_WALKWAYPOINTS, FALSE);
It should be false by default. So if that does not solve your porblem you may need to search for where it is getting set to true at in your scripts and delete it from the script.
#7
Posté 28 septembre 2010 - 08:26
Just an FYI on the function.
If the NPC is hostile and the player uses a door transition from one area to the next, as when fleeing, setting that particular module switch will not stop the hostile from going through the area transition as they chase the PC. This is because the above function only stops NPCs from using a transition while processing the walkwaypoint routine where the waypoints are in different areas.
A hostile creature will still follow through a door to door area transition regardless of the TRUE / FALSE setting.
FP!
If the NPC is hostile and the player uses a door transition from one area to the next, as when fleeing, setting that particular module switch will not stop the hostile from going through the area transition as they chase the PC. This is because the above function only stops NPCs from using a transition while processing the walkwaypoint routine where the waypoints are in different areas.
A hostile creature will still follow through a door to door area transition regardless of the TRUE / FALSE setting.
FP!
#8
Posté 28 septembre 2010 - 09:52
You will want to alter the default script "nw_g0_transition". This is an example that does currently work that you could try(I just added the parts in red):
////////////////////////////////////////////////////////////
// OnClick/OnAreaTransitionClick
// NW_G0_Transition.nss
// Copyright © 2001 Bioware Corp.
////////////////////////////////////////////////////////////
// Created By: Sydney Tang
// Created On: 2001-10-26
// Description: This is the default script that is called
// if no OnClick script is specified for an
// Area Transition Trigger or
// if no OnAreaTransitionClick script is
// specified for a Door that has a LinkedTo
// Destination Type other than None.
////////////////////////////////////////////////////////////
//:: Modified By: Deva Winblood
//:: Modified On: Apr 12th, 2008
//:: Added Support for Keeping mounts out of no mount areas
//::////////////////////////////////////////////////////////
#include "x3_inc_horse"
#include "x0_inc_henai"
void main()
{
object oClicker=GetClickingObject();
if (GetIsInCombat(oClicker) && !GetIsPC(oClicker))
{
AssignCommand(oClicker, ClearAllActions(TRUE));
AssignCommand(oClicker, ActionMoveAwayFromObject(OBJECT_SELF, FALSE, 5.0));
return;
}
object oTarget=GetTransitionTarget(OBJECT_SELF);
location lPreJump=HORSE_SupportGetMountLocation(oClicker,oClicker,0.0);
Hope that helps.
Note: I did not post the whole script. I just posted the first little bit of it to show what I added to it.
////////////////////////////////////////////////////////////
// OnClick/OnAreaTransitionClick
// NW_G0_Transition.nss
// Copyright © 2001 Bioware Corp.
////////////////////////////////////////////////////////////
// Created By: Sydney Tang
// Created On: 2001-10-26
// Description: This is the default script that is called
// if no OnClick script is specified for an
// Area Transition Trigger or
// if no OnAreaTransitionClick script is
// specified for a Door that has a LinkedTo
// Destination Type other than None.
////////////////////////////////////////////////////////////
//:: Modified By: Deva Winblood
//:: Modified On: Apr 12th, 2008
//:: Added Support for Keeping mounts out of no mount areas
//::////////////////////////////////////////////////////////
#include "x3_inc_horse"
#include "x0_inc_henai"
void main()
{
object oClicker=GetClickingObject();
if (GetIsInCombat(oClicker) && !GetIsPC(oClicker))
{
AssignCommand(oClicker, ClearAllActions(TRUE));
AssignCommand(oClicker, ActionMoveAwayFromObject(OBJECT_SELF, FALSE, 5.0));
return;
}
object oTarget=GetTransitionTarget(OBJECT_SELF);
location lPreJump=HORSE_SupportGetMountLocation(oClicker,oClicker,0.0);
Hope that helps.
Note: I did not post the whole script. I just posted the first little bit of it to show what I added to it.
Modifié par GhostOfGod, 28 septembre 2010 - 09:55 .
#9
Posté 29 septembre 2010 - 01:04
Nice because having monsters follow you thru transitions isnt what I want them to do.





Retour en haut






