Geeves83 Posted September 26, 2011 Share Posted September 26, 2011 (edited) I'm trying to set up a pretty simple (so I thought) script attached to a base effect attached to an ingest-able. Basically, it shows a menu upon activation that allows the user to select what bodypart to heal. Problem is, I just can't get it to work. I've done a little basic scripting before, and honestly can't see what's happening here. i can get the message box to pop up ok, but it won't do anything that's scripted; all of the buttons pressed just close the message box and do nothing else. I was wondering if it was a problem with using a script attached to a base effect attached to an ingestible... so i tried changing it to an object script and attaching it right to the ingest able in question...no dice. I thought that maybe there was something wrong with my effects utilizing the separate buttons, but even the first one won't work, and all it does is give the player an item. Can anyone give me a hand? scn PoulticeScript short buttonshort awaitinput begin scripteffectstartset awaitinput to 1showmessage Poulticemsgend Begin MenuMode -if awaitinput == 1 ----set Button to GetButtonPressed -------if Button == 0 ---------set awaitinput to 0 ---------player.additem NVDLC02HealingPoultice 1 1 -------elseif Button == 1 ---------set awaitinput to 0 ---------player.CIOS PoulticeLArm -------elseif Button == 2 ---------set awaitinput to 0 ---------player.CIOS PoulticeRArm -------elseif Button == 3 ---------set awaitinput to 0 ---------player.CIOS PoulticeLLeg -------elseif Button == 4 ---------set awaitinput to 0 ---------player.CIOS PoulticeRLeg -------elseif Button == 5 ---------set awaitinput to 0 ---------player.CIOS PoulticeChest -------elseif Button == 6 ---------set awaitinput to 0 ---------player.CIOS PoulticeHead -------endif ----endif -endifend Edited September 26, 2011 by Geeves83 Link to comment Share on other sites More sharing options...
drakeelvin Posted September 26, 2011 Share Posted September 26, 2011 (edited) I have not played much with menus but I know of a mod that uses a simple one related to antivenom, I used this mod a lot in the past before I discovered how to write auto-heal scripts, and its by a master modder so maybe worth looking at how he did his menu with antivenom. Companion Cure by RickerHK One thing about RHK, if you ever try Wendy Gilbert, you'll see he knows how to write awesome menu driven interfaces, he's the guru guy. I'd say look at Wendy but thats a huge mod; however, if you're up for it check her out too :) Edited September 26, 2011 by drakeelvin Link to comment Share on other sites More sharing options...
viennacalling Posted September 26, 2011 Share Posted September 26, 2011 Instead of MenuMode try using GameMode. Link to comment Share on other sites More sharing options...
Geeves83 Posted September 26, 2011 Author Share Posted September 26, 2011 Thanks Drakeelvin. I'll give his mod a look, see if I can learn a thing or two. viennacalling; Yeah, I've tried using gamemode as well, but it doesn't seem to make any difference. Thanks for the suggestion, though. Link to comment Share on other sites More sharing options...
Tefnacht Posted September 26, 2011 Share Posted September 26, 2011 Hi. I might be totally wrong here but I think for effect scripts the only valid script blocks are ScriptEffectStart, ScriptEffectUpdate and ScriptEffectFinish. All other blocks are ignored in a effect script. AFAIK. Not sure where I read that or if it is even true ... My suggestion is, before anything else, make sure the MenuMode or GameMode block of your script is actually executed. If you're using NVSE add a debug message with the PrintToConsole command. If you're using vanilla ... maybe use ShowMessage or PlaySound or something simple like that. Just to make sure the block is actually running. If my suspicions are correct the part of your script dealing with pressed buttons is never executed at all and therefore does nothing.Using a ScriptEffectUpdate block instead of MenuMode might do the trick ... assuming your effect has a duration greater than 0, otherwise ScriptEffectUpdate would not be fired either. Good luck. Link to comment Share on other sites More sharing options...
Geeves83 Posted September 26, 2011 Author Share Posted September 26, 2011 God damn.... that was exactly the problem. I had no idea the gamemode block didn't work for effect scripts. Just changed the actual effect starting the script duration to 1 from 0 and used 'scripteffectupdate' instead of gamemode/menumode. Thanks a lot, Tefnacht! ... this was driving me crazy. I was getting ready to do horrible, horrible things to my computer :). Link to comment Share on other sites More sharing options...
Recommended Posts