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

[Script] WildShape - easy ShapeShift for your PCs and NPCs

1592773686

Edited 1621873431
Angelo
API Scripter
NOTICE : Hi everyone, as of the 20th May 2021 i have dropped my pro subscription from roll20 (not happy with the way they've been handling UDL and community feedbacks in general and I've moved my DMing somewhere else). I would love to keep supporting this script but unfortunately i won't be able to test any changes without a pro subscription so there will be no further development from me on this. The fact that so many people found it useful made me really happy, I hope someone else can pick it up and keep expanding the script as needed (you can find the link to the code in the second post of this thread). Good luck to you all and happy gaming! ---------------- We just started a new campaign with a few friends and one of them wanted to play a druid, i saw there were a couple of options available in terms of scripts but i wasn't really satisfied with them so i decided to write my own as my first API, please welcome WildShape! a little premise: I am a new GM that is also new to roll20 and it was my first time writing something in javascript (I work in c++) so please if you know of any improvements I can make to the scripts just let me know! Also, we use the standard 5e sheet, but it should be really easy to adapt it to other sheets if you need to do so. The script is available in the library through the one click install. Main features Can be used for both PC and NPC to shape shift into either a PC or an NPC Alt-double clicking on the "shape shifted" token will open the relative pc/npc sheet so that you can run actions from your new shape Automatically: change the token size set hp/ac/speed (or any other attribute you might want) on bar1/2/3 when you shapeshift setup senses (e.g. light, vision) from darkvision/blindsight info on NPCs, can set defaults and overrides per shape change roll settings on NPC sheet (when transforming from a PC) to never whisper, toggle advantage, don't autoroll damage show journal entries to players for all their shapes change the token to the last taken shape when dropping a new shifter token (e.g. from the journal or copy/paste, useful when moving between maps) Also, for Druids Only it will automatically:  copy INT/WIS/CHA attributes to NPCs  set corrected saving throws and skills considering proficiencies according to 5e rules check and decrease a configurable wild shape resource Additional Features: shapes can be mass imported from a journal folder i've tried to make most things configurable through chat menus so that if you don't like a setting you should be able to easily change it, if not just shoot me a message and i will see what i can do Usage With a token selected both the GM and the player that controls that token can run  !ws  to be presented with a list of all available shapes, just click on an entry to trigger the shapeshift (the GM will have an additional "edit" shown on top as a shortcut). Here is an example with the before an after clicking on the "Tiger" button for a druid named "Zanaphia"
1592773928

