Frictional Games Forum (read-only)
[SCRIPT] Script on potions - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Script on potions (/thread-19092.html)



Script on potions - ZodiaC - 11-04-2012

Is it possible to activate a command(ex:playsound or spawn enemy) when player uses an potion(exConfusedanity potion)?


RE: Script on potions - ZodiaC - 11-05-2012

Really no one??


RE: Script on potions - Tiger - 11-05-2012

I don't think so. It would probably be pretty advanced coding, but I'm not sure.


RE: Script on potions - ZodiaC - 11-05-2012

(11-05-2012, 04:09 PM)Tigerwaw Wrote: I don't think so. It would probably be pretty advanced coding, but I'm not sure.
I think I found it by myself...But I don't really like my way...I would like to know if anyone has done it and how


RE: Script on potions - FlawlessHappiness - 11-05-2012

No, i think it's been mentioned before. It's not possible. I guess your way was: Checking if the players health changes.
How about making a timer that checks if GetPlayerHealth is bigger than what it was 1 second ago?


RE: Script on potions - ZodiaC - 11-05-2012

(11-05-2012, 04:35 PM)beecake Wrote: No, i think it's been mentioned before. It's not possible. I guess your way was: Checking if the players health changes.
How about making a timer that checks if GetPlayerHealth is bigger than what it was 1 second ago?
That's a good theory but i thought what if the player's health is already 100???And it actually works like a sanity potion..I made a value set to 1 when the player picks the item and the checks if the player has the item so if the var is 1 and the player has used the item it changes the var to 0 and that's it...But I'm not sure how is it going to work when the player chooses to use the item in another map


RE: Script on potions - FlawlessHappiness - 11-05-2012

Have the timer going in all the maps, checking the player sanity. And stop the timer with a GlobalVarInt when it is triggered. Or yea, make a timer that checks if the player has the item. Thats a good idea.