I've set up a simple test convo with a npc where a plot flag is triggered that has a script that switches the npc's team to turn hostile. It works great, test convo ends and the two npc's before the player turn hostile. however.... they don't attack the player and even weirder is as the player you can select the hostile npcs the player will :"face off" with one of them but neither of them attacks. The to npc's just end up threatening over and over. Anybody have a idea of whats going on?
Npc is hostile yet not attacking.
Débuté par
carmadaum
, avril 27 2010 09:17
#1
Posté 27 avril 2010 - 09:17
#2
Posté 27 avril 2010 - 11:42
Lots of possibilities. To start with the most obvious, do you have a script attached to the NPCs, and if so, is it either creature_core or does i fall through to creature_core?
Are you setting the plot flag on the last node of the conversation? If not, that could cause some weirdness if later flags are clearing commands or some such (the same could be true if there is an end conversation flag on the root node, which fires after the last line).
Is there custom AI on the creatures? What are you doing to turn the team hostile? UT_TeamGoesHostile is generally your best bet for that.
Are you setting the plot flag on the last node of the conversation? If not, that could cause some weirdness if later flags are clearing commands or some such (the same could be true if there is an end conversation flag on the root node, which fires after the last line).
Is there custom AI on the creatures? What are you doing to turn the team hostile? UT_TeamGoesHostile is generally your best bet for that.
#3
Posté 28 avril 2010 - 11:52
All the settings are basic... the npcs are on the core script as well as the area and the plot flag is on the last npc line in the convo. I'm using this script:
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_naldis_bank"
int StartingConditional()
{
event eParms = GetCurrentEvent(); // Contains all input parameters
int nType = GetEventType(eParms); // GET or SET call
string strPlot = GetEventString(eParms, 0); // Plot GUID
int nFlag = GetEventInteger(eParms, 1); // The bit flag # being affected
object oParty = GetEventCreator(eParms); // The owner of the plot table for this script
object oConversationOwner = GetEventObject(eParms, 0); // Owner on the conversation, if any
int nResult = FALSE; // used to return value for DEFINED GET events
object oPC = GetHero();
plot_GlobalPlotHandler(eParms); // any global plot operations, including debug info
if(nType == EVENT_TYPE_SET_PLOT) // actions -> normal flags only
{
int nValue = GetEventInteger(eParms, 2); // On SET call, the value about to be written (on a normal SET that should be '1', and on a 'clear' it should be '0')
int nOldValue = GetEventInteger(eParms, 3); // On SET call, the current flag value (can be either 1 or 0 regardless if it's a set or clear event)
// IMPORTANT: The flag value on a SET event is set only AFTER this script finishes running!
switch(nFlag)
{
case GUARDS_ATTACK:
{
//This causes all members of the bandit's "team" (the bandit and
//the other bar patrons) to turn hostile. Since they're in the presence
//of the player already, they'll immediately percieve him and initiate
//combat.
UT_TeamGoesHostile(5);
break;
}
}
}
else // EVENT_TYPE_GET_PLOT -> defined conditions only
{
}
plot_OutputDefinedFlag(eParms, nResult);
return nResult;
}
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_naldis_bank"
int StartingConditional()
{
event eParms = GetCurrentEvent(); // Contains all input parameters
int nType = GetEventType(eParms); // GET or SET call
string strPlot = GetEventString(eParms, 0); // Plot GUID
int nFlag = GetEventInteger(eParms, 1); // The bit flag # being affected
object oParty = GetEventCreator(eParms); // The owner of the plot table for this script
object oConversationOwner = GetEventObject(eParms, 0); // Owner on the conversation, if any
int nResult = FALSE; // used to return value for DEFINED GET events
object oPC = GetHero();
plot_GlobalPlotHandler(eParms); // any global plot operations, including debug info
if(nType == EVENT_TYPE_SET_PLOT) // actions -> normal flags only
{
int nValue = GetEventInteger(eParms, 2); // On SET call, the value about to be written (on a normal SET that should be '1', and on a 'clear' it should be '0')
int nOldValue = GetEventInteger(eParms, 3); // On SET call, the current flag value (can be either 1 or 0 regardless if it's a set or clear event)
// IMPORTANT: The flag value on a SET event is set only AFTER this script finishes running!
switch(nFlag)
{
case GUARDS_ATTACK:
{
//This causes all members of the bandit's "team" (the bandit and
//the other bar patrons) to turn hostile. Since they're in the presence
//of the player already, they'll immediately percieve him and initiate
//combat.
UT_TeamGoesHostile(5);
break;
}
}
}
else // EVENT_TYPE_GET_PLOT -> defined conditions only
{
}
plot_OutputDefinedFlag(eParms, nResult);
return nResult;
}
#4
Posté 29 avril 2010 - 12:05
Haven't had much time to fiddle with this since I got exams going on but I deleted the two npc's that i had in the area at first and then added in some other enemy npcs that i've used earlier in the mod that are already set hostle into the area and I get the same problem. So i'm guess this is a problem with the area itself, or maybe even the lvl? I don't know.
#5
Posté 29 avril 2010 - 02:07
I have no idea what the problem was exactly but it had to do with the fact the the lvl that it was in was a two story house. I deleted the 2nd floor (gonna turn the second floor into a lvl of its own) and it fixed the problem.
#6
Posté 29 avril 2010 - 03:03
So the problem was that dragon age doesn't support the type of level layout you made. No stacked walkable layers, unfortunately.
#7
Posté 29 avril 2010 - 08:19
Even though you can navigate overlapping spaces using WASD on PC, the point and click pathfinding, as well as NPC pathfinding, is based on a 2d walkmesh that can't overlap. Most likely the enemies were trying to attack, but the pathfinding they were on and all the pathfinding between them and their target was invalid, so they couldn't move.





Retour en haut






