Frictional Games Forum (read-only)
Custom Entities - 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: Custom Entities (/thread-20610.html)



Custom Entities - 7heDubz - 03-04-2013

Help with custom entity,

I just want to place it inside the players inventory from the begining of the game, but not quite sure how.

Cant find anything on the Interwebs so hoping i could find some help here!


RE: Custom Entities - Rapture - 03-04-2013

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

Jump down to --> Inventory and...

void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);


RE: Custom Entities - 7heDubz - 03-04-2013

(03-04-2013, 06:35 AM)Rapture Wrote: http://wiki.frictionalgames.com/hpl2/amnesia/script_functions

Jump down to --> Inventory and...

void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);

Thanks, do you know what each of the feilds mean? ex the floattime at the end. what decimal needs to go there?


RE: Custom Entities - PutraenusAlivius - 03-04-2013

(03-04-2013, 06:35 AM)Rapture Wrote: http://wiki.frictionalgames.com/hpl2/amnesia/script_functions

Jump down to --> Inventory and...

void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);
You'd just copy-paste that from the Script Functions page, huh? Anyway, how to make the script in the Script Functions page to turn into a script that can be put into the .hps file?
EXAMPLE:
From the Script Functions page;
PHP Code:
void StartEffectFlash(float afFadeInfloat afWhitefloat afFadeOut); 
to
PHP Code:
void OnStart()
{
    
SetEntityPlayerInteractCallback("ENTITYNAME""FUNCNAME"false);
}

void FUNCNAME(string &in asEntity)
{
    
StartEffectEmotionFlash("MessageCat""MessageEntry""ui_emotion_stone.snt");

How to do it?


RE: Custom Entities - Rapture - 03-04-2013

void OnStart()
{
SetEntityPlayerInteractCallback("ENTITYNAME", "FUNCNAME", false);

GiveItem("stone_hammer_chipper", "Puzzle", "stone_hammer_chipper", "stone_hammer_chipper.tga", 1);
}


Took it from this... http://wiki.frictionalgames.com/hpl2/tutorials/level_editor/combininghammerchipperjenniferorange