logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Faction Plugins?

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Lugoun



Joined: 18 May 2007
Posts: 36

PostPosted: Mon Jan 05, 2009 4:07    Post subject: Faction Plugins? Reply with quote

I've looked around a little, but didnt see any goodies for getting access into faction changes as an event. Is anyone aware of anything for this for NWNX4?

Im currently running about a dozen or more custom factions that players are part of and PC's get "reset" back to their kingdom default when they respawn (i.e. if they've attacked the local guards 'all is forgiven' when they respawn). But I need to get some persistent tracking for long term consequences and eventual permanent faction shifts. Doing this strictly through nwscript is likely to be a pain since there are no events for it.
_________________
Lugoun
www.hotta-rpg.org
Back to top
View user's profile Send private message
GodBeastX



Joined: 09 Aug 2006
Posts: 65

PostPosted: Mon Jan 05, 2009 22:39    Post subject: Reply with quote

You don't need a plugin for this.

Basically what you do is setup an area with entities that hold all the factions. Make sure they have no scripts, can't move, etc. They'll all just sit in there being dumb. You then give them a tag like "faction###". Then you can use built in NWN2 functions for gaining and losing rep with the factions, even use NWNX SQL Persistence to store and retrieve this information on character save/load.
Back to top
View user's profile Send private message
Lugoun



Joined: 18 May 2007
Posts: 36

PostPosted: Tue Jan 06, 2009 1:44    Post subject: Reply with quote

Yeah, I've already got a 'faction stable' and an extensive system in place to initially set each player's reputation with each NPC faction when they enter the module as well as adjusting whether each player is hostile towards the player of an opposing kingdom.

That is fairly easily controlled, as player's logging in are forced to go initially through our entry areas their first log in after a reboot on the way in to the main play areas. This isnt too horrible as it just occurs once and cycles through the stable of NPC's as players log in.

However, since there is no module event I can hook into when a faction change does occur (such as attacking a friendly guard), I would be forced to either cook up some periodic checks of some sort (cycling through each player and each player being cycled through each NPC faction rep), or link it to some events like resting, dying and death. I'm not sure if just linking to the OnClientLeave event would be sufficient (I guess I need to test if the GetPCPlayerName function works correctly in that event, I seem to remember issues with that in NWN1).

I was just hoping to only have to take those actions when it was necessary, such as when a PC's reputation towards an NPC faction had actually undergone a change.
_________________
Lugoun
www.hotta-rpg.org
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Thu Jan 08, 2009 14:16    Post subject: Reply with quote

In NWN1 (and probably NWN2), GetPCPlayerName() fails in OnClientLeave because the player object is no longer valid, though the character is (so most other functions work fine). A nice workaround for this is to set a local string containing the player name on the PC at login, and reference that on exit instead.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
GodBeastX



Joined: 09 Aug 2006
Posts: 65

PostPosted: Sat Jan 10, 2009 2:06    Post subject: Reply with quote

Why not link it to the AI scripts? I think there's enough info in the AI framework to know when a PC pisses them off and changes faction with them.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group