[MOD] 0.9.X]Red Alert Harvester V0.0.5

Topics and discussion about specific mods
User avatar
darius456
Fast Inserter
Fast Inserter
Posts: 222
Joined: Thu Jan 02, 2014 6:33 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.3

Post by darius456 »

Magnificent but unfortunately
"You have to be in it while it mines"
, so please make it automatic with possibility to choose ore type to harvest.
Lenovo Y580 8GB Ram GF660m 128GB SSD W7
Scoutter
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat May 17, 2014 9:04 pm
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.3

Post by Scoutter »

Hello there.


I like the mod a lot but I have the problem that my game crashes everytime the harvester try to mine the last 1 of an ore, even your programming should exclude this event.
Attachments
Harvester error.jpg
Harvester error.jpg (165 KiB) Viewed 5576 times
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.3

Post by FreeER »

Scoutter wrote:I like the mod a lot but I have the problem that my game crashes everytime the harvester try to mine the last 1 of an ore, even your programming should exclude this event.
This was fixed just recently (though the newest version doesn't seem to have been uploaded yet, perhaps he's working on it some more or is busy?) but if you want to edit the control.lua for a quick fix yourself you can change line 11's >= to > and line 16 "ore.amount = 0 to "ore.destroy()".
I'll apologize for this one since it was my mistake (I thought Factorio would destroy it for me if I set it to 0...silly me :lol:), um right sorry :oops:

...technically that quick fix isn't compatible with any mods that add infinite ores through negative amounts (if that's still a thing since the infinite prototype option was created), but the next release should have code to take care of that case
darius456 wrote:so please make it automatic with possibility to choose ore type to harvest.
that would take a decent amount of work (though drs9999 was, um, nice enough to upload an A* implementation in the WIP section so at least that part could be mostly done lol).
McSpiffy
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Mon May 05, 2014 9:17 pm
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.3

Post by McSpiffy »

I uploaded a fix for this ^_^ 0.0.4
Scoutter wrote:I like the mod a lot but I have the problem that my game crashes everytime the harvester try to mine the last 1 of an ore, even your programming should exclude this event.
HoneyFox
Burner Inserter
Burner Inserter
Posts: 12
Joined: Thu May 08, 2014 9:09 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.3

Post by HoneyFox »

quotes
I've actually changed a bit based on the v0.0.3 on my own side, to make it as an item cloner so that it will duplicate anything in its own inventory when player is not inside :oops: for cheating...
but the part of codes that keep track of all harvester instances should be the same.
control.lua.zip
(2.45 KiB) Downloaded 140 times
Last edited by HoneyFox on Sun May 18, 2014 5:56 am, edited 2 times in total.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.4

Post by FreeER »

HoneyFox wrote:I've actually changed a bit based on the v0.0.3 on my own side
are you asking what line you should be changing to fix it then? If so you could have downloaded the original and found line 11 then did a search in your new one for that line (it's line 192 in yours, and line 16 no longer matters since you are setting it to 99, for cheaty reasons I suppose). If that is indeed what you wanted then I'd suggest that in the future when you've cheat modded of a mod and want a little "bug testing" help fixing it that you pm someone (me or mod author for instance) instead of posting in that mod's thread (since it's actually unrelated), of course if that's not what you were asking then...ignore this? :lol:

P.S. could you edit your post to place the quote in a spoiler (or simply shorten what you've quoted) to avoid people having to scroll further due to repeated text? useful tip, if you hit reply first you can then just highlight/select the relevant text and press quote and it'll only quote the selected text instead of the full post.
HoneyFox
Burner Inserter
Burner Inserter
Posts: 12
Joined: Thu May 08, 2014 9:09 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.4

Post by HoneyFox »

FreeER wrote:are you asking what line you should be changing to fix it then?
no. i was just trying to help since someone want the harvesters to be able to collect ore even when the player is not inside, hence that means the script need to keep track of all these harvesters. and that's what i also did in my edit, though for a different purpose...
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.4

Post by Airat9000 »

mod work?
drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.4

Post by drs9999 »

FreeER wrote:
darius456 wrote:so please make it automatic with possibility to choose ore type to harvest.
that would take a decent amount of work (though drs9999 was, um, nice enough to upload an A* implementation in the WIP section so at least that part could be mostly done lol).
Actually I think that it will not work well in this scenario, just because of performance-reasons.
BUT I am very very curious - it might work.
Scoutter
Burner Inserter
Burner Inserter
Posts: 11
Joined: Sat May 17, 2014 9:04 pm
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.3

Post by Scoutter »

McSpiffy wrote:I uploaded a fix for this ^_^ 0.0.4
Scoutter wrote:I like the mod a lot but I have the problem that my game crashes everytime the harvester try to mine the last 1 of an ore, even your programming should exclude this event.

Thank you. I will try it out.
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.4

Post by FreeER »

drs9999 wrote:Actually I think that [A*] will not work well in this scenario, just because of performance-reasons.
BUT I am very very curious - it might work.
It might work ok for a few harvesters, but for more than that... perhaps an interface request could be made for access to a C++ implemented pathing algorithm, actually, more importantly, is the car automatable via lua? I want to say the train is now but...if the car isn't this could only be done via teleportation which probably wouldn't look so great (not to mention you are still limited to just a few harvesters since the script would need to control each one "constantly" and/or make larger teleportation jumps)... OR maybe make the harvesters into player-forced 'units' instead and track their inventory via lua tables (hm, unless units have inventories?)....that might work, but it prevents them from being drivable of course.
Vitduo
Fast Inserter
Fast Inserter
Posts: 182
Joined: Sun Nov 17, 2013 7:28 pm
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.4

Post by Vitduo »

Small translate for this good mod
Attachments
hm_ru.zip
(788 Bytes) Downloaded 153 times
drs9999
Filter Inserter
Filter Inserter
Posts: 831
Joined: Wed Mar 06, 2013 11:16 pm
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.4

Post by drs9999 »

FreeER wrote:is the car automatable via lua?
No it is not, so yeah teleportation seems the only way here, which leads to the points you mentioned according to it.
FreeER wrote:OR maybe make the harvesters into player-forced 'units' instead and track their inventory via lua tables (hm, unless units have inventories?)....that might work
This sounds good. There might is also the possibility to recycle some code from the cobra commander mod to control the units.
FreeER wrote:but it prevents them from being drivable of course.
But then again that is the downside. Well for me it would be explanation enough if the harvester would be renamed to "automatic harvester" :D
Anyway there might exist also a workaround for it. Using the onputevent in connection with game.player.selected could destroy the unit, replace it with the real car entity and convert the virtual inventory into a real trunk.

All in all sounds like a lot of work :D
McSpiffy
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Mon May 05, 2014 9:17 pm
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.4

Post by McSpiffy »

Yea I was going to look in to automating the Harvester after I have gotten the Refinery and Service Station done. More so after the Refinery was finished so all the ore could be dumped from the Harvester into it in one quick action.
McSpiffy
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Mon May 05, 2014 9:17 pm
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.5

Post by McSpiffy »

Just updated! :D
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.5

Post by Airat9000 »

please comfortable in bob ore mod (the 6 new resourses) tnanks!
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.5

Post by Airat9000 »

Airat9000 wrote:please comfortable in bob ore mod (the 6 new resourses) tnanks!
bug
stone - long harvest (2 number in sec)
other resoursers fast (25 - 50 number in 1 sec)
(bob mode)
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.5

Post by FreeER »

Airat9000 wrote:please comfortable in bob ore mod (the 6 new resourses) tnanks!
I'm not certain what you're asking here unless it's to make this mod compatible (ie work with) the bob's ore mod, which it already is as long as all of bob's ores are standard 'resources' (and not liquids).
Airat9000 wrote:bug
stone - long harvest (2 number in sec)
other resoursers fast (25 - 50 number in 1 sec)
(bob mode)
I'll assume you're talking about bob's ore mod again (since you made a similar post there, but you said 'mode' not 'mod' so I could be wrong). This might actually be considered a bug, the harvester actually mines from multiple spots at the 'same' time which allows it to pull in more resources faster, stone however tends to spawn in smaller deposits...If you find a larger stone deposit the harvester mines it at the same exact speed as any other resource. Where as the stone being naturally slower to mine in bob's ore mod isn't a bug per se (since it's in vanilla and has been for a long time) unless the bug is that everything else is too fast and should be mined as a rate more similar to stone...not sure if that's what you want or rather you were making a feature request to speed up stone as well...
Airat9000
Smart Inserter
Smart Inserter
Posts: 1418
Joined: Fri Mar 28, 2014 12:32 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.5

Post by Airat9000 »

quotes
yes yes I was producing 2-3 cells extracted for 2 pieces per second,
but iron and copper large cells .. understood ..
therefore depends on the number of cells mean?
User avatar
FreeER
Smart Inserter
Smart Inserter
Posts: 1266
Joined: Mon Feb 18, 2013 4:26 am
Contact:

Re: [MOD] 0.9.X]Red Alert Harvester V0.0.5

Post by FreeER »

Airat9000 wrote:therefore depends on the number of cells mean?
exactly. There could/should probably be some extra code that boosts the amount extracted if there are a small number of cells though, which is why I mentioned that it could actually be considered more of a bug here than bob's ore mod.

@McSpiffy that code would be an if statement around the local oreAmount = 2 (line 26 in v0.0.5) that checks if #ore > 4 then local oreAmount = 2 else local oreAmount = 8 end ( 4 and 8 are arbitrary numbers that you can tweak). Which as stated above, would extract more ore from each 'cell' (found resource entity) at a time if there are 4 or fewer found.
Post Reply

Return to “Mods”