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
multiple functions problem
reptalol Offline
Junior Member

Posts: 5
Threads: 2
Joined: Oct 2011
Reputation: 0
#1
multiple functions problem

I appologize for two threads so soon of eachother, and definitely thanks for solving my problem earlier! But i've ran into another one, this one regarding my script. Ive watched several guides and read every tutorial i could find, but i'm not 100% sure what's wrong with this script, can you guys tell me?

PHP Code: (Select All)
void OnStart()
{
FadeOut(float (0));
SetPlayerSanity(float (0));
StartScreenShake(float (1), float (1), float (1), float (2));FadeIn(float (7));


AddEntityCollideCallback("Player""SanityTest""Scripttest"true, (1));SetEntityCallbackFunc("beginninglantern""lanterntrigger")}
void Scripttest(string &in asParentstring &in asChildint alState) {SetPlayerSanity(float (65));}
void lanterntrigger(string &in asEntitystring &in type) {SetSwingDoorClosed("castle_1"truetrue);} 
(This post was last modified: 10-09-2011, 06:09 AM by reptalol.)
10-09-2011, 06:06 AM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#2
RE: multiple functions problem

You don't have to write float (1) for float numbers, writing just 1 will automatically convert it to float.

Do you have any familiarity with identation which helps the code to be readable.

Write your numbers without float (1) or any parentheses. For further examples, you can look into the actual game maps scrip files.

(This post was last modified: 10-09-2011, 06:13 AM by Tanshaydar.)
10-09-2011, 06:12 AM
Website Find
reptalol Offline
Junior Member

Posts: 5
Threads: 2
Joined: Oct 2011
Reputation: 0
#3
RE: multiple functions problem

Oh thanks! As i said earlier im very new too this, but the problem im having was with the SetEntityCallbackFunc part, the first callback worked fine, but when they're both together my map wont start it would seem.
10-09-2011, 06:16 AM
Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#4
RE: multiple functions problem

There are types of callbacks depends on what you want to do.
Collision callbacks (collide callback)
Interaction callbacks (interact callback)
State callbacks (for wheels and levers, statechange callback)
and special type of callbacks like "OnIgnite", "OnBreak" and "OnPickup"

I'm sure you want to do something as soon as player picks up lantern. So it's easy. Just set the lanterntrigger name into the interaction callback section of entity tab.

void lanterntrigger(string &in asEntity)
{
SetSwingDoorClosed("castle_1", true, true);
}


for further reference http://wiki.frictionalgames.com/hpl2/amn..._functions

10-09-2011, 06:29 AM
Website Find
reptalol Offline
Junior Member

Posts: 5
Threads: 2
Joined: Oct 2011
Reputation: 0
#5
RE: multiple functions problem

perfect! Thanks so much that's excatly what i needed help on Tongue
(This post was last modified: 10-09-2011, 06:44 AM by reptalol.)
10-09-2011, 06:43 AM
Find




Users browsing this thread: 1 Guest(s)