# Adding new iuse function

**URL:** <https://discourse.cataclysmdda.org/t/adding-new-iuse-function/10686>\
**Category:** The Toolbox\
**Created:** [October 13, 2015, 4:13pm UTC](https://discourse.cataclysmdda.org/t/adding-new-iuse-function/10686 "2015-10-13T16:13:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Osobist](https://avatars.discourse-cdn.com/v4/letter/o/b3f665/32.png) [@Osobist](https://discourse.cataclysmdda.org/u/Osobist)\
**Post date:** [October 13, 2015, 4:13pm UTC](https://discourse.cataclysmdda.org/t/adding-new-iuse-function/10686/1 "2015-10-13T16:13:19Z")

</div>

Greetings. I have a question - is there any mean to add new iuse function in mod without main gamedata being involved, so it could work only when mod is activated.

For example: we have a two variants of the talking doll. I want to add a new one with different speech lines but I can’t since the use\_action DOLLCHAT takes lines from already existing doll.

---

<div class="post-metadata">

**Author:** ![Litppunk](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/litppunk/32/409_2.png) [@Litppunk](https://discourse.cataclysmdda.org/u/Litppunk)\
**Post date:** [October 13, 2015, 4:47pm UTC](https://discourse.cataclysmdda.org/t/adding-new-iuse-function/10686/2 "2015-10-13T16:47:46Z")

</div>

OH… hmm not the one to go for on help for stuff like this, but I am first responder, so I will do my best. Should be a way with .json’s to add possible results to the talking doll. Would be kind of nice to have doll choose from a variety of random sayings. Untill now I didn’t even realize that you could (a)ctivate them and get a message…I just always stole the batteries out of them/ left them to be broken down later, maybe if they can be for parts.

---

<div class="post-metadata">

**Author:** ![Osobist](https://avatars.discourse-cdn.com/v4/letter/o/b3f665/32.png) [@Osobist](https://discourse.cataclysmdda.org/u/Osobist)\
**Post date:** [October 13, 2015, 5:15pm UTC](https://discourse.cataclysmdda.org/t/adding-new-iuse-function/10686/3 "2015-10-13T17:15:21Z")

</div>

Yeah, batteries and spare parts is the main benefit but I think about authenticity too.

---

<div class="post-metadata">

**Author:** ![Litppunk](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/litppunk/32/409_2.png) [@Litppunk](https://discourse.cataclysmdda.org/u/Litppunk)\
**Post date:** [October 13, 2015, 5:16pm UTC](https://discourse.cataclysmdda.org/t/adding-new-iuse-function/10686/4 "2015-10-13T17:16:46Z")

</div>

^.^ always nice. I just didn’t even realize they do that.

---

<div class="post-metadata">

**Author:** ![Coolthulhu](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/coolthulhu/32/2446_2.png) [@Coolthulhu](https://discourse.cataclysmdda.org/u/Coolthulhu)\
**Post date:** [October 13, 2015, 7:07pm UTC](https://discourse.cataclysmdda.org/t/adding-new-iuse-function/10686/5 "2015-10-13T19:07:31Z")

</div>

You can either edit the game code and PR the changes on github or make a lua iuse function.  
For lua iuse functions, there is an example in the docs somewhere.

---

<div class="post-metadata">

**Author:** ![Osobist](https://avatars.discourse-cdn.com/v4/letter/o/b3f665/32.png) [@Osobist](https://discourse.cataclysmdda.org/u/Osobist)\
**Post date:** [October 13, 2015, 7:39pm UTC](https://discourse.cataclysmdda.org/t/adding-new-iuse-function/10686/6 "2015-10-13T19:39:13Z")

</div>

Both seems hard for me since I can’t into the code. But that’s a good reason to start studying. Thanks for the help.

---

<div class="post-metadata">

**Author:** ![RADIALTHRONE1](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/radialthrone1/32/377_2.png) [@RADIALTHRONE1](https://discourse.cataclysmdda.org/u/RADIALTHRONE1)\
**Post date:** [October 14, 2015, 7:14pm UTC](https://discourse.cataclysmdda.org/t/adding-new-iuse-function/10686/7 "2015-10-14T19:14:54Z")

</div>

> [@Coolthulhu](#):
>
> For lua iuse functions, there is an example in the docs somewhere.

For activating a manhack. Which is useful if thats the kind of iuse your trying to make. Otherwise, you have to know how to write lua, the equivalent code from the C++ iuse coding, how to make the game read the lua file, etc.

See relevant topics:  
[“Lua modding prototype” by CIB](http://smf.cataclysmdda.com/index.php?topic=2179)  
[CIB’s devlog](http://smf.cataclysmdda.com/index.php?topic=7264)  
[Way to add new iuse values to a mod?](http://smf.cataclysmdda.com/index.php?topic=7192)  
[Questions about the old .lua coding system](http://smf.cataclysmdda.com/index.php?topic=11222)

---

<div class="post-metadata">

**Author:** ![Dampe](https://avatars.discourse-cdn.com/v4/letter/d/e19b73/32.png) [@Dampe](https://discourse.cataclysmdda.org/u/Dampe)\
**Post date:** [October 16, 2015, 1:43pm UTC](https://discourse.cataclysmdda.org/t/adding-new-iuse-function/10686/8 "2015-10-16T13:43:01Z")

</div>

> [@Litppunk](#):
>
> OH… hmm not the one to go for on help for stuff like this, but I am first responder, so I will do my best. Should be a way with .json’s to add possible results to the talking doll. Would be kind of nice to have doll choose from a variety of random sayings. Untill now I didn’t even realize that you could (a)ctivate them and get a message…I just always stole the batteries out of them/ left them to be broken down later, maybe if they can be for parts.

Their messages are creepy as hell, too…
