Frictional Games Forum (read-only)

Full Version: When interact Entity 'Get Item'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I need some help on a script.

void GetRope(string &in asEntity)
{

}

How to let the player get an item in his inventory?
GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);

asName - internal name
asType - item to give
asSubTypeName - item name for .lang file
asImageName - For exemple: void GiveItem(string& asName, string& asType, “chemical_container_full”, “chemical_container_full.tga” , float afAmount);

or

GiveItemFromFile(string& asName, string& asFileName);
Adds a single item to the player's inventory. This is meant to be used for debug mostly as it creates the actual item and then destroys it.

asName - internal name
asFileName - item to give + extension (.ent)
(06-09-2013, 02:39 PM)Kullin Wrote: [ -> ]GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);
Adds an item to the inventory of the player. Note that the item does not have to exist as entity in the world to be able to do this.
asName - internal name
asType - item to give
asSubTypeName - item name for .lang file
asImageName - For exemple: void GiveItem(string& asName, string& asType, “chemical_container_full”, “chemical_container_full.tga” , float afAmount); The image is from <nowiki> <nowiki> <nowiki>\ </nowiki> </nowiki> </nowiki> graphics\Item\chemical_container_full.tga : is the image which will appear in Inventory -
THanks!
No problem!
If you need script functions go to: http://wiki.frictionalgames.com/hpl2/amn..._functions
And press CTRL+F and search after something, like "giveitem" Wink
(06-09-2013, 02:43 PM)Kullin Wrote: [ -> ]No problem!
If you need script functions go to: http://wiki.frictionalgames.com/hpl2/amn..._functions
And press CTRL+F and search after something, like "giveitem" Wink

So should be?

void GetRope(string &in asEntity)
{
GiveItem("rope_beam02_1", "string_pile_1", "Rope", "string_pile.tga", 1);
SetEntityActive("rope_beam02_1", false);
}

mmm i don't get it work :S
(06-09-2013, 02:52 PM)VeNoMzTeamHysterical Wrote: [ -> ]
(06-09-2013, 02:43 PM)Kullin Wrote: [ -> ]No problem!
If you need script functions go to: http://wiki.frictionalgames.com/hpl2/amn..._functions
And press CTRL+F and search after something, like "giveitem" Wink

So should be?

void GetRope(string &in asEntity)
{
GiveItem("rope_beam02_1", "string_pile_1", "Rope", "string_pile.tga", 1);
SetEntityActive("rope_beam02_1", false);
}

mmm i don't get it work :S
Can I get the whole script and can you tell me exactly what you wanna do?
(06-09-2013, 03:04 PM)Kullin Wrote: [ -> ]
(06-09-2013, 02:52 PM)VeNoMzTeamHysterical Wrote: [ -> ]
(06-09-2013, 02:43 PM)Kullin Wrote: [ -> ]No problem!
If you need script functions go to: http://wiki.frictionalgames.com/hpl2/amn..._functions
And press CTRL+F and search after something, like "giveitem" Wink

So should be?

void GetRope(string &in asEntity)
{
GiveItem("rope_beam02_1", "string_pile_1", "Rope", "string_pile.tga", 1);
SetEntityActive("rope_beam02_1", false);
}

mmm i don't get it work :S
Can I get the whole script and can you tell me exactly what you wanna do?
I don't get the text.
I do get the item now.

void GetRope(string &in asEntity)
{
GiveItem("rope_beam02_1", "string_pile.ent", "Rope", "pile_string.tga", 1);
SetEntityActive("rope_beam02_1", false);
}
Oh it don't show that, but you can use the:

SetMessage(string& asTextCategory, string& asTextEntry, float afTime);
asTextCategory - the category in the .lang file
asTextEntry - the entry in the .lang file
afTime - determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length.
(06-09-2013, 03:16 PM)Kullin Wrote: [ -> ]Oh it don't show that, but you can use the:

SetMessage(string& asTextCategory, string& asTextEntry, float afTime);
asTextCategory - the category in the .lang file
asTextEntry - the entry in the .lang file
afTime - determines how long the message is displayed. If time is < =0 then the life time is calculated based on string length.

That sucks so i cant load some how the item with this?

<Entry Name="ItemDesc_Cellar_Key">It might be useful!</Entry>
<Entry Name="ItemName_Cellar_Key">Rope!</Entry>
GiveItem("rope_beam02_1", "string_pile_1", "Cellar_Key", "string_pile.tga", 1);


Like that, i think, if it's called Cellar_key in the lang!
Pages: 1 2