Edited 1614370926
Angelo
API Scripter
You can find script, detailed help, etc. on my github here:  WildShape If i post a direct link to my github in the original post the entire thing gets shadowbanned for some reason, i have been trying to get support for 2 weeks but i am getting no help, please let me know if i am breaking any rules. IMPORTANT NOTES NOTE 1: There is a limitation on using images directly from the marketplace, whenever you want to use a monster from the Monster Manual (or similar external resource in your compendium) the API might give you an error. For instance if you were trying this: drag a monster from the compendium onto the Map (e.g. Ape, this step is only in case you don't already have it in your journal) drag the token for your shapeshifter onto the Map go in the WildShape config for your shifter, click on "Add NPC" and try to add Ape again from the list it might fail because of the image with this error: ERROR: WildUtils::duplicateCharacter (Ape -> Zanaphia - Ape): cannot find image on either token or avatar; if it's using a marketplace link the image needs to be re-uploaded into the library and set on the target character as either token or avatar image if you do get the error this is a list of steps you can follow to fix it: alt+double click on the monster token or open the character sheet from the Journal (e.g. "Ape"), go to Bio & info, right click on the avatar, save as... whatever you want on your pc (e.g. "ape.png") on that same Ape character sheet pop-up click on Edit on the top bar remove current avatar click on the upload button in the avatar section and select the "ape.png" you just saved close the Ape character sheet go in the WildShape config for your shifter, click on "Add NPC" and try to add Ape from the list everything should work just fine NOTE 2:  Right now I am using the token names to find shifters when they try to shapeshift, if you change it in your game you will have to edit it in the shifter settings otherwise they won't be able to transform anymore Known Issues Please let me know if you have any tips on any of the following, right now i have no idea how to fix them: after shapeshifting you need to reselect your token to refresh the values in the token bars (it seems to work on and off?) cannot copy a shapeshifted token, when pasting it it becomes an empty token for some reason... Wishlist This is a prioritized list of things i would like to do whenever i have some extra time, please add more features requests in the thread! see if i can copy saves/skills/proficiencies from druids to npcs <--- added to v1.2 add an automatic "duplicate & rename pc/npc" when adding new shapes   <--- added to v1.3 Upgrading to v1.2 v1.2 added a feature for druids to automatically calculate and set the correct saving throw and skills on the shapes considering proficiencies according to 5e rules To do the proper calculation I need the original stats info for INT/WIS/CHA and unfortunately with druids the script was already overriding the original data. This means that if you were playing/testing the scripts and shapeshifted into some shapes then the original stats for those shapes are gone and there is no way i can recover it ---> the calculation for those saves/skills is most likely going to be wrong To fix this problem simple remove those shapes, and readd a vanilla version to the list of shapes for your druid. This problem happens only for shapes that you have shapeshifted into, if you have other shapes in your list that you have never tried you won't need to remove/readd them. i am now caching all original stats internally every time you add a shape to avoid the same problem in the future.
1592779768
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That is strange. I post github links in the top posts of my scripts without issue. This script looks really ambitious and intriguing. I can't wait to try it out.
This script is THE wildshape solution for me. I've tried others and they were too cumbersome, or didn't quite do all that I wanted them to do.  The druid in my game is very happy. Thanks for your work on this and helping troubleshoot issues I ran into initially!
Holy. Moly. Been desperate for a wild shape script for months. Can't wait to try this out!
Very nice! Been looking for something like this for my game.
1593095318

Edited 1593097040
Great script! But I encountered a problem that you already mentioned: Those images from marketplace. I think a followed your suggested steps, but the error still comes ... But maybe I did something wrong ... I looked for the creatures in the compendium, opened them and clicked on "duplicate". Those creatures were now located in my journal. Weird - some showed up at the top, some at the botton. Only the latter were names "copy of <...>". Your last step reads "change the avatar on the "Copy of Black Dragon" character sheet to the file you uploaded to the library" - do you really mean to change the avatar image (the upper image) or the token image? I tried both, but no success.
Forget about my problem. I don't know what happened but now those steps do what they're supposed to do.
1593106709

Edited 1593106831
Angelo
API Scripter
great! I am not sure how does it work duplicating from the compendium, i have always duplicated from the journal, maybe that was the problem? and just to be clear, i do mean to change the avatar; at least from what i have seen all Monster Manual NPCs avatar/token images are the same and the avatar is easier to change. as an update: I have a version with the copying of save/skill proficiencies for druids, i need to do a little bit more testing on it but I hope to push it in the next few days. I would love to hear more feedbacks/feature requests!
Thank you for the clarification on the avatar image. Whatever the reasons were, I will look into it next time I need to setup more wild shapes for the group's druid (or for some shape-shifting enemies) I will gladly share any feedback from the druid's player, as soon as there's any ;-)
I just installed this for my druid player, and in testing it found it amazing - I cannot *wait* to hear how they like it on our next session on Sunday. What a wonderful script!
I'm so excited to use this on my campaign! My player's druid just got to level 2 last session and I had to manually control a wolf on their behalf...this is the glory! THANKS! Feature Request (not bug, just something i thought would be fun) : It seems that the token keeps it's original name. Would it be possible to have an option to show the "short name" as the token name? Context: My druid gave the Wolf shape a nickname (which i'm using as short name on the WildShape script) and would be AWESOME if the wolk token also shows that nickname (just for the sake of fun) instead of the druid's name.
1593220217
Angelo
API Scripter
Juan said: I'm so excited to use this on my campaign! My player's druid just got to level 2 last session and I had to manually control a wolf on their behalf...this is the glory! THANKS! Feature Request (not bug, just something i thought would be fun) : It seems that the token keeps it's original name. Would it be possible to have an option to show the "short name" as the token name? Context: My druid gave the Wolf shape a nickname (which i'm using as short name on the WildShape script) and would be AWESOME if the wolk token also shows that nickname (just for the sake of fun) instead of the druid's name. thank you! i would love to do that but unfortunately for now I am using the token name instead of the token id to associate the list of shapes to a particular token, if i change the name they won't be able to ever transform into anything else... I did this because i thought that the token ID is probably changing between campaign pages whilst the name is constant, but i haven't actually tried it... like if i drop one character from the journal in two separate pages would both tokens have the same ID? does anyone know this?
1593221014
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
If memory serves, the tokens created that way have unique ids, but oddly, transmogrified tokens retain their id. Thee Aaron can give a better answer to this, since he was the one who reported the bug.
Good to know this! Then I will also make sure on my end not to manually edit the token name, o/w won't be able to transform back!  Angelo said: i would love to do that but unfortunately for now I am using the token name instead of the token id to associate the list of shapes to a particular token, if i change the name they won't be able to ever transform into anything else...
1593224587
Angelo
API Scripter
I have just pushed version 1.2 to master , you will need to update both files. The version comes with some fixes and a big change : - for druids it will automatically calculate and set the correct saving throw and skills on the shapes considering proficiencies according to 5e rules There is  one problem with the upgrade To do the proper calculation I need the original stats info for INT/WIS/CHA and unfortunately with druids the script was already overriding the original data. This means that if you were playing/testing the scripts and shapeshifted into some shapes then the original stats for those shapes are gone and there is no way i can recover it ---> the calculation for those saves/skills is most likely going to be wrong T o fix this problem  simple remove those shapes, make a new copy from the original and readd it to the list of shapes for your druid. This problem happens only for shapes that you have shapeshifted into, if you have other shapes in your list that you have never tried you won't have to remove/readd them. i am now caching all original stats internally every time you add a shape to avoid the same problem in the future. Enjoy!
Hey Angelo! Just updated the script, and I think I may have found a bug(?) Added shapes from a folder (which were added correctly, suffix addition and all) and added manually another shape, when trying to shapeshift, it only does so for the manually added shape, all the other ones appear in the list of options, but when clicking them, nothing happens (no message on chat, no error on the api console). If helpful, I can see on all character sheets (both added via folder and added individually) that the stats are appearing and indeed are following proper rules, but it doesn't shift shapes. 
1593239176
Angelo
API Scripter
Juan said: Hey Angelo! Just updated the script, and I think I may have found a bug(?) Added shapes from a folder (which were added correctly, suffix addition and all) and added manually another shape, when trying to shapeshift, it only does so for the manually added shape, all the other ones appear in the list of options, but when clicking them, nothing happens (no message on chat, no error on the api console). If helpful, I can see on all character sheets (both added via folder and added individually) that the stats are appearing and indeed are following proper rules, but it doesn't shift shapes.  mmh weird, I just tried it and it works fine for me...  if you open the script right at the top there is a "DEBUG: false", can you try to set that to true and see if you get any messages at all? what type of shapes are giving you problems, npcs or pcs? Maybe if you can post some screenshots of your folder structure/shapes i can see if i notice anything wrong
Ok, so digged down and found my problem! I was mis-using the script (forgive me for suggesting it might have been a bug!) FWIW this is what was happening: I use my bars for HP, AC and Passive Wisdom, so on the config I had configured for SPEED to be read from "passive_wisdom". The shifting was getting stuck on this line of code: targetData . speed . current . split ( ' ' ) [ 0 ] ) It so happened by chance that the shapes I was adding manually were shapes where I had manually adjusted the passive_wisdom attribute, which in turn caused that attribute to be now stored as a string, and then when passed to the above split function, no issues were raised. However, the shapes I was adding via folder were shapes I hadn't manually altered, and hence the passive_wisdom attribute kept its original value and type (number), so when passed to the split function, the function failed. So, the issue was never folder vs individual shapes, but rather, shapes where I had manually changed the value of passive_wisdom, versus those with native passive_wisdom. What I'm doing on my end is editing that code so as to read without performing split (but that's because of my particular use case of your speed feature). Thanks again! I insist that this script is the glory!
1593282897
Angelo
API Scripter
Ah I see! I am going to see if I can change it to not make that assumption so you don't have to keep the local changes. Thank you for reporting!
Hi Angelo! Could you add a user token to the animal shapes which calls your !ws script? My druid is very lazy, never uses the chat (well, not if he had to type things). His character has the script as a macro token available, but if he changes into an animal shape those scripts are lost of course.
Hi Angelo! Angelo said: I have just pushed version 1.2 to master , you will need to update both files. (...) There is  one problem with the upgrade (...) To fix this problem  simple remove those shapes, make a new copy from the original and readd it to the list of shapes for your druid. I noticed that not all shapes were affected, those I had problems to import (new avatar image) seem to be correct. But to be certain, I will change all as you suggested. Just to be sure: Should I import the new avatars first (and not use them) and then do the update, or vice versa ?
1593453785

Edited 1593454220
Angelo
API Scripter
Norman V. said: Hi Angelo! Could you add a user token to the animal shapes which calls your !ws script? My druid is very lazy, never uses the chat (well, not if he had to type things). His character has the script as a macro token available, but if he changes into an animal shape those scripts are lost of course. Hi Norman, i think instead of adding another token that you/he would need to handle a better solution for this could be for your player to just have a normal "!ws" macro button in the bar in the bottom left instead of having it on the token itself? Norman V. said: Hi Angelo! Angelo said: I have just pushed version 1.2 to master , you will need to update both files. (...) There is  one problem with the upgrade (...) To fix this problem  simple remove those shapes, make a new copy from the original and readd it to the list of shapes for your druid. I noticed that not all shapes were affected, those I had problems to import (new avatar image) seem to be correct. But to be certain, I will change all as you suggested. Just to be sure: Should I import the new avatars first (and not use them) and then do the update, or vice versa ? the avatar reupload issue and the save/skill proficiencies problems due to the upgrade are different and unrelated things. The problem with 1.2 it's only if you are upgrading from a previous version AND you shapeshifted into a shape. To make sure the calculations are correct you will need to: - remove those shapes (or all of them if you are not sure which ones were used by your player and/or in testing) - make new copies from the originals - add the new copies to the list of shapes The problem with the avatar is because of a marketplace limitation. Now, if you are making new copies of the originals and you already have the avatars in your library you won't need to download/upload images again... but you still need to set the avatar on the copies from the files you previously uploaded to your library. Again, I would suggest to only do the "change avatar step" if you get the image error when trying to shapeshift, it's really hit or miss... i was getting it on most of my shapes when i first did it, another user told me he never had to do it
My druid is singing your praises as I hoped she would ;) She's delighted by this API, and so am I :) The ease of use and set up is just A+ Big, big thanks from both of us.
Could you add a user token to the animal shapes which calls your !ws script? My druid is very lazy, never uses the chat (well, not if he had to type things). His character has the script as a macro token available, but if he changes into an animal shape those scripts are lost of course. i think instead of adding another token that you/he would need to handle a better solution for this could be for your player to just have a normal "!ws" macro button in the bar in the bottom left instead of having it on the token itself? You're absolutely right! I totally forgot that players can use the bottom macro line as well .... silly me!
1593536036
Angelo
API Scripter
Inkcharm said: My druid is singing your praises as I hoped she would ;) She's delighted by this API, and so am I :) The ease of use and set up is just A+ Big, big thanks from both of us. happy you found it useful, thank you! i am planning on working on automatically duplicating/deleting characters when you add/remove shapes next, i should be done sometimes this week depending on how much free time i have :)
Hi Angelo! Sorry to bother you again. I just deleted all shapes, copied them again and tried to change the druid character into the first shape, an ape (monster manual, compendium). I got lots of errors ... (just showing them partly here): They are obviously caused by the lacking attributes. Creatures in the appendix A of the monster manual have their attributes named slightly different. I will change that by hand (adding those missing attributes), but maybe you want to include this case in your script.
And another suggestion, but I don't know how to handle that one: I created a token macro for starting the 'wild shape'. This macro reduces the amount of 'wild shape resources'. But of course ending the wild shape (returning to the original form) does not cost a resource. Do you have any idea, a kind of 'hook', that is only used if transforming into something else?
1593621461

