MechanicalPirate Posted December 23, 2008 Share Posted December 23, 2008 I need a script for an item (An Ingestible) that when used will cause a menu to come up with several buttons. Depending on which of these buttons is pressed a different effect will be given. I can do this for an activator but I can't get it to work for ALCH items such as stimpaks or food. Any Ideas? Link to comment Share on other sites More sharing options...
Khet Posted December 23, 2008 Share Posted December 23, 2008 What is the Begin you are using? I believe you should be able to use either OnEquip or OnActivate Link to comment Share on other sites More sharing options...
MechanicalPirate Posted December 23, 2008 Author Share Posted December 23, 2008 Hmm, I've been trying OnActorEquip. I think I tried OnEquip and it came up with an error. I'll get back to you on that soon. Edit: OnEquip tells me the ItemId I'm using is invalid. OnActivate does the same. It seems they both want an Actor Reference not an item. Link to comment Share on other sites More sharing options...
GodofAlcohol Posted December 23, 2008 Share Posted December 23, 2008 If you are using a chem for the activator, you can make an effect which runs the script and attach it to the itemif you dont want the item to disappear, just add another item when its used and hide the add-message hope it helps ;) Link to comment Share on other sites More sharing options...
Khet Posted December 23, 2008 Share Posted December 23, 2008 You shouldn't need to have an item ID if the script is attached directly to the item you want the script to run on. Actually, I'm positive about this because while trying to test out a script for someone else I used an OnEquip script on an item (StealthBoy) and it worked, but I'll take another look and see what I come up with. Link to comment Share on other sites More sharing options...
MechanicalPirate Posted December 24, 2008 Author Share Posted December 24, 2008 scn ACEMedicalBraceEffect Short controlvar Short button Begin ScriptEffectStart If ( controlvar == 0 ) ShowMessage ACEMedicalBraceMsg Set controlvar to 1 ElseIf ( controlvar > 1 ) Activate EndIf End Begin GameMode If ( controlvar == 1 ) Set button to GetButtonPressed If ( button == -1 ) Return ElseIf ( button == 0) ShowMessage ACEMedicalBraceMsgStayInPain AddItem ACEMedicalBrace 1 Set controlvar to 2 ElseIf ( button == 1) ShowMessage ACEMedicalBraceMsgLeftLeg CastImmediateOnSelf ACEBraceLeftLeg Set controlvar to 3 ElseIf ( button == 2) ShowMessage ACEMedicalBraceMsgLeftArm CastImmediateOnSelf ACEBraceLeftArm Set controlvar to 3 ElseIf ( button == 3) ShowMessage ACEMedicalBraceMsgRightArm CastImmediateOnSelf ACEBraceRightArm Set controlvar to 3 ElseIf ( button == 4) ShowMessage ACEMedicalBraceMsgRightLeg CastImmediateOnSelf ACEBraceRightLeg Set controlvar to 3 ElseIf ( button == 4) ShowMessage ACEMedicalBraceMsgNowhere AddItem ACEMedicalBrace 1 Set controlvar to 2 EndIf ElseIf ( controlvar == 1 ) Activate Set controlvar to 0 EndIf End Begin ScriptEffectFinish If (controlvar == 2) Return Else ShowMessage ACEMedicalBraceEffectOverMsg Endif End Edit: So I got my previous problem working, the menu shows and when I click on the buttons they do what they should. But now I've fallen into the trap of conditioned buttons. The button for crippled left leg only shows if the player has a crippled left leg. However, due to the buttons having conditions, sometimes I can click the third button which says "Right Leg" and instead I get a fixed up left arm! Is there any way around this issue, or should I change the script so that all the buttons are present at all times? Link to comment Share on other sites More sharing options...
MechanicalPirate Posted December 25, 2008 Author Share Posted December 25, 2008 I'm still having trouble with this, so I'm bumping it. It's dropped down a few pages so I doubt many would have seen it and it's better to bump than make a new topic surely :) Link to comment Share on other sites More sharing options...
GodofAlcohol Posted December 26, 2008 Share Posted December 26, 2008 Generally I would show all the buttons, but give a message when theres no crippled limb. Link to comment Share on other sites More sharing options...
MechanicalPirate Posted December 26, 2008 Author Share Posted December 26, 2008 Looks like that's what it's gonna be. I'll go do that. Thanks for the help! Link to comment Share on other sites More sharing options...
steph87 Posted February 10, 2009 Share Posted February 10, 2009 Hi, is the last script you posted a working one? I Tried using it, i get the menu to show up but whichever option i click in the menu has no effect. (It doesn't actually enter in the gameMode section i've tried printing a debug message there) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.