Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /nfs/c01/h06/mnt/10927/domains/dragonprime.net/html/Sources/Load.php(225) : runtime-created function on line 3
Multiple Names
DragonPrime - LoGD Resource Community
Welcome Guest
  • Good morning, Guest.
    Please log in, or register.
  • September 17, 2019, 04:00:54 AM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: Multiple Names  (Read 2259 times)
0 Members and 1 Guest are viewing this topic.
DarknessFalls
Militia
**
Offline Offline

Posts: 36


View Profile
« on: August 17, 2015, 01:49:07 PM »

So, this is going to be a very interesting question. I'm not even sure where to begin with this.

I'm going to be building a realm that will have two cities. The characters will have split personalities on the realm, and I'd like to be able to have a character switch their name to go with their personality whenever they travel to the other city, where the matching personality exists dominantly.

Like: Joe is dominant in City1, but his other personality which is Chuck is dominant in City2.

It would be like a character having two names, but only one shows and the one that shows depends on the city that they are in.

Is this even possible to accomplish?
Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1934


You're welcome.


View Profile WWW
« Reply #1 on: August 17, 2015, 07:03:40 PM »

Certainly should be. A module with two prefs for the two names, and a hook into the village (probably header-village) to update the user's name based on the village. And two settings: Use Name #1 in which village(?), and Name #2 in which village(?).

I'm not sure how the two names are set in the first place, though? (Or, rather, how the second name is set, given that the first will be the one they signed up with). Then there's the issues of updating both DK titles when one levels (should be easy to do by hooking into a dragon hook, and using the code to update the title that the dragon code uses).
Logged

DarknessFalls
Militia
**
Offline Offline

Posts: 36


View Profile
« Reply #2 on: August 17, 2015, 07:12:58 PM »

Certainly should be. A module with two prefs for the two names, and a hook into the village (probably header-village) to update the user's name based on the village. And two settings: Use Name #1 in which village(?), and Name #2 in which village(?).

I'm not sure how the two names are set in the first place, though? (Or, rather, how the second name is set, given that the first will be the one they signed up with). Then there's the issues of updating both DK titles when one levels (should be easy to do by hooking into a dragon hook, and using the code to update the title that the dragon code uses).


This is for a project I'm going to begin down the road. I'm not fully comfortable doing everything that will need to be done. I'd need a damn good coder if I were to start the project now, and there aren't many that I trust.

For the names: That's what I'm trying to figure out. Like everyone knows, I'm not much good at this. Nowhere near as good as I'd need to be for this kind of project.

For the titles: I'm going to do away with the DK titles, and go with just custom titles.
Logged
Anharat
Codemeister
****
Offline Offline

Posts: 283



View Profile
« Reply #3 on: August 18, 2015, 10:45:34 AM »

More problematic will be stuff like the commentary where the user name is fetched with the account id. It would definitely require some major core code changes and I do not think it's realisable in a "reasonable" module.
Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1934


You're welcome.


View Profile WWW
« Reply #4 on: August 18, 2015, 06:28:40 PM »

More problematic will be stuff like the commentary where the user name is fetched with the account id. It would definitely require some major core code changes and I do not think it's realisable in a "reasonable" module.

How would account IDs come into this? The user just needs two interchangeable names, not two accounts.
Logged

Anharat
Codemeister
****
Offline Offline

Posts: 283



View Profile
« Reply #5 on: August 18, 2015, 10:23:46 PM »

Sure, but in the commentary table the user is linked with the account id not with the name and I'm pretty sure that there is no modulehook in the commentary section where you could modify the name displayed in a descend way and there will be several other examples like this.

And even if you would allways update the account name in the accounts table when moving to the other city all commentary in the first one will change the display name as well.
As said a modification like this is possible but would require a good amount of changes. But it may be good to check out stuff like the npcchat module.

While writing I was thinking about just having two accounts and switching the session "user" data when moving between the cities, but I think it'd be hard to synchronise all the settings. Especially module prefs made me discard this idea.
Logged
Boris735
Mod God
*****
Offline Offline

Posts: 570


View Profile
« Reply #6 on: August 19, 2015, 05:48:44 AM »

Part of those changes should be making the commentary store the name/clan/etc. as part of the comment, which is something I think has needed doing for a long time.  It somewhat reduces the available comment space (particularly for people who like to excessively colour their names) but gives a much-needed consistency to the commentary when scrolling back.  It's not trivial, alas.
Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1934


You're welcome.


View Profile WWW
« Reply #7 on: August 19, 2015, 04:22:29 PM »

Code:
<?php
$name  
= ($session['user']['location'] == get_module_setting("village1") ? $row['name'] : get_module_setting('duplicatename');

I don't see why this wouldn't work for displaying the different names in a chat (in either a new modulehook - the holiday hook, perhaps? - or the core). Everything else would remain the same (bio link, clan, staff tags, etc).
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
76 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search