Edited 1593621796
Angelo
API Scripter
i could modify the script to automatically handle a wild shape resource, i will add that as my next thing to do, should be pretty fast. About the Ape i have tried with both Ape and Giant Ape and it seems to work just fine for me, they both have all attributes needed. Were you trying with a different type of Ape?
1593658269

Edited 1593658302
Angelo
API Scripter
i have just pushed version 1.2.5 (you will need to update both files) the main new feature is: - in the main config there is a new "Wild Shape Resource" that you can set, if you do so it will automatically check and decrease the value whenever a druid transforms (thank you for the feedback Norman!) also: - i have added support for numerical values on the "SPEED" settings for npcs, that way you can use it for any other attribute you might want to assign to one of the three token bars (Juan this should fix your problem with using passive_wisdom instead)
- in the main config there is a new "Wild Shape Resource" that you can set, if you do so it will automatically check and decrease the value Only a small (I hope) problem here: The character sheet of my druid player uses not the 'repeated_resource(...)' just the 'class_resource'. I have not figured out yet, how to modify your code to look there (and also 'other_resource') also. Somehow it doesn't work, but I am just beginning to understand javascript :-)
1593700575
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
That section of the D&D 5th Edition by Roll20 Sheet is very odd and complicated to program for.
Yeah, I figured out that much :-) But I've seen the code from Angelo and I think he knows much better than me what to do :-)
Norman V. said: - in the main config there is a new "Wild Shape Resource" that you can set, if you do so it will automatically check and decrease the value Only a small (I hope) problem here: The character sheet of my druid player uses not the 'repeated_resource(...)' just the 'class_resource'. I have not figured out yet, how to modify your code to look there (and also 'other_resource') also. Somehow it doesn't work, but I am just beginning to understand javascript :-) One thing you could is create a repeated_resource for wild shape (with the same name) and fill the class_resource section with something else. I've done that myself for my own jury-rigged short rest and power expenditure macros, and to track exhaustion, and it seems to work.
1593716287

