View previous topic :: View next topic |
Author |
Message |
VirgiL
Joined: 02 Apr 2010 Posts: 16
|
Posted: Sun Aug 14, 2011 21:34 Post subject: |
|
|
i've used function:
Code: |
NWNXFuncs_AddFeat(oPC, nFeat, -1);
NWNXFuncs_AddFeat(oPC, nFeat, 1);
|
and the first case did nothing - my character didn't got any feat granted... May i know if this is bug or just im stupid and dont know how to use this function?
the second case worked - my PC got the feat granted, however the feat is not in the "SPecial abilities" section while when i select this faet trough normal level-up, it is... bug? So it means the feat is useless when it's purpose was that the players will have to 'use' it (like a spell they put on quickbar) |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Sun Aug 14, 2011 21:37 Post subject: |
|
|
NWNXFuncs_AddFeat(oPC, nFeat, -1);
Wont work, because -1 is not valid for a level argument.
0 = Do not add to Level Stats list (this means it will be accessible at all levels)
1-40 = Puts the feat into that level stats list, meaning if you delevel, you will lose the feat.
If I use
NWNXFuncs_AddFeat(oPC, 1115, 0);
This gives me playertool10 at all levels.
NWNXFuncs_AddFeat(oPC, 1115, 5);
Will make me lose the playertool10 if I drop below level 5 etc. |
|
Back to top |
|
|
VirgiL
Joined: 02 Apr 2010 Posts: 16
|
Posted: Sun Aug 14, 2011 23:31 Post subject: |
|
|
my mystake, sorry
anyway, the most important part was still not answered:
Quote: |
the feat is not in the "SPecial abilities" section while when i select this faet trough normal level-up, it is... bug? So it means the feat is useless when it's purpose was that the players will have to 'use' it (like a spell they put on quickbar)
|
|
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Sun Aug 14, 2011 23:32 Post subject: |
|
|
what feat?
Feats that I add via this function, are accessible right away in the special abilities menu, if they are meant to. |
|
Back to top |
|
|
VirgiL
Joined: 02 Apr 2010 Posts: 16
|
Posted: Sun Aug 14, 2011 23:47 Post subject: |
|
|
a custom feat that is granted on 2nd levelby default (defined in cls_feat_*.2da)... i tried to grant that feat using nwnx func on iLevel = 0, 1 and 2 and still the feat is not shown under Special abilities - so i can't use it
cls_feat_*.2da says;
# FeatLabel FeatIndex List GrantedOnLevel Menu
<n> <label> <id> 3 2 1
not sure whats wrong
edit:
i've mistakenly edited the classes.2da file column FeatsTable - put some additional char inside so the cls_feat_<class>.2da file was not found at all even if the "correct" file contained correct settings (mentioned above...
thanks for willing for help, appreciated |
|
Back to top |
|
|
morikahn
Joined: 04 Aug 2006 Posts: 5
|
Posted: Tue Sep 13, 2011 4:36 Post subject: |
|
|
Would it be possible though clever use of the effect NWNXFuncs_EffectCustomEffect function to direct it to a custom entry on the effecticons.2da?
I'd like to be able to display custom icons for custom effects and immediate player notification purposes.
This is something you see often in games like WoW. In an action oriented situation, player's don't have to to read their logs (which get spammed with combat data), or peruse their journals. |
|
Back to top |
|
|
Aradan Kir
Joined: 23 Aug 2011 Posts: 8
|
Posted: Fri Sep 16, 2011 14:23 Post subject: |
|
|
Is there a bug with NWNXFuncs_GetSoundSetID?
On testing when I use this to try and retrieve the PCs soundset, it actually sets the soundset of the PC to 0.
Also, NWNXFuncs_SetSoundSetID doesn't seem to set a soundset, even if I put a manual integar in there (one which I know works).
Tested both in-game and then looking at the bic files directly in an external program.
Any suggestions - I'm looking for a way to modify the soundsets of PCs in-game without a relog. I've seen it on another world, so it's possible .... somehow! _________________ http://www.silver-spire.com |
|
Back to top |
|
|
Aradan Kir
Joined: 23 Aug 2011 Posts: 8
|
Posted: Sat Sep 17, 2011 11:28 Post subject: |
|
|
Failed.Bard on the Bioware forum sorted out a fix for this. The two functions in nwnx_funcs.nss need replacing with these below. Tested and all now works perfectly!
Code: | int NWNXFuncs_GetSoundSetID(object oCreature) {
SetLocalString(oCreature, "NWNX!FUNCS!SETSOUNDSETID", "-");
int ret = StringToInt(GetLocalString(oCreature, "NWNX!FUNCS!SETSOUNDSETID"));
DeleteLocalString(oCreature, "NWNX!FUNCS!SETSOUNDSETID");
return ret;
}
void NWNXFuncs_SetSoundSetID(object oCreature, int iSoundSetID) {
SetLocalString(oCreature, "NWNX!FUNCS!GETSOUNDSETID", IntToString(iSoundSetID));
DeleteLocalString(oCreature, "NWNX!FUNCS!GETSOUNDSETID");
} |
_________________ http://www.silver-spire.com |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Thu Dec 29, 2011 22:18 Post subject: v 0.0.9 update |
|
|
I hope I'm not messing anybody up who kept on developing nwnx_funcs...
Mainly changes in the code base this time:
Code: |
v 0.0.9
- Reworked the log mechanism so that it can be used in anywhere without a reference to CNWNXFuncs
- Changed the name of CGenericObject to CGameObject to conform to the general server api.
- Classes derived from CNWSObject use inheritance now instead of composition; saves some typing but true polymorphism seems out of the question (at least for me) since it would add
new virtual function tables and screw up the overlays.
- Fixed CNWSModule by adding CResHelper to the beginning which should make using the "mod+0x1C" pointer arithmatic obsolete
- Encapsulated script functions in their own classes
- Cleaner code
- Easier to add new functions (no more overflow of the function pointer array)
- Cuts down on recompile time
Fixed:
NWNXFuncs_Get/SetAutoRemoveKey should now work correctly (noob mistake in an if())
NWNXFuncs_Get/SetAutoRemoveKey should now also work on placeables
NWNXFuncs_Get/SetSoundSet should now work correctly ("get" called "set" and vice versa)
|
|
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Fri Dec 30, 2011 22:57 Post subject: |
|
|
Thanks for your dedication and hard work, MaxRock. You... Rock! |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Sat Dec 31, 2011 1:41 Post subject: |
|
|
No, unfortunately I don't...
I just found a serious bug which renders v0.0.9 unusable
Edit:
I've fixed it and v0.0.91 is up and doesn't crash anymore |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Sat Dec 31, 2011 12:04 Post subject: |
|
|
I've got your latest version (0.0.91) and can't seem to get NWNXFuncs_GetFirstArea and NWNXFuncs_GetNextArea to work on module load. I've got it calling after the SQLInit() call but the area it returns for NWNXFuncs_GetFirstArea is not valid.
Here's the code but I don't think it'll help much:
Code: |
object oArea = NWNXFuncs_GetFirstArea();
PrintString("Area = " + GetName(oArea)); // DEBUG
while(GetIsObjectValid(oArea))
{
PrintString("Area = " + GetName(oArea)); // DEBUG
string sSpawnID = GetResRef(oArea);
//string sRespawnPrefix = sSpawnID + "_respawn_";
//string sSpawnPrefix = sSpawnID + "_spawn_";
int iSpawnCount;
int iRespawnCount;
object oWaypoint = GetFirstObjectInArea(oArea);
while(GetIsObjectValid(oWaypoint))
{
string sResref = GetResRef(oWaypoint);
// Spawn waypoint
if(sResref == ZSS_SPAWN_WAYPOINT_RESREF)
{
iSpawnCount++;
//SetTag(oWaypoint, sSpawnPrefix + IntToString(iSpawnCount));
SetLocalArrayObject(oArea, ZSS_SPAWN_WAYPOINT_OBJECT_ARRAY, iSpawnCount, oWaypoint);
}
// Respawn waypoint
else if(sResref == ZSS_RESPAWN_WAYPOINT_RESREF)
{
iRespawnCount++;
//SetTag(oWaypoint, sRespawnPrefix + IntToString(iRespawnCount));
SetLocalArrayObject(oArea, ZSS_RESPAWN_WAYPOINT_OBJECT_ARRAY, iRespawnCount, oWaypoint);
}
oWaypoint = GetNextObjectInArea(oArea);
}
// Mark the number of spawn and respawn waypoints for this area
SetLocalInt(oArea, ZSS_SPAWN_WAYPOINT_COUNT, iSpawnCount);
SetLocalInt(oArea, ZSS_RESPAWN_WAYPOINT_COUNT, iRespawnCount);
// Mark the unique identifier (the resref)
SetLocalString(oArea, ZSS_WAYPOINT_NAME, sSpawnID);
// Move to the next area
oArea = NWNXFuncs_GetNextArea();
}
|
Thanks again for your hard work, bugs and all. |
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Sat Dec 31, 2011 21:20 Post subject: |
|
|
what does the nwnx_funcs log say? |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Sun Jan 01, 2012 2:37 Post subject: |
|
|
This is the only thing that pops up. Log level is set to 3. Should I raise it higher?
Quote: |
[12/31/2011 19:35:33] OnCreate DebugLevel: 3
[12/31/2011 19:35:33] Windows NWNX Funcs plugin v.0.0.9.1
[12/31/2011 19:35:33] * CreateNewGeometry hooked
[12/31/2011 19:35:33] * CustomEffect function hooked
[12/31/2011 19:35:33] * CNWVirtualMachineCommands__ExecuteCommandGetItemPropertyType hooked
[12/31/2011 19:35:33] * CNWVirtualMachineCommands__ExecuteCommandItemPropertyEffect hooked
[12/31/2011 19:35:33] * CNWSMessage__TestObjectVisible hooked
[12/31/2011 19:35:33] * CNWSCreatureStats__GetEffectImmunity hooked
[12/31/2011 19:35:33] * CServerExoAppInternal__RemovePCFromWorld hooked; script to run: rotd_mod_leavin.nss
|
|
|
Back to top |
|
|
MaxRock
Joined: 24 Jan 2008 Posts: 196
|
Posted: Sun Jan 01, 2012 10:05 Post subject: |
|
|
No, 3 should be enough.
There should be a "- ObjReq: XXXXXXXX Request: GETFIRSTAREA"
followed by "GetAreaByPos(x)" in there somewhere... uhm. Looks like that function is never actually called.
I assume it was working before?
Edit
Does anything else in OnModuleLoad work?
With a little testing I noticed my onload script isn't run at all (using resman; with and without nwnx_funcs.dll)
Edit2
Guess timing is important. I renamed nwnx_resman to nwnx_areasman - so that it gets loaded before any other plugins - and the onload script runs now, including GetFirstNextArea.
Code: |
[01/01/2012 02:22:04] Windows NWNX Funcs plugin v.0.0.9.1
[01/01/2012 02:22:04] log level: 3
[01/01/2012 02:22:04] * CreateNewGeometry hooked
[01/01/2012 02:22:04] * CustomEffect function hooked
[01/01/2012 02:22:04] * CNWVirtualMachineCommands__ExecuteCommandGetItemPropertyType hooked
[01/01/2012 02:22:04] * CNWVirtualMachineCommands__ExecuteCommandItemPropertyEffect hooked
[01/01/2012 02:22:04] * CNWSMessage__TestObjectVisible hooked
[01/01/2012 02:22:04] * CNWSCreatureStats__GetEffectImmunity hooked
[01/01/2012 02:22:04] * CServerExoAppInternal__RemovePCFromWorld hooked; script to run: onplayerleaving.nss
[01/01/2012 02:22:04] - ObjReq: 07C09DAC Request: GETFIRSTAREA
[01/01/2012 02:22:04] GetAreaByPos(0)
[01/01/2012 02:22:04] - ObjReq: 07C09DAC Request: GETNEXTAREA
[01/01/2012 02:22:04] GetAreaByPos(1)
[01/01/2012 02:22:04] - ObjReq: 07C09DAC Request: GETNEXTAREA
[01/01/2012 02:22:04] GetAreaByPos(2)
[01/01/2012 02:22:04] - ObjReq: 07C09DAC Request: GETNEXTAREA
[01/01/2012 02:22:04] GetAreaByPos(3)
[01/01/2012 02:22:04] - ObjReq: 07C09DAC Request: GETNEXTAREA
[01/01/2012 02:22:04] GetAreaByPos(4)
[01/01/2012 02:22:04] - ObjReq: 07C09DAC Request: GETNEXTAREA
[01/01/2012 02:22:04] GetAreaByPos(5)
[01/01/2012 02:22:04] - ObjReq: 07C09DAC Request: GETNEXTAREA
[01/01/2012 02:22:04] GetAreaByPos(6)
|
|
|
Back to top |
|
|
|