Author Topic: My monsters just stand there  (Read 550 times)

Legacy_Zeidae

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
My monsters just stand there
« on: September 06, 2011, 05:54:02 pm »


               Ok, so I have some monsters, but when they spawn, they don't do anything.

I've tried using the NW_C2  and X2_Def script sets.

Some monsters will fight after a couple of seconds but usually they all just stand there.

I had this problem before but always assumed it was from a laggy script I  was running. After everything I  tried failed, I  just went with the default script sets but still to no avail.

Any suggestions?
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
My monsters just stand there
« Reply #1 on: September 06, 2011, 06:26:23 pm »


               Check if they dont have Rapid Shot feat while using melee weapon. If so then download my patch, it fixes this issue. If not we need more details possible the whole creature exported.
               
               

               
            

Legacy_Zeidae

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
My monsters just stand there
« Reply #2 on: September 06, 2011, 06:45:30 pm »


               the monsters i am testing at the moment don't have the rapid shot feat or any equipment.

I don't need to try and describe everything I am doing when a freshly created monster with default scripts won't do anything.
If I attack the monsters they will all join in. They just won't initiate combat for some reason.
               
               

               
            

Legacy_ent.devil

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
My monsters just stand there
« Reply #3 on: September 06, 2011, 08:42:14 pm »


               Are they in the standard hostile faction (or one that is hostile to the player)?
               
               

               
            

Legacy_Zeidae

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
My monsters just stand there
« Reply #4 on: September 06, 2011, 09:41:20 pm »


               yeah, all hostile

I was finally able to fix the problem, but, I don't know HOW. Everything seems to be about the way I had it before. I changed the order of some lines, so perhaps it was hanging up somewhere. But I find that strange since it was the default NwN script set.

At least for the moment it appears to be working, but i've only seen 2 creatures. I will cross my fingers.

Thanks!
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
My monsters just stand there
« Reply #5 on: September 06, 2011, 09:46:26 pm »


               

Zeidae wrote...

 
I was finally able to fix the problem, but, I don't know HOW. Everything seems to be about the way I had it before. I changed the order of some lines, so perhaps it was hanging up somewhere. But I find that strange since it was the default NwN script set.

Thanks!


Just because you are using the default script set, does not mean that the scripts are still in there default state.   If you want to make sure that you are using the default scripts, delete any of them that you have in your module, that will make the game go back to loading them from the game files when they are called for.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
My monsters just stand there
« Reply #6 on: September 08, 2011, 11:56:21 pm »


               I have seen this sort of question from time to time, sometimes it's do to a change in the AI setting.
Where for example in some scripts you have the line concerning the AI setting return the script if that setting is low.  Also in the onspawn there are many changes/settings you could make to change the behaviors of creatures, cowardly, archers, ambushers, scocability, etc...So if you made any changes there as Lightfoot points out, you might have changed the behavior for many creatures.   But if it seems to working now that's good.
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
My monsters just stand there
« Reply #7 on: September 13, 2011, 06:49:02 am »


               Usually when you create a custom monster, sometimes, you will end up altering something that isn't standard, like you give them X levels with the level up wizard then change something.  Often when a monster has too many feats or feats they shouldn't have, that's when they get bugged.  Also caster often get bugged when they have too many spells.

Making non-standard mobs is rather time consuming & difficult because you have to test them like mad on a server & fix them A LOT, my best advice to you would be to use the AI Scripting (as ffbj suggest above) to FORCE the Mobs to do things, all you have to do is create some template monsters & make some template OnSpawn & OnHeartbeat scripts for them to make them do things specifically (very good for control).

I was working on a custom Monster Template system, but wanted to finish up my other work first, I'll get back to you when I finish that Builder's Resource.

This is something I use to referrence...


Actually you can set different combat behaviors using SoU's combat AI.

Just stick this in the creature's OmnSpawn and it will run away if the PC comes within melee range:
#include "x0_i0_anims"
void main()
{
SetCombatCondition(X0_COMBAT_FLAG_RANGED);
}

The available conditions are:

X0_COMBAT_FLAG_AMBUSHER (move out of sight range of enemy and use invisibility or hide then attack)
X0_COMBAT_FLAG_COWARDLY (good for animals)
X0_COMBAT_FLAG_DEFENSIVE (use defensive feats like knockdown and expertise)
X0_COMBAT_FLAG_RANGED (creature moves away when enemy comes within melee range)

If I need anything more specialized I make my own combat AI by setting a local string on the creature called X2_SPECIAL_COMBAT_AI_SCRIPT with the value being the name of the AI script I want it to run.


====================================

Ok, I have what I feel is a better mage, this is how it's done, properly...


Level up a Mage to say level 3, remove all his spells, then go to the level tab and without using the Level up Wizard, give the wizard as many levels as you want them to have as a caster, now go back to the Spells Tab and manually give them the spells you want them casting...  (If you give a NPC or Monster too many feats, this will bug them bad..)


Next, set these Variables on the Monster / NPC to control how they act...

Variable = What it does..   (Variables are set as Integers not strings!)

X2_L_BEH_OFFENSE = Chance of Peforming an Offensive Action (0 (never) to 100 / 100 = all the time)

(This more or less controls how often they cast a defensive spell or summons or a Hostile Spell)
(40 would mean more defensive casting, where 70 would mean more offensive casting)

X2_SPELL_RANDOM = Set that they randomly pick spells (not in order)  (Set to TRUE or 1)
(This can make them do bizzare actions, like cast a Horrid Wilting first followed by a buff spell)
(Which can be good for the PCs, giving them time to recover from pain.. '<img'>)

X2_L_BEH_MAGIC = Determines what % you want them casting magic..

So if you set it to 80, then they will use spells 80% of the time, and attack too
100 = Use Spells ONLY!



This will produce a very highly desirable caster, now you can also give them Haste & Quicken Spell 1/2/3 to make them a super mage!

I'm going to be tweaking monsters over the next few months, comming up with better monsters, overall..



Here are all of the other options you have for ALL Monsters / NPCs...

Simply set the variable on the monster/npc (variables use Parentheses "" )


//------------------------------------------------------------------------------
// How to Modify C R E A T U R E S Combat AI
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// * see x2_ai_demo for details
//------------------------------------------------------------------------------
const string CREATURE_VAR_CUSTOM_AISCRIPT = "X2_SPECIAL_COMBAT_AI_SCRIPT";


//------------------------------------------------------------------------------
// * Setting this variable on a creature will make its use a
// * random name.
// * see nw_c2_default9 for details.
//------------------------------------------------------------------------------
const string CREATURE_VAR_RANDOMIZE_NAME = "X2_NAME_RANDOM";

//------------------------------------------------------------------------------
// * Setting this variable on a spellcaster creature will make its spelluse a
// * bit more random, but their spell selection may not always be appropriate
// * to the situation anymore.
//------------------------------------------------------------------------------
const string CREATURE_VAR_RANDOMIZE_SPELLUSE = "X2_SPELL_RANDOM";

//------------------------------------------------------------------------------
// * Set to 1 to make the creature activate stealth mode after spawn
//------------------------------------------------------------------------------
const string CREATURE_VAR_USE_SPAWN_STEALTH = "X2_L_SPAWN_USE_STEALTH";

//------------------------------------------------------------------------------
// * Set to 1 to make the creature activate detectmode after spawn
//------------------------------------------------------------------------------
const string CREATURE_VAR_USE_SPAWN_SEARCH = "X2_L_SPAWN_USE_SEARCH";

//------------------------------------------------------------------------------
// * Set to 1 to make the creature play mobile ambient animations after spawn
//------------------------------------------------------------------------------
const string CREATURE_VAR_USE_SPAWN_AMBIENT = "X2_L_SPAWN_USE_AMBIENT";

//------------------------------------------------------------------------------
// * Set to 1 to make the creature play immobile ambient animations after spawn
//------------------------------------------------------------------------------
const string CREATURE_VAR_USE_SPAWN_AMBIENT_IMMOBILE = "X2_L_SPAWN_USE_AMBIENT_IMMOBILE";

//------------------------------------------------------------------------------
// * Set to 1 to make the creature immune to dispel magic (used for statues)
//------------------------------------------------------------------------------
const string CREATURE_VAR_IMMUNE_TO_DISPEL = "X1_L_IMMUNE_TO_DISPEL";

