Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

Skarpeteczki

How can i change my character ?

Recommended Posts

rezecib    3,144

Edit: To future readers, there's an easier way to do this that I detailed below. First use the scoreboard to get the player's number, let's say it's 3. Then you can do c_despawn(AllPlayers[3]).

 

@Skarpeteczki, Whoever's hosting can force one of you to change characters. It will delete all their items, though, so they should drop everything first.

 

Let's say you're both Willow. If the host wants to change their character, they'd enter this on the console (opens with the "~" or tilde key):

DeleteUserSession(ThePlayer) ThePlayer:Remove()

Literally write "ThePlayer", don't substitute usernames or anything.

 

If the host wants to force the other Willow to change characters, they would enter this:

local p = c_find('willow') DeleteUserSession(p) p:Remove()

Once this is entered, whoever is changing characters will be stuck on a black screen that they will need to alt+f4 out of. Once they rejoin/rehost, though, they will be back at character select.

Share this post


Link to post
Share on other sites
Kuldiin    32

Edit:- Nevermind, she wasnt willow she was playing as Clementine..

 

 

@Skarpeteczki, Whoever's hosting can force one of you to change characters. It will delete all their items, though, so they should drop everything first.

 

Let's say you're both Willow. If the host wants to change their character, they'd enter this on the console (opens with the "~" or tilde key):

DeleteUserSession(ThePlayer) ThePlayer:Remove()

Literally write "ThePlayer", don't substitute usernames or anything.

 

If the host wants to force the other Willow to change characters, they would enter this:

local p = c_find('willow') DeleteUserSession(p) p:Remove()

Once this is entered, whoever is changing characters will be stuck on a black screen that they will need to alt+f4 out of. Once they rejoin/rehost, though, they will be back at character select.

 

I use this method flawlessly normally and it resets players.

 

Today though, I have a player as Willow who I cannot seem to reset. Any ideas? Im stumped.

Share this post


Link to post
Share on other sites
rezecib    3,144

@Kuldiin, Hmm, well, recently they added c_despawn, which basically does what my command did, but a bit more nicely under the hood, and easier to use. On the scoreboard it now has numbers next to each player, you can reset player 3 by doing:

c_despawn(AllPlayers[3])

Share this post


Link to post
Share on other sites
Kuldiin    32

 

@Kuldiin, Hmm, well, recently they added c_despawn, which basically does what my command did, but a bit more nicely under the hood, and easier to use. On the scoreboard it now has numbers next to each player, you can reset player 3 by doing

c_despawn(AllPlayers[3])

 

Thanks once again :)

Share this post


Link to post
Share on other sites
Kuldiin    32

While testing I used the command (and checked it was 2, and that I was 2) but it reset the wrong player.

 

Im able to use console to refund their items, but they have asked if there is a way I can refund their days on server (as it showed them as at 335 days.

 

Is there a way using the console to do this?

 

Thanks

Share this post


Link to post
Share on other sites
rezecib    3,144
While testing I used the command (and checked it was 2, and that I was 2) but it reset the wrong player.
 Oh no! I guess I was wrong about the number on the scoreboard corresponding... Which sucks, because it seems like that would've been the main thing to use that number for.

 

I guess you can get the number more accurately from the list printed out by c_listallplayers().

 

As for restoring the day count... Hmm... This might work, using the number from c_listallplayers():

AllPlayers[3].components.age:LongUpdate(335*30*16)

Share this post


Link to post
Share on other sites
Kuldiin    32

No you were right.

 

I was the only one on the server, and as I executed the command someone else logged in, and was placed into position 2 moving me to three.

 

The command works well, but if you get the timing wrong it can get ugly :-)

 

 

Result from the command was:-

 

[string "AllPlayers[3].components.age:LongUpdate(335..."]:1: attempt to index field '?' (a nil value)

 

 

Share this post


Link to post
Share on other sites
rezecib    3,144

@Kuldiin, The host should always be position 1 in AllPlayers... The age component should definitely exist on the server... Are you running a dedicated server and not using a remote command for that or something?

 

You won't be able to execute that as a non-admin client, if that's what you're trying.

Share this post


Link to post
Share on other sites
Kuldiin    32

Ok worked out what is going on.

 

Earlier when I tried the command line, there was only three people on. (1 dedicated host, 3 players)

 

http://steamcommunity.com/sharedfiles/filedetails/?id=386019236

 

So I entered the below:-

 

http://cloud-4.steamusercontent.com/ugc/26229066310228278/0FEAE723AD0D30100D881E15EDC98BD5A785CF3E/

 

Which resulted in:-

 

http://cloud-4.steamusercontent.com/ugc/26229066310234374/1C41086DC38E98F08D6EF0671B1A08FCF10BABFF/

 

The wrong player got bumped up, instead of [3] me, player [4] MissPurpleMonki, was boosted (I entered the command three times.

 

 

Now there are 6 on (including Host Server), player 5 on the list I wanted to update. I deduced that I should therefore update AllPlayers[4] to update Player 5, but when I executed the command it updated Player 6.

 

I think Ill leave the days alone =p

 

 

Share this post


Link to post
Share on other sites
rezecib    3,144

@Kuldiin, Oh, okay, I think the numbers are off by 1 on dedicated servers, because it's giving 1 to the host, but the host has no player, and thus no entry in AllPlayers.

 

I would say that seems like a bug, actually...

Share this post


Link to post
Share on other sites
SethR    1,229

@Kuldiin, Oh, okay, I think the numbers are off by 1 on dedicated servers, because it's giving 1 to the host, but the host has no player, and thus no entry in AllPlayers.

 

I would say that seems like a bug, actually...

 

Indeed! I'll make it so the player list counts from 0 on dedicated servers--that should help with any confusion on this.

Share this post


Link to post
Share on other sites
Strael    4
c_listallplayers()  lists 

[1] Strael

[2] Danalith

 

Holding tab, I see:

0.  Good Host (admin)

1.  Strael (admin)

2.  Danalith

 

c_despawn(AllPlayers[1])  OR

c_despawn(AllPlayers[2]) ...does nothing

 

Any thoughts?  When I try:   local p = c_find('wickerbottom') DeleteUserSession(p) p:Remove()

My client locks up. =/ Also, looking at the command-line for the server, I can't actually input anything there?

 

(Yes, she was playing as Wicker)

...I have to hit etilde, then Control for "Remote:"  to pop in blue, DUH.

Share this post


Link to post
Share on other sites
L0K3    0

On dedicated serves only the host sees the "correct" c_listallplayers() list.

For each individual player that is not the host, their playerlist varies by the order they join the server as well as who goes in and out of their player range.

 

For example, a friend and I went next to eachother and typed c_listallplayers().

For me it showed: [1] Me [2] Friend

For him it showed: [1] Friend [2] Me

 

When we went ouf of range of eachother and tried again it showed only the individual under [1] until the other returned within range.

Would it be possible to return the c_listallplayer() from the console and print to the players console?

 

This would give us a valid indicator, without looking at the server console, for the player index for use of commands.

Share this post


Link to post
Share on other sites
1Void1    1

DeleteUserSession(ThePlayer) ThePlayer:Remove() made my game not respond and hence crash. Also it made the my character still stay conected while I left the game, once I was back, there was a clone there still standing. So yeah rather buggy.

 

c_despawn() worked well on me (and the extra "me" clones that were made troughg the buggy DeleteUserSession(ThePlayer) ThePlayer:Remove() ). Still would be nice to have the posibility of changing chars without playing around with server commands...

Share this post


Link to post
Share on other sites