# Android kawaiimaidmod lua bug... please help me

**URL:** <https://discourse.cataclysmdda.org/t/android-kawaiimaidmod-lua-bug-please-help-me/17692>\
**Category:** The Lab\
**Tags:** mod\
**Created:** [December 1, 2018, 3:41am UTC](https://discourse.cataclysmdda.org/t/android-kawaiimaidmod-lua-bug-please-help-me/17692 "2018-12-01T03:41:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Azure\_Soul\_Azur](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/azure_soul_azur/32/2835_2.png) [@Azure\_Soul\_Azur](https://discourse.cataclysmdda.org/u/Azure_Soul_Azur)\
**Post date:** [December 1, 2018, 3:41am UTC](https://discourse.cataclysmdda.org/t/android-kawaiimaidmod-lua-bug-please-help-me/17692/1 "2018-12-01T03:41:47Z")

</div>

Android version 8219

I believe the problem with CTDing is here

" player:i\_rem(item) "

As one can guess it is the part of the code to remove a item from the player’s inv…

like when you open the fancy box.  
like when you use the install implant kit.  
like when you send out items for points.

… But it just plain is not working and i can’t figure out why for the life of me.

Please someone with a clue of what they are doing help me.

" player:i\_rem(item(“kawaii\_amts\_box”, 1)) "  
does not work either… just gives me a error that there is no item to remove

---

<div class="post-metadata">

**Author:** ![Azure\_Soul\_Azur](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/azure_soul_azur/32/2835_2.png) [@Azure\_Soul\_Azur](https://discourse.cataclysmdda.org/u/Azure_Soul_Azur)\
**Post date:** [December 1, 2018, 6:03am UTC](https://discourse.cataclysmdda.org/t/android-kawaiimaidmod-lua-bug-please-help-me/17692/2 "2018-12-01T06:03:22Z")

</div>

Okay a temp and bad fix for this is to just remove all the " player:i\_rem(item) " lines

And it works fine just the items don’t get removed like they should…  
Just going to drop them on the ground for now till someone can fix this…  
I have 100% run out of ideas other then this being a bug with CDDA and the " player:i\_rem(item) "  
no longer works.

---

<div class="post-metadata">

**Author:** ![Zhilkin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zhilkin/32/3749_2.png) [@Zhilkin](https://discourse.cataclysmdda.org/u/Zhilkin)\
**Post date:** [December 1, 2018, 8:56am UTC](https://discourse.cataclysmdda.org/t/android-kawaiimaidmod-lua-bug-please-help-me/17692/3 "2018-12-01T08:56:06Z")

</div>

If you want to remove item from player inventory you should either provide `item` (item reference) or `int` (item position in player inventory).

You can interate through all items in player inventory and use `player:i_at(int)` to get `item`.

---

<div class="post-metadata">

**Author:** ![Azure\_Soul\_Azur](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/azure_soul_azur/32/2835_2.png) [@Azure\_Soul\_Azur](https://discourse.cataclysmdda.org/u/Azure_Soul_Azur)\
**Post date:** [December 1, 2018, 9:01am UTC](https://discourse.cataclysmdda.org/t/android-kawaiimaidmod-lua-bug-please-help-me/17692/4 "2018-12-01T09:01:32Z")

</div>

All hail Zhilkin! I will try to set that up as soon as my tablets battery is not nearly 0%… bit to much coding and playing cdda… :3

---

<div class="post-metadata">

**Author:** ![Azure\_Soul\_Azur](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/azure_soul_azur/32/2835_2.png) [@Azure\_Soul\_Azur](https://discourse.cataclysmdda.org/u/Azure_Soul_Azur)\
**Post date:** [December 2, 2018, 12:36am UTC](https://discourse.cataclysmdda.org/t/android-kawaiimaidmod-lua-bug-please-help-me/17692/5 "2018-12-02T00:36:44Z")

</div>

Okay i know this is a problem of my own lack of ability but at this point i am just going to take a break from trying to get this to work and leave this here

at least like this it no longer CTDs but the items still don’t get removed.

– ■AMTS Installation kit (Read the notes on the outer box) (“kawaii\_amts\_box”)  
function amts\_kit(item, active)  
game.popup(gText(“boxmemo”))  
cmsg(“light\_green”, “You open the fancy box.”)  
player:i\_add(item(“kawaii\_amts\_box2”, 1))  
player:i\_add(item(“kawaii\_amts\_manual”, 1))  
player:i\_at(int)  
player:i\_rem(item)  
end

– ■AMTS Installation kit (treatment) (“kawaii\_amts\_box2”)  
function amts\_kit2(item, active)  
cmsg(“light\_green”, “You implant the AMTS device.”)  
player:set\_value(“Kawaii\_AMTS\_Active”, “true”)  
player:i\_add(item(“kawaii\_amts\_reciver”, 1))  
player:i\_add(item(“kawaii\_amts\_transmitter”, 1))  
player:i\_add(item(“kawaii\_amts\_point\_viewer”, 1))  
EditRP(0)  
EditPoint(0)  
player:i\_at(int)  
player:i\_rem(item)  
end

And even if i get that working i have no idea about the removeing of 1 item out of a list of them for another part of the code… kawaiimaidmod preload.lua

If anyone wants to tell my bakaself what i am doing wrong please tell me.

---

<div class="post-metadata">

**Author:** ![Azure\_Soul\_Azur](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/azure_soul_azur/32/2835_2.png) [@Azure\_Soul\_Azur](https://discourse.cataclysmdda.org/u/Azure_Soul_Azur)\
**Post date:** [December 2, 2018, 12:14pm UTC](https://discourse.cataclysmdda.org/t/android-kawaiimaidmod-lua-bug-please-help-me/17692/6 "2018-12-02T12:14:06Z")

</div>

Been playing for awhile now and…

turns out even more of the lua is borked…

You can’t gain points for rank ups…

… i really like this mod but my goddess it’s lua loves breaking.

…guess i’ll try to fix it after i or someone else somehow or another fixes the item removels.