Edited 1593727635
Angelo
API Scripter
I'm actually not familiar with that stuff at all, learning as we go :D If you could tell me how you create a class resource instead of a repeated resource then I could look into it; I am just adding it as another "ammo" resource (don't remember the name right now, the ones to the right under ideals, flaws etc ) and I saw it showed up under "repeated_resource", that's why I coded for that EDIT: nvmd, i found out that the first one in that list is "class_resource", the second one is "other_resource" and all additional ones are "repeating_resource_-id_resource"... i am gonna modify the code to support all three
1593734970
Angelo
API Scripter
i have pushed a new version, now you should be able to use either class/other/repeating resources for your wildshape ability (you can just update the WildHelpers.js)
Hi Jay! and Hi Angelo! I thought of that solution or yours, Jay , also, but I also thought, that Angelo is certainly clever enough to adapt the regular expression. :-) I actually had tried in a similar way, but I missed some of the important consequence of introducing a new grouping paranthesis in the expression, so it couldn't work. Yeah, you see, I am just tinkering with the code - but, that way, I learned a bit or two from him :-) :-) :-) Angelo , just tested your new WildHelpers, great! There's one thing you might add to your documentation: 'Don't use resource names (including class_resource and other_resource) that have  parantheses in it, e.g. "Wild Shape (SR)".' I guess that issue is solveable, too, but I would suggest to leave it as it is now. Could be a nuisance to 'escape' those paranthesis accordingly ... Might I add a small wish? Check also, if the player is the GM. If so, then allow to change shape even if no more resource are left. This will work like 'ammo' from Aaron then, which I find quite useful.
1593898393