//------------------------------------------------------------------------------
// * Set this variable to 1 on a creature to make it walk through other creatures
//------------------------------------------------------------------------------
const string CREATURE_VAR_IS_INCORPOREAL = "X2_L_IS_INCORPOREAL";

//------------------------------------------------------------------------------
// * Set this variable to 1 - 6 to override the number of attacks a creature has based on its BAB
//------------------------------------------------------------------------------
const string CREATURE_VAR_NUMBER_OF_ATTACKS = "X2_L_NUMBER_OF_ATTACKS";

//------------------------------------------------------------------------------
// * The value of this variable (int) is added to the chance that a creature
// * will use magic in combat. Set to 100 for always, 0 for never
//------------------------------------------------------------------------------
const string CREATURE_AI_MODIFIED_MAGIC_RATE = "X2_L_BEH_MAGIC";

//------------------------------------------------------------------------------
// * The higher value of this variable, the higher the chance that the creature
// * will use offensive abilities in combat. Set to 0 to make them flee.
//------------------------------------------------------------------------------
const string CREATURE_AI_MODIFIED_OFFENSE_RATE = "X2_L_BEH_OFFENSE";

//------------------------------------------------------------------------------
// * The higher value of this variable, the higher the chance that the creature
// * will aid friendly creatures in combat. Not that helping usually degrades
// * the overall difficulty of an encounter, but makes it more interesting.
//------------------------------------------------------------------------------
const string CREATURE_AI_MODIFIED_COMPASSION_RATE = "X2_L_BEH_COMPASSION";

//------------------------------------------------------------------------------
// * This allows you to script items that enhance a palemaster's summoned creatures. You need
// * to put the name of a script into this variable that will be run on any creature called by
// * the pale master's summon undead ability. You can use this script to add effects to the creature.
// * You can use the OnEquip/OnUnEquip event hooks set this variable.
//------------------------------------------------------------------------------
const string CREATURE_VAR_PALE_MASTER_SPECIAL_ITEM = "X2_S_PM_SPECIAL_ITEM";




This is a template for Custom AI...
You have to set the variable X2_SPECIAL_COMBAT_AI_SCRIPT on the NPC / Monster for this script.


//::///////////////////////////////////////////////
//:: Custom AI Demo Template
//:: x2_ai_demo
//:: Copyright © 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
This is a template for those who want to
override the standard combat AI NWN uses.

The code in this file effectivly replaces
the DetermineCombatRound() function in
nw_i0_generic.nss, which is the core of the
NWN combat AI.

To override the default AI with this or any
other AI script you created, you can either
call the SetCreatureOverrideAIScript from
x2_inc_switches

*/
//:://////////////////////////////////////////////
//:: Created By: Georg Zoeller
//:: Created On: 2003-08-21
//:://////////////////////////////////////////////

#include "nw_i0_generic"
#include "x2_inc_switches"
void main()
{
// The following two lines should not be touched
object oIntruder = GetCreatureOverrideAIScriptTarget();
ClearCreatureOverrideAIScriptTarget();


// ********************* Start of custom AI script ****************************


// Here you can write your own AI to run in place of DetermineCombatRound.
// The minimalistic approach would be something like
//
// TalentFlee(oTarget); // flee on any combat activity


// ********************* End of custom AI script ****************************

// This line *** has to be called here *** or the default AI will take over from
// this point and really bad things are going to happen
SetCreatureOverrideAIScriptFinished();
}
               
               

               


                     Modifié par _Guile, 13 septembre 2011 - 01:30 .
                     
                  


            

Legacy_Zeidae

  • Jr. Member
  • **
  • Posts: 72
  • Karma: +0/-0
My monsters just stand there
« Reply #8 on: September 15, 2011, 04:42:59 pm »


               Thanks again for the replies. I'm not exactly sure what I did to fix the AI, but so far everything has been going smoothly. I've only fought a small portion of the monsters i've created, but i'm not expecting any problems. I've been careful to make sure creatures don't have too many spells. I'll have to see about too many feats. But really I could not be any happier with the way my creatures have turned out so far.