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 
 
Dynamic names
Goto page Previous  1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
Ne0nx3r0



Joined: 29 Nov 2006
Posts: 36

PostPosted: Sat Jan 09, 2010 20:37    Post subject: Reply with quote

T3h yay! It works
Back to top
View user's profile Send private message
nwn_martin



Joined: 06 Apr 2007
Posts: 10

PostPosted: Sat Jan 09, 2010 21:10    Post subject: : Reply with quote

shiny! Arrow thank you Exclamation
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Sun Jan 10, 2010 19:52    Post subject: Reply with quote

Make sure to set nUnknownStyle to 2, since 1 is in russian, so it'll probably display as a gibberish for you if you don't have russian fonts installed. Smile
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Sat Jan 16, 2010 19:29    Post subject: Reply with quote

NWNX Names 1.0.1
Added GetDynamicName function
http://nwn.virusman.ru/trac/nwnx2-linux/changeset/290/
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Tiamas



Joined: 10 Sep 2009
Posts: 3

PostPosted: Sun Jan 17, 2010 5:56    Post subject: Reply with quote

Hi, i have a few questions about this plugin. (Dont want to install linux just for testing ^^)

1. On the first pages i read its impossible to port it to windows, then there are some posts about the possibility. I just want to know if its really impossible, possible but would take years or possible but still a lot of work to do ^^. I am asking because this plugin may convince me to change my OS, but i would prefer keeping windows.

2. About the plugin itself: If i want to change the name of one player for all clients, do i have to cycle through all players and check new entering clients to change the displayed name or is there an easier way? (Would use this for polymorphed chars to hide their identity and display the name of the creature they changed into)

Thx for any answers to the questions Smile
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Sun Jan 17, 2010 14:47    Post subject: Reply with quote

Tiamas wrote:
1. On the first pages i read its impossible to port it to windows, then there are some posts about the possibility. I just want to know if its really impossible, possible but would take years or possible but still a lot of work to do ^^. I am asking because this plugin may convince me to change my OS, but i would prefer keeping windows.
Possible, but it would take a significant time.
Windows compiler uses a different calling convention (thiscall), so it's not as easy to unwind the stack as in Linux (stdcall).
In earlier posts Zebranky said that he was going to port it. Ask him if it's still in his plans. But even then, it may take months.
Tiamas wrote:
2. About the plugin itself: If i want to change the name of one player for all clients, do i have to cycle through all players and check new entering clients to change the displayed name or is there an easier way? (Would use this for polymorphed chars to hide their identity and display the name of the creature they changed into)
Yes. It's fairly easy, though - just a few lines of code. You'll have to initialize and enable the system for every entering player anyway.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Thu May 06, 2010 20:52    Post subject: Reply with quote

NWNX Names 1.0.3:
  • Added UpdateDynamicName function (force creature name update in the client)
  • Added UpdatePlayerList function (force player list update in the client)
  • Minor fixes

http://nwn.virusman.ru/trac/nwnx2-linux/changeset/338/
http://data.virusman.ru/nwn/nwnx_names-1.0.3-linux.rar
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Sethan



Joined: 04 Oct 2008
Posts: 47

PostPosted: Tue May 11, 2010 4:55    Post subject: Reply with quote

I am (slowly) putting together a Linux server atm. For someone with zero starting knowledge of Linux, this is no small undertaking. The main impetus for me to do so is NWNX names.

I had the idea to make a functioning disguise system using this.

If NWNX names could be ported to Windows, that would be awesome.
Back to top
View user's profile Send private message
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Fri Dec 31, 2010 1:27    Post subject: Reply with quote

