Jump to content

necris

Members
  • Posts

    3
  • Joined

  • Last visited

necris's Achievements

0

Reputation

  1. Thanks, my lua skills are lacking. I get now that Lua does not overload functions, it handles name conflicts by using the most recently defined function, which is why you save the previous one since the version in the mod will be appended to the end and therefore always be the "most recent one".
  2. If you just want to change the existing mine command, yes. You dont have to modify these: data/scripts/entity/craftorders.lua data/scripts/player/map/mapcommands.lua You can simply overwride just the mine.lua like I did in the attached example. This will modify the vanilla game file. All other scripts and the game itself will use the modded script this way. Thanks for the example, I'm a little confused though. The original Mine.lua already contains a function called AIMine.findMinedAsteroid(), doesn't appending another cause issues? Do you know if the function replaced or if the code is appended to that function? Where in that function is it appended is it appended if it is appended?
  3. New to Avorion modding but have been modding since Morrowind and Starcraft, programmed since last millenia and works as an IT consultant. Making small changes and testing stuff have been easy, but when I now want to do it properly I run into some problems. I think I'm just to unfamiliar still to come up with any good solutions and am therefore in need of your help. I want to make some changes to existing functions in the files below so that a miner uses my custom mine command instead: data/scripts/entity/ai/mine.lua data/scripts/entity/craftorders.lua data/scripts/player/map/mapcommands.lua According to the "Write your own mod"-guide I can't just change what order is called from galaxymap portraits and/or right-click context menu. Mod data is appended to files with nameclashes so I couldn't overwrite what those clicks do. How would you solve this? Make a new mine.lua file and a new command added to the context menu that uses that new mine.lua file? Am I overthinking this and missing something simple?
×
×
  • Create New...