Jump to content

[Mod] Avorion Commands Package (/inventory, /crew, /sethome and more)


Aki

Recommended Posts

For some reason I can't seem to get above the number 12 when trying this out, 12 is Tesla Gun and after that, any number adds a Tesla gun. Anyone know what I'm doing wrong?

 

try insteed the number the full name.

 

ForceGun

SalvagingLaser

PulseCannon

 

I tried, but it didn't work sadly. ForceGun adds a Lightning Gun, SalvagingLaser adds a Tesla Gun and PulseCannon throws an error message "Could not identify weaponType"

P.S. I'm on version 0.16.7 r11165 if it matters

Link to comment
Share on other sites

  • Replies 212
  • Created
  • Last Reply

Top Posters In This Topic

Go into your files path: data/scripts/commands open the LUA file that says inventory and do ctrl+f and search for number 12 once you find it there will be a line of code that'll read weapontype = limit(tonumber(w), 12, 0) change the 12 to a 16. i havent figured out how to make the mod recognize the new upgrade types yet so if anyone knows how to do that i would appreciate it.

 

Link to comment
Share on other sites

Go into your files path: data/scripts/commands open the LUA file that says inventory and do ctrl+f and search for number 12 once you find it there will be a line of code that'll read weapontype = limit(tonumber(w), 12, 0) change the 12 to a 16. i havent figured out how to make the mod recognize the new upgrade types yet so if anyone knows how to do that i would appreciate it.

 

Yep, it worked, thanks a lot!

Link to comment
Share on other sites

Go into your files path: data/scripts/commands open the LUA file that says inventory and do ctrl+f and search for number 12 once you find it there will be a line of code that'll read weapontype = limit(tonumber(w), 12, 0) change the 12 to a 16. i havent figured out how to make the mod recognize the new upgrade types yet so if anyone knows how to do that i would appreciate it.

 

Yep, it worked, thanks a lot!

 

no problem just hope someone can figure out how to get it to recognize the new system modules so i can ad them to my ship.

Link to comment
Share on other sites

Eurekas were had! I found out how to add systems to the [/inventory upgrade] spawner

Look at lib\cmd\upgrades.lua. you'll find strings that essentially go: {function (str) return str:find("^{SEARCH WORD}") end, "{NAME OF UPGRADE found in the systems folder}", "{<<<repeat last}"},

 

As an example, I managed to get it to spawn the XSTN-Ks by adding these to the list

	{function (str) return str:find("^teleporterkey1") end, "teleporterkey1", "teleporterkey1"},
{function (str) return str:find("^teleporterkey2") end, "teleporterkey2", "teleporterkey2"},
{function (str) return str:find("^teleporterkey3") end, "teleporterkey3", "teleporterkey3"},
{function (str) return str:find("^teleporterkey4") end, "teleporterkey4", "teleporterkey4"},
{function (str) return str:find("^teleporterkey5") end, "teleporterkey5", "teleporterkey5"},
{function (str) return str:find("^teleporterkey6") end, "teleporterkey6", "teleporterkey6"},
{function (str) return str:find("^teleporterkey7") end, "teleporterkey7", "teleporterkey7"},
{function (str) return str:find("^teleporterkey8") end, "teleporterkey8", "teleporterkey8"},

 

I will not try spawning them with a level lower than legendary though. Don't want to risk yerg-ing anything on my end mid-testing ;D.

 

Other snippets for the newly released vanilla systems:

{function (str) return str:find("^loot") end, "lootrangebooster", "lootrangebooster"},
{function (str) return str:find("^shieldimp") end, "shieldimpenetrator", "shieldimpenetrator"},

 

Good for DarkPaapi's Unique Xsotan Keys mod, now you don't have to type a long string of code and have to manually change the seed everytime if you want to try them.

 

so i added the booster and impenetrable code to the lib but i still cant spawn them is there some other code i have to modify?

Link to comment
Share on other sites

I've managed to fix the agoods problem:

 

in \scripts\player\cmd\agoods.lua, the code should be:

 

 

if onServer() then
    package.path = package.path .. ";data/scripts/lib/?.lua"
    require ("goods")
end

function initialize(name, quantity, ...)
local player = Player()

name = string.gsub(name, "_", " ")

if goods[name] ~= nil then
	local ship = Entity(player.craftIndex)
	local good = tableToGood(goods[name])

	ship:addCargo(good, quantity)
else
	player:sendChatMessage("Server", 0, string.format("Error:%s is not a good!", name ))
end

terminate()
end

 

 

am i missing something i altered the code but still can use the command?

Link to comment
Share on other sites