Edited 1593898416
Angelo
API Scripter
Norman V. said: Hi Jay! and Hi Angelo! I thought of that solution or yours, Jay , also, but I also thought, that Angelo is certainly clever enough to adapt the regular expression. :-) I actually had tried in a similar way, but I missed some of the important consequence of introducing a new grouping paranthesis in the expression, so it couldn't work. Yeah, you see, I am just tinkering with the code - but, that way, I learned a bit or two from him :-) :-) :-) Angelo , just tested your new WildHelpers, great! There's one thing you might add to your documentation: 'Don't use resource names (including class_resource and other_resource) that have  parantheses in it, e.g. "Wild Shape (SR)".' I guess that issue is solveable, too, but I would suggest to leave it as it is now. Could be a nuisance to 'escape' those paranthesis accordingly ... Might I add a small wish? Check also, if the player is the GM. If so, then allow to change shape even if no more resource are left. This will work like 'ammo' from Aaron then, which I find quite useful. these are all great points, i should be able to add all of them tomorrow (with the escaping of the resource name), thank you!
1593983365
Angelo
API Scripter
pushed a new version, now you can use special characters in your wild shape resource name and if you are a GM it will force the transformation if the resource goes down to 0. I have also fixed a bug, when dropping the token from the journal if it was doing the auto-transformation to the last shape it was also decreasing the resource. thanks again for the feedback! next up auto-duplicate/delete characters when adding to/removing from the shape list...
Wow, amazing! Many thanks!
Receiving this error when entering !ws command  (From WildShape):  ERROR: Cannot find ShapeShifter for the selected token any ideas?
1594278053
Angelo
API Scripter
Jeff S. said: Receiving this error when entering !ws command  (From WildShape):  ERROR: Cannot find ShapeShifter for the selected token any ideas? you have to make sure the name on the token matches whatever name is in your list of shapeshifters
1594282488

