Give Feat
#1
Posté 16 juin 2011 - 10:16
Is there a function, or a series of functions, that allow a PC to permanently gain a feat?
Thanks!
#3
Posté 17 juin 2011 - 01:01
#4
Posté 17 juin 2011 - 01:34
The easiest way to see what bonus feats can be added is to copy/past this into the script editor, move the cursor to the IP_CONST_*, and press F2. That should give you the full list of constants you can choose from.
#include "x2_inc_itemprop"
void main()
{
// You'll have to decide what method you're using to assign the feat to know how
// you're determining oPC. OBJECT_SELF is just so it'll compile as is right now.
object oPC = OBJECT_SELF;
// if present, the creature skin is always in this slot, whether PC, NPC, or creature.
object oSkin = GetItemInSlot (INVENTORY_SLOT_CARMOUR, oPC);
// As an example, I've chosen knockdown as the bonus feat, but it can be any that's
// been defined as being able to be a bonus feat. I can't remember the 2da offhand.
itemproperty ipSkin = ItemPropertyBonusFeat (IP_CONST_FEAT_KNOCKDOWN);
// I greatly prefer the safe add script to the standard add item property script.
// You need the include in this script in order to access it, but it's worth it.
// Four straight-forward lines and you're done.
IPSafeAddItemProperty(oSkin, ipSkin, 0.0f, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE);
}
Modifié par Failed.Bard, 17 juin 2011 - 01:35 .
#5
Posté 17 juin 2011 - 01:55
The reason I was asking for this is that I have some custom feats and I'm planning on doing some scripted checks to see whether the PC's have them or not. If I add the feats to their skins, would I have to check to see if their skins have the feat?
Modifié par Ralthis, 17 juin 2011 - 01:56 .
#6
Posté 17 juin 2011 - 01:59
As for checking it, GetHasFeat used on the player should report back that the player has the feat, whether they have it normally or it's granted by an item or on the skin.
#7
Posté 17 juin 2011 - 07:20
Kato
Modifié par Kato_Yang, 17 juin 2011 - 07:28 .
#8
Posté 17 juin 2011 - 07:27
Modifié par Kato_Yang, 17 juin 2011 - 07:28 .
#9
Posté 17 juin 2011 - 09:36
Modifié par Xardex, 17 juin 2011 - 09:36 .
#10
Posté 17 juin 2011 - 02:15
Xardex, would that require the people who play my module to have NWNX as well?
#11
Posté 17 juin 2011 - 02:51
The Linux version of it is far more developed at the moment, since the functions are generally written for it first then ported to windows, but both versions allow for permanent adding and removing of feats, as well as event hooking and other useful options not available in NWScript normally.
#12
Posté 17 juin 2011 - 06:53
Modifié par Xardex, 17 juin 2011 - 06:53 .
#13
Posté 18 juin 2011 - 02:22
As far as changes can it change names and such without the player having to make a whole new toon?
Modifié par MyKiara, 18 juin 2011 - 02:23 .
#14
Posté 18 juin 2011 - 05:27
NWNX-Leto allows you to edit the .bic file of any toon. it means virtually any field of the bic file can be edited. Although FunkySwerve could probably tell you more than anyone on the subject, a good place to start to get the infos would probably be the NWNX web site. Simply google NWNX and you're there.(besides, it's amazingly instructive to examine the Higher Ground Legendary Levels system, wich uses NWNX-Leto to modify toons on level-up. Look at the script: hgll_inc_leto and many things will become clear)MyKiara wrote...
How do you do the changes to the toons through NWNX. I have it up and running our server but only as a watchdog for reboots and such. I haven't used it for much else. (Mainly because I had no idea what it all it is capable of!)
As far as changes can it change names and such without the player having to make a whole new toon?
Kato
#15
Posté 18 juin 2011 - 05:32
Kato_Yang wrote...
NWNX-Leto allows you to edit the .bic file of any toon. it means virtually any field of the bic file can be edited. Although FunkySwerve could probably tell you more than anyone on the subject, a good place to start to get the infos would probably be the NWNX web site. Simply google NWNX and you're there.(besides, it's amazingly instructive to examine the Higher Ground Legendary Levels system, wich uses NWNX-Leto to modify toons on level-up. Look at the script: hgll_inc_leto and many things will become clear)
:crying:I will check all this out but as far as looking at a script to figure it out I may end up more lost than I am right now! I have figured out some scripts and learned how to change by looking at them, but others give me a headache and I have no idea how to figure anything out on those.
Thanks though and I will go back to the NWNX website and see what I can learn from there too. I am trying hard to learn the scripting and how things work. I just did my first script completely from scratch and it didn't quite work the way I wanted it to.
Modifié par MyKiara, 18 juin 2011 - 05:33 .
#16
Posté 18 juin 2011 - 05:43
Kato
(kato2200@gmail.com)
#17
Posté 18 juin 2011 - 04:20
Modifié par Xardex, 18 juin 2011 - 04:21 .
#18
Posté 18 juin 2011 - 04:51
That's all correct. The thing that motivates most people to use leto instead is unrelated to any of this, and something I make a point of posting when I mention it: nwnx_funcs requires linux.Xardex wrote...
Use nwnx_funcs. Unlike letoscript, its just a bunch of new functions in an include script and you can do pretty much everything with it that leto can, and more. Letoscript is hard to get into, no matter what anyone says. Also to my understanding leto requires player booting to change the .bic's while nwnx_funcs does not.
Funky
#19
Posté 18 juin 2011 - 05:02
That said, since most of the scripts are developed in the linux version then ported over, the linux version of nwnx has far more options.
#20
Posté 18 juin 2011 - 05:25
Funky
#21
Posté 11 septembre 2012 - 09:51
int GetArmorAC(object oObject);
void SetArmorAC(object oObject, int iAC);
void SetGoldPieceValue(object oObject, int iValue);
void SetTag(object oObject, string sValue);
void SetRacialType(object oObject, int nRacialType);
int GetDescriptionLength(object oObject);
string GetDescription(object oObject);
string SetDescription(object oObject, string sNewDescription);
string GetConversation(object oObject);
int GetUndroppableFlag(object oItem);
void SetUndroppableFlag(object oItem, int bUndroppable);
int GetItemWeight(object oObject);
void SetItemWeight(object oObject, int nWeight);
string GetEventHandler(object oObject, int nEventId);
void SetEventHandler(object oObject, int nEventId, string sScript);
int GetFactionID(object oObject);
void SetFactionID(object oObject, int nFaction);
float GetGroundHeight(location lLocation);
int GetIsWalkable(location lLocation);
object GetFirstArea();
object GetNextArea();
void Set2DAString(string s2DA, string sColumn, int nRow, string sValue);
void SetMovementRate(object oCreature, int nMovementRate);
void ActionUseItemOnObject(object oItem, object oTarget, int nPropertyNum = 0);
void ActionUseItemAtLocation(object oItem, location lLocation, int nPropertyNum = 0);
int GetPCPort(object oPlayer);
void BootPCWithMessage(object oPC, int nStrRef);
int JumpToLimbo(object oObject);
int GetIsVariableValid(struct scriptvar svVariable);
struct scriptvar GetFirstLocalVariable(object oObject);
struct scriptvar GetNextLocalVariable(object oObject);
int GetItemCount(object oTarget);
object GetItemByPosition(object oTarget, int nPosition);
object IntToObject(int nObjectID);
this was the "complete function list" from the readme of 1.9.0. is there more complete documentation somewhere else?
Modifié par acomputerdood, 11 septembre 2012 - 09:52 .
#22
Posté 12 septembre 2012 - 12:14
Modifié par Squatting Monk, 12 septembre 2012 - 12:17 .
#23
Posté 12 septembre 2012 - 11:31
or is there another way around it?
#24
Posté 13 septembre 2012 - 12:01
acomputerdood wrote...
i'm going to go ahead and guess you have to turn off Enforce Legal Characters on the server if you use the AddKnownFeat() func, yes?
or is there another way around it?
Having never used nwnx, I am going to guess yes,
A Way Around it, Hmm, If the AddFeat function lets you remove feats also, Or if there is a function that allows you to remove feats. I guess that you could add a few extra Dummy feats to the Character class, and remove them when you add a new feat. I dont know I would have to think about and work that out.
Main Question: Can you also remove feats?





Retour en haut