Code:
diff --git a/plugins/names/HookFunc.cpp b/plugins/names/HookFunc.cpp
index 14cc970..912e1dc 100644
--- a/plugins/names/HookFunc.cpp
+++ b/plugins/names/HookFunc.cpp
@@ -703,7 +703,7 @@ int GetNameHookProc(void *pObjectInfoStruct, int some_flag, char *objName_buf, i
                        {
                                NewName = "";
                        }
-                       if(nStyle==1)
+                       else if(nStyle==1)
                        {
                                char *nCreatureStruct = *(char **)((char *)pCreature+0xC68);
                                char nCreatureGender = *((char *)nCreatureStruct+0x6C);


This fix makes it possible to use nUnknownStyle = 0 and not have everyone's names come out as "ΓΛήΚ!!!" on entry. In theory, anyway. Will test tomorrow, just posting here before I forget.
Back to top
View user's profile Send private message
MetaPhaze



Joined: 03 Jun 2007
Posts: 30
Location: USA

PostPosted: Fri Dec 31, 2010 6:22    Post subject: Something wrong with my ax_lib_misc_h.nss file? Reply with quote

Figured this out...
you can remove this post Wink


Last edited by MetaPhaze on Sat Jan 08, 2011 11:23; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Calan



Joined: 23 Mar 2009
Posts: 16

PostPosted: Sun Jan 09, 2011 20:14    Post subject: Reply with quote

(Sun, Jan 2)

Got the plugin working rather well for me. Once again, biggest complaint is lack of documentation on the commands in the NWN include. Still was able to figure things out, though.

For the most part, I have it set up to just set the dynamic name for the character to be their normal name. My need for this plugin isn't to have people "Unknown" ever, but rather to be able to change the name later on, for polymorph type reasons like mentioned in a previous post. Seems to be working fairly well, so far.

Just a few things I noticed:

-Players logging in to the server are often not announced. I can't find a pattern to this; sometimes they are announced, sometimes they are not. At first, it seemed that the first time a player logged in they were announced, but after that they were not. That pattern did not hold for everyone, but it seems to be close to that. At least with how I am using the plugin, if a player is not announced, they aren't announced for any client. If they are announced, they are announced for all clients. I haven't seen a case yet where someone got a login message on their client, but someone else didn't see it.

-Shouts seem to always come from "Unknown," even when the dynamic name is set.

-When invited to a party, even when the dynamic name is set, the popup that comes up saying who has invited... the name seems to always be a null string.



-Update: (Fri, Jan 7)

Still looking into details, but it has become apparent that calling the UpdatePlayerList() function on a DM that is possessing an NPC will crash the server.

Later edit: It seems that this happens any time SetDynamicName or UpdatePlayerList is called to send an update to a non-player character. This should probably gracefully do nothing at all, rather than crash the server, since GetFirst/NextPC will return the DM avatar rather than the NPC that the DM is possessing (which at that point, the DM avatar is a non-player character, and the NPC is the player-controlled character).



-Update: (Sun, Jan 9)

If a player has a dynamic name set on their own character, all text (other than tells, and oddly enough, shouts too which still come from "Unknown") is completely missed.

Also, I have noticed that every time the player list is updated it is reported in the log file as:
"Unknown Update sub-message"
This creates a ton of "spam" in the log file if the player list is updated frequently.

If there isn't already such a mode, it would be very nice to have a mode where the "UnknownStyle" was to default to do nothing at all, rather than default someone to "Unknown." That way the plugin can be used to change names only, rather than be forced to have a dynamic name on everyone for those of us who would like to use it as a simple PC name changer.
Back to top
View user's profile Send private message Visit poster's website
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Tue Jan 11, 2011 15:30    Post subject: Reply with quote

Calan wrote:
If there isn't already such a mode, it would be very nice to have a mode where the "UnknownStyle" was to default to do nothing at all, rather than default someone to "Unknown." That way the plugin can be used to change names only, rather than be forced to have a dynamic name on everyone for those of us who would like to use it as a simple PC name changer.


While I haven't tested this (still), I think the patch in my post above should do that, if you set nUnknownStyle to 0.
Back to top
View user's profile Send private message
Calan



Joined: 23 Mar 2009
Posts: 16

PostPosted: Wed Jan 12, 2011 5:23    Post subject: Reply with quote

Thanks, but I have attempted that patch. I actually came to the same conclusion, then realized it was the same thing you did. All it seemed to do was default all the unknown names to null strings, rather than to their normal names.

I have looked through the code though and I may see a place where it would be an easy change to make this a possible mode. If I do come up with something that works I'll post it.

I haven't seen any updates on the svn trunk in quite a while, is there any development happening at all any more?

update:
I tried that fix that I thought might work, and it did not. I'm sure it can be done but I'd rather wait for the author who knows the code better since he could probably do it in a very short time where it may take me quite a while to figure it out. Eventually I'll probably do it, if it doesn't happen for a while.
Back to top
View user's profile Send private message Visit poster's website
Monti



Joined: 06 May 2011
Posts: 5

PostPosted: Fri May 06, 2011 1:20    Post subject: Reply with quote

Some progress on this wonderful plugin? I'm aware of this issue for a long time to see when you get a stable version, without errors. No doubt I will use in my PW.

Thank you very much for your effort.

Sorry for my English, I'm Spanish.
Back to top
View user's profile Send private message
metagamer



Joined: 30 Nov 2014
Posts: 20

PostPosted: Sun Nov 30, 2014 14:31    Post subject: some suggestions Reply with quote

Hello everybody,

Firstly, I want to thank everybody for the help and the effort to improve this old but amazing game called NwN.

Secondly, I have some questions about the implementation of Dynamic Names plugin developed by virusman.

I am working with Ubuntu 14.04 LTS, 64bit architecture.
The system has been installed and launching ./nwnstartup.sh I obtain:

Quote:

* Searching for signatures...
* Loading modules...
EVENTS plugin registered.
ERROR: ODBC: OnCreate() failed.
FUNCSEXT plugin registered.
TWEAKS plugin registered.
TMI plugin registered.
STRUCTS plugin registered.
VISIBILITY plugin registered.
HASHSET plugin registered.
FUNCS plugin registered.
AREAS plugin registered.
NAMES plugin registered.
FUNCTIONS plugin registered.
PROFILER plugin registered.
SPELLS plugin registered.
CHAT plugin registered.
WEAPONS plugin registered.
RESMAN plugin registered.
DMACTIONS plugin registered.
FIXES plugin registered.
DEFENSES plugin registered.
RESET plugin registered.
MNX plugin registered.
SYSTEM plugin registered.
EXTEND plugin registered.
* NWNX2 activated.
Neverwinter Nights Server
Build:8109
Copyright BioWare Corp 1998-2004

Server: Loading...
Server: Running...

Server: Loading module "modulo00X"....
Server: Module loaded


At the login, OnClientEnter, I have this script:

Code:
#include "vir_dnames_inc"

void main()
{

 object PC = GetEnteringObject();
 object oTgt = GetModule();
 SetLocalString(oTgt,"NWNX!INIT","1");
 GetLocalObject(GetModule(), "NWNX!INIT");

 //SetName(appoggio, "prova");

 InitPlayerNameList(oTgt, 0);
 SetNamesEnabled(PC);
 int nPCID = GetPCId(PC);


SetDynamicName(PC, oTgt, "prova");
UpdateDynamicName(PC,oTgt);

// Debug
SendMessageToPC(PC, "nwnx: " + GetDynamicName(PC,oTgt));
SendMessageToPC(PC, "nome pg " + GetName(PC));
}


but the name does not change anyway.
I imported the erf file, I inserted the nwnx_names.so file inside the nwn folder, I imported also vir_dnames_inc.nss

I obtain this message:

Quote:
* NWNX2 activated.
Neverwinter Nights Server
Build:8109
Copyright BioWare Corp 1998-2004

Server: Loading...
Server: Running...

Server: Loading module "modulo00X"....
Server: Module loaded
INIT(S): valid ret=0x082041ec
INIT(O): valid ret=0x08203e79


Whatelse should I do? Where is the mistake?

I would be thankfull if you can give me some code example Very Happy
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5  Next
Page 4 of 5

 
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