VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
When interact Entity 'Get Item'
I need some help on a script.
void GetRope(string &in asEntity)
{
}
How to let the player get an item in his inventory?
|
|
06-09-2013, 02:04 PM |
|
Kullin
Member
Posts: 218
Threads: 23
Joined: May 2013
Reputation:
3
|
RE: When interact Entity 'Get Item'
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)
(This post was last modified: 06-09-2013, 02:41 PM by Kullin.)
|
|
06-09-2013, 02:39 PM |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: When interact Entity 'Get Item'
(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!
|
|
06-09-2013, 02:39 PM |
|
Kullin
Member
Posts: 218
Threads: 23
Joined: May 2013
Reputation:
3
|
|
06-09-2013, 02:43 PM |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: When interact Entity 'Get Item'
(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"
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 |
|
Kullin
Member
Posts: 218
Threads: 23
Joined: May 2013
Reputation:
3
|
RE: When interact Entity 'Get Item'
(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"
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 |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: When interact Entity 'Get Item'
(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"
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);
}
|
|
06-09-2013, 03:05 PM |
|
Kullin
Member
Posts: 218
Threads: 23
Joined: May 2013
Reputation:
3
|
RE: When interact Entity 'Get Item'
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.
(This post was last modified: 06-09-2013, 03:16 PM by Kullin.)
|
|
06-09-2013, 03:16 PM |
|
VeNoMzTeamHysterical
Member
Posts: 240
Threads: 36
Joined: Dec 2012
Reputation:
3
|
RE: When interact Entity 'Get Item'
(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>
|
|
06-09-2013, 03:24 PM |
|
Kullin
Member
Posts: 218
Threads: 23
Joined: May 2013
Reputation:
3
|
RE: When interact Entity 'Get Item'
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!
|
|
06-09-2013, 03:28 PM |
|
|