1anonymous25 Posted April 22, 2013 Share Posted April 22, 2013 (edited) Im trying to add weapons to the player with a terminal, any help would be much appreciated. :smile: because this so far hasnt worked Edited April 22, 2013 by 1anonymous25 Link to comment Share on other sites More sharing options...
Jojash Posted April 22, 2013 Share Posted April 22, 2013 (edited) The "AddItem" function has two flags. The first of which specifies how many items you want to add. You've left it blank, which, I assume, means that it will add zero. Try adding a one to the end of each function and it ought to work! :) Edited April 22, 2013 by Jojash Link to comment Share on other sites More sharing options...
1anonymous25 Posted April 22, 2013 Author Share Posted April 22, 2013 Thank you! sorry to ask but how do you make it a once off thing? is it to do with "If doonce == 0 ... set doonce to 1 end if end" :turned: Link to comment Share on other sites More sharing options...
Jojash Posted April 22, 2013 Share Posted April 22, 2013 (edited) The easiest way to do this is to add a global variable into the mix. This is pretty simple to set up, just select "Gameplay" in the main toolbar and then click on "Globals...". From here, right-click and select "new". Then type in the name of your global variable. For the sake of this example, I'll be calling it "ExampleGlobal". Once you've made the global variable, go to your terminal and go to the button that you wish to make only work once. Right-click in the "conditions" box and then find the option that says "GetGlobalValue" then, in the "functions" box, select the global variable that you've made. Now, in the "value" box, change the value to "0", then click "OK". Now, you need to change the value of the global variable when the user selects one of the options. Add in the line "Set ExampleGlobal to 1" after your last function. Obviously, you'll have named your global something other than "ExampleGlobal", so just substitute that in. Finally, you'll have to check the box next to "Force Redraw". If you want to make this happen with both options, you have a choice. You can either make it so that you can select both options once, or only one option once. If you want to do the latter then copy the condition you made for this button and paste it into the conditions box of the other button. For the former, you'll need to repeat this process with that button, but you'll need a separate global. Edited April 22, 2013 by Jojash Link to comment Share on other sites More sharing options...
1anonymous25 Posted April 23, 2013 Author Share Posted April 23, 2013 Thanks for the help Jojash! i can finally continue working on my newest mod :D Link to comment Share on other sites More sharing options...
senterpat Posted April 26, 2013 Share Posted April 26, 2013 That's not easier then using a one time use variable unless I'm missing something Link to comment Share on other sites More sharing options...
Jojash Posted April 26, 2013 Share Posted April 26, 2013 (edited) That's not easier then using a one time use variable unless I'm missing somethingNo, it's a little harder, but I don't think you can use the variables in a condition for the terminal in the same way. Using the variables as you're suggesting would mean leaving the button there, which would be a little confusing. Perhaps I should have said neater as opposed to easier... Of course I could be totally wrong, and if I am, feel free to correct me! :smile: Edited April 26, 2013 by Jojash Link to comment Share on other sites More sharing options...
senterpat Posted April 26, 2013 Share Posted April 26, 2013 Ya sorry, forgot you cant declare variables in terminals. So it is probably the easiest way. Link to comment Share on other sites More sharing options...
Jojash Posted April 26, 2013 Share Posted April 26, 2013 No worries! I'm just glad I didn't forget something horrifically obvious! :) Link to comment Share on other sites More sharing options...
jazzisparis Posted April 26, 2013 Share Posted April 26, 2013 Ya sorry, forgot you cant declare variables in terminals. So it is probably the easiest way.Actually, you can. However, variables declared in result script boxes cannot be used in conditions, therefore will not be suitable here. Link to comment Share on other sites More sharing options...
Recommended Posts