SphereCommunity
(Solved!) Anyway to trick the client to skip the entire character creation process? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: (Solved!) Anyway to trick the client to skip the entire character creation process? (/Thread-Solved-Anyway-to-trick-the-client-to-skip-the-entire-character-creation-process)

Pages: 1 2


RE: Anyway to trick the client to skip the entire character creation process? - Mordaunt - 07-24-2012 07:45 AM

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.


RE: Anyway to trick the client to skip the entire character creation process? - darksun84 - 07-24-2012 07:58 AM

Britain was just a placeholder Veryhappy

But yes, that script should be tested properly.


RE: Anyway to trick the client to skip the entire character creation process? - Mordaunt - 07-24-2012 08:16 AM

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?


RE: Anyway to trick the client to skip the entire character creation process? - Rayvolution - 07-24-2012 08:35 AM

(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. Big Grin

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)
[Image: 1.jpg]

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)
[Image: 2.jpg]

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'
[Image: 3.jpg]

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'
[Image: 4.jpg]

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! Big Grin

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



(Solved!) Anyway to trick the client to skip the entire character creation process? - Mordaunt - 07-24-2012 09:24 AM

I'm not dissing the idea... far from it, I like it, it just needs a little tinkering...

As for the issue of a player deleting a character on the gump without your files:
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
    if (<serv.account.<args>.chars> < 5)
        newnpc c_newplayer
        serv.log making additional chars
        new.go 2497, 2064
        new.account = <args>
        new.disconnect
    endif
    serv.log Chars already created // Log notification
endif
That way when they log in if they have less that whatever you have allowed the slots would refill with the new ones


(Solved!) Anyway to trick the client to skip the entire character creation process? - Rayvolution - 07-24-2012 09:51 AM

(07-24-2012 09:24 AM)Mordaunt Wrote:  I'm not dissing the idea... far from it, I like it, it just needs a little tinkering...

As for the issue of a player deleting a character on the gump without your files:
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
    if (<serv.account.<args>.chars> < 5)
        newnpc c_newplayer
        serv.log making additional chars
        new.go 2497, 2064
        new.account = <args>
        new.disconnect
    endif
    serv.log Chars already created // Log notification
endif
That way when they log in if they have less that whatever you have allowed the slots would refill with the new ones

hah, sorry. I didnt mean to come across negatively to you. Wink I knew you were for the idea, I just was very excited to show it off in action!

I was going to do a script in game that would do what you suggested, but I think your idea is much cleaner/better, so I'll go for that instead. Then, all I'll need to do in game is run a script that disconnects/removes the player currently logged in on command.

Something simple, along these lines:
.deletechar yes <password>
(Confirm screen), Click "yes".
Logout Character, and removes it.

When they log back in, your script launches and a new character is created.


(Solved!) Anyway to trick the client to skip the entire character creation process? - sagitariuz2 - 02-18-2013 07:10 AM

Great thing you guys did here. But isnt it possible if someone deletes a char, to instantly create a newone, so he cant get in the charcreation?


flamethrower - darksun84 - 02-18-2013 08:18 AM

(02-18-2013 07:10 AM)sagitariuz2 Wrote:  Great thing you guys did here. But isnt it possible if someone deletes a char, to instantly create a newone, so he cant get in the charcreation?

you can block the deletion in f_onchar_delete


RE: flamethrower - sagitariuz2 - 02-18-2013 11:49 AM

(02-18-2013 08:18 AM)darksun84 Wrote:  
(02-18-2013 07:10 AM)sagitariuz2 Wrote:  Great thing you guys did here. But isnt it possible if someone deletes a char, to instantly create a newone, so he cant get in the charcreation?

you can block the deletion in f_onchar_delete

also a good way to optimize it Big Grin