logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
NWNX_Patch
Goto page Previous  1, 2, 3 ... 17, 18, 19 ... 42, 43, 44  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Wed Jul 26, 2017 19:19    Post subject: Reply with quote

Quote:
- ini option in nwnplayer.ini ?

this
---
Could you put a list of all the levers for the plug-in?
I suspect that new ones have been added that are not known Smile
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Jul 27, 2017 17:32    Post subject: Reply with quote

The option to turn off TAB key feature must be variable actually...

I am still solving the HighlightObject function. Found out its possible to highlight object in several colors (red, green, light purple, bright white), but even after several hours I couldn't decrypt the color codes. They don't match anything already used in game elsewhere like fog colors.

So there are three options:
- make it so it will always highlight in bring white
- make it so it will highlight in a color it would be highlighted if player pressed TAB (ie. enemies red, friendlies green, player purple, rest white)
- let scripter choose one of these colors with additional parameter
- let scripter mix his own color using 3 parameters (and give him the color codes for those 4 colors known)
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Thu Jul 27, 2017 17:37    Post subject: Reply with quote

Maybe its HSL

https://www.w3schools.com/colors/colors_hsl.asp
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Thu Jul 27, 2017 17:51    Post subject: Reply with quote

Hello Terra_777 long time no see!
Terra_777 wrote:
Maybe its HSL

https://www.w3schools.com/colors/colors_hsl.asp


These are the values used:

//red highlight
//object->Hilite(1065353216,1036831949,1036831949,2,0,1);
//green highlight
//object->Hilite(1050253722,1065353216,1050253722,2,0,1);
//light purple
//object->Hilite(1053609165,1053609165,1065353216,2,0,1);
//light green
//object->Hilite(1050253722,1065353216,1065353216,2,0,1);
//bright light
//object->Hilite(1065353216,1065353216,1065353216,2,0,1);
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Thu Jul 27, 2017 18:26    Post subject: Reply with quote

Quote:
- make it so it will always highlight in bring white
- make it so it will highlight in a color it would be highlighted if player pressed TAB (ie. enemies red, friendlies green, player purple, rest white)
- let scripter choose one of these colors with additional parameter
- let scripter mix his own color using 3 parameters (and give him the color codes for those 4 colors known)

How do you want.
I would prefer
Quote:
- let scripter mix his own color using 3 parameters (and give him the color codes for those 4 colors known)
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Jul 28, 2017 4:25    Post subject: Reply with quote

NWNCX_Patch and NWNX_Patch v1.27

DOWNLOAD

Fixes:
- fixed SetCurrentHitPoints

New custom functions:
NWNXPatch_HighlightObject(object oPlayer, object oObject, int nColorCode1, int nColorCode2, int nColorCode3);
NWNXPatch_UnhighlightObject(object oPlayer, object oObject);
NWNXPatch_DisableClientObjectHighlight(object oPlayer);
void SetImmunityOverride(object oCreature, int nImmunityType, int bResult);
void RemoveImmunityOverride(object oCreature, int nImmunityType);

Notes:
So as was said, highlight object takes 3 parameters the function header shows the known colors, if you want different color you have to experiment.

Disabling client highlighting had to be done this way, its better anyway as this allows to exclude DMs or specific players.

Forgot to add function header into SetImmunityOverride and RemoveImmunityOverride. Its working probably the same way as in nwnx_funcs. You set certain immunity to return true or false for oCreature and then you apply effect you want to succed or fail. However it seems its not possible to override lvl 20 monk immunity as far as I tested, might have same results on other immunity feats. If its true, can you check if nwnx_funcs has same issue or not?

Also, I need to decide whether to use "NWNXPatch_" prefix for these kind of functions that actually simply set variable.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Valbor



Joined: 26 Dec 2016
Posts: 145

PostPosted: Fri Jul 28, 2017 6:58    Post subject: Reply with quote

And what is this function RemoveImmunityOverride(oObject, IMMUNITY_TYPE_*)? if you have this SetImmunityOverride(oObject, IMMUNITY_TYPE_*, FALSE);

Your SetImmunityOverride its worked normally, unlike NWNXFuncs_*. Also not worked on feats Sad
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Jul 28, 2017 8:18    Post subject: Reply with quote

Valbor wrote:
And what is this function RemoveImmunityOverride(oObject, IMMUNITY_TYPE_*)? if you have this SetImmunityOverride(oObject, IMMUNITY_TYPE_*, FALSE);

Your SetImmunityOverride its worked normally, unlike NWNXFuncs_*. Also not worked on feats Sad

SetImmunityOverride(oObject, IMMUNITY_TYPE_*, TRUE); = when applying effect that should be negated by immunity_type_* it will return true and the effect application will fail
SetImmunityOverride(oObject, IMMUNITY_TYPE_*, FALSE); = when applying effect that should be negated by immunity_type_* it will return false and the effect application will succed

