Do something when wheel is on its limit - 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: Do something when wheel is on its limit (/thread-23988.html) |
Do something when wheel is on its limit - Neo - 11-30-2013 Hey there I've got a problem with the wheels again I found out how to execute code when the player interacts with a valve or so, but then you just need to click on it one time, and I want to do something when you spin the wheel to the limit. Is it possible? :/ I haven't found a function for this yet... It would be very kind if someone could help me RE: Do something when wheel is on its limit - DnALANGE - 11-30-2013 (11-30-2013, 03:46 PM)Neo Wrote: Hey there here is an example you can copy paste: ///////OpenHeavyDoor/////// void OpenheavyDoor(string &in asEntity, int alState) { if(alState == 1) //Meaning wheel is "toutching" MAX { SetWheelStuckState("YOURWHEELNAME", 1, true); //Sets the wheel STUCK so you can't spin it anymore. //STUFF YOU WANT TO HAPPEN IF WHEEL goes to MAX, can be empty if you only want something happen on MINUMUM. } if(alState == -1) //Meaning wheel is "toutching" MINIMUM { //STUFF YOU WANT TO HAPPEN IF WHEEL goes to MIMIMUM, can be empty if you only want something happen on MAX. } } ----- void OpenheavyDoor(string &in asEntity, int alState) The OpenheavyDoor copy paste this into your EDITOR -> YOURWHEEL -> ENTITIY-tab -> CONNECTCHANGESTATECALLBACK. EXTRA EDIT: // <-- If you remove those 2 slashes, that specific line will work, // is only for giving you an idea. so remove it if you want to use the function. - Have fun, if it didnt work, be free to ask here. RE: Do something when wheel is on its limit - Neo - 11-30-2013 Ahh, it works! Thank you very much! I just needed to find out how to execute code when the wheel is at maximum My code: Spoiler below!
I created a string variable. When you touch the wheel before the pump was activated, it displays a message and does nothing else. If you activate the pump the variable changes. Now the wheel isn't stuck anymore and you can spin it. Thanks! |