Aller au contenu

Photo

possable to set PC to Special faction script, On player Enter script.


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

#1
Araticus

Araticus
  • Members
  • 2 messages
so i ve been wondering how would one go about Adding a PC to a faction in the game.
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
Mudeye

Mudeye
  • Members
  • 126 messages
Your PCs faction is who you like, not who likes you. A PC has his own faction. The player gets to decide who he likes, the programmer has no say in it. You can, however, make the NPC's hostile or friendly to the PC using their factions.

#3
Baragg

Baragg
  • Members
  • 271 messages
On SM, we split the PCs into good/evil by giving the PC a no-drop item. Then when the NPCs perceive the PC they will check weather the PC has the good or evil item. If the NPCs are part of the good faction and the PC has the good item no probs but if the PC has the evil item they attack. So you could create the different factions then have items for them and have the differing factions check for said items and react accordingly.

#4
Baaleos

Baaleos
  • Members
  • 1 330 messages
Note

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
Araticus

Araticus
  • Members
  • 2 messages
ok i may have to look into the Non-drop items. any idea where i could start for finding a script to make the items?



And what of the on player enter gold exp script? how would i go about doing that?

#6
TSMDude

TSMDude
  • Members
  • 865 messages
Vidorin's Factions By Token System

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
MiraQ

MiraQ
  • Members
  • 3 messages
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); 
   }
}

#8
kalbaern

kalbaern
  • Members
  • 824 messages

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. :) If they can, would that be the best method as well? IE... would a placeable demand fewer resources?

Modifié par kalbaern, 07 janvier 2011 - 07:26 .


#9
MiraQ

MiraQ
  • Members
  • 3 messages
According to the NWN Lexicon, it won't work to use a placeable as reference.
http://www.nwnlexico...reputation.html