RemoveImmunityOverride will remove the overrides

the usual usage is:
SetImmunityOverride(FALSE);
ApplyEffectToObject
RemoveImmunityOverride
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Fri Jul 28, 2017 12:59    Post subject: Reply with quote

Thanks.
I'll go to test Smile


Last edited by Antegate on Fri Jul 28, 2017 15:07; edited 1 time in total
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Fri Jul 28, 2017 15:07    Post subject: Reply with quote

Quote:
NWNXPatch_DisableClientObjectHighlight(object oPlayer);

is not working
Maybe there is not enough variable on the module, but I do not know its value and name.
Maybe you forgot to add the code to nwnx_patch? I see the function in the client's log and can not see the in the server log.


Could you put a list of all new the levers and local variables for the plug-in?
Please
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Jul 28, 2017 17:08    Post subject: Reply with quote

Antegate wrote:
Quote:
NWNXPatch_DisableClientObjectHighlight(object oPlayer);

is not working
Maybe there is not enough variable on the module, but I do not know its value and name.
Maybe you forgot to add the code to nwnx_patch? I see the function in the client's log and can not see the in the server log.


Could you put a list of all new the levers and local variables for the plug-in?
Please

No the error was in client. That happens when you do something, you test it, it works but then you change the code to be more efficient and don't re-test it.

nwncx_patch 1.27b - fixed DisableClientHighlightObject

Note I made minor improvement.

The function DisableClientHighlightObject can now be used again to enable it again. Ie. the function works as a toggle. First use disable second use enable. I will change the function name in next release as well to ToggleClientHighlightObject.

This allows to make it disabled only in certain area or under certain effect (darkness) as you need.

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.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect


Last edited by ShaDoOoW on Fri Jul 28, 2017 17:20; edited 1 time in total
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Fri Jul 28, 2017 17:20    Post subject: Reply with quote

is working Smile
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Fri Jul 28, 2017 18:09    Post subject: Reply with quote

Quote:
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.

Automatically - it would be good, but then you need a switch of local variable on the module
Back to top
View user's profile Send private message
Antegate



Joined: 20 Apr 2012
Posts: 100

PostPosted: Fri Jul 28, 2017 20:00    Post subject: Reply with quote

Creaturespeed.2da
    0 PC_Movement **** PLAYER 2.00 4.00
    1 Immobile 2319 NOMOVE 0.00 0.00
    2 Very_Slow 2320 VSLOW 0.75 1.50
    3 Slow 2321 SLOW 1.25 2.50
    4 Normal 2322 NORM 1.75 3.50
    5 Fast 2323 FAST 2.25 4.50
    6 Very_Fast 2324 VFAST 2.75 5.50
    7 Default 6614 DEFAULT 0.00 0.00
    8 DM_Fast 6893 DFAST 5.50 11.00


Quote:
NWNXPatch_SetMovementRate(oPC, 1);
NWNXPatch_SetMovementRate(oPC, 4); or NWNXPatch_SetMovementRate(oPC, 0);


is not working. Character Immobile =/
Back to top
View user's profile Send private message
highv priest



Joined: 01 Mar 2013
Posts: 111

PostPosted: Sat Jul 29, 2017 3:43    Post subject: Reply with quote

ShaDoOoW wrote:
Hello Terra_777 long time no see!
Terra_777 wrote:
Maybe its HSL

https://www.w3schools.com/colors/colors_hsl.asp


These are the values used:

//red highlight
//object->Hilite(1065353216,1036831949,1036831949,2,0,1);
//green highlight
//object->Hilite(1050253722,1065353216,1050253722,2,0,1);
//light purple
//object->Hilite(1053609165,1053609165,1065353216,2,0,1);
//light green
//object->Hilite(1050253722,1065353216,1065353216,2,0,1);
//bright light
//object->Hilite(1065353216,1065353216,1065353216,2,0,1);


1065353216 represents the floating point value of 1.0 in C. If the colors are following standard RGB format this means the first example having 1065353216 means it is 1.0.

Likewise the number 1036831949 means 0.1... So the colors are literally just decimal value representations in hexadecimal format and nothing else.

So the first one being red has 1.0 red and 0.1 green and blue for pure red.

EDIT= Also this is the very same coloration used by fog colors. If you enter in 1065353216 as a fog color number you will get red(and 1036831949 is black). This is because you gave the raw number, which would be just the first one(Red) and the others being 0(green/blue).
You can create colors just by using 0xFFFFFF, where each F represents a location that can be a number. Then convert it.
Sorry colors is kind of my specialty.... Usually the first thing I hex edit into a game.

To create more colors easily these websites should do the trick:
http://www.binaryconvert.com/convert_float.html

http://www.binaryhexconverter.com/decimal-to-hex-converter
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3 ... 17, 18, 19 ... 42, 43, 44  Next
Page 18 of 44

 
Jump to:  
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