Aller au contenu

Photo

Multiplayer Faction Scripting


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

#1
gedweyignasia

gedweyignasia
  • Members
  • 16 messages

I understand that the faction system for NWN2 is thoroughly broken, but I'd like to give it a try anyway. My thought was to use the personal reputation functions.

 

Has anyone made a working faction system? Can anyone point me at any specific problems and/or workarounds?



#2
kevL

kevL
  • Members
  • 4 061 messages

you'd like to try what, specifically? PvP solo vs. solo, PvP faction vs faction, or NPC-faction vs NPC-faction, or NPC-faction vs PC-faction?

I've learned a lot (of not good stuff) about the last two but nothing really about the first two.



#3
gedweyignasia

gedweyignasia
  • Members
  • 16 messages

I want to be able to dynamically flag individual NPCs to become hostile or neutral to a specific player.

 

I've written my own system to manage factions as a whole, I just have to be able to get individual creatures to become hostile to specific players when they need to attack. (Otherwise you might issue an attack order, but the player register them as an enemy.)



#4
kevL

kevL
  • Members
  • 4 061 messages

the problem i encountered with Personal Reputations is that, when enabled, the AI refused to let Companions auto-attack.

( now that I think about it, that sorta makes sense ) But since i didn't want that, i dropped it and went global.

Have you tried messing around with Personal Reps on yet? Seems a fella would need 2+ computers to test it though. Even then, even if it works in particular, it wouldn't surprise me if an NPC that's hostile to one PC is also *red* to another PC, even if it doesn't attack.

worst case: it attacks anyway, meaning you'd have to redesign creature AI scripts (rather ingeniously -- then merely 'hope for the best' anyway).



#5
Psionic-Entity

Psionic-Entity
  • Members
  • 195 messages

Personal reputations works just fine for PCs but you can't flag NPCs as hostile without assigning them to a faction that is hostile to a particular PC, which might mean you need a lot of factions.



#6
gedweyignasia

gedweyignasia
  • Members
  • 16 messages

Personal reputations works just fine for PCs but you can't flag NPCs as hostile without assigning them to a faction that is hostile to a particular PC, which might mean you need a lot of factions.

 

Can you explain this in more words? I don't understand what you're telling me. :(



#7
gedweyignasia

gedweyignasia
  • Members
  • 16 messages

the problem i encountered with Personal Reputations is that, when enabled, the AI refused to let Companions auto-attack.

( now that I think about it, that sorta makes sense ) But since i didn't want that, i dropped it and went global.

Have you tried messing around with Personal Reps on yet? Seems a fella would need 2+ computers to test it though. Even then, even if it works in particular, it wouldn't surprise me if an NPC that's hostile to one PC is also *red* to another PC, even if it doesn't attack.

worst case: it attacks anyway, meaning you'd have to redesign creature AI scripts (rather ingeniously -- then merely 'hope for the best' anyway).

 

 

I saw you mention something like this in one of your earlier posts I stalked. I imagined I just have to get NPCs to ALSO set temporary hostile to companions/summons. (Or maybe use the NPC-to-NPC set hostile thing?)



#8
kevL

kevL
  • Members
  • 4 061 messages

idk, I didn't get far into PReps before deciding it was no-go for my intents.

That being, i was approaching it from the opposite direction: I noticed only that a Companion would not attack a creature that was PR-hostile to my PC (iirc, the creature was still blue to the Companion, while red to my PC -- this was well over a year ago, but I seem to recall being miffed that Companion couldn't even cast a spell to start his/her own aggro state). However, i did not check if the creature would initiate hostilities on the Companion ....
 

... I just have to get NPCs to ALSO set temporary hostile to companions/summons.


that would be nice. i mean it should work ...

Since some of the faction-functions are said to rely on PReps, including SetIsTemporary*(), I ended up going global and writing my own functions for setting and releasing reputations -- basically by plopping down a factionPig, setting its rep to the aggro'd party, then retrieving that rep after a certain amount of time (along with other conditions, like "no enemy faction member is in sight"), and deleting the pig ( PC faction doesn't do that, ofc ... how it feels about another 'faction' is decided by the player )

but again, that is global and I didn't even try to focus on a single player/PC.



#9
gedweyignasia

gedweyignasia
  • Members
  • 16 messages

Can you tell me any weird issues that I should keep in mind when working with personal reps, besides the companion/summons thing?



#10
kevL

kevL
  • Members
  • 4 061 messages

well not really.

but when you're working with NPC vs NPC factions, beware that my belief is that the faction table entries are reversed.



#11
kevL

kevL
  • Members
  • 4 061 messages

oh, and There appear to be three places that may (or may not) turn on/off PReps
1. onModLoad script
2. Campaign settings
3. individually for each faction in the Faction Table.

i have no clue what takes precedence over what, or what - i do global



#12
gedweyignasia

gedweyignasia
  • Members
  • 16 messages

Thanks!!! I'll post more when I get a proof-of-concept working and see how it breaks.