(07-24-2012 08:16 AM)Mordaunt Wrote: Is it not possible to fudge it with f_onchar_create and have the script fill in temporary data till the player completes the custom start menu?
(07-24-2012 08:16 AM)Mordaunt Wrote: There are only 2 problems I can see with this. Firstly you wind up with all those "new player" characters on the selection screen, it may confuse new players to your server.
Secondly I really wouldn't use britain as the place to dump them, all the created characters idle there after they are created (plus all those logged out characters in one place is liable to cause serious lag on a busy server.
Thirdly... wait wait, I'll come back in and start again... no screw it... Thirdly if you happen to be running a script which enforces unique names on players this script is going to cause some issues...
That said, I can see potential here, just needs to be modified a little.
Well, the idea is to remove the vanilla creation process completely.
It shouldn't confuse new players because when they login for the first time, they'll just see 5 character slots marked "New Character", with no Delete or New button to make/remove any. From the player's perspective, it should look like 5 open character slots.
The player will have no idea he actually owns 5 "New Character" characters, he'll just think that he's creating a new character.
What happens:
1. New player logins in the first time.
2. When he reaches the Shard Selection screen (before character creation), the script fires, and creates 5 new characters (Named New Character) and moves them to the start location where the in-game character creation system is.
3. Player sees 5 "New Characters", and no Delete/New button to click on because those buttons were deleted in the GUI.
4. He clicks on any of the 5 "New Character" characters and is sent *directly* into the game shipping the entire vanilla process, because all he's really doing is logging in a character.
5. He's now sitting in the character creation "room", where I can fire all the needed scripts/GUIs/etc to setup his character.
When they delete a character (will be done via an in-game function) it will log them out, delete the character and recreate another "New Character" to fill the slot.
The script has worked! .. I've tried to break it several ways, and I can't.
Here's a step by step of what the player sees on his end:
Brand new account, not even created yet (I set "Free" account creation for this test)
Shard Selection, this is where the script fires and creates the characters as seen in the logs:
15:47:190:Client connected [Total:1] ('127.0.0.1' 1/1)
15:47:(sphere_serv_triggers.scp,44)New Player 00 for Account NewCharTest created
15:47:(sphere_serv_triggers.scp,44)New Player 01 for Account NewCharTest created
15:47:(sphere_serv_triggers.scp,44)New Player 02 for Account NewCharTest created
15:47:(sphere_serv_triggers.scp,44)New Player 03 for Account NewCharTest created
15:47:(sphere_serv_triggers.scp,44)New Player 04 for Account NewCharTest created
15:47:190:Login 'NewCharTest'
15:49:190:Client disconnected [Total:0] ('127.0.0.1' 0/0)
Character screen, and for some reason the trigger fires again. But it doesn't matter because it detects players already exist, and won't execute:
15:49:190:Client connected [Total:1] ('127.0.0.1' 1/1)
15:49:(sphere_serv_triggers.scp,47)Chars already created
15:49:190:Login 'NewCharTest'
And login! I haven't built the character creation room yet, so I just dropped the player in the middle of one of my new half completed cities on my shard's custom map.
15:49:190:Setup_Start acct='NewCharTest', char='Create New Character', IP='127.0.0.1'
I still need to write a script to block character deletion (just in case someone uses the original gump file to "activate" the button) and then write an in-game way to delete the character, but other than that. It looks like it's game on!
Thanks guys!
Here's the modified version of the script:
Code:
[FUNCTION f_onaccount_login]
if !<serv.account.<args>.chars> //I have 0 players, create 5 of them
//code for creating the newplayers here
FOR 0 4
newnpc c_newplayer //CHARDEF of the "New Character"
new.go 2497, 2064 //Send NPC to "Character Creation Room"
new.account = <args> //Assign NPC to account logging in.
new.disconnect // "Disconnect" the NPC, if you don't do this the NPC, even though attached to the account, will wander around aimlessly in the room.
serv.log New Player <local._for> for Account <args> created // Log notification
ENDFOR
else
serv.log Chars already created // Log notification
endif
[CHARDEF c_newplayer]
ID = c_man
Name = Create New Character
ON=@Create
STR = 1
DEX = 1
INT = 1