Page 2 of 4

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

Posted: Wed May 14, 2014 4:28 am
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.

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

Posted: Sat May 17, 2014 9:09 pm
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.

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

Posted: Sat May 17, 2014 10:24 pm
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).

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

Posted: Sun May 18, 2014 3:55 am
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.

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

Posted: Sun May 18, 2014 4:01 am
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 119 times

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

Posted: Sun May 18, 2014 4:20 am
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.

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

Posted: Sun May 18, 2014 5:59 am
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...

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

Posted: Sun May 18, 2014 6:08 am
by Airat9000
mod work?

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

Posted: Sun May 18, 2014 6:38 am
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.

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

Posted: Sun May 18, 2014 7:00 am
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.

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

Posted: Sun May 18, 2014 6:21 pm
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.

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

Posted: Sun May 18, 2014 7:18 pm
by Vitduo
Small translate for this good mod

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

Posted: Sun May 18, 2014 7:32 pm
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

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

Posted: Mon May 19, 2014 2:00 pm
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.

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

Posted: Sun May 25, 2014 11:40 pm
by McSpiffy
Just updated! :D

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

Posted: Mon May 26, 2014 10:15 am
by Airat9000
please comfortable in bob ore mod (the 6 new resourses) tnanks!

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

Posted: Tue May 27, 2014 5:22 pm
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)

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

Posted: Tue May 27, 2014 5:38 pm
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...

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

Posted: Tue May 27, 2014 5:45 pm
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?

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

Posted: Tue May 27, 2014 5:55 pm
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.