HIdden Entities and Such
HIdden Entities and Such
I am trying to implement an accumulator charger entity to complement the tile I made for my mod.
Basically, every tick, it check for the tile that the player is currently on, and based on the tile's name, it will do things.
I am implementing an accumulator charger entity that goes with this. So every time, it check for that particular tile, the accumulator will drain.
So far, I am trying to 'hide' it. Didn't really work the way I want it to. Apparently, you can't have an entity without creating item and recipe for it. Maybe it would be better to get rid of the tile and go entirely for the entity instead?
Right now I am trying to make it transparent, and so far the game is not cooperating with me. It's complaining about sprite being outside. No clues what that supposed to mean.
Anyway, I don't know what the hell I am doing.
Basically, every tick, it check for the tile that the player is currently on, and based on the tile's name, it will do things.
I am implementing an accumulator charger entity that goes with this. So every time, it check for that particular tile, the accumulator will drain.
So far, I am trying to 'hide' it. Didn't really work the way I want it to. Apparently, you can't have an entity without creating item and recipe for it. Maybe it would be better to get rid of the tile and go entirely for the entity instead?
Right now I am trying to make it transparent, and so far the game is not cooperating with me. It's complaining about sprite being outside. No clues what that supposed to mean.
Anyway, I don't know what the hell I am doing.
- DedlySpyder
- Filter Inserter
- Posts: 253
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: HIdden Entities and Such
I forget the exact process, but my powered entities mod (see signature) has invisible power poles. And, IIRC I didn't need an item or recipe for them, I think that relies on the mined property.
EDIT: After a quick check, I left the minable of normal power poles, since they can't be mined it doesn't matter.
But the main things you'll want are the flags, 0 collision box, collision mask, nil selection box, and you'll need a transparent picture (you can just take the one I use and rename it)
EDIT: After a quick check, I left the minable of normal power poles, since they can't be mined it doesn't matter.
But the main things you'll want are the flags, 0 collision box, collision mask, nil selection box, and you'll need a transparent picture (you can just take the one I use and rename it)
Re: HIdden Entities and Such
You don't need an item for entity and under no condition you are forced to have a recipe for an item.
Remove "-placeabe" flags from entity definition.
You need to specify a custom collision_mask, as a field in entity prototype, for example an empty one, like the plane mods do.
The "sprite outside of ..." is an error related to goofed image sizes. You need to make sure, that animation-related fields (direction_count, frames... etc.) do not make the game look for more of picture than there is.
I tend to use 'empty.png' picture from core mod, when doing invisible entities.
Also, you might have a look at klonan's power mods, some of that stuff is bound to have invisible accumulator in it.
Remove "-placeabe" flags from entity definition.
You need to specify a custom collision_mask, as a field in entity prototype, for example an empty one, like the plane mods do.
The "sprite outside of ..." is an error related to goofed image sizes. You need to make sure, that animation-related fields (direction_count, frames... etc.) do not make the game look for more of picture than there is.
I tend to use 'empty.png' picture from core mod, when doing invisible entities.
Also, you might have a look at klonan's power mods, some of that stuff is bound to have invisible accumulator in it.
If I remember right it did error on that one. Dot-boxes of {{0,0},{0,0}} seem to work fine.DedlySpyder wrote:nil selection box
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
- DedlySpyder
- Filter Inserter
- Posts: 253
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: HIdden Entities and Such
Maybe they fixed it at some point, or something caused from me taking a deep copy then setting selection box to nilAdil wrote:If I remember right it did error on that one. Dot-boxes of {{0,0},{0,0}} seem to work fine.DedlySpyder wrote:nil selection box
Re: HIdden Entities and Such
I don't understand how to get rid of the error. I tried to get rid of the animation fields altogether, but it had no impact.Adil wrote:You don't need an item for entity and under no condition you are forced to have a recipe for an item.
Remove "-placeabe" flags from entity definition.
You need to specify a custom collision_mask, as a field in entity prototype, for example an empty one, like the plane mods do.
The "sprite outside of ..." is an error related to goofed image sizes. You need to make sure, that animation-related fields (direction_count, frames... etc.) do not make the game look for more of picture than there is.
I tend to use 'empty.png' picture from core mod, when doing invisible entities.
Also, you might have a look at klonan's power mods, some of that stuff is bound to have invisible accumulator in it.
If I remember right it did error on that one. Dot-boxes of {{0,0},{0,0}} seem to work fine.DedlySpyder wrote:nil selection box
(I made a transparent.png the size of 32x32.)
Code: Select all
data:extend({
{
type = "accumulator",
name = "accelerator_charger",
icon = "__base__/graphics/entity/accumulator/accumulator.png",
flags = {"placeable-neutral", "player-creation"},
minable = {hardness = 0.1, mining_time = 0.1, result="accelerator_charger"},
indestructible = true,
max_health = 150,
order = "a-a-a",
corpse = "medium-remnants",
collision_mask = {"water-tile"},
collision_box = {{-0.9, -0.9}, {0.9, 0.9}},
selection_box = {{-1, -1}, {1, 1}},
energy_source =
{
type = "electric",
buffer_capacity = "5MJ",
usage_priority = "terciary",
input_flow_limit = "300kW",
output_flow_limit = "300kW"
},
picture =
{
filename = "__MagneticFloor__/graphics/transparent.png",
priority = "extra-high",
width = 32,
height = 32,
shift = {0.0, 0.0}
},
charge_animation =
{
filename = "__MagneticFloor__/graphics/transparent.png",
width = 32,
height = 32,
line_length = 0,
frame_count = 1,
shift = {0.482, -0.638},
animation_speed = 0.5
},
charge_cooldown = 30,
charge_light = {intensity = 0.3, size = 7},
discharge_animation =
{
filename = "__MagneticFloor__/graphics/transparent.png",
width = 32,
height = 32,
line_length = 0,
frame_count = 1,
shift = {0, 0},
animation_speed = 0.5
},
discharge_cooldown = 60,
discharge_light = {intensity = 0.7, size = 7},
vehicle_impact_sound = { filename = "__base__/sound/car-metal-impact.ogg", volume = 0.65 },
working_sound =
{
sound =
{
filename = "__base__/sound/accumulator-working.ogg",
volume = 1
},
idle_sound = {
filename = "__base__/sound/accumulator-idle.ogg",
volume = 0.4
},
max_sounds_per_type = 5
},
}
})
Re: HIdden Entities and Such
Why is line_length = 0 ? Did you try 1 there?
Also, there's crop-cache.dat file in the game folder, I remember deleting that in the past to solve the problems, that seemed not my fault, and rarely it seemed to work.
Also, there's crop-cache.dat file in the game folder, I remember deleting that in the past to solve the problems, that seemed not my fault, and rarely it seemed to work.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: HIdden Entities and Such
I don't understand what line_length, even after reading the documentation. Is it about loading how many images on a single width?Adil wrote:Why is line_length = 0 ? Did you try 1 there?
Deleting the crop-cache.dat works. Thanks!Also, there's crop-cache.dat file in the game folder, I remember deleting that in the past to solve the problems, that seemed [[not my fault, and rarely it seemed to work.
I got rid of the animation, since it's invisible.
Re: HIdden Entities and Such
Figured out how to resize the selection box, though it required me to restart factorio, which really slowed development down.
Now, I am wondering why it's not showing me 'not powered' errors.
Now, I am wondering why it's not showing me 'not powered' errors.
Re: HIdden Entities and Such
These are not yet documented, so my guess would be similar to yours, but it is intuitively wrong to have that number zero.kiba wrote: I don't understand what line_length, even after reading the documentation. Is it about loading how many images on a single width?
All prototype alterations require game reboot to take place. (Or fiddling with migrations, probably.)kiba wrote:Figured out how to resize the selection box, though it required me to restart factorio, which really slowed development down.
Is it of the same force as your player?kiba wrote:Now, I am wondering why it's not showing me 'not powered' errors.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: HIdden Entities and Such
They are documented. I read it in the wiki, but I still don't understand what it means.Adil wrote: These are not yet documented, so my guess would be similar to yours, but it is intuitively wrong to have that number zero.
Yeah, and they causes slowdown in development speed. Either way, mods get developed slower.Adil wrote: All prototype alterations require game reboot to take place. (Or fiddling with migrations, probably.)
I am pretty sure that's the case. I'll have to check for sure.Adil wrote: Is it of the same force as your player?
- DedlySpyder
- Filter Inserter
- Posts: 253
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: HIdden Entities and Such
IIRC, there is a setting somewhere that saves a large amount of data to your drive, so that if you use a SSD the load time is drastically reducedkiba wrote:Yeah, and they causes slowdown in development speed. Either way, mods get developed slower.Adil wrote: All prototype alterations require game reboot to take place. (Or fiddling with migrations, probably.)
Re: HIdden Entities and Such
I removed all the flags, it's still complaining about the lack of item.Adil wrote:You don't need an item for entity and under no condition you are forced to have a recipe for an item.
Remove "-placeabe" flags from entity definition.
- DedlySpyder
- Filter Inserter
- Posts: 253
- Joined: Fri Jun 20, 2014 11:42 am
- Contact:
Re: HIdden Entities and Such
I think it's your minable property, you are referencing an item in that that doesn't exist, so try removing it altogetherkiba wrote:I removed all the flags, it's still complaining about the lack of item.Adil wrote:You don't need an item for entity and under no condition you are forced to have a recipe for an item.
Remove "-placeabe" flags from entity definition.
Re: HIdden Entities and Such
Thanks. For some reason, I never thought to try removing minable altogether.DedlySpyder wrote:I think it's your minable property, you are referencing an item in that that doesn't exist, so try removing it altogetherkiba wrote:I removed all the flags, it's still complaining about the lack of item.Adil wrote:You don't need an item for entity and under no condition you are forced to have a recipe for an item.
Remove "-placeabe" flags from entity definition.
Re: HIdden Entities and Such
Edit: Never mind.