Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
When interact Entity 'Get Item'
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#1
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?

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
(This post was last modified: 06-09-2013, 03:36 PM by VeNoMzTeamHysterical.)
06-09-2013, 02:04 PM
Website Find
Kullin Offline
Member

Posts: 218
Threads: 23
Joined: May 2013
Reputation: 3
#2
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
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#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!

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
06-09-2013, 02:39 PM
Website Find
Kullin Offline
Member

Posts: 218
Threads: 23
Joined: May 2013
Reputation: 3
#4
RE: When interact Entity 'Get Item'

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
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#5
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" 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

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
(This post was last modified: 06-09-2013, 02:56 PM by VeNoMzTeamHysterical.)
06-09-2013, 02:52 PM
Website Find
Kullin Offline
Member

Posts: 218
Threads: 23
Joined: May 2013
Reputation: 3
#6
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" 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
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#7
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" 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);
}

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
06-09-2013, 03:05 PM
Website Find
Kullin Offline
Member

Posts: 218
Threads: 23
Joined: May 2013
Reputation: 3
#8
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
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#9
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>

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
06-09-2013, 03:24 PM
Website Find
Kullin Offline
Member

Posts: 218
Threads: 23
Joined: May 2013
Reputation: 3
#10
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
Find




Users browsing this thread: 3 Guest(s)