View previous topic :: View next topic |
Author |
Message |
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Tue Jul 25, 2017 17:53 Post subject: |
|
|
Just found out I completely screwed the server functions into client updates.
Probably none of the recent functions that forces to update values on client (if he is in area) will not work correctly.
EDIT: function SetAreaColor will be removed and reworked into two functions so if you use it wait for bit longer it will get changed completely... _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Wed Jul 26, 2017 1:24 Post subject: |
|
|
NWNCX_Patch and NWNX_Patch v1.26
DOWNLOAD
Fixes:
- fixed functions requiring client to update area
EDIT: - setting no rest flag will now work also for players inside area automatically
New custom functions:
int NWNXPatch_GetAreaAmbientColor(object oArea, int nType);
void NWNXPatch_SetAreaAmbientColor(object oArea, int nType, int nColor);
int NWNXPatch_GetAreaDiffuseColor(object oArea, int nType);
void NWNXPatch_SetAreaDiffuseColor(object oArea, int nType, int nColor);
int NWNXPatch_GetAreaShadowsEnabled(object oArea, int nType);
void NWNXPatch_SetAreaShadowsEnabled(object oArea, int nType, int bShadowsEnabled);
int NWNXPatch_GetAreaChanceOfLightning(object oArea);
void NWNXPatch_SetAreaChanceOfLightning(object oArea, int nChance);
int NWNXPatch_GetAreaSpotModifier(object oArea);
void NWNXPatch_SetAreaSpotModifier(object oArea, int nModifier);
int NWNXPatch_GetAreaListenModifier(object oArea);
void NWNXPatch_SetAreaAreaListenModifier(object oArea, int nModifier);
Notes:
I tested only Get/Set ambient and diffuse, dont be suprised it other functions wont work properly.
I removed GetAreaColor and SetAreaColor and replaced them with new functions Get/SetAreaAmbient/DiffuseColor as I found out fog color can be changed using vanilla functions. I also made it so these functions share parameters with SetFogColor function. This means the functions accepts the constants FOG_COLOR_*. These constants are not representing all color choices though, see NWN Lexicon, the info on SetFogColor apply to new functions as well.
I can add function to change fog clip distance and shadow opacity only if I knew what this actually do.
EDIT: just noticed the typo in last function name. This will get changed next tim to the "SetAreaListenModifier". _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Last edited by ShaDoOoW on Wed Jul 26, 2017 17:18; edited 1 time in total |
|
Back to top |
|
|
Antegate
Joined: 20 Apr 2012 Posts: 100
|
Posted: Wed Jul 26, 2017 5:25 Post subject: |
|
|
Thanks much)
Quote: | EDIT: just noticed the typo in last function name. This will get changed next tim to the "SetAreaListenModifier". |
) |
|
Back to top |
|
|
Valbor
Joined: 26 Dec 2016 Posts: 145
|
Posted: Wed Jul 26, 2017 7:15 Post subject: |
|
|
NWNXPatch_SetCurrentHitPoints not working in multiplayer. |
|
Back to top |
|
|
Antegate
Joined: 20 Apr 2012 Posts: 100
|
Posted: Wed Jul 26, 2017 11:45 Post subject: |
|
|
Quote: | int NWNXPatch_GetAreaAmbientColor(object oArea, int nType);
void NWNXPatch_SetAreaAmbientColor(object oArea, int nType, int nColor);
int NWNXPatch_GetAreaDiffuseColor(object oArea, int nType);
void NWNXPatch_SetAreaDiffuseColor(object oArea, int nType, int nColor);
int NWNXPatch_GetAreaShadowsEnabled(object oArea, int nType);
int NWNXPatch_GetAreaChanceOfLightning(object oArea);
void NWNXPatch_SetAreaChanceOfLightning(object oArea, int nChance);
int NWNXPatch_GetAreaSpotModifier(object oArea);
int NWNXPatch_GetAreaListenModifier(object oArea); |
is working
Quote: | void NWNXPatch_SetAreaAreaListenModifier(object oArea, int nModifier);
void NWNXPatch_SetAreaSpotModifier(object oArea, int nModifier); |
is working. Is this displayed in the hero's properties?
Quote: |
void NWNXPatch_SetAreaShadowsEnabled(object oArea, int nType, int bShadowsEnabled);
|
Not working. Does nothing.
Last edited by Antegate on Wed Jul 26, 2017 11:58; edited 1 time in total |
|
Back to top |
|
|
Antegate
Joined: 20 Apr 2012 Posts: 100
|
Posted: Wed Jul 26, 2017 11:50 Post subject: |
|
|
Hero's range of visibility. He sees the tiles until he conceals the fog (FOG_TYPE_SUN / FOG_TYPE_MOON)
Shadow distance visibility |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Wed Jul 26, 2017 13:32 Post subject: |
|
|
Antegate wrote: |
void NWNXPatch_SetAreaAreaListenModifier(object oArea, int nModifier);
void NWNXPatch_SetAreaSpotModifier(object oArea, int nModifier);
is working. Is this displayed in the hero's properties? |
no its hidden value completely _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Last edited by ShaDoOoW on Wed Jul 26, 2017 14:41; edited 1 time in total |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Wed Jul 26, 2017 14:40 Post subject: |
|
|
Valbor wrote: | NWNXPatch_SetCurrentHitPoints not working in multiplayer. |
Tested it in both single and multiplayer and works. Check out nwnx_patch log, if there is some error message on the function. Also note function only allows to set hitpoints below MAX HP. What number are you trying to set? I tried 1, worked.
Antegate wrote: | void NWNXPatch_SetAreaShadowsEnabled(object oArea, int nType, int bShadowsEnabled);
Not working. Does nothing. |
Works for me properly in both client and server. nType must be 0/1/2 ie. FOG_TYPE_* constants and bShadowsEnabled must be 0 or 1. And if its multiplayer, client needs to run nwncx_patch.
Check for nwnx_patch.txt/nwncx_patch.txt for errors. _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
Antegate
Joined: 20 Apr 2012 Posts: 100
|
Posted: Wed Jul 26, 2017 14:57 Post subject: |
|
|
Quote: | Works for me properly in both client and server. nType must be 0/1/2 ie. FOG_TYPE_* constants and bShadowsEnabled must be 0 or 1. And if its multiplayer, client needs to run nwncx_patch.
Check for nwnx_patch.txt/nwncx_patch.txt for errors. |
yes, is working. |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Wed Jul 26, 2017 16:30 Post subject: |
|
|
I am taking requests for more new functions. Maybe its also time to "steal" functions from other plugins, which I did so far only if I needed said function for my softcoded scripts.
Also, managed to make HighlightObject(oPlayer, oObject) which will highlight specific object for specific PC (like if you pressed TAB ingame but for 1 object only). _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
Antegate
Joined: 20 Apr 2012 Posts: 100
|
Posted: Wed Jul 26, 2017 16:47 Post subject: |
|
|
Quote: | HighlightObject(oPlayer, oObject) |
cool
Is it possible to turn off the highlighting altogether?
Quote: | I am taking requests for more new functions. |
What about those queries about the events of the Journal and the Group? |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Wed Jul 26, 2017 16:55 Post subject: |
|
|
Antegate wrote: | Quote: | HighlightObject(oPlayer, oObject) |
cool
Is it possible to turn off the highlighting altogether?
Quote: | I am taking requests for more new functions. |
What about those queries about the events of the Journal and the Group? |
Yes I think thats possible to do. But it will work only with nwncx_patch so any player who would want to avoid being unable to highlight all objects would just need to play game without plugin. But now there is verifyclientrunningnwncx which should help in those cases.
Those are events not functions . _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
Antegate
Joined: 20 Apr 2012 Posts: 100
|
Posted: Wed Jul 26, 2017 17:17 Post subject: |
|
|
Quote: | Yes I think thats possible to do. But it will work only with nwncx_patch so any player who would want to avoid being unable to highlight all objects would just need to play game without plugin. But now there is verifyclientrunningnwncx which should help in those cases. |
Add this feature?
Quote: | Those are events not functions |
sorrow... (T_T)
Is it possible to import improvements for the RetrieveCampaignObject function? |
|
Back to top |
|
|
Valbor
Joined: 26 Dec 2016 Posts: 145
|
Posted: Wed Jul 26, 2017 17:25 Post subject: |
|
|
ShaDoOoW wrote: | Valbor wrote: | NWNXPatch_SetCurrentHitPoints not working in multiplayer. |
Tested it in both single and multiplayer and works. Check out nwnx_patch log, if there is some error message on the function. Also note function only allows to set hitpoints below MAX HP. What number are you trying to set? I tried 1, worked. |
NWNXFuncs_SetCurrentHitPoints(oPC, GetMaxHitPoints(oPC));
NWNXPatch_SetCurrentHitPoints(oPC, GetMaxHitPoints(oPC));
Well I used both of these functions when NWNXFuncs_SetCurrentHitPoints; restored HP, but your NWNXPatch_SetCurrentHitPoints not restored, and if you have it working properly, maybe it's my problem perhaps due to the fact that i use 2 different plugin? |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Wed Jul 26, 2017 18:35 Post subject: |
|
|
Antegate wrote: |
Add this feature?
Is it possible to import improvements for the RetrieveCampaignObject function? |
Yes I want to definitely add this. I already made it work. The only question is how should this be done.
- ini option in nwnplayer.ini ?
- variable on module ?
As for RetrieveCampaignObject, I am afraid this won't be in my abilities for now as the code for linux is a mess and I don't even understand it. Try request it in windows odbc plugin thread, maybe virusman will update it.
Valbor wrote: | NWNXFuncs_SetCurrentHitPoints(oPC, GetMaxHitPoints(oPC));
NWNXPatch_SetCurrentHitPoints(oPC, GetMaxHitPoints(oPC));
Well I used both of these functions when NWNXFuncs_SetCurrentHitPoints; restored HP, but your NWNXPatch_SetCurrentHitPoints not restored, and if you have it working properly, maybe it's my problem perhaps due to the fact that i use 2 different plugin? |
Seems I was only testing with value 1 which worked, trying to set GetMaxHitpoints() failed because the function is trying to avoid errors and won't let you set hitpoints higher than max hitpoints. Unfortunately setting hitpoints for creature needs to calculate constitution bonus in it. I checked nwnx_funcs and this plugin is doing it the same way but without any sanity checks, so I think I just remove the check for max hitpoints and its done. _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
|