Aller au contenu

Photo

non-aggro mobs


  • Veuillez vous connecter pour répondre
16 réponses à ce sujet

#1
Werkaldegim

Werkaldegim
  • Members
  • 19 messages
Hi everyone,
I have a question, is it possible to make an passive monsters by scripting. I would like to make the monster hostile but passive until we don't attack/cst spell at mob. I tried many compilations but it always fails, if the mod doesn't attack, he doesn't do that at all, in other case he attacks only if we continue battle.

ps.
sorry for my bad english :P

#2
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Yes, but it'd be somewhat complicated, requiring edits to the ai scripts. It might be simplest to use a second copy of the monster with the scripts removed, and swap em out as needed.



Funky

#3
Xenovant

Xenovant
  • Members
  • 95 messages
If you remove the "on perception" script, the creature won't see/hear you when you are near  but if you attack it, it will counterattack

Modifié par Xenovant, 02 décembre 2010 - 02:49 .


#4
Mudeye

Mudeye
  • Members
  • 126 messages
I know this isn't exactly what you said, but, you can also change their faction in a script so they start non-hostile and you change the faction to hostile. Or make a faction that will not normally attack but will fight back it you attack it.

#5
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

Xenovant wrote...

If you remove the "on perception" script, the creature won't see/hear you when you are near  but if you attack it, it will counterattack


Good Idea,

Going with Xenovant's thought I cam up with this.

 #include "nw_i0_generic"
void main()
{
  int bRiotState =GetLocalInt(GetArea(OBJECT_SELF),"RIOT_STATE");
  int bMyState = GetLocalInt(OBJECT_SELF,"MY_STATE");
  // Check to see if there has been a change in the mobs state.
  if ( bMyState != bRiotState )
  {
    // There has been a change check to see wich one.
    if (bMyState)
    {
       //MyState was true so the I was rioting and the riot is now over.
       //Stop fighting and clear my state.
       ClearAllActions(TRUE);
       SetLocalInt(OBJECT_SELF,"MY_STATE",0);
    }
    else
    {
       //MyState was false so a riot has just started.
       //Set MyState to true and make sure I start fighting enemys in the area.
       SetLocalInt(OBJECT_SELF,"MY_STATE",1);
       DetermineCombatRound();
    }
  }
  // If we are in riot open our eyes, If not keep them closed.
  if( bRiotState ) ExecuteScript("nw_c2_default2",OBJECT_SELF);
}


Place it in the OnPerception event of your Mob.  Then inorder to start/stop the riot all you have to do is change the  LocalInt "RIOT_STATE" on the area..  Set it to true and they will fight.  Set it to false and the will close there eyes to enemys around them.

#6
Werkaldegim

Werkaldegim
  • Members
  • 19 messages
Well, it works but I have already tried this way and this is not exactly what I expected. If you ever played mmo (I bet you do) there are many passive mobs, which attack only if we provoke them. Of course it is not possible to make in nwn use only factions, just because if we set faction at neutral, we can't attack the target until we use this crappy "circle attack manu" (I hope you understand what I mean :P).



So.. if you guys have any other ideas, i'll be waiting :)

#7
CheeseshireCat

CheeseshireCat
  • Members
  • 48 messages
Actually, you can put the "crappy attack menu" icon onto your quickbar and then it's just two clicks (or a keypress and a click).

#8
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages
Oh, I think I understand now. Just make a custom faction, non-global, that is non-hostile to players. They won't attack unless players attack them.



Funky

#9
Werkaldegim

Werkaldegim
  • Members
  • 19 messages
It was my first thought Funky, but even non-global faction after attack changes all mobs with that faction to hostile. As you can see it is not possible to use. i've been trying to change all default scripts with DetermineCombatRound(); function but it still not working.

This defaults are:

OnCombatRoundEnd - nw_c2_default3

OnDamaged - nw_c2_default6

OnDisturbed - nw_c2_default8

OnPerception - nw_c2_default2

OnPhysicalAttacked - nw_c2_default5

OnSpellCastAt - nw_c2_defaultb

In case removal/change OnDisturbed/OnPerception script the effect is correct but still global(when I attack one monster all response). After OnCombatRoundEnd removal/change mob is only hostile by one round. In all other cases mobs don't attack in general ;/

#10
Xenovant

Xenovant
  • Members
  • 95 messages
look in the onphysical and onspell scripts for this string: "SetSummonHelpIfAttacked();" and delete/comment it


EDIT: I mean to resolve that  "all creatures attack" issue

Modifié par Xenovant, 03 décembre 2010 - 10:20 .


#11
FunkySwerve

FunkySwerve
  • Members
  • 1 308 messages

Werkaldegim wrote...

It was my first thought Funky, but even non-global faction after attack changes all mobs with that faction to hostile.

Only in the same area - that's what non-global denotes. If that's not good enough, just reset the party's faction reputation ondeath (default7).

Funky

#12
Werkaldegim

Werkaldegim
  • Members
  • 19 messages
Well it works fine, but when I kill one mob all others become peaceful. Slowly I begin to think, this cannot be done... (finally nwn is not wow)

#13
NorthWolf

NorthWolf
  • Members
  • 86 messages
I'm confused. Don't you want other mobs to become non-hostile after you've dispatched whatever particular mob you enraged...? Or do they become non-hostile even if they were previously in active combat with you?

#14
Werkaldegim

Werkaldegim
  • Members
  • 19 messages

NorthWolf wrote...

they become non-hostile even if they were previously in active combat with you

Yes, that's the problem. Actually, I would like for the other mobs do not attack even if I'm in a fight with the other. This cannot be done on factions, because after attack all mobs are going "red". So, I think the only option is to make them hostile but change scripts... yeah, how to do that ? :P

#15
kalbaern

kalbaern
  • Members
  • 824 messages
Or just make several custom factions that are neutral to each other as well as to PCs. Making them "Local" and not "Global" is key as well. Or are you building an areas with for example all orcs and you want only those in the nearest group attacked to become hostile and not others?

#16
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
One problem with the help you are getting here is that non of us really know what you want. So far I see nothing you have asked for that can not be done. Here are a few questions.



If you only want one mob fighting at a time. How are you telling the mobs appart?

Are there more then one mob in an area?

Are there mobs in more then one area?

Are we useing the same deffinition of mob? (a group gathering in protest of something)

How do you want the mod to act as a whole?

How do you want each mob member to act as a single creature?

Once a mob member starts fighting do you ever want him to stop before death? Perhaps, When if the PC are beaten back.

Do you want them to react to anyother monsters/factions or just PC's?

#17
Invisig0th

Invisig0th
  • Members
  • 170 messages
Factions are only part of the answer here -- and not really even the most important part.

This Bioware tutorial will explain pretty much everything related to what you are trying to do. It's a bit complicated, but they have some great examples here of how the game uses several things together to create enemy behavior, exactly how and why creatures help each other out, and exactly how you can circumvent that default behavior.

Factions, Shouts and Attacking My Enemy

Modifié par Invisig0th, 07 décembre 2010 - 11:01 .