RebCom1807 Posted January 31, 2017 Share Posted January 31, 2017 So! After fiddling about in the files, I have something that, while not the most elegant of solutions, works. This mod modifies the factions.lua file under ..scripts/server, and the turretgenerator.lua file under ..scripts/lib - So the mod will probably conflict with anything that modifies those files. If anyone can come up with a more elegant solution, feel free! There probably is a way that I'm missing. Original post: So, figure I might as well get the one that I'd find more interesting out of the way - What, exactly, determines the size of the turrets? Is this value independent from the number of crew needed to run it? And, secondly, how might one go about making it so that every turret has the Independent Targeting system on it - As well as, perhaps, a minor damage buff to compensate for the lowered damage from that mod? I'm asking partly for the sake of being able to try out how it feels, as I'm one of those odd sorts that enjoys having the turrets do their thing while I fly. AllTurretsAuto.zip Link to comment Share on other sites More sharing options...
Tiberiumkyle Posted January 31, 2017 Share Posted January 31, 2017 From my own testing, it looks like tech level determines size of the turret, as well as general stat potential. Higher tech level = bigger turret, more crew, higher stats (dependent upon quality) Link to comment Share on other sites More sharing options...
RebCom1807 Posted January 31, 2017 Author Share Posted January 31, 2017 Fair enough. 'tis a bit of a shame, though.. Turrets just feel way too small in a lot of cases, I've found. x.x Link to comment Share on other sites More sharing options...
Tiberiumkyle Posted January 31, 2017 Share Posted January 31, 2017 They get pretty large once they're needing 6-7 crew, and I'm pretty sure I could make em larger, in testing. Link to comment Share on other sites More sharing options...
QuickToes Posted January 31, 2017 Share Posted January 31, 2017 Use this mod from Aki and experiment with the 'tech' parameter. http://www.avorion.net/forum/index.php/topic,830.0.html I found a tech of 30 to be quite good ;) Link to comment Share on other sites More sharing options...
RebCom1807 Posted February 1, 2017 Author Share Posted February 1, 2017 So, any help to be had, mod-wise, for having all turrets spawn with the Independent Targeting thing? Link to comment Share on other sites More sharing options...
Kane Hart Posted February 1, 2017 Share Posted February 1, 2017 Lot of people keep talking about turret sizes so I made a quickly video showing there is already scaling through the TL's. Link to comment Share on other sites More sharing options...
QuickToes Posted February 1, 2017 Share Posted February 1, 2017 You need to be careful how you place those large turrets. There recoil actually moves your ship! Link to comment Share on other sites More sharing options...
RebCom1807 Posted February 1, 2017 Author Share Posted February 1, 2017 Alright, I got something mildly.. Well, cludgey working, but hey, it's working! All I did was replace, in TurretGenerator.lua, this: return GenerateTurretTemplate(seed, weaponType, dps, tech, rarity, material) with this: local TurretTemplate T = GenerateTurretTemplate(seed, weaponType, dps, tech, rarity, material) T.automatic = true return T And then, in factions.lua, under the player initialization, I added turret.automatic = true in the appropriate places. Sadly, I had no luck finding the actual GenerateTurretTemplate code, but this works, from what I'm seeing, otherwise I would have modified that. Link to comment Share on other sites More sharing options...
zerociii Posted February 1, 2017 Share Posted February 1, 2017 :'( been trying to get this to work in turretgenerator.lua for an hour, 12 game tests and nothings loading, could you please be more specific about where to place "turret.automatic = true" argument? and/or would you mind posting your full lua, for examination. im very interested in seeing how many other variables you could force with turretgenerator. thanx -- Love Avorion, Love Exploration! Link to comment Share on other sites More sharing options...
RebCom1807 Posted February 1, 2017 Author Share Posted February 1, 2017 Well, half of figuring out that I could do this was looking into the documentation and noting that 'automatic' wasn't a read-only variable. As for the LUA files - Here 'ya go! It's only a couple of lines each, though. factions.lua turretgenerator.lua Link to comment Share on other sites More sharing options...
zerociii Posted February 1, 2017 Share Posted February 1, 2017 Thank you soo much! now next thing im gonna look into is where the "read only" parameters stored. because if we can acess them, we can write separe turret generator addons luas to make custom weapons, like cluster rockets, or even guided pulse torpedoes XD now that would be interesting! Testing Update: Managed to get This working: -- added float multipliers to energy consuming weapons, effectively -- making them use 1/10th of a % of their normal, compliments to --"RebCom1807" local TurretTemplate T = GenerateTurretTemplate(seed, weaponType, dps, tech, rarity, material) T.automatic = true T.baseEnergyPerSecond = 0.001 T.energyIncreasePerSecond = 0.001 return T Link to comment Share on other sites More sharing options...
RebCom1807 Posted February 1, 2017 Author Share Posted February 1, 2017 Heh. Would be interesting, for sure. Could see a missile launcher that launches a 'salvo' of seeker missiles - Which happens to be enough to overheat it. Link to comment Share on other sites More sharing options...
SpeedBreaker Posted February 1, 2017 Share Posted February 1, 2017 my eng is bad. if i install the mod all lasern have autoturret? Link to comment Share on other sites More sharing options...
zerociii Posted February 1, 2017 Share Posted February 1, 2017 yes Speed, ALL turrets = Auto target Link to comment Share on other sites More sharing options...
SpeedBreaker Posted February 1, 2017 Share Posted February 1, 2017 nice that need this game! Link to comment Share on other sites More sharing options...
SpeedBreaker Posted February 2, 2017 Share Posted February 2, 2017 sorry again in this? G:\Steam\steamapps\common\Avorion\data\scripts\player dont work for me. in which folder? after copy i can test with other mod and write /inventory turret salvaging blue xanion 10 1? Link to comment Share on other sites More sharing options...
RebCom1807 Posted February 2, 2017 Author Share Posted February 2, 2017 Sorry, I should have clarified.. Well, actually, I'll do one better. Have a standard install format! Just drag the data folder into your Avorion base folder, and overwrite what needs overwriting. EDIT: Sorry, wrong file included. Fixed now! And as for it working with the other mod, it depends on if they are using the function in TurretGenerator. For Aki's mod, at least, it won't, as I have no access - To my knowledge - to the function that actually generates the turrets. All I have is the ability to intercept the TurretTemplate object in a couple of places and manually adjust the 'automatic' variable. AllTurretsAuto.zip Link to comment Share on other sites More sharing options...
LordHavoc Posted February 2, 2017 Share Posted February 2, 2017 To help answer the weapon scaling. Although I've not tested [weaponTech], I have tested [weaponDPS] When I adjusted the value of generated salvagers/miners to have X4 dps, the turrets were big! And this also adjusted the amount of crew needed to use them In turretgenerator.lua if weaponType == WeaponType.MiningLaser then dps = miningDPS * 4 --added to existing code here tech = miningTech if weaponType == WeaponType.SalvagingLaser then --added this to affect salvagers only dps = dps * 4 tech = weaponTech elseif weaponType == WeaponType.ForceGun then dps = rand:getFloat(800, 1200); -- force tech = weaponTech else dps = weaponDPS tech = weaponTech end Link to comment Share on other sites More sharing options...
LordHavoc Posted February 2, 2017 Share Posted February 2, 2017 Something in the mod is breaking world generation. Everytime I create a new world, it's putting me at coords 0,0 (the centre of the galaxy) I can't do a clean playthrough with this Hold that thought...it could be something i'm doing. Testing now Update: Yep it was me WARNING - be careful when editing turretgenerator.lua - it appears to have a retroactive effect on existing turrets. The changes I made above, tried to adjust the drones starter turrets. Then it must have thrown a wobbly and generated me in the centre. It is indeed odd that it only manifests on world generation. I'm gonna leave it alone for a while till I get more used to coding in lua Link to comment Share on other sites More sharing options...
SpeedBreaker Posted February 2, 2017 Share Posted February 2, 2017 thx autoturret work now. very good mod thx Link to comment Share on other sites More sharing options...
RebCom1807 Posted February 2, 2017 Author Share Posted February 2, 2017 I'll try to make a 'cleaner' version when I get home today. The way I'm doing it currently might have some issues - Namely, adjusting something too close to the source. If I could, I would totally adjust the actual function at a base level. To help with the issue you're having, Havoc, maybe adjust it where it's calling the TurretGenerator's function? Link to comment Share on other sites More sharing options...
Romual Posted February 2, 2017 Share Posted February 2, 2017 Does this mod toss away stats drop from turrets being autofire or compensates for it? Link to comment Share on other sites More sharing options...
RebCom1807 Posted February 3, 2017 Author Share Posted February 3, 2017 Unfortunately, I don't know how much that change is - Otherwise I would endeavor to compensate for it! Link to comment Share on other sites More sharing options...
El Poncho negro Posted February 15, 2017 Share Posted February 15, 2017 Hi, the mod seems to work but it is not retroactive for me. - When i create a new game it generate me in the center of the galaxy too. - Creative mod is affected : must pay to build I put " turret.automatic = true " at the wrong place in faction.lua file: -- create turret generator local dps, tech = Balancing_GetSectorWeaponDPS(450, 0) local turret = InventoryTurret(GenerateTurretTemplate(random:createSeed(), WeaponType.ChainGun, dps, tech, Rarity(RarityType.Uncommon), Material(MaterialType.Iron))) player:getInventory():add(turret) player:getInventory():add(turret) local dps, tech = Balancing_GetSectorMiningDPS(450, 0) local turret = InventoryTurret(GenerateTurretTemplate(random:createSeed(), WeaponType.MiningLaser, dps, tech, Rarity(RarityType.Uncommon), Material(MaterialType.Iron))) player:getInventory():add(turret) player:getInventory():add(turret) player:createShipStyle("TestStyle") turret.automatic = true end [s]turret.automatic = true[/s] function matchResources(player) Apparently it solve the problem 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