multirocketshot
-
- Smart Inserter
- Posts: 1462
- Joined: Sun Jun 15, 2014 11:39 am
- Contact:
multirocketshot
im trying to create modded explosive rockets that fire multiple rockets with one shot and i keep getting an error when i try to load it up about dataloader.lua looking for a table that doesn't exist.
im not sure what the issue is to fix it- Attachments
-
- multishotrocket_0.0.1.zip
- modded rocket
- (1.21 KiB) Downloaded 101 times
-
- error.jpg (24.58 KiB) Viewed 7832 times
Re: multirocketshot
In your ammo.lua are two typos.
After the data:extend only a normal bracket ( is needed, no curly bracket {. The same at the very end of the file: you only need a ).
After the data:extend only a normal bracket ( is needed, no curly bracket {. The same at the very end of the file: you only need a ).
Former moderator.
-
- Smart Inserter
- Posts: 1462
- Joined: Sun Jun 15, 2014 11:39 am
- Contact:
Re: multirocketshot
thanks that got that error to go away. now its coming up with this.
i appericate any help in getting this to work. all im trying to do is get it to fire 2 or missile at the same time
all my brackets seem to be closed. Code: Select all
data.extend(
type = "ammo",
name = "explosive-rocket",
icon = "__base__/graphics/icons/explosive-rocket.png",
flags = {"goes-to-main-inventory"},
ammo_type =
{
category = "rocket",
action =
{
type = "direct",
repeat_count = 12,
action_delivery =
{
type = "projectile",
projectile = "explosive-rocket",
starting_speed = 0.1,
direction_deviation = 0.3,
range_deviation = 0.3,
source_effects =
{
type = "create-entity",
entity_name = "explosion-hit"
}
}
}
},
magazine_size = 10,
subgroup = "ammo",
order = "d[rocket-launcher]-b[explosive]",
stack_size = 100
)
Re: multirocketshot
I fixed it. Code below.
Code: Select all
data:extend(
{
{
type = "ammo",
name = "explosive-rocket",
icon = "__base__/graphics/icons/explosive-rocket.png",
flags = {"goes-to-main-inventory"},
ammo_type =
{
category = "rocket",
action =
{
type = "direct",
repeat_count = 12,
action_delivery =
{
type = "projectile",
projectile = "explosive-rocket",
starting_speed = 0.1,
direction_deviation = 0.3,
range_deviation = 0.3,
source_effects =
{
type = "create-entity",
entity_name = "explosion-hit"
}
}
}
},
magazine_size = 10,
subgroup = "ammo",
order = "d[rocket-launcher]-b[explosive]",
stack_size = 100
}
})
Former moderator.
-
- Smart Inserter
- Posts: 1462
- Joined: Sun Jun 15, 2014 11:39 am
- Contact:
Re: multirocketshot
ya i tried that already. it goes back to giving the original error about a table being expected
Re: multirocketshot
I see I still have Factorio 0.12.7, I need to update.
This can take a while since the factorio.com servers seem down.
This can take a while since the factorio.com servers seem down.
Former moderator.
-
- Filter Inserter
- Posts: 478
- Joined: Sat Aug 23, 2014 11:43 pm
- Contact:
Re: multirocketshot
you used data.extend instead of data:extend.
fixed it for you in the code below
fixed it for you in the code below
Code: Select all
data:extend(
{
{
type = "ammo",
name = "explosive-rocket",
icon = "__base__/graphics/icons/explosive-rocket.png",
flags = {"goes-to-main-inventory"},
ammo_type =
{
category = "rocket",
action =
{
type = "direct",
repeat_count = 12,
action_delivery =
{
type = "projectile",
projectile = "explosive-rocket",
starting_speed = 0.1,
direction_deviation = 0.3,
range_deviation = 0.3,
source_effects =
{
type = "create-entity",
entity_name = "explosion-hit"
}
}
}
},
subgroup = "ammo",
order = "d[rocket-launcher]-b[explosive]",
stack_size = 100
}
})
Waste of bytes : P
Re: multirocketshot
Nope, that's not true.keyboardhack wrote:you used data.extend instead of data:extend.
Former moderator.
-
- Filter Inserter
- Posts: 478
- Joined: Sat Aug 23, 2014 11:43 pm
- Contact:
Re: multirocketshot
i downloaded the mod he uploaded and in there he uses data.extend. The mod loads with the code i posted.Kajanor wrote:Nope, that's not true.keyboardhack wrote:you used data.extend instead of data:extend.
Waste of bytes : P
Re: multirocketshot
You both posted the exact same code, except that keyboardhack removed the line "magazine_size = 10," from the code.
keyboardhack was talking about the original code post, Kajanor fixed the same issue in his code.keyboardhack wrote:i downloaded the mod he uploaded and in there he uses data.extend. The mod loads with the code i posted.Kajanor wrote:Nope, that's not true.keyboardhack wrote:you used data.extend instead of data:extend.
-
- Smart Inserter
- Posts: 1462
- Joined: Sun Jun 15, 2014 11:39 am
- Contact:
Re: multirocketshot
thanks guys for the help. after i corrected the data:extend issue the way Kajanor posted it loads now and rockets now have magazines to them. just got to get the multi rocket part to work but should be easier to figure out now that i have slept.
-
- Smart Inserter
- Posts: 1462
- Joined: Sun Jun 15, 2014 11:39 am
- Contact:
Re: multirocketshot
another small issue. ive got the recipes created and items created for the ammo. i cant figure out how to update the rocketry tech to add my items recipes to be unlocked by it. . the items work fine they just cant be researched yet. i attached the files with the rest of the info in case its needed.
Code: Select all
data.raw.technology["rocketry"].effects,{type = "unlock-recipe", recipe = "mini-rocket"}, {type = "unlock-recipe", recipe = "rocket-shotgun-ammo" }
- Attachments
-
- multishotrocket_0.0.1.zip
- all files
- (2.7 KiB) Downloaded 108 times
Re: multirocketshot
Use
For existing saves you need to add a migration file, containing sth. like
Code: Select all
table.insert(data.raw.technology["rocketry"].effects, {type = "unlock-recipe", recipe = "mini-rocket"})
table.insert(data.raw.technology["rocketry"].effects, {type = "unlock-recipe", recipe = "rocket-shotgun-ammo" })
Code: Select all
for _, force in pairs(game.forces) do
force.reset_recipes()
force.reset_technologies()
end
-
- Smart Inserter
- Posts: 1462
- Joined: Sun Jun 15, 2014 11:39 am
- Contact:
Re: multirocketshot
ah, i didn't realize i needed the table.insert for that. and thanks for the script it was my next task and you saved me a lot of time trying to reverse engineer it from something. the mods is updated with tech and recipes now if anybody wants to play with it. https://forums.factorio.com/forum/vie ... 28#p109028. feedback would be appreciated.