Jump to content

bulwulff

Member
  • Posts

    4
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

bulwulff's Achievements

  1. Ok I've been doing more work on this and I think I might be getting somewhere. I don't think there's a way to modify the capacity at least currently or directly on a per vehicle basis. The goal here is to increase the trunk size for each seat removed (there's more space right?) and decrease the trunk size as long as the space is available per seat reinstalled. This would make larger vehicles with multiple seats more useful (such as busses for example). Now in the scripts themselves I can edit them so as to increase/double/modify the size of the trunks themselves on the item side which does affect vehicles that use them. But since they can't be uninstalled (and even if they could they would need to be empty which could be a major pain) it's not possible to swap them either using the sendClientCommand to circumvent the install/uninstall process queue. My thought was to create more trunk variations (BigTrunk1, BigTrunk2, etc) and if a seat was uninstalled, then upgrade the trunk to the next size but it creates the above conflict. It would be very useful to have a command that allows us to modify that particular value on a per object basis from lua and would open up some options to further optimize some aspects of the game. Such a command could also allow us to create upgrade paths for containers (have some empty plastic bags from chips and some thread, why not sew them onto the sides of your bag. Rough I know, but hey storage is storage right?) so it would open up a new avenue for modding. Please think about it!
  2. Ok ... *rolls up sleeves* this one we can tackle. Ready? Staring win media/lua/client/TimedActions lets take a look at the ISTakeWaterAction.lua. In there you'll find a function for ISTakeWaterAction:perform(). Inside, a few lines down you'll see a self.waterObject:isTaintedWater() where it sets self.item:setTaintedWater(true). Here we can see that there's a flag for isTaintedWater(). Ok we're getting somewhere! For a better grasp you might look at ISTransferWaterAction.lua as well. You could add in an if statement that checked for the container you're drawing from. You'll have to play with the code (use -debug and print commands to assist) but it's likely possible. The big issue I've been having is the lack of any support documentation - I'm literally just opening every lua file and reading through the code to discover what functions may or may not work. Good luck!
  3. Hey there Salvixd! I'm Bulwulff and I've been programming for over 20 years and modded more games than I care to count. From experience lets start here: The first thing to consider is the mechanics -> How exactly will you attach a barrel to a generator? by a hose or pipe? Pipe might make more sense from the games logic point as you could create sprites for the pipes and build them like you would walls or floors. I've thought about doing something like this myself. From a programming standpoint however doing something like a hose would be simpler though still a big challenge, especially if you want to make the hose visible and be able to connect it to barrels or maybe even the gas tank of another vehicle, or other container. If you're not worried about making the hose or pipe itself visible, then from a programming standpoint it would be a modification to the generator lua code - specifically the ISGeneratorInfoWindow.lua so you can add something that shows it's connection, and maybe MOGenerator.lua? It may even be better to write your own code as well. Just something to think on since no one else has responded yet. I know what it's like to get stuck on something you want to make happen.
  4. I've been working on a mod to help create something the community at large has been requesting. In order to make this happen however, I'm stuck on trying to figure out the lua code needed to modify the max storage capacity of a vehicles trunk. I've tried the following without success: for i=1,self.vehicle:getPartCount() do local tpart = self.vehicle:getPartByIndex(i-1) if tpart:getId():contains("Trunk") then local tcap = self.vehicle:getPartByIndex(i-1):getContainerCapacity() + 30; -- other unrelated code here -- self.vehicle:getPartByIndex(i-1):setContainerCapacity(tcap) break; end end This didn't update the capacity at all (and didn't oddly enough error out either). The other method I tried was this: local playerObj = getSpecificPlayer(self.playerNum) sendClientCommand(playerObj, "vehicle", "setContainerCapacity", { vehicle = self.vehicle:getId(), part = self.vehicle:getPartByIndex(i-1):getId(), amount = tcap}) My mod makes it so the trunk can't be uninstalled (I don't believe it can be normally anyways but I might be mistaken so I did it just to be safe), and attempts to make upgrades to the capacity of the trunk as actions are taken. Anyone have an idea how to make this happen?
×
×
  • Create New...