Frictional Games Forum (read-only)
How to remove Item (Entity)? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: How to remove Item (Entity)? (/thread-20742.html)

Pages: 1 2


How to remove Item (Entity)? - ehovda321 - 03-14-2013

Is it possible to do a function... something like this?

RemoveItem("potion_health.ent");

Can you do something similar to that?


RE: How to remove Item (Entity)? - tonitoni1998 - 03-14-2013

You mean from the inventory?


RE: How to remove Item (Entity)? - ehovda321 - 03-14-2013

(03-14-2013, 05:48 PM)tonitoni1998 Wrote: You mean from the inventory?

Yes, I want to remove 1 .ent from the inventory (If you have 3 health potions - I want to remove 1)


RE: How to remove Item (Entity)? - tonitoni1998 - 03-14-2013

Well thats already what you have. Its RemoveItem(string asName);

All scripts are in the wiki http://wiki.frictionalgames.com/hpl2/amnesia/script_functions Wink use F3 ctrl+f to browse the whole page.


RE: How to remove Item (Entity)? - ehovda321 - 03-14-2013

(03-14-2013, 05:54 PM)tonitoni1998 Wrote: Well thats already what you have. Its RemoveItem(string asName);

All scripts are in the wiki http://wiki.frictionalgames.com/hpl2/amnesia/script_functions Wink use F3 ctrl+f to browse the whole page.

Yeah, but bro- here's the problem, the RemoveItem(); function can not be used with an .ent at the end... Sad

(03-14-2013, 05:54 PM)tonitoni1998 Wrote: Well thats already what you have. Its RemoveItem(string asName);

All scripts are in the wiki http://wiki.frictionalgames.com/hpl2/amnesia/script_functions Wink use F3 ctrl+f to browse the whole page.

and btw - I've already developed 3 custom stories, so I know where the script functions are... xD


RE: How to remove Item (Entity)? - tonitoni1998 - 03-14-2013

Oh :x sorry i thought you're a newbie Tongue


RE: How to remove Item (Entity)? - ehovda321 - 03-14-2013

(03-14-2013, 06:02 PM)tonitoni1998 Wrote: Oh :x sorry i thought you're a newbie Tongue

No problem, thanks for your help. I'm developing a store in my mod, I've got everything set up- but when you "SELL" items, I want it to remove .ent files from your inventory.


RE: How to remove Item (Entity)? - tonitoni1998 - 03-14-2013

Nice idea actually.


RE: How to remove Item (Entity)? - ehovda321 - 03-14-2013

(03-14-2013, 06:08 PM)tonitoni1998 Wrote: Nice idea actually.

Thanks! I've figured out what to do... but it's gonna add like 700 lines to my code... lol


RE: How to remove Item (Entity)? - Your Computer - 03-14-2013

You're supposed to provide the (internal) name of the item, not the file name, to RemoveItem. If the item was picked up from the environment, then it should be the entity name. If it was given through a script, then you were the one that gave it a name.

Also, 700+ lines of code for a merchant script? That sounds absurd.