Frictional Games Forum (read-only)
[SCRIPT] Is there a way to make the player spawn with a lantern in their inventory? - 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: [SCRIPT] Is there a way to make the player spawn with a lantern in their inventory? (/thread-12474.html)



Is there a way to make the player spawn with a lantern in their inventory? - A Tricky Carnie - 01-09-2012

I'm making the second chapter of my custom story, and since in continues from where the first one left off, I want the player to spawn in the first map with a lantern, and keep it throughout the CS. Is this possible?

Also what is the script command to make the player start out with half their oil instead of it being full?

thanks in advance Big Grin .


RE: Is there a way to make the player spawn with a lantern in their inventory? - flamez3 - 01-09-2012

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 \ graphics\Item\chemical_container_full.tga : is the image which will appear in Inventory - img155.imageshack.us/img155/6871/20806785.jpg


Taken from http://wiki.frictionalgames.com/hpl2/amnesia/script_functions


Sorry I can't help you any more, don't have amnesia with me to test : P



RE: Is there a way to make the player spawn with a lantern in their inventory? - Statyk - 01-09-2012

^^^
That's for spawning with the lantern.

SetPlayerLampOil(50);

sets the lamp oil to 50%


RE: Is there a way to make the player spawn with a lantern in their inventory? - MulleDK19 - 01-09-2012

(01-09-2012, 01:02 AM)flamez3 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 \ graphics\Item\chemical_container_full.tga : is the image which will appear in Inventory - img155.imageshack.us/img155/6871/20806785.jpg


Taken from http://wiki.frictionalgames.com/hpl2/amnesia/script_functions


Sorry I can't help you any more, don't have amnesia with me to test : P
No, don't use that.

Use void GiveItemFromFile(string& asName, string& asFileName);




Code:
GiveItemFromFile("lantern", "lantern.ent");



RE: Is there a way to make the player spawn with a lantern in their inventory? - Statyk - 01-09-2012

(01-09-2012, 05:47 PM)MulleDK19 Wrote:
(01-09-2012, 01:02 AM)flamez3 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 \ graphics\Item\chemical_container_full.tga : is the image which will appear in Inventory - img155.imageshack.us/img155/6871/20806785.jpg


Taken from http://wiki.frictionalgames.com/hpl2/amnesia/script_functions


Sorry I can't help you any more, don't have amnesia with me to test : P
No, don't use that.

Use void GiveItemFromFile(string& asName, string& asFileName);




Code:
GiveItemFromFile("lantern", "lantern.ent");

They both work the same, but putting it the way flamez3 did it is more precise and adjustable.