Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Giving players control of a character on the fly

So, I was in a rather large combat last session with several allied NPCs and a bunch of enemies, and I started thinking, "Boy it would be nice if there was a quick way to give control of a character to the players."  Then I thought, there probably is, but I don't know how to do it.  What I'm looking for is a script that will allow me to click a macro, click a token, input a player's name, or better yet, click their token, and give them control.  What would be the easiest/quickest way to do this?  Would this be a TokenMod thing, or ChatSetAtt?
1492623841
Gold
Forum Champion
Just the default built-in way would be equally fast and as-few clicks as what you described, wouldn't it? Shift-Doubleclick the Token, this will open the Character. Click EDIT. Add the Player's name using the drop-down of all Players under Controlled By. Wiki docs, <a href="https://wiki.roll20.net/Journal#Bio_.26_Info_Tab" rel="nofollow">https://wiki.roll20.net/Journal#Bio_.26_Info_Tab</a> There could be a faster way with the API but since you're needing to input the Player name either way, the existing interface is pretty quick for that as it has a drop-down menu of the Players names.
1492623894

Edited 1492623933
The Aaron
Pro
API Scripter
Also this: !token-mod --set controlledby|+?{Player name to add} and !token-mod --set controlledby|-?{Player name to remove}
1492624361
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
As a note, the token-mod way won't work if the graphic represents a character (as then the character's controlledby overrides the graphic's controlledby). ChatSetAttr won't work (AFAIK) because it only deals with attributes of a character, not a character's properties.
1492624410
The Aaron
Pro
API Scripter
Actually, TokenMod will change the character permissions if it's currently representing a character... =D
1492624592
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
oh, nice, did not know that. Makes tokenmod the way to go for this then :) Should of known you would of thought of that.
@ Gold - Yes, you're probably right, but I was trying to think of a way to do it without having to open up the character sheet.&nbsp; It's a little bit of a speed thing, and a little bit that I get overwhelmed sometimes with the number of sheets/handouts I have open in a session. @The Aaron - I could make that "Player name to add" part a dropdown query, but sometimes they change their player name, or new people join the game.&nbsp; Is it possible to use ?{target|player_name}, or some such thing as the query? EDIT: Does TokenMod overwrite the character permissions?&nbsp; Usually my tokens are linked to a character sheet, either as mooks or as full-blown NPCs
1492626375
The Aaron
Pro
API Scripter
So, it's actually fairly thorough in what it will accept. Player You can specify Players using one of five methods: Player ID, Roll20 ID Number, Player Name Matching, Token ID, Character ID Player ID is a unique identifier assigned that player in a specific game. You can only find this id from the API, so this is likely the least useful method. Roll20 ID Number is a unique identifier assigned to a specific player. You can find it in the URL of their profile page as the number preceeding their name. This is really useful if you play with the same people all the time, or are cloning the same game with the same players, etc. Player Name Matching is a string that will be matched to the current name of the player in game. Just like with Characters above, it can be quoted if it has spaces and is case insensitive. All players that match a given string will be used. Token ID will be used to collect the controlledby entries for a token or the associated character if the token represetns one. Character ID will be used to collect the controlledby entries for a character. Note that you can use the special string all to denote the All Players special player. It will change the permissions on a character, so in the case of Mooks, might not be ideal. &nbsp;Short of cloning a character and changing the represents to point to the cloned character, then adjusting that specific character, there isn't a great way to single out an instance of a Mook for character control. Here's the full help on the Player type of setting and the controlledby instance:
1492626579

Edited 1492626588
The Aaron
Pro
API Scripter
Depending on what you want the player to do with the token, this note from the bottom of that section of help might work: Remove the represent setting for the token and then give bob controll of that token (useful for one-offs from npcs or monsters): !token-mod --set represents| controlledby|bob
I think that helps though - it looks like there's also a command to remove all controlled by, so I could give the players control of an NPC temporarily, and then remove it when the combat is over.&nbsp; I'm assuming that would also then give them access to any Abilities set up as Token Actions then? Also, if I did !token-mod --set&nbsp; controlledby|all Would that work for both Mooks and Non-Mooks (Characters?).&nbsp; My mooks still have character sheets, it's just they are Numbered (using TNN), and they don't have HP linked to their sheet.&nbsp; Or do I need to use |represents?
1492628460
The Aaron
Pro
API Scripter
Correct on both counts.