Frictional Games Forum (read-only)

Full Version: Can using a Laudanium call a callback?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi. Can someone call a callback using a laudanium? (obviously to myself);
Just using a normal laudanium.
here's the part of the code:
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
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.
(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?
(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.
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....
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.
Can you paste the code please? I'm kind of noob on that.
Thank you that worked! Shy