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
Can using a Laudanium call a callback?
Hardarm Offline
Posting Freak

Posts: 891
Threads: 39
Joined: Apr 2011
Reputation: 43
#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

listen to boards of canada
(This post was last modified: 06-16-2011, 10:28 AM by Hardarm.)
06-16-2011, 10:26 AM
Website Find
Tanshaydar Offline
From Beyond

Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation: 67
#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
Website Find
Hardarm Offline
Posting Freak

Posts: 891
Threads: 39
Joined: Apr 2011
Reputation: 43
#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?

listen to boards of canada
(This post was last modified: 06-16-2011, 11:27 AM by Hardarm.)
06-16-2011, 10:34 AM
Website Find
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#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
Hardarm Offline
Posting Freak

Posts: 891
Threads: 39
Joined: Apr 2011
Reputation: 43
#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....

listen to boards of canada
06-16-2011, 12:38 PM
Website Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#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
Hardarm Offline
Posting Freak

Posts: 891
Threads: 39
Joined: Apr 2011
Reputation: 43
#7
RE: Can using a Laudanium call a callback?

Can you paste the code please? I'm kind of noob on that.

listen to boards of canada
06-16-2011, 01:21 PM
Website Find
nemesis567 Offline
Posting Freak

Posts: 874
Threads: 65
Joined: May 2011
Reputation: 10
#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
Hardarm Offline
Posting Freak

Posts: 891
Threads: 39
Joined: Apr 2011
Reputation: 43
#9
RE: Can using a Laudanium call a callback?

Thank you that worked! Shy

listen to boards of canada
06-16-2011, 02:21 PM
Website Find




Users browsing this thread: 1 Guest(s)