View previous topic :: View next topic |
Author |
Message |
Teakor
Joined: 25 Jun 2014 Posts: 4
|
Posted: Wed Jun 25, 2014 11:54 Post subject: |
|
|
Hi, I have a problem with this plugin.
When I go to recreate the geometry of a trap, which has been disarmed or triggered, nwserver crashes. This, from version 091 to 0941. From version 089 and earlier, recreates the trap, but when I try to disarm or activate it crashes nwserver.
Does anyone know how I could fix it?
The proplema occurs on any kind of windows you are using.
thanks |
|
Back to top |
|
|
Teakor
Joined: 25 Jun 2014 Posts: 4
|
Posted: Fri Jun 27, 2014 11:22 Post subject: |
|
|
Maybe I discovered what the problem is. The Traps that is created does not have a tag and resref |
|
Back to top |
|
|
Teakor
Joined: 25 Jun 2014 Posts: 4
|
Posted: Fri Jul 25, 2014 10:01 Post subject: |
|
|
Hello everyone, I managed to find the source code of the plugin and I have tried do some testing to solve the problem of the crash traps.
If I use system of plugins, which intercepts the function for creating geometry and apply the old geometry, as I said, when I interact with the trap, nwserver crashes.
Then I tried a trick, which is to change the geometry of the trap after its creation. The trap appears in the shape I want, but when I interact with her, as happens with the plugin. Nwnserver crashes
Some good soul more experienced than me, could give me a solution / help?
Thank you. |
|
Back to top |
|
|
magaiti
Joined: 08 Aug 2014 Posts: 7
|
Posted: Fri Aug 08, 2014 14:23 Post subject: BootPCWithMessage and custom TLK |
|
|
I have tried to use NWNXFuncs_BootPCWithMessage, passing a strref to custom TLK table (16777216 + string number in custom tlk).
This seems to work only in ~50% calls, in other cases I get message with same string number but from base tlk file. I think the code lacks the step where TLK file is chosen, and gets either base or custom tlk depending on garbage data or data from previous tlk fetch.
Any Ideas on how this can be fixed (other than modifying original tlk)?
PS:
well I guess i could call GetStringByStrRef() with same strref before calling nwnx. I'll try and see if this helps. |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Fri Aug 08, 2014 14:47 Post subject: |
|
|
Just checked the src code for funcs for windows.
DisconnectPlayer from CNetLayer is an inbuilt nwserver method.
It does take a TlkEntry int number, but no input for tlk files.
I would assume - since a module and therefore a server, can only be associated with one tlk file, it would choose the tlk file that the module has selected as its tlk file.
Are you sure that all the players have the exact version of the tlk file?
Its important to note that players only need to have a tlk file present with the right name, to get into a server. The contents can be different per client - and the only issue raised will be strings being missing or incorrect.
Code: |
int CNetLayer_s::DisconnectPlayer(unsigned long PlayerID, unsigned long tlkEntry, int a3) {
return CNetLayer__DisconnectPlayer(this, PlayerID, tlkEntry, a3);
}
int CNssPlayer::BootPCWithMessage(CGameObject *oObject, char *Params) {
int iMsg = 0;
CParams::ExtractP1(Params, iMsg);
CNWSObject *obj = oObject->AsNWSObject();
nwn_objid_t plID = obj->obj_id;
CNWSPlayer* pPlayer = ((*NWN_AppManager)->app_server)->GetClientObjectByObjectId(plID);
if(pPlayer != NULL) {
uint32_t pID = pPlayer->pl_id;
CNetLayer* netlayer = (*NWN_AppManager)->app_server->srv_internal->srv_network;
netlayer->DisconnectPlayer(pID, iMsg, 1);
return 1;
}
return 0;
}
|
If it is booting the player, then check the nwn_funcs.txt log file - see if it is receiving the right int value.
Make sure your definitely loading the same module with the correct tlk files.
The code doesn't appear to be incorrect. |
|
Back to top |
|
|
magaiti
Joined: 08 Aug 2014 Posts: 7
|
Posted: Fri Aug 08, 2014 16:24 Post subject: |
|
|
[08/08/2014 15:54:58] - StrReq: "BOOTPCWITHMESSAGE" Params: "16877814"
This has been returning both entry 100598 from dialog.tlk and entry 100598 from custom tlk, chosen seemingly at random.
I have tried several times within several minutes, connectiong from the same game client, with same account/character, into the same server. Both servers have same modules with same custom tlk file.
My guess is that bioware never considered giving modders control over boot messages. And the boot code was not revised when custom tlk support was intoduced in HotU. It might use a different method of fetching strrefs, not aware of custom tlk.
Maybe there is some known code there, to select a tlk file before fetching a string?
Adding GetStringByStrRef() prior to this command didn't help. |
|
Back to top |
|
|
magaiti
Joined: 08 Aug 2014 Posts: 7
|
Posted: Sun Aug 10, 2014 22:02 Post subject: |
|
|
Hey, I have found a bug which makes GetRemainingSpellSlots to always return 0
int CNssSpells::GetRemainingSpellSlots(CGameObject *oObject, char
if (cre->cre_stats->cs_classes[i].cl_class != SpellLevel)
- comparing class to spelllevel doesn't seem right.
Can i get a fix somewhere?
UPDATE: ugh, the whole spellslots code is a mess. only a few functions are working, by miracle no less. I guess I'll have to fix it myself.
I'm not done yet, but in case I will, how do I submit a patch? |
|
Back to top |
|
|
Kato
Joined: 05 Mar 2010 Posts: 47
|
Posted: Thu Jan 15, 2015 1:03 Post subject: NWNXFuncs_AddFeat() |
|
|
The function NWNXFuncs_AddFeat() works well for most feats, but in some cases the given feat has no effect, even though it is visible on the sheet. For instance, none of the epic feats like Great Str, Dex, Con do apply any ability modif after adding the feat.
Refreshing and even relogging changes nothing and the ability bonus is not part of the calculation on the combat log. Maybe the secret is the third parameter(iLevel), I'm not sure to understand what it does?
Thanks for any insight
Kato |
|
Back to top |
|
|
Baaleos
Joined: 02 Sep 2007 Posts: 830
|
Posted: Thu Jan 15, 2015 2:03 Post subject: |
|
|
ILevel allows you to specify what level the feat was 'gained' at.
Eg : if you de-level below this level: the feat will vanish.
One of two things is happening with the great <ability> feats.
1. You may need to add the iLevel argument - the engine may be iterating through every level and taking all the feats and skill / ability score gains and adding them up to produce a figure for the ability score bonus
2. The more likely case is that the feat gets recognised on level up as having the bonus ability points attached and those points get added by the engine (once) at level up. Level up is a very computationally complex process, so it may have code in there that automatically does the ability score bonuses in certain feat gains.
Try option 1 - use iLevel: if that doesn't work: you may need to do it manually |
|
Back to top |
|
|
Kato
Joined: 05 Mar 2010 Posts: 47
|
Posted: Thu Jan 15, 2015 2:46 Post subject: |
|
|
Test results:
if iLevel > 20 ;I get a corrupted toon
else ;the feat is added and displayed normally but without effect
Thus, no problem performing the upgrade manually, I just feared I had messed something, tyvm for such a quick answer, Baaleos |
|
Back to top |
|
|
Kato
Joined: 05 Mar 2010 Posts: 47
|
Posted: Thu Jan 15, 2015 20:25 Post subject: |
|
|
In case it can be helpful: NWNX_RemoveFeat() works well as long as you pass FALSE to the last argument. Otherwise, you end up removing the wrong feat, and possibly more than one at a time.
Kato |
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Thu Dec 15, 2016 5:06 Post subject: |
|
|
Does anyone know of a better method to remove feats from the level stat list?
I use the Enforce Legal Character, because I came from a server where they always just circumvented it somehow, even to the point of adding only small bonuses that were hard to detect.
Anyway I'd like to just remove the feats from the stat list, because even if it's removed from the general list, it will throw a "too many feats" error.
I tried doing it with Leto, but I couldn't get it to work... Even doing replace and delete. |
|
Back to top |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Thu Dec 15, 2016 18:50 Post subject: |
|
|
My lua plugin can do it, not directly but the feat functions add/remove will modify the levelstat list aswell. Its also possible to read it.
The lua functions: http://pastebin.com/FZP7xgWB
Where to get it: https://github.com/TerrahKitsune/NWNX
However it requires a bit of knowledge in lua. _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Fri Dec 16, 2016 0:16 Post subject: |
|
|
Can't lie there is some impressive options in that plugin... Might be worth learning LUA, I imagine the language is used in other things too. |
|
Back to top |
|
|
Terra_777
Joined: 27 Jun 2008 Posts: 216 Location: Sweden
|
Posted: Sat Dec 17, 2016 1:49 Post subject: |
|
|
You can just pass snippets of lua to the plugin, I can help you if you need to just do something simple. Its not all that unlike passing say, sql querries. _________________ I dun have any signature, I'm happy anyway. |
|
Back to top |
|
|
|