Jump to content

SiriusSam

Members
  • Posts

    46
  • Joined

  • Last visited

Everything posted by SiriusSam

  1. Well, i added both. By default you see only one barrel with the summary of the main resources. Clicking on it will toggle to the other view. Clicking on any of the resources will toggle back to summary. I have also added public static parameters to modify the behavior of the DLL. ManageResources yes/no: if false, resources aren't taken into account (and their parts don't appear in the editor). Otherwise they are stored/refunded etc. ResourceDisplay: minimal / detail, can be switched programatically to change between the two modes. a String.Format for the text that appears inside the icons, so each modder can choose how they want to format the information. I am currently splitting the project in two parts: The Scrapyard, Shared Inventory System: The base of the mod. Manages parts and resource storage. If you plan on making a mod using the Scrapyard, you should link to this DLL. More detailed explanation to come. KSP 4X This DLL is based on the Scrapyard, so far it only adds the rewards for experimental parts, but this is where i will keep adding features and missions in the future. It is a good example to get started if you want to make a mod based on the Scrapyard. I am setting up the GitHub and collaborating with Magico to determine the best way to go about this, so there will be some changes to this thread shortly.
  2. I could also switch pages on click. Or maybe even switching between both styles by clicking on the "summary" icon... (not sure i can pull it out) Looking at the screenshots i prefer the display of one icon per resource, but we need a way to filter them. There's also the problem of implementation: -if I use one part total: the modders must register the name of their resource + abbreviation in a static dictionary -if i use one part per resource: the modders must supply one part named like their resource (unless one of you knows how to add a part programatically). How about the display? Do you prefer "used/stored" ? or the total (stored - used) ?
  3. Thanks it looks much better like this, i just need to make it more readable it gets a bit cluttered if i start displaying the prices, i think i'd better make a total
  4. It means the fuel must be purchased when you roll out the ship (using more than the quantity in store) Here is an alternative version it shows "qty in use / qty available". I could put the text in red and add the cost if you go over the limit.
  5. Yes, definitely. I was trying to add as little to the game UI, but i think i can't escape a toolbar icon for actions like these. I'm thinking of a little panel that would sum up some information about the costs, and allows you sell items or filter the list to see all the parts you own.
  6. Hi, I am making a test for the resource storage. Resources are now visible in the inventory, with the quantity available / in use. It works like parts, resources recovered are stored and reused as much as possible for future ships. It will really start making sense when we start collecting rare resources from other planets (for example KSPI's anti-matter), so it can wait for later. What do you think of this system? useful? overkill?
  7. Magico Let's continue the technical conversation as private messages if you don't mind, I would prefer to keep this thread readable for everyone. Or Maybe we can open a new thread? Anyway my answer will be in PM shortly.
  8. Hello Themorris, This was part of my original plan, because I really like the idea of refurbishing a ship that jsut landed and sending it back ^^ In the end i'd like to have 3 kinds of storage: -parts -vehicles -assemblies But for now idecided to focus on the most "simple" aspect (parts) until it works 100%. As a sidenote, the mod KCT (Kerbal Construction Time) sounds pretty close to what you are describing.
  9. haha, don't sweat it, i was kidding. Shared Inventory is fine, or maybe Open Inventory.. Anyway, good night!
  10. It's 1 am here so just a quick thing about the rollout: Not all parts are removed from the inventory on rollout, but only the ones you currently have in store, the rest (negative values in the editor list) is purchased. Maybe it would be useful to have a function that scans a ship and returns all the missing parts on one hand and the ones available in the inventory on the other.
  11. Name I was going for something silly like Epic Lootz, but maybe i can keep that for my questline. Shared Inventory System... that's a bit too unsilly but I guess it can't hurt to be srious from time to time. DLL I suppose i'd have to configure the automatic major/minor increments on build so modulemanager finds it? or is it based on the date? By any means, both solutions work for me. Persistence Load/Save I use the game events onGameSave and onGameLoad. But so far those events always triggered a call to persistence load/save (i tracked it in the debugger, but maybe there are exceptions?) I played around with the persistence thing but i found too many different tutorials doing it completely differently and when i finally got it working it turned out serializing dictionnaries wasn't really his thing..... Since that's the only thing i had to save, I figured it would be much easier to write my own parser for the load and save function (and it was). Rant apart, if there are more benefits to peristenceload/save, I'm all for it. Recovery: Its probably a bad idea to leave it on by default. But we could just leave a recovership() function without linking it to the gameEvent. This way it wouldn't be too painful to activate it if the mod needs it and it wouldn't need to be written by every modder. Same for the rollout, although this one seems more natural by default. Adding a remove function: Done, with default parameter for quantity. Source Right now, the link is in the description and the code hosted on my homeserver. I can setup an SVN, my machine is almost always on but i can't guarantee i won't have to reboot it (windows..) or that i'll never have a downtime. So a github sounds like a good idea. I never used it yet (i usually use SVN), so let's figure it out! Stagerecovery Well this is a much needed feature, and since it appears you are the author of the mod i think this settles the question.
  12. By the way, I have to add StageRevoery / DebRefund mecanics. I used to play with DebRefund, but I'm not too sectarian. What is the diference between the two?
  13. That sounds like a good solution also! I figured out another way to make it work: By default indicate the quantity of normal sized (100%) items in the list. If other sizes are available, display an indicator (could be just one dot for each available size) Right click the icon to switch between available sizes So far we have 3 different solutions for this problem don't store the sizes, but make the player pay extra for bigger parts, and refund him for smaller ones store tweaked parts as fractions or multiples switch between available sizes by right clicking We still have a bit of time to decide, because: 1-I plan on making a lot of testing before going to the next updates. the base of the mod should be flawless, otherwise all the rest will go to s**t.. 2-err... I just put my hands on an Oculus DK2 with the dev kit... so I'm experimenting with it in Unity and its taking a bit of time
  14. I just finished modifying the Experiment missions: When you pick a mission where you have to test an experimental part, you are given 1 unit to test. So if you succeed the mission AND the part hasn't been destroyed in the process, it will remain in your inventory and you can reuse it as long as you keep recovering it. This makes the tests a lot more exciting already, because you really want to keep the part alive. I still have to remove the part when the mission is cancelled, but at least the mod is playable now. I have restarted a game and I haven't had any glitches so far.
  15. Hi magico! Sounds good to me. I also use a dictionnary<string,int> to store the items, and I don't modify the costs of parts: the parts that you own are refunded when the vessel is rolled out. The thing is, if i use your inventory, there isn't much code left in my mod , so I'd propose you let me handle this part. Then we could have one DLL that only takes care of the inventory, on which we base both our mods. no worries, i will keep testing this until it is flawless (and of course you are welcome to make any suggestion about the sources, since i only started modding kerbal last week.. the part you need is in inventory.cs and its just one page). If that is agreable to you, I will split my project in 2: inventory.dll : takes care of saving/loading the inventory and making it accessible to other parts KSP4X.dll: the rest of my mod.. (display quantities in the part's icons, retrieve parts when a vessel is rolled out, recover parts when a vessel is recovered). If you want to use the icons and the recovery/rollout mecanics then it's almost all my mod, so there wouldn't be a need to split it so far. The only problem with displaying the numbers in the icons would be the tweakscale compatibility, but i think i found a good solution for that (and in this case I plan on using the same naming convention as you for the scale). For Inventory.dll, I propose the following specs: Dictionnary<string,int> Part : list of parts Get(name) : retrieves quantity available Add(name, qty) : adds a certain quantity of items to the ones in store (negative value to retrieve) Set(name, qty) : sets the quantity for a part Commit(ConfigNode) : persist inventory in the savegame Rollback(ConfigNode) : reloads inventory from the savegame Optionaly: Store(Part) : store the part and all its children recursively Retrieve(Part) : retrieve (adds -1 unit) the part and all its children recursively Of course, the naming and specs are open to suggestion.
  16. yes.. i think i'll stick to case #1 which is how the mod should behave now. I'll just make sure there is no exploits to generate money, i think this should be simple enough. I started a new game and so far i can't find any edge cases i missed, but i probably need 1 week of testing to be sure.
  17. passinglurker sorry.. i meant EvilReeper The limitation of parts is already there, you can't place more than you have in the inventory. Was quite a pain to make sure you don't go over the limit by duplicating with ALT or using symmetry.... but its done. The problem now is just to find a way to give the initial few parts when a mission is picked. I'll start looking for a solution when the modde headache is gone
  18. Forsaken: Yes i've been magico's code a lot. But since his inventory is saved in a separate window i'm not sure his method would be compatible.
  19. For tweakscale I see two possibilities: 1- I only store parts in one size, if a part is tweaked it will cost more when you unroll the ship, but the recovery price is unchanged. As a result you will pay extra, but recover a normal sized part. This is how it should behave right now (but i didn't try it yet). 2- Store items in multiple sizes. Then either : create an additionnal icon for each sized part.. but this will put a LOT of icons in the list... add more information inside the icon (0.65 : X, 1.25 : Y, 2.5 : Z... If you can come up with something else, i'm all ears.
  20. Forsaken I am using a clean install for now. But you are right, I have to take tweakscale into account.. or i won't be able to use it on my main save And it can potentially wreck havok to the interface... so i think i'll do that next.
  21. Alright! I think this is almost ready for release. Parts are stored / unstored as needed, funds work as intended, the inventory is saved in the savegames, and it is not possible to place more experimental parts than you have in store. The only thing i need before releasing is to change the experimental missions to give 1 unit of the part that must be tested. I sure wouldn't mind if EvilReeper has an opinion about how to get there
  22. Well i found a workaround.. but i'd still be curious if someone knows the answer!
  23. Hello, I'm making an inventory mod, and i need to prevent the player from placing parts that are out of stock. Right now I listen for GameEvents.OnPartAttach, recurse on all subparts to check if they are available, store them in a List and destroy them inside EditorShipchanged event using EditorLogic.DeletePart(P). The parts are successfully removed from the construct, but then it all goes wrong... i get nullpointerexceptions when i hover the ship, move it, etc... I tried many other methods to delete the nodes, but they pretty much all go back to this problem. Is there something I'm missing?
  24. @passinglurker I checked ExPL, but i haven't dabbled with the code yet. If they are open source then i will surely take some bits here and there I don't know about such mods, but i have the feeling this won't be very complicated as long as we have some properly built ship models. then you just have to redirect them, paste some chutes on them and land them to recover . I started building some alien temples in the editor, i think it could be fun to explore that kind of structure with your kerbal, looking for chests or detachable parts to bring back home ^^ Anyway.. let's not get carried away. I'm going to make the code as stable as i can, look for all the possible loopholes. And then the fun will begin
  25. @pellinor I think so but i still have to try it. In essence, when we can have multiple inventories I don't see a problem doing this. I definitely want to make the assembly directly in space (at a much later stage), and use the panel to interact with KAS containers. I'm not sure if its possible but so far Kerbal is very open, it feels less like modding and more like programming.. so we'll see when i reach the level
×
×
  • Create New...