Eurekas were had! I found out how to add systems to the [/inventory upgrade] spawner

Look at lib\cmd\upgrades.lua. you'll find strings that essentially go: {function (str) return str:find("^{SEARCH WORD}") end, "{NAME OF UPGRADE found in the systems folder}", "{<<<repeat last}"},

 

As an example, I managed to get it to spawn the XSTN-Ks by adding these to the list

	{function (str) return str:find("^teleporterkey1") end, "teleporterkey1", "teleporterkey1"},
{function (str) return str:find("^teleporterkey2") end, "teleporterkey2", "teleporterkey2"},
{function (str) return str:find("^teleporterkey3") end, "teleporterkey3", "teleporterkey3"},
{function (str) return str:find("^teleporterkey4") end, "teleporterkey4", "teleporterkey4"},
{function (str) return str:find("^teleporterkey5") end, "teleporterkey5", "teleporterkey5"},
{function (str) return str:find("^teleporterkey6") end, "teleporterkey6", "teleporterkey6"},
{function (str) return str:find("^teleporterkey7") end, "teleporterkey7", "teleporterkey7"},
{function (str) return str:find("^teleporterkey8") end, "teleporterkey8", "teleporterkey8"},

 

I will not try spawning them with a level lower than legendary though. Don't want to risk yerg-ing anything on my end mid-testing ;D.

 

Other snippets for the newly released vanilla systems:

{function (str) return str:find("^loot") end, "lootrangebooster", "lootrangebooster"},
{function (str) return str:find("^shieldimp") end, "shieldimpenetrator", "shieldimpenetrator"},

 

Good for DarkPaapi's Unique Xsotan Keys mod, now you don't have to type a long string of code and have to manually change the seed everytime if you want to try them.

 

so i added the booster and impenetrable code to the lib but i still cant spawn them is there some other code i have to modify?

 

Did you check the upgradegenerator.lua?

UpgradeGenerator.add("data/scripts/systems/shieldimpenetrator.lua", 1)

and

UpgradeGenerator.add("data/scripts/systems/lootrangebooster.lua", 1)

Should be listed there. If not, it is out of date, but should be rectified by adding them in. Also check the upgrades folder to see if the files are there.

Link to comment
Share on other sites

My apologies in advance if this answer was listed amidst the several pages I read through, but:

 

Question:

I know the MOD Developer hasn't done work on this project for a while so is that why only the crew commands work while the spawn commands are buggy?  I'll spawn say either a turret or system upgrade, yet the only appear in my physical inventory but are not available to slot via the upgrades or build menu (weapons.) 

 

Has anyone found a way to resolve this themselves?

 

Any help would be much appreciated.  I did and still love the MOD least for the crew fulfillment option.  Thank you!

Link to comment
Share on other sites

  • 1 month later...

My apologies in advance if this answer was listed amidst the several pages I read through, but:

 

Question:

I know the MOD Developer hasn't done work on this project for a while so is that why only the crew commands work while the spawn commands are buggy?  I'll spawn say either a turret or system upgrade, yet the only appear in my physical inventory but are not available to slot via the upgrades or build menu (weapons.) 

 

Has anyone found a way to resolve this themselves?

 

Any help would be much appreciated.  I did and still love the MOD least for the crew fulfillment option.  Thank you!

 

That sounds like you create/joined an alliance. When you add turrets and upgrades via this script they're placed in your personal inventory. If you're part of an alliance, flying an alliance ship, you need to move these upgrades to the alliance inventory first for them to become available for slotting.

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

the Mod is outdated. You can do most of the stuff with the entitydebug-tool, try to enter the following in your chat (Well, you need to be Admin on the Server or in a singleplayer-game):

/run Entity():addScript("lib/entitydbg.lua")

But if I'm not mistaking, you won't be able to generate a specific upgrade that way.

Link to comment
Share on other sites

Hello everyone,

I managed to get the /inv turret part or the weapon spawning part of the the mod working again.

I have checked and all the current and new weapons are now spawnable. Credit goes to the original mod author only I just fixed a part.

I have also included a list of weapons and their weapon code to spawn them named "avorion-commands-master_List"

To Install just overwrite the scripts folder from this into your "Avorion/data/" folder , you need the original mod already installed before this.

avorion-commands-master.zip

Link to comment
Share on other sites

  • 4 weeks later...

The Fighter command still seems to be broken, in the same way the turret spawning was. For instance, I can't spawn a salvaging fighter, no matter what I try - anything above 12 (or even listing it specifically as SalvagingLaser) just spawns a Force Fighter. I imagine it's the same issue as the turrets, with the enum list being all out of whack?

