Dandie Posted October 15, 2013 Share Posted October 15, 2013 Hi, I was thinking about OWB Stealth Suit, specifically it's stimpak administration function, and thought it would be fun to make it a bit less useful :laugh:. The general idea is to make Suit have sort of a "Stimpak compartment", where a limited number of stimpaks (say, five or six) can be stored for automated administration.option to open up container upon equipping Stealth Suit, where the player would have to "load" stimpaks. So when player's health drops, Suit would administer stimpaks from this container, instead of players inventory.Can somebody help me with a scripting - maybe just a main idea on how to implement it? I know a thing or two about geck scripts, but not that advanced to do it on my own. Link to comment Share on other sites More sharing options...
Gerandirr Posted October 15, 2013 Share Posted October 15, 2013 If you played Lonesome Road or ever ran into Cazadores, you would rethink that idea. lolBut some players like that sort of stuff, so don't mind me here. Link to comment Share on other sites More sharing options...
Dandie Posted October 15, 2013 Author Share Posted October 15, 2013 If you played Lonesome Road or ever ran into Cazadores, you would rethink that idea. lolBut some players like that sort of stuff, so don't mind me here.Well, in fact I did both. Though I understand what you're talking about :laugh: Link to comment Share on other sites More sharing options...
devinpatterson Posted October 15, 2013 Share Posted October 15, 2013 Hi, I was thinking about OWB Stealth Suit, specifically it's stimpak administration function, and thought it would be fun to make it a bit less useful :laugh:. The general idea is to make Suit have sort of a "Stimpak compartment", where a limited number of stimpaks (say, five or six) can be stored for automated administration. Disclaimer, I'm not a scripting guy. I'd just add it to the existing main quest script on the suit. Throw a new variable (short) on there, maybe call it stimInv or something. It's going to track your inventory of stimpacks in the suits internal container. You could use some messages and set button, getButton as the interface for the player to load the stims into the compartment (maybe when the short stimInv reaches 0, then flip a doOnce var). I forget how many buttons you can fit, maybe you could do 9 buttons ie load 1, 2 etc up to eight, & a load none. But if you choose a load none, you have to have a failsafe backup way to load some stims in later since you don't want the suit asking you constantly to load stims. You will have some sort of condition already in the quest script that polls the players health and determines whether or not to administer a stim. You'll want to add the additional condition that stimInv => 1 so that it can't function if hte suit doesn't have at least one stim left. You'll need to enclose them in parenthesis or add two && so both conditions haev to be met. In addition you will want to find the player.removeItem stimPack 1 and change it to subtract 1 from stimInv (so it draws from the suits compartment). Might be some other stuff, but that's the basics. Link to comment Share on other sites More sharing options...
devinpatterson Posted October 15, 2013 Share Posted October 15, 2013 Another option for when to load/reload stims in teh compartment might be to tag along on the equip barks the suit makes. Look for player.getEquipped and add your button, getButton there under a condition of stimInv < 8. That way you can a have the buttons pop up when you put the suit on (only if it doesn't already have 8 in the compartment) and it might be a more realistic feeling to load it only while your suiting up. Or in addition to when stimInv reaches 0 (and/or on the unEquip as well). Really depends on your personal preference. So if you decide how you want it to work in game, I might be able to give you a better idea of specifically/detail how to achieve it. Link to comment Share on other sites More sharing options...
devinpatterson Posted October 15, 2013 Share Posted October 15, 2013 also want to flip the do once var when you use a button to load in a new stim. Also subtract a stimpack equal to the number of the button used (ie subtract 8 if you the player hits the load 8 button) from the player inventory. And some basic code to make sure it can't add more than 8 - (minus) the current number already in the suits inventory. That way if you already have 4 in the suits inventory (for example), selecting the load 8 button doesn't make 4 of the stims disappear into the ether. Link to comment Share on other sites More sharing options...
devinpatterson Posted October 16, 2013 Share Posted October 16, 2013 You should also change the "stimpacks are adequate to point to the stimInv var instead of the players inventory. and you can change the buttons to a condition so that only the buttons that are applicable show up. For example on the add 4 stims to suit inventory button, put a condition like stimInv >3 && <5. If you don't have exactly 4 in the suits compartment then the add 4 button won't show up. Of course that only allows you add enough stims to make a full compartment (if 8 is full) so it's not as granular as allowing you to have any number from 1 *up to* 8. Link to comment Share on other sites More sharing options...
Dandie Posted October 16, 2013 Author Share Posted October 16, 2013 (edited) Hey, thanks for all of the advices.But I was thinking, instead of adding a variable, about replacing player inventory checks with a new container checks, so instead of lines like:player.getitemcount Stimpak > 0player.removeitem Stimpaketc,it would be like (with "SuitContStim" being a name for a Container):SuitContStim.getitemcount Stimpak > 0SuitContStim.removeitem Stimpak And adding a portion of the script about filling compartment with simpaks.Would this work?I was also thinking, since Suit can administer Med-X as well, to have basically a container menu opening when loading chems, So it's up to player to decide how many Simpaks and Med-X to "load", within container capacity of course. The only problem here is that I don't know how to make player able to add only stimpaks and Med-X. Edited October 16, 2013 by Dandie Link to comment Share on other sites More sharing options...
devinpatterson Posted October 16, 2013 Share Posted October 16, 2013 well I'm not a script guy, but I would think making it a var adds a layer of abstraction. If all your doing though is comparing conditions, subtracting and adding, then I suspect they'd be equivalent. You might end up doing a little more typing because the var is just a shorthand for what you'd be doing each time with a getItemCount. You'll probably still end up using a messagebox for your persistant container because it has to be linked to an inventory item (maybe in some null cell somewhere, like one of the test cells in the geck), but that's just a guess. I honestly don't really know how to go about that particular route/option. But I don't think filtering it is impossible. Containers can have a script attached and you can just use an if statement to test if it's a stim or med-x, else removeItem the item and add 1 count to the players inventory (net result 0 loss, and everything except stim or med-x falls in the "else" category). Use a ref var to store what was added so it can be easily accessed in the removeItem and addItem to players inventory. Just a guess. But there are some good scripters in the mod talk forum that would probably have a much more elegant solution. Link to comment Share on other sites More sharing options...
Recommended Posts