View previous topic :: View next topic |
Author |
Message |
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Sat Jul 29, 2017 22:34 Post subject: |
|
|
Finally it makes some sense, except I still cant figure out how to convert color code such as FOG_COLOR_RED = 16711680; into 3 these floats or integers (yes i can enter the values as 1.0 0.0 0.0)
In worst case I remake the functions to use 3 float values instead but I would rather use the FOG_COLOR_* codes. _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
DarkSet
Joined: 06 Jun 2016 Posts: 98
|
Posted: Sun Jul 30, 2017 13:32 Post subject: |
|
|
Quote: | EDIT: just realized this will make some issues.
Each time client shutdown nwn and restart it you must send him this function to disable it again. Now with this change, if he only exits server but do not shutdown client and logs it again, he will still have last value (ie disable) and disabling again make it enable.
To workaround this, you need to track clients on which you used DisableClientHighlightObject, and use it again to toggle it off when they leave server (OnClientExit) and reapply OnClientEnter if needed.
I suppose I can make this automatical and send it internally when player is leaving server, or to change the function to take integer parameter - yes/no. Let me know what you think. |
looks like we need here a function to getDisableHigtlightObjectStatus and to set it with true/false parameter. Or, maybe, even with oprions to enable/disable highlitning of object types. Like disable creature higlight, but not doors, etc.
And thank you for a great job done! It's making nwn better and better tool to create!
Actually about requests. There's a big, great gap of nwn 1 in custom GUIs. Maybe you can do something with nwnx and nwncx to make it possible to create custom gius? Message boxes, combo boxes, lists, button panels, anything already present in game, but customized with texts and action/event scripts? And maybe something completely custom?
For example - trade window with custom names for buttons and custom scripts on it's click. And custom scripts on open/close of course. Custom timer pannel, we already have several, but text can't be modified and cancel button action too. Custom message box is just not working and crushing client. Custom kick screen can display only tlk line, and it would be great to pass text value to it.
And as a part of it all or as a saparete thing - canceling positive effects in the effect list. We have the list, of effects, pictures there are great, and even the name can pop up, but no information about duration and no ability to cancel the effect if it's positive and you don't want it anymore.
And one more thing. Monk speed bonus. When I change creature speed with NWNx fuctions it works great, but monk speed bonus is added after it anyway. I saw in nwn documentation that nwn horses somehow disable monk speed while he's mounted. Maybe they just apply speed decrease equal to monk's bonus, I don't know. But have the ability to switch bonus on/off for a creature/PC would be great! |
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Mon Jul 31, 2017 1:47 Post subject: |
|
|
ShaDoOoW wrote: | Finally it makes some sense, except I still cant figure out how to convert color code such as FOG_COLOR_RED = 16711680; into 3 these floats or integers (yes i can enter the values as 1.0 0.0 0.0)
In worst case I remake the functions to use 3 float values instead but I would rather use the FOG_COLOR_* codes. |
Well you could always just use math.... Again the fog colors ARE using the very same numbers. Fog colors use the 0xFFFFFF method as well(EDIT, Also you can pass hex numbers as normal numbers in nwn just fine). The constants are simply the hex converted.... So for instance you just have to use math to convert 6684672 to it's hex equivalent to get the "FOG_COLOR_RED_DARK".
FROM NWSCRIPT:
Code: |
int FOG_COLOR_RED = 16711680;
int FOG_COLOR_RED_DARK = 6684672;
int FOG_COLOR_GREEN = 65280;
int FOG_COLOR_GREEN_DARK = 23112;
int FOG_COLOR_BLUE = 255;
int FOG_COLOR_BLUE_DARK = 102;
int FOG_COLOR_BLACK = 0;
int FOG_COLOR_WHITE = 16777215;
int FOG_COLOR_GREY = 10066329;
int FOG_COLOR_YELLOW = 16776960;
int FOG_COLOR_YELLOW_DARK = 11184640;
int FOG_COLOR_CYAN = 65535;
int FOG_COLOR_MAGENTA = 16711935;
int FOG_COLOR_ORANGE = 16750848;
int FOG_COLOR_ORANGE_DARK = 13395456;
int FOG_COLOR_BROWN = 10053120;
int FOG_COLOR_BROWN_DARK = 6697728;
|
|
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Mon Jul 31, 2017 23:19 Post subject: |
|
|
DarkSet wrote: | looks like we need here a function to getDisableHigtlightObjectStatus and to set it with true/false parameter. Or, maybe, even with oprions to enable/disable highlitning of object types. Like disable creature higlight, but not doors, etc. |
I will remake it into SetDisableHighlightObjects(object oPC, int bValue); should solve all issues.
Quote: | Actually about requests. There's a big, great gap of nwn 1 in custom GUIs. Maybe you can do something with nwnx and nwncx to make it possible to create custom gius? Message boxes, combo boxes, lists, button panels, anything already present in game, but customized with texts and action/event scripts? And maybe something completely custom? |
Not likely to happen from me unfortunately... Too difficult.
Quote: | And as a part of it all or as a saparete thing - canceling positive effects in the effect list. We have the list, of effects, pictures there are great, and even the name can pop up, but no information about duration and no ability to cancel the effect if it's positive and you don't want it anymore. |
I don't understand. Cancel effect? Any effect can be removed negative or positive, can you be more specific about what you want to achieve?
Quote: | And one more thing. Monk speed bonus. When I change creature speed with NWNx fuctions it works great, but monk speed bonus is added after it anyway. I saw in nwn documentation that nwn horses somehow disable monk speed while he's mounted. Maybe they just apply speed decrease equal to monk's bonus, I don't know. But have the ability to switch bonus on/off for a creature/PC would be great! |
The solution is to remove Monk Speed feat. I don't think its worth to add engine switch to disable it when it can be solved so easily.
If you want to keep Monk Speed feat visible in character feat list just completely override its values you need to make a new feat with same name/icon/etc. and replace the vanilla Monk Speed with this new feat (which will do nothing by default). That way PC won't notice a difference except the speed itself. _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
Antegate
Joined: 20 Apr 2012 Posts: 100
|
Posted: Thu Aug 03, 2017 8:38 Post subject: |
|
|
Is it possible аdd an OnOpen and OnClose event to creatures аnd make the constants on the ADD_ITEM and REMOVE_ITEM working in OnDisturbed event to creatures? |
|
Back to top |
|
|
DarkSet
Joined: 06 Jun 2016 Posts: 98
|
Posted: Thu Aug 03, 2017 22:14 Post subject: |
|
|
Quote: | I don't understand. Cancel effect? Any effect can be removed negative or positive, can you be more specific about what you want to achieve? |
well, it's about gui again. I mean cancel effect by click ot double click or right click on effect icon in effects list. For player to do it without special tokens and other developer help.
And add shoing remaining time for effect there.
One can manipulate effects from scripts, yes, I know this. It's just about GUI.
Quote: | The solution is to remove Monk Speed feat. I don't think its worth to add engine switch to disable it when it can be solved so easily. |
I thought add and remove feat functions work with adding and removing feats on PC creature hide item. You say it really changes char file? Basic feats taken on level up?
I mean if I remove the feat from char itself, and then add it to the hide - it won't be taken by delevel automatically if monk was not the first class and I have to manage this as well. And maybe something more. |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Sun Aug 06, 2017 9:13 Post subject: |
|
|
DarkSet wrote: | I thought add and remove feat functions work with adding and removing feats on PC creature hide item. You say it really changes char file? Basic feats taken on level up?
I mean if I remove the feat from char itself, and then add it to the hide - it won't be taken by delevel automatically if monk was not the first class and I have to manage this as well. And maybe something more. |
Currently nwnx_patch doesn't have the function RemoveFeat so using nwnx_funcs is recommended.
But since the monk speed feat is added on 3rd level. Assuming this is for new module/persistent world, all you need is to remove the feat from cls_feat_monk.2da and add this 2da into hak. That way players never even get this feat. You can replace it there with your custom feat that does nothing and recalculate the speed manually using SetMovementRate function or EffectMovementSpeedIncrease.
If you got there already characters with monk speed, function for removing feats is needed. For adding feat, either use AddFeat from nwnx_funcs which allows you to specify level which will then remove feat automatically on losing level or recalculate bonus feats on levelup/delevel.
I am not sure now if I added the script for delevel, but nwnx_patch will execute 70_mod_leveldown. _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Sun Aug 06, 2017 10:13 Post subject: |
|
|
Antegate wrote: | Is it possible аdd an OnOpen and OnClose event to creatures аnd make the constants on the ADD_ITEM and REMOVE_ITEM working in OnDisturbed event to creatures? | but creatures cannot add/remove item from inventory... _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Wed Aug 09, 2017 13:55 Post subject: |
|
|
EDIT: nvm, i tested with nonmonk character and reproduced the bug _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Wed Aug 09, 2017 20:58 Post subject: |
|
|
NWNCX_Patch and NWNX_Patch v1.28
DOWNLOAD
Fixes:
- SetMovementRate function will now restore movement if previous value was immobile
New features and improvements:
- NWNXPatch_DisableClientObjectHighlight changed to NWNXPatch_SetDisableObjectHighlight(object oPlayer, int bDisable); to avoid issues where you cannot know for sure whats the value client is entering your module
- additionally, object highlighting should get resetted for players when leaving module/server where the builder disabled it so they can again highlight objects in other modules/servers
- NWNXPatch_HighlightObject function improved, now takes the single color parameter that matches FOG_COLOR_* constants (and thus you can mix your own color using hexadecimal input in NWscript)
New custom functions:
- NWNXPatch_GetEffectRemainingDuration
Notes:
From now on, all the custom scripts, vanilla scripts edits, custom 2das, and vanilla 2da edits will be inside the archive with plugins. Also, there is a documentation folder which contains copies of the documentation I wrote on my Google Drive and also variables.txt file which should list all possible variables that plugin registers. Majority of them should be already used by custom functions in 70_inc_nwnx, feel free to create custom function and send the code to me for those missing.
The documentation is however still slightly outdated. Hopefully I will find mood/time to update it for next release.
I am thinking about renaming 70_inc_nwnx to nwnx_patch as I don't think it will be part of community patch 1.72 anymore. _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Last edited by ShaDoOoW on Wed Aug 09, 2017 21:45; edited 1 time in total |
|
Back to top |
|
|
Antegate
Joined: 20 Apr 2012 Posts: 100
|
Posted: Wed Aug 09, 2017 21:43 Post subject: |
|
|
Thanks |
|
Back to top |
|
|
highv priest
Joined: 01 Mar 2013 Posts: 111
|
Posted: Thu Aug 10, 2017 17:12 Post subject: |
|
|
ShaDoOoW wrote: |
- NWNXPatch_HighlightObject function improved, now takes the single color parameter that matches FOG_COLOR_* constants (and thus you can mix your own color using hexadecimal input in NWscript)
|
Awesome look forward to using this. |
|
Back to top |
|
|
ShaDoOoW
Joined: 20 Aug 2005 Posts: 584
|
Posted: Fri Aug 11, 2017 19:22 Post subject: |
|
|
DarkSet wrote: | Found a couple of bugs in dwarver defender's defensive stance:
1. If you unequip weapon while in stance it cancels. That's not right. Disarm works as well. In the same time - you can activate stance without weapon in hands, so looks like the reason is in uneqiupment process, not in fact of empty hands.
2. If you use a potion in stance - it cancels. Havn't check other type of actions like using scrolls, activationg items or abilities.
3. Not sure of this is a bug or normal - when use whirlwind attack in stance - it deactivates. |
Got into this one when polishing old code.
Managed to do this. Defensive Stance will not deactivate unless manually canceled and in addition the softcoded script allows to make "mobile defensive stance".
Question is: should spellcasting be allowed by default? I can see this a bit controversial change although nothing in rules actually says otherwise. _________________ Community Patch / NWNX Patch / NWNX Files / NWNX Connect |
|
Back to top |
|
|
DarkSet
Joined: 06 Jun 2016 Posts: 98
|
Posted: Fri Aug 11, 2017 21:33 Post subject: |
|
|
Quote: | Question is: should spellcasting be allowed by default? I can see this a bit controversial change although nothing in rules actually says otherwise. |
if one can cast in expertise why not to cast in defensive stance? Developer can always softcode 100% spellbreake. |
|
Back to top |
|
|
Valbor
Joined: 26 Dec 2016 Posts: 145
|
Posted: Sat Aug 12, 2017 10:30 Post subject: |
|
|
Is it possible the OnDamage event to PC in your's patch or functions Get and SetEventScript?
I tried to use NWNXFuncs_SetEventScript(object oObject, string sScript, int iEvent), but my server is crashing and i don't know what that reason is.
Also replacing nwnx_patch.dll from v1.27 on v1.28 i have stopped running the server from using nwnx, reason also unknown |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|