Need help with energy/force field

Place to get help with not working mods / modding interface.
Post Reply
CryAngel
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Dec 28, 2014 9:38 am
Contact:

Need help with energy/force field

Post by CryAngel »

I looking for some help about some mod idea. I have few questions actually, but main question is if that mod idea possible at all. I will explain mod idea to give a points what i looking for (by other words - if current game engine have needed features). I know, there are already some force field mods, but i want something different. In general i want fields which work like electric poles do i.e. some emitters which can be placed and if at least two of them in some range then field will appear between them. some fast pic to better explanation in attachment.
fence.png
fence.png (6.43 KiB) Viewed 1554 times
field may (or may not) deal damage on touch and/or will block movement (i.e. i prefer to have ability define dealed damage or collision box or both. or, at least one of them, if other not possible). other part about electric consumption - i want make consumption depend on damage by bitters (or something else). is will be close to as electric turrets work: consume some on idle, and consume much more on each bitters attack - like electric turrets consumption on each fire. for sure, if field drain too much is will stop work (fade out) as any electric machines do. i hope i explain my idea good enough to understand :lol: (i not native english speaker, so sry for mistakes). after all, my question if is possible to implement all what i want right now (then i like some guide which interfaces, events, etc. i need use) or i need request something first?
little addon: that mechanic can be used not only for force fields, other types of fences can be created also - like wired fence which just block movement, electric wired fence and so on (may be some kind of alarm perimeter also? which not block, not deal damage but just make signal when passed?)

User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

Re: Need help with energy/force field

Post by L0771 »

I think this isn't possible, the hard part is the electricity, all others stuff are possible

Rahjital
Filter Inserter
Filter Inserter
Posts: 435
Joined: Thu May 29, 2014 10:44 am
Contact:

Re: Need help with energy/force field

Post by Rahjital »

It definitely is possible with some fakery. You could make each of the poles an accumulator type entity and subtract amount of power it uses when it charges. Another option would be to have an invisible assembler that a script would create whenever one of the poles is placed and which would simulate the electricity drain.

CryAngel
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sun Dec 28, 2014 9:38 am
Contact:

Re: Need help with energy/force field

Post by CryAngel »

thanks for answers. so, no direct way... that sad. i newb about factorio modding (just done few experiments with turrets, end up with ~+25% power, range, consumption :mrgreen: ) and before answers have hope there some way to modify electric poles (replace images, add collision to wire, add power consumption). well, i got idea about emitters, and what about fields? what entity better use? look like is need to be variable size(from min range to max range, like wires on poles) and have collision box.
anyway, anyone else like to have fence-style defensive structure or everyone happy with just stone walls(powered field is just my preference as high-tech protection, but some passive, steel wire fence is another option as example)?

User avatar
L0771
Filter Inserter
Filter Inserter
Posts: 516
Joined: Tue Jan 14, 2014 1:51 pm
Contact:

Re: Need help with energy/force field

Post by L0771 »

Rahjital wrote:It definitely is possible with some fakery. You could make each of the poles an accumulator type entity and subtract amount of power it uses when it charges. Another option would be to have an invisible assembler that a script would create whenever one of the poles is placed and which would simulate the electricity drain.
it isn't the problem, i think the problem is substract the energy, you need scan the area inside the poles every... 15 ticks? or every tick, is possible, but "expensive" for the game, but possible and isn't hard.

Post Reply

Return to “Modding help”