Author Topic: need help with some modifications  (Read 145 times)

plablo

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    8
    • View Profile
on: July 14, 2018, 03:38:53 AM
Sorry if i put this topic in the wrong section
i'm not a modder, but i want to mess with  pirate/xsotan/trader attacks to spawn more and bigger and powerfull even in normal difficulty not just on insane
i already found how to add more ships  but where do i scale?



Hammelpilaw

  • Sr. Member
  • ****
  • Status:
    Offline
    Posts:
    431
    • View Profile
    • Scrap Yard - Avofactory
on: July 14, 2018, 08:47:15 AM
You can modify the size of a ship by modding the ship plan. There are lot of ways to do this. If you modify ./lib/galaxy.lua or ./lib/plangenerator.lua you could make all generated ships larger. Usely galaxy.lua is the better place for balancing, but if you change one thing there, it affects other stuff (like when increasing ship size, the weapons you find or build at turret factory also increases dps) so I recommand not to change it as an unexperienced modder.

plangenerator.lua:
Code: [Select]
function PlanGenerator.makeAsyncShipPlan(callback, values, faction, volume, styleName, material, sync)
    volume = volume * 2 -- ADD THIS LINE to multiply size off ALL npc ships (also Xsotan, pirates, factions) by 2

To make Xsotan ships stronger you could modify ./lib/story/xsotan.lua:

Code: [Select]
function Xsotan.createShip(position, volumeFactor)
    position = position or Matrix()
    local volume = Balancing_GetSectorShipVolume(Sector():getCoordinates())

    volume = volume * (volumeFactor or 1)
    volume = volume * 2 -- xsotan ships aren't supposed to be very big -- CHANGE THIS LINE if you have not done in plangenerator.lua yet

    local x, y = Sector():getCoordinates()
    local probabilities = Balancing_GetMaterialProbability(x, y)
    local material = Material(getValueFromDistribution(probabilities))
    local faction = Xsotan.getFaction()
    local plan = PlanGenerator.makeShipPlan(faction, volume, nil, material)
    local ship = Sector():createShip(faction, "", plan, position)    ship.damageMultiplier = ship.damageMultiplier * 2 -- ADD THIS LINE to multiply the damage of normal Xsotan ships by 2

I marked 2 lines in the code you could mod.

These are only examples, there are lot of scripts that affects generation of different ships/factions and so on. To make enemies stronger I love the damageMultiplier, it's really awesome. Already used it in lot of my balancing mods to make enemies stronger.

Ps.: Its the correct section for modding question.
Pps.: Make a backup of your modded scripts, because game scripts may be overwritten when you download an Avorion patch.



plablo

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    8
    • View Profile
on: July 14, 2018, 03:11:54 PM
re:
just to make sure i did it right.
in the pirate/alien/trader attack lua files, i basically copied and pasted the

pirateattack.lua:
Code: [Select]
Code: [Select]
         generator:createScaledRaider(MatrixLookUpPosition(-dir, up, pos))
and i didnt forget to add the " + right * -distance * 2.0~  + right * distance * 2.0~"

alienattack.lua
Code: [Select]
Code: [Select]
                  {size=1, title="Xsotan Scout"%_t},
and their variations just to spawn even more
did i did it right?
« Last Edit: July 14, 2018, 03:17:10 PM by plablo »



Hammelpilaw

  • Sr. Member
  • ****
  • Status:
    Offline
    Posts:
    431
    • View Profile
    • Scrap Yard - Avofactory
on: July 14, 2018, 03:24:05 PM
Your code looks good to me, but only a test can give you the final answer if it works. I recommand testing with the admin panel in debug mode.

You can enable debug mode in your test galaxy by editing server.ini in galaxy directory and change DevMode to true:

Code: [Select]
DevMode=true



Shrooblord

  • Sr. Member
  • ****
  • Status:
    Offline
    Posts:
    496
    • View Profile
on: July 15, 2018, 02:36:47 AM
the admin panel in debug mode.
Ohh?? What's this? Do you have a screenshot for me? This potentially sounds game-changing for a modder such as myself, if it is what I think it is.
Shrooblord



ArgMGa

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    5
    • View Profile
on: July 15, 2018, 08:00:11 AM
Sorry mean to be a quote...
« Last Edit: July 15, 2018, 08:04:29 AM by ArgMGa »



ArgMGa

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    5
    • View Profile
on: July 15, 2018, 08:04:47 AM
the admin panel in debug mode.
Ohh?? What's this? Do you have a screenshot for me? This potentially sounds game-changing for a modder such as myself, if it is what I think it is.

I think he mean for the debug script, i might be wrong but other than the way he says you can try usin this command in the chat:   /run Entity():addScript("lib/entitydbg.lua")
« Last Edit: July 15, 2018, 08:10:07 AM by ArgMGa »



Hammelpilaw

  • Sr. Member
  • ****
  • Status:
    Offline
    Posts:
    431
    • View Profile
    • Scrap Yard - Avofactory
on: July 15, 2018, 08:19:02 AM
I think he mean for the debug script, i might be wrong but other than the way he says you can try usin this command in the chat:   /run Entity():addScript("lib/entitydbg.lua")

Correct.



ArgMGa

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    5
    • View Profile
on: July 15, 2018, 09:32:58 AM
I think he mean for the debug script, i might be wrong but other than the way he says you can try usin this command in the chat:   /run Entity():addScript("lib/entitydbg.lua")

Correct.

hehe thanks for confirmin my supicions :P may i ask you about some moding capabilitis on this game?



plablo

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    8
    • View Profile
on: July 15, 2018, 04:32:47 PM
if hx == x and hy == y and player.playtime < 30 * 60 then
 this is the line to change the time to pirates spawn?
because i found some outdated pirate mods and i been tweaking some lines

they do spawn properly using the dev but i want to leave the game to actually spawn by it self