Guest Alopix Posted February 11, 2017 Share Posted February 11, 2017 Hi! This is the first time I've made a mod for a game! I've been playing for a while, and digging around in the scripts messing with stuff. Today I was playing around with a turret factory. I noticed the seed didn't change, and I wondered why that was. Well, it's drawn from the station ID and your coordinates. I like the idea, it means you have an incentive to explore to find more factories, and remember where the good ones are! But, what I really wanted at the time, was the ability to select the seed. Like you can at a shipyard. Lightbulb. I opened /scripts/entity/merchants/shipyard.lua and found the bits governing the seed selection box, and crudely grafted them onto turretfactory.lua. A little bit of elbow grease and it worked. With this mod, you can manually set the seed used to generate turret schematics at turret factories the same way you can when building a ship at a shipyard. Place this file in /steam/steamapps/common/avorion/data/scripts/entity/merchants/. Or, I have made comments where I changed the code, if you have another mod using that file, you can graft these parts into the same places in your modded file. I tested this on my own machine and it worked, but yours may have something different. Please let me know if it doesn't work for you, and I'll try to fix it. I have only the most basic programming knowledge and none specific to lua, so that may not happen... This is a copy paste hack, I wrote nothing, all the code is Koonschi's. https://drive.google.com/open?id=0B7YzN93iPgvcTFhSeURibXF6RGs Link to comment Share on other sites More sharing options...
Tarantel Posted February 11, 2017 Share Posted February 11, 2017 Hey nice idea ^^ But hey can you change the Postname to [MOD] ^^ So i find them better ^^ The Mod is added to the Modlist! Link to comment Share on other sites More sharing options...
Guest Alopix Posted February 11, 2017 Share Posted February 11, 2017 Hey nice idea ^^ But hey can you change the Postname to [MOD] ^^ So i find them better ^^ The Mod is added to the Modlist! Done! Link to comment Share on other sites More sharing options...
Tarantel Posted February 11, 2017 Share Posted February 11, 2017 Thanks ^^ Link to comment Share on other sites More sharing options...
Tiberiumkyle Posted February 12, 2017 Share Posted February 12, 2017 For me, while the turret stats listed change, what is actually built remains based on the original turret factory seed. Link to comment Share on other sites More sharing options...
Guest Alopix Posted February 12, 2017 Share Posted February 12, 2017 For me, while the turret stats listed change, what is actually built remains based on the original turret factory seed. Tested again and yep, it's broken. Sorry. The current version lets you change the seed, but the turret it actually gives you is the same no matter what. I have a version now that lets you change the seed and actually get what you select, but it messes up the tech level and who knows what else, and I don't know why. I'll try to fix it in the morning. Link to comment Share on other sites More sharing options...
Devious Posted February 12, 2017 Share Posted February 12, 2017 Will be looking forward to your fix :) Link to comment Share on other sites More sharing options...
Tiberiumkyle Posted February 12, 2017 Share Posted February 12, 2017 If nothing else, I'd like to poke around with the version that does allow seed change, despite messing with tech level. Link to comment Share on other sites More sharing options...
Tidus Klein Posted February 16, 2017 Share Posted February 16, 2017 So any word on this? Link to comment Share on other sites More sharing options...
LoSboccacc Posted February 19, 2017 Share Posted February 19, 2017 bump :P Link to comment Share on other sites More sharing options...
Weylin Posted February 20, 2017 Share Posted February 20, 2017 Excellent idea here, though I'm still working on a way to just outright pick and choose what features you want your turrets to have. Link to comment Share on other sites More sharing options...
Nozeron Posted February 26, 2017 Share Posted February 26, 2017 I really should have read the comments before installing this. Just bought 15 of what I thought was a REALLY good salvage laser, then ended up getting shit in comparison. =( I'll eagerly await for the update that fixes this. Great job though, it's kind of fun to be able to go through various seeds to see what kind of turrets there are. Link to comment Share on other sites More sharing options...
Martin Levac Posted March 9, 2017 Share Posted March 9, 2017 I'm not that good with scripts but I think I figured out why the mod doesn't work as intended. In the shipyard.lua, function setSeed includes argument updatePlan, which calls function updatePlan, which includes argument "local seed = seedTextBox.text", which becomes the actual seed to be used to create the ship. If I'm not mistaken. Your mod has function setSeed, which includes argument refreshUI, which calls function refreshUI, so that's where you should add argument "local seed = something appropriate" -edit- Or, maybe you have to change function onSeedChanged because it still includes the argument "setSeed(seedTextBox.text)", which according to the rest of your mod is not the seed but +1/-1 to the seed. Something like: "setSeed(same as argument "local seed = xxx" in function refreshUI)" Link to comment Share on other sites More sharing options...
Wilponderoci Posted March 14, 2017 Share Posted March 14, 2017 I love the idea of this mod.... after two days of almost 18 hours I have finally collected enough stuff to make about 20-30 turrets and YOU KNOW WHAT I dont feel it to be the least bit "cheaty" considering how much time I put into the actual gathering of the parts. But yeah as it says in the comments.... :( The mod shows you what the item would be but doesnt actually make them. Link to comment Share on other sites More sharing options...
Wilponderoci Posted March 14, 2017 Share Posted March 14, 2017 Anyone want to take up the challenge to fix this mod? Looks like OP is mia Link to comment Share on other sites More sharing options...
Laserzwei Posted March 14, 2017 Share Posted March 14, 2017 Anyone want to take up the challenge to fix this mod? Yeah i do. If the turret looks to awesome to be true, chances are high that you get a different worse turret. It seems to be those turrets where you can get boni by decreasing ingredients. turretfactory.zip Link to comment Share on other sites More sharing options...
unbekannt1984 Posted April 8, 2017 Share Posted April 8, 2017 Anyone want to take up the challenge to fix this mod? Looks like OP is mia Is this Mod still broken? I had a quick look at the changes that Alopix made to the turretfactory.lua, but I didn't find any obvious mistake. Link to comment Share on other sites More sharing options...
Wilponderoci Posted April 9, 2017 Share Posted April 9, 2017 This mod essentially works Things to watch out for... it will make 0dps turrets if they seem to good and the sector tech level is low. Experiment. It does work but its trial and error. I would love a more concise fix but for now its pretty cool. Link to comment Share on other sites More sharing options...
unbekannt1984 Posted April 9, 2017 Share Posted April 9, 2017 it will make 0dps turrets if they seem to good and the sector tech level is low. Could you give me an example? Best would be a screenshot of a "too good to be true"-turret. I would love a more concise fix but for now its pretty cool. Well, I can't promise you anything, but I'll try. Link to comment Share on other sites More sharing options...
Wilponderoci Posted April 10, 2017 Share Posted April 10, 2017 Although I didn't directly compare the 2 files for changes, I'm pretty sure laserzwei's fix works better. So if your going to mess with it try that. The best thing to do is go into creative and give yourself the mats to experiment. Then you will see. I will try to upload a screen of what can happen if it goes badly. here you go: Link to comment Share on other sites More sharing options...
karakara Posted July 15, 2017 Share Posted July 15, 2017 Any possibility on this getting updated? Tried to merge the codes into v12, the UI box for seed choosing showed up but had no actual effect on the end result. Didn't learn anything about coding so I have no idea how to force it to use the chosen seed. p.s. Also the 0 dps turrets are probably result of the required materials didn't update to correct numbers. From my experience it can be fixed by switching to different type and rarity of turrets. Though final products were usually not exactly the same with the one in preview but at least they work. Link to comment Share on other sites More sharing options...
DevX Posted July 22, 2017 Share Posted July 22, 2017 Here is a working version as of today (07/21/17) http://dev-x.org/avorion/turretfactory.lua I didn't have the original script, but thank you Alopix for pointing me to the files to get started I've fixed the problem where you don't actually get the turret you see. The script runs essentially twice, once on the server, and once on the client. Clicking the buttons updates the client, but the buildTurret function gets called on the server, so you need to pass the seed into that guy to update him as well. This works in singleplayer, I do not know what may happen in multiplayer (another player may be able to change the seed of the factory your looking at, something like that). As for the damage going below zero That happens without mods. Being able to change the seed just makes it quicker to find. The calculations for turret ingredients likely just go out of range, haven't looked at that yet. You can find seeds that have damage numbers that go up as you reduce the number of parts. Note I did change the default seeds, the seed number itself was way to large and didn't fit into the textbox Anyway, enjoy! Link to comment Share on other sites More sharing options...
Shrooblord Posted October 8, 2017 Share Posted October 8, 2017 Awesome, thanks DevX (especially since right now it looks like you made an account here only to post this, and that's all you've posted... dedication!). I'll be messing around with this in my savegame for sure. Link to comment Share on other sites More sharing options...
Martin Levac Posted December 3, 2017 Share Posted December 3, 2017 0.15.1 changes turretfactory.lua significantly with the ability to set independent targeting, and adjusts DPS accordingly with various functions that weren't there before. I want to use custom seed with this new change. What specific changes do I need to do to make it work with the new .lua? Link to comment Share on other sites More sharing options...
HERC Posted December 3, 2017 Share Posted December 3, 2017 Working version for 0.15.0, idkn does it work for 0.15.x versions. Copied code from DevX's file to 0.15 file and edited to work with this version. I also added line of code so you can make exotic rarity turret's. (if you don't like possibility to build exotic turrets just delete 400th line of code rarityCombo:addEntry("Exotic"%_t)) I update it to 0.15 version, all credits go to original author. HF turretfactory.zip Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now