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

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can using a Laudanium call a callback?
Author Message
Hardarm Offline
Senior Member

Posts: 699
Joined: Apr 2011
Reputation: 34
Post: #1
Can using a Laudanium call a callback?
Hi. Can someone call a callback using a laudanium? (obviously to myself);
Just using a normal laudanium.
here's the part of the code:
void fade1(string &in asTimer)
{
SetEntityPlayerInteractCallback("potion_health_1", "TakeIt", true);
FadeIn(1.0);
StartPlayerLookAt("potion_health_1", 10, 1, "");
SetMessage("Global", "Hint02", 4);
SetPlayerActive(true);
}

void TakeIt(string &in asEntity)
{
SetMessage("Global", "Hint03", 3);
SetEntityActive("rock_debris_brown01_1", true);
SetEntityActive("rock_debris_brown02_1", true);
StartScreenShake(0.3, 2, 0.5, 0.5);
PlaySoundAtEntity("", "break_stairs.snt", "ScriptArea_4", 0, false);
AddUseItemCallback("", "potion_health_1", "Player", "fade2", false);
}

void fade2(string &in asItem, string &in asEntity)
{
ExitInventory();
SetInventoryDisabled(true);
FadeOut(2.0);
AddTimer("", 4, "fade3");
}

I tried this, map does start, but fade2 doesn't work. help please? Sad

(This post was last modified: 06-16-2011 10:28 AM by Hardarm.)
06-16-2011 10:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,091
Joined: Mar 2009
Reputation: 66
Post: #2
RE: Can using a Laudanium call a callback?
Interaction callbacks are being called the moment you pick the item, not the moment you use them. You can check player health instead whenever it opens or closes inventory.

(This post was last modified: 06-16-2011 10:29 AM by Tanshaydar.)
06-16-2011 10:28 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Hardarm Offline
Senior Member

Posts: 699
Joined: Apr 2011
Reputation: 34
Post: #3
RE: Can using a Laudanium call a callback?
(06-16-2011 10:28 AM)Tanshaydar Wrote:  Interaction callbacks are being called the moment you pick the item, not the moment you use them. You can check player health instead whenever it opens or closes inventory.

In fact you fall down in a really big descent. and the health must be 99, but if someone's smart can just sit there and wait, and take the laudanium later


Help please i need it to continue the script of my map :/ Shall I edit the inventory.hps?

(This post was last modified: 06-16-2011 11:27 AM by Hardarm.)
06-16-2011 10:34 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Russ Money Offline
Senior Member

Posts: 360
Joined: Dec 2010
Reputation: 3
Post: #4
RE: Can using a Laudanium call a callback?
(06-16-2011 10:34 AM)Hardarm Wrote:  
(06-16-2011 10:28 AM)Tanshaydar Wrote:  Interaction callbacks are being called the moment you pick the item, not the moment you use them. You can check player health instead whenever it opens or closes inventory.

In fact you fall down in a really big descent. and the health must be 99, but if someone's smart can just sit there and wait, and take the laudanium later


Help please i need it to continue the script of my map :/ Shall I edit the inventory.hps?

Editing the inventory.hps wouldn't do anything, I believe that's mainly used for combinations. If you anticipate the player would use the Laudanium when they got it, you could set a short timer that after they pick it up, it would fade to black. Otherwise I cannot think of a way besides checking their health to see if it "stablized" meaning they used the Laudanium.

06-16-2011 11:51 AM
Find all posts by this user Quote this message in a reply
Hardarm Offline
Senior Member

Posts: 699
Joined: Apr 2011
Reputation: 34
Post: #5
RE: Can using a Laudanium call a callback?
But how to call a callback when they use it; i mean. They use the Laudanium, and inventory will exit and there's a series of action, as you can see on fade2. But i can't make that function work....

06-16-2011 12:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
nemesis567 Offline
Posting Freak

Posts: 840
Joined: May 2011
Reputation: 10
Post: #6
RE: Can using a Laudanium call a callback?
Loop Timer, 1 sec duration. When the player landanum count reduces by 1, that is called since the only way for the player to loose the landanum is to use it.

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
06-16-2011 01:11 PM
Find all posts by this user Quote this message in a reply
Hardarm Offline
Senior Member

Posts: 699
Joined: Apr 2011
Reputation: 34
Post: #7
RE: Can using a Laudanium call a callback?
Can you paste the code please? I'm kind of noob on that.

06-16-2011 01:21 PM
Visit this user's website Find all posts by this user Quote this message in a reply
nemesis567 Offline
Posting Freak

Posts: 840
Joined: May 2011
Reputation: 10
Post: #8
RE: Can using a Laudanium call a callback?
http://pastebin.com/MCE1rWbW

Today I dreamt the life I could live forever. You only know that when you feel it for you know not what you like until you've experienced it.
06-16-2011 01:42 PM
Find all posts by this user Quote this message in a reply
Hardarm Offline
Senior Member

Posts: 699
Joined: Apr 2011
Reputation: 34
Post: #9
RE: Can using a Laudanium call a callback?
Thank you that worked! Shy

06-16-2011 02:21 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




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