Frictional Games Forum (read-only)

Full Version: How to remove Item (Entity)?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Is it possible to do a function... something like this?

RemoveItem("potion_health.ent");

Can you do something similar to that?
You mean from the inventory?
(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)
Well thats already what you have. Its RemoveItem(string asName);

All scripts are in the wiki http://wiki.frictionalgames.com/hpl2/amn..._functions Wink use F3 ctrl+f to browse the whole page.
(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/amn..._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/amn..._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
Oh :x sorry i thought you're a newbie Tongue
(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.
Nice idea actually.
(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
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.
Pages: 1 2