possable to set PC to Special faction script, On player Enter script.
#1
Posté 17 décembre 2010 - 06:53
ex. John is a PC and who also wants to join the Knights of Alexandria, the KoA are fighting the Knights of Kione. is it possable to giv the player eiter an item that makes him part of the faction? or is there a Special script i can use to add the PC to the Faction?
Also i want a Script were when the player enters the server, if Part of a faction he or she will recive Gold and EXP, the gold and Exp of course being for there training while being part of the faction.
Anyone thing they can help me out?
#2
Posté 17 décembre 2010 - 07:15
#3
Posté 17 décembre 2010 - 07:41
#4
Posté 17 décembre 2010 - 08:09
In terms of factions and how they work in nwn.
A faction is basically another term for 'party'
If you use the AddToFaction function or whatever it is called, on two Players, it will make them 'join' eachothers party.
If you do however manage to 'set' the faction of a player to one of the NPC general factions, it can have adverse results.
Eg - Hundreds of npcs appearing as party members, sometimes not possible to get out through doorways etc...
I have used the dm console to set factions mainly for roleplay reasons, allowing me to make a dragon friendly to players, or to make a commoner suddenly become hostile. etc
In short, if you want to affect how a faction feels towards you or your players, you need to Alter your reputation in the eyes of that faction.
This is how alot of PW's are set up, making vampire players friendly to other vampires, but hostile to humans, or humans friendly with Humans, but hostile to the undead etc....
Note - if you want to take this one step further, you can actually force pvp via setting player hostility towards one another, if they are of differing factions.
I do this in my new module, and have the pvp controls hooked in nwnx, preventing friendly behavior towards others of different race. (Partying however allows co-op - Im not a completely evil person)
#5
Posté 17 décembre 2010 - 09:07
And what of the on player enter gold exp script? how would i go about doing that?
#6
Posté 18 décembre 2010 - 01:09
Kingdom of Paramon PW
If you use the Kingdom of Paramon module there is a faction system in there that allows you to do some nice things.
Second God War
2nd God has some great features and ideas as well.
And for a easy to use set up script of gold and all that, Sir Elric's Simple New Player Setup v1.5 does not get much easier to use.
#7
Posté 07 janvier 2011 - 04:45
- Create two NPCs in areas in your module where they won't be disturbed by anything. They can't be invulnerable or immortal. Their tags could be "factionnpc_koa" and "factionnpc_kok".
- Include nw_i0_plot in your OnClientEnter script, so HasItem will work (#include "nw_i0_plot").
- Do the following modification to the OnClientEnter event:
if(HasItem(oPC, "faction_koa"))
{
//Set factions friendly and hostile
AdjustReputation(oPC, GetObjectByTag("factionnpc_koa"), 100); //KoA faction will be friendly
AdjustReputation(oPC, GetObjectByTag("factionnpc_kok"), -100); //KoK faction will be hostile
if(!(GetLocalInt(oPC, "faction_koa"))
{
//Reward gold and exp
GiveXPToCreature(oPC, 100);
GiveGoldToCreature(oPC, 100);
SendMessageToPC(oPC, "You have received gold and exp for training as a Knight of Alexandria.");
//Make sure this only happens the first time you log in so it can't be exploited by logging in and out all the time.
SetLocalInt(oPC, "faction_koa", 1);
}
}
#8
Posté 07 janvier 2011 - 07:25
MiraQ wrote...
Say you create an item for the Knights of Alexandria. Let's give it the tag "faction_koa". In the OnClientEnter event in your module, the PC (GetEnteringObject()) will be oPC below.
- Create two NPCs in areas in your module where they won't be disturbed by anything. They can't be invulnerable or immortal. Their tags could be "factionnpc_koa" and "factionnpc_kok".
- Include nw_i0_plot in your OnClientEnter script, so HasItem will work (#include "nw_i0_plot").
- Do the following modification to the OnClientEnter event:
if(HasItem(oPC, "faction_koa"))
{
//Set factions friendly and hostile
AdjustReputation(oPC, GetObjectByTag("factionnpc_koa"), 100); //KoA faction will be friendly
AdjustReputation(oPC, GetObjectByTag("factionnpc_kok"), -100); //KoK faction will be hostile
if(!(GetLocalInt(oPC, "faction_koa"))
{
//Reward gold and exp
GiveXPToCreature(oPC, 100);
GiveGoldToCreature(oPC, 100);
SendMessageToPC(oPC, "You have received gold and exp for training as a Knight of Alexandria.");
//Make sure this only happens the first time you log in so it can't be exploited by logging in and out all the time.
SetLocalInt(oPC, "faction_koa", 1);
}
}
I've not tried it yet, but since placeables use factions, couldn't they be used for referrences instead of NPCs as is usually suggested? I'm just curious.
Modifié par kalbaern, 07 janvier 2011 - 07:26 .
#9
Posté 08 janvier 2011 - 01:59
http://www.nwnlexico...reputation.html





Retour en haut