Link to comment
Share on other sites

  • 2 weeks later...

Now, for All those who wanted to get Turret System Upgrades I found out how by messing around with commands and looking at the components themselves! The reason is you have different types of TCS - Turret Command Systems. There-in I started to think, you have Military and Civ, although it took me a minute till I plugged in "Civ" bc description shows All-Round lol. But here are your commands for the M-TCS and A-TCS:

M-TCS

/inv upgrade military (tier 1-5) (Qty)

A-TCS

/inv upgrade civ (tier 1-5) (Qty)

I still can't get the XSTN-K 1-8 to spawn but if you're just looking for the Turret Command Systems, Here you all go. Hope it finds it's way to someone! Cheers!

Link to comment
Share on other sites

  • 4 months later...

When trying to add a few turrets types (All those with number above 10 if i remember) it always add tesla turrets.

 

Is this mod still supported or should i move to another package collection? (Is it worth fixing it if not maintained anymore?)

Link to comment
Share on other sites

Is this mod still supported or should i move to another package collection? (Is it worth fixing it if not maintained anymore?)

 

There's always the developer command

 

/run Entity():addScript("lib/entitydbg.lua")

 

that you can use to give yourself 10 random sets of 20 weapons, any cargo, any system, to spawn any station or factory, and to create any other of the dozens of odd things, too.

Link to comment
Share on other sites

  • 1 month later...

i feel like this mod or at least its commands  should be integrated into the game as working commands

 

here is an updated weapons.lua for the mining update that is currently in beta

-- Table of system upgrade scripts for use with `findString()` from `lib.cmd.common`
return
{
{function (str) return str:find("^[cC]ha") end,  0, "ChainGun"},
{function (str) return str:find("^[pP]dc") end,  1, "PdChainGun"},
{function (str) return str:find("^[pP]dl") end,  2, "PdLaser"},
{function (str) return str:find("^[lL]as") end,  3, "Laser"},
{function (str) return str:find("^[mM]in") end,  4, "MiningLaser"},
{function (str) return str:find("^[rR]awm") end,  5, "RawMiningLaser"},
{function (str) return str:find("^[sS]al") end,  6, "SalvagingLaser"},
{function (str) return str:find("^[rR]aws") end,  7, "RawSalvagingLaser"},
{function (str) return str:find("^[pP]la") end,  8, "PlasmaGun"},
{function (str) return str:find("^[rR]oc") end,  9, "RocketLauncher"},
{function (str) return str:find("^[cC]an") end,  10, "Cannon"},
{function (str) return str:find("^[rR]ai") end,  11, "RailGun"},
{function (str) return str:find("^[rR]ep") end,  12, "RepairBeam"},
{function (str) return str:find("^[bB]ol") end,  13, "Bolter"},
{function (str) return str:find("^[lL]ig") end,  14, "LightningGun"},
{function (str) return str:find("^[tT]es") end,  15, "TeslaGun"},
{function (str) return str:find("^[fF]or") end,  16, "ForceGun"},
{function (str) return str:find("^[pP]ul") end,  17, "PulseCannon"},
{function (str) return str:find("^[aA]nt") end,  18, "AntiFighter"},
}

 

i might update the upgrades list later if i have time.

Link to comment
Share on other sites

  • 1 month later...

So I have been pouring over this information and the lua files. It seems that COAXIAL weapons are merely a type of "toggle" - GetWeaponsCoaxial or something like that. I am trying to figure out how to "toggle" that code so I can command a coaxial weapon into my inventory. Any thoughts?

Link to comment
Share on other sites

In case anyone is interested, I managed to create custom coaxial weapons using this "customized" version of the mod:

 

https://www.avorion.net/forum/index.php/topic,3748.html

 

The command /INVENTORY MYTURRET allows you to create a customized turret by physically editing the inventory.lua file before running the command. At lines 213 and 214, add the following:

 

--Make Turret A CoAxial Weapon
item.coaxial = true

 

This will make the weapon a coaxial weapon.

 

If you want to go back to making turrets just add "--" at the beginning of line 214.

 

Link to comment
Share on other sites

Due to the most recent updates, the Turret generation this script used has been changed.

The following Changes need to be made in 'inventory.lua' in 'data/scripts/commands/'

 

Line 10

Add
  TurretGenerator = require("turretgenerator")

 

Line 46

Replace
  GenerateTurretTemplate(random():createSeed(), weapontype, dps, tech, rarity, material)
with
  TurretGenerator.generateSeeded(random():createSeed(), weapontype, dps, tech, rarity, material)

 

This will allow the script to spawn turrets again.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...