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
How to place several scripts in the .hps file
GoDiiXz Offline
Junior Member

Posts: 7
Threads: 2
Joined: Mar 2012
Reputation: 0
#1
Bug  How to place several scripts in the .hps file

Hey!

I am making my first custom story and i was wondering how i could get several scripts in the .hps file

i have fixed it so i have several of keys and doors to unlock, and in the script it looks like the picture i added, now i wonder where and what i am supposed to put in it.

there are to few video tutorials of htis scripting and on, and i think video make it so much easy, as i don't understand any code or any of that Tongue Cool



Attached Files
.jpg   script.jpg (Size: 315.46 KB / Downloads: 103)
03-27-2012, 03:05 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#2
RE: How to place several scripts in the .hps file

This is how your script works.

void OnStart
{
AddUseItemCallback("", "NAMEOFKEY", "NAMEOFTHEDOOR", "NAMEOFFUNCTION", true);
}

void NAMEOFFUNCTION(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("NAMEOFDOOR", false, true);
PlaySoundAtEntity("", "NAMEOFSOUND", "NAMEOFDOOR", 0, false);
RemoveItem(asItem);
}

AddUseItemCallback is used to be able to use an item on the world for example a key on a door or a knife on a corpse or what ever.

SetSwingDoorLocked is used to unlock the door but to unlock it you need to check the Locked on the Door in the level editor.

PlaySoundAtEntity plays a sound at the entity of your choice, can be the player, a script area or just an entity.

RemoveItem removes the item or in this case, the key.

I would suggest you look at Elven and YourComputer's video tutorials Smile

Elven:
http://wiki.frictionalgames.com/hpl2/tut...ng/article

YourComputer:
http://www.youtube.com/user/ThisIsYourComputer

(This post was last modified: 03-27-2012, 03:22 PM by SilentStriker.)
03-27-2012, 03:18 PM
Find
GoDiiXz Offline
Junior Member

Posts: 7
Threads: 2
Joined: Mar 2012
Reputation: 0
#3
RE: How to place several scripts in the .hps file

now i know how it works, but my problem as said, i do not know where i put in example: void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);

but i do not know where to put this script as i already have the door/key script there, to say it short: where do i put this scirpt: void AddEntityCollideCallback(string& asParentName, string& asChildName, string& asFunction, bool abDeleteOnCollide, int alStates);
please reply me a picture that shows where, in notepad++ offcourse ;D
03-27-2012, 03:52 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#4
RE: How to place several scripts in the .hps file

All callbacks are used inside the void OnStart and then the functions are outside it Smile

03-27-2012, 03:55 PM
Find
GoDiiXz Offline
Junior Member

Posts: 7
Threads: 2
Joined: Mar 2012
Reputation: 0
#5
RE: How to place several scripts in the .hps file

oooh, now I THINK i get it

all kinds of callback goes in this section? (first picture)

and all the FUNCTIONS goes in this section o.o? (second picture)

Big Grin

http://imageshack.us/photo/my-images/152/script1x.jpg/ (First image)
http://imageshack.us/photo/my-images/819/script2m.jpg/ (second image)
03-27-2012, 04:16 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#6
RE: How to place several scripts in the .hps file

Yes Smile When the callback calls a function you write the function outside the OnStart Smile

A function is for example the UsedKeyOnDoor Smile

03-27-2012, 04:26 PM
Find
GoDiiXz Offline
Junior Member

Posts: 7
Threads: 2
Joined: Mar 2012
Reputation: 0
#7
RE: How to place several scripts in the .hps file

THANK YOU SOOOO MUCH FOR YA HELP Big Grin I AM SOOOOO HAPPEY NOW ^^^^^^^ APPRECIATE YA MAN ;D
03-27-2012, 04:30 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#8
RE: How to place several scripts in the .hps file

Your Welcome Smile

03-27-2012, 04:34 PM
Find
GoDiiXz Offline
Junior Member

Posts: 7
Threads: 2
Joined: Mar 2012
Reputation: 0
#9
RE: How to place several scripts in the .hps file

another thing, a script to get a area wich the player goes in and activates a monster wich is a hallucination
03-27-2012, 06:22 PM
Find
SilentStriker Offline
Posting Freak

Posts: 950
Threads: 26
Joined: Jul 2011
Reputation: 43
#10
RE: How to place several scripts in the .hps file

Script areas and monster are created in the Level editor remember to check hallucination in the settings of the monster then use the AddEntityCollideCallback and SetEntityActive.

03-27-2012, 07:15 PM
Find




Users browsing this thread: 1 Guest(s)