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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom Entities
Author Message
7heDubz Offline
Posting Freak

Posts: 1,329
Joined: Feb 2013
Reputation: 41
Post: #1
Custom Entities

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!

03-04-2013 05:30 AM
Find all posts by this user Quote this message in a reply
Rapture Offline
Posting Freak

Posts: 1,078
Joined: May 2011
Reputation: 30
Post: #2
RE: Custom Entities

http://wiki.frictionalgames.com/hpl2/amn..._functions

Jump down to --> Inventory and...

void GiveItem(string& asName, string& asType, string& asSubTypeName, string& asImageName, float afAmount);
03-04-2013 06:35 AM
Find all posts by this user Quote this message in a reply
7heDubz Offline
Posting Freak

Posts: 1,329
Joined: Feb 2013
Reputation: 41
Post: #3
RE: Custom Entities

(03-04-2013 06:35 AM)Rapture Wrote:  http://wiki.frictionalgames.com/hpl2/amn..._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?

03-04-2013 06:59 AM
Find all posts by this user Quote this message in a reply
PutraenusAlivius Offline
Posting Freak

Posts: 4,712
Joined: Dec 2012
Reputation: 119
Post: #4
RE: Custom Entities

(03-04-2013 06:35 AM)Rapture Wrote:  http://wiki.frictionalgames.com/hpl2/amn..._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: (Select All)
void StartEffectFlash(float afFadeInfloat afWhitefloat afFadeOut); 
to
PHP Code: (Select All)
void OnStart()
{
    
SetEntityPlayerInteractCallback("ENTITYNAME""FUNCNAME"false);
}

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

How to do it?

"Veni, vidi, vici."
"I came, I saw, I conquered."
03-04-2013 08:31 AM
Find all posts by this user Quote this message in a reply
Rapture Offline
Posting Freak

Posts: 1,078
Joined: May 2011
Reputation: 30
Post: #5
RE: Custom Entities

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/tut...iferorange
03-04-2013 04:39 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)