Hardarm
Posting Freak
Posts: 891
Threads: 39
Joined: Apr 2011
Reputation:
43
|
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?
listen to boards of canada
(This post was last modified: 06-16-2011, 10:28 AM by Hardarm.)
|
|
06-16-2011, 10:26 AM |
|
Tanshaydar
From Beyond
Posts: 3,085
Threads: 17
Joined: Mar 2009
Reputation:
67
|
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 |
|
Hardarm
Posting Freak
Posts: 891
Threads: 39
Joined: Apr 2011
Reputation:
43
|
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 |
|
Russ Money
Senior Member
Posts: 360
Threads: 25
Joined: Dec 2010
Reputation:
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 |
|
Hardarm
Posting Freak
Posts: 891
Threads: 39
Joined: Apr 2011
Reputation:
43
|
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 |
|
nemesis567
Posting Freak
Posts: 874
Threads: 65
Joined: May 2011
Reputation:
10
|
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 |
|
Hardarm
Posting Freak
Posts: 891
Threads: 39
Joined: Apr 2011
Reputation:
43
|
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 |
|
nemesis567
Posting Freak
Posts: 874
Threads: 65
Joined: May 2011
Reputation:
10
|
RE: Can using a Laudanium call a callback?
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 |
|
Hardarm
Posting Freak
Posts: 891
Threads: 39
Joined: Apr 2011
Reputation:
43
|
RE: Can using a Laudanium call a callback?
Thank you that worked!
listen to boards of canada
|
|
06-16-2011, 02:21 PM |
|
|