Edited 1594282661
Thank you for that direction. Where is that added?  here? let contents = this . makeList ( listItems ) + addShifterButton /*+ importShifterButton*/ + '<hr>' + configButton ; this . showMenu ( WS_API . NAME , contents , WS_API . NAME + ': ShapeShifters' ) ;
Maybe DM has to run it on their end first?
1594310528

Edited 1594311487
Angelo
API Scripter
Hey Jeff, The DM needs to add the API and configure which shapes tokens can shapeshift into which shapes, players don't have permissions to do that configuration. Everything is configurable through chat menus, you shouldn't need to change anything in the code.  The guide is on the readme in the GitHub link, point your DM to that and if he/she has problems I'll be happy to help
Hey, I've been trying around a bit with this api, for one of my players who is planning to play a Druid. It looks good so far, but is there a way to make the script mostly silent? I would very much prefer to use powercards for any emotes and messages in the chat.
1594317942

Edited 1594318274
Angelo
API Scripter
Sven K. said: Hey, I've been trying around a bit with this api, for one of my players who is planning to play a Druid. It looks good so far, but is there a way to make the script mostly silent? I would very much prefer to use powercards for any emotes and messages in the chat. hi! i am about to push (at some point today) an update with the auto duplication of character, I can add a new "silent" setting so that transformation messages are not sent together with that update. That should be the only message that is sent to all, another message (sent only to the player shifting) shows how many "wild shape" resources you have left for shifting, do you think that should be muted as well?
Angelo said: Sven K. said: Hey, I've been trying around a bit with this api, for one of my players who is planning to play a Druid. It looks good so far, but is there a way to make the script mostly silent? I would very much prefer to use powercards for any emotes and messages in the chat. hi! i am about to push (at some point today) an update with the auto duplication of character, I can add a new "silent" setting so that transformation messages are not sent together with that update. That should be the only message that is sent to all, another message (sent only to the player shifting) shows how many "wild shape" resources you have left for shifting, do you think that should be muted as well? I would actually prefer that. It is easy enough to add that in the PowerCard myself to get a consistent look with all my other macros, for spell slots, other class resources etc.
1594320891
Angelo
API Scripter
Sven K. said: Angelo said: Sven K. said: Hey, I've been trying around a bit with this api, for one of my players who is planning to play a Druid. It looks good so far, but is there a way to make the script mostly silent? I would very much prefer to use powercards for any emotes and messages in the chat. hi! i am about to push (at some point today) an update with the auto duplication of character, I can add a new "silent" setting so that transformation messages are not sent together with that update. That should be the only message that is sent to all, another message (sent only to the player shifting) shows how many "wild shape" resources you have left for shifting, do you think that should be muted as well? I would actually prefer that. It is easy enough to add that in the PowerCard myself to get a consistent look with all my other macros, for spell slots, other class resources etc. cool, i haven't used PowerCard so i am not sure how you can integrate my API menus with that to display the wild shape resource usage left AFTER you shapeshift, but I will do that, no prob :) Fyi all other GM messages (and player errors, like if they try to shapeshift through the API but they don't have resources left) will still be active, but in case you want to disable those for some reason you can go in the WildHelpers.js and comment out the code of all the chat functions, i really do not recommend doing that tho