diff --git a/changelog.txt b/changelog.txt index 16c0696..f298e1d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,10 +1,11 @@ --------------------------------------------------------------------------------------------------- -Version: 1.2.12 +Version: 1.3 Date: 7/3/2024 Additions: - Filter Ejector Hatch. I'm sure you can figure out what it does. Recommended by LoupAndSnoop + - Added a setting to have thrower inserter ranges calculated based on the original inserter's range. Normally thrower range is set by whether the inserter is or isn't the vanilla long inserter. Added by wrothmonk Changes: - - Made the arrows of the thrower inserters line up with the way their vanilla versions are. https://github.com/Kiplacon/RenaiTransportation/issues/48 + - Made the arrows of the thrower inserters line up with the way their base versions are. At last the game is playable. See https://github.com/Kiplacon/RenaiTransportation/issues/48 --------------------------------------------------------------------------------------------------- Version: 1.2.11 Date: 6/15/2024 diff --git a/control.lua b/control.lua index 977b023..85ba793 100644 --- a/control.lua +++ b/control.lua @@ -231,18 +231,19 @@ function(event) distance = math.sqrt((x-catapult.position.x)^2 + (y-catapult.position.y)^2) start=catapult.position speed = 0.25 - -- catapult.surface.play_sound - -- { - -- path = "RTEjector", - -- position = catapult.position, - -- volume = 0.7 - -- } + --[[ catapult.surface.play_sound + { + path = "RTEjector", + position = catapult.position, + volume_modifier = 0.1 + } ]] else - -- catapult.surface.play_sound - -- { - -- path = "RTThrow", - -- position = catapult.position - -- } + catapult.surface.play_sound + { + path = "RTThrow", + position = catapult.position, + volume_modifier = 0.2 + } end local AirTime = math.max(1, math.floor(distance/speed)) -- for super fast throwers that move right on top of their target local destination = nil diff --git a/data-final-fixes.lua b/data-final-fixes.lua index 6b39b53..283d981 100644 --- a/data-final-fixes.lua +++ b/data-final-fixes.lua @@ -422,7 +422,7 @@ TheThrower = table.deepcopy(data.raw.inserter[ThingData.name]) if settings.startup["RTThrowersDynamicRange"].value == true then local original_inserter = data.raw.inserter[ThingData.name] ItsRange = math.floor(math.sqrt(original_inserter.insert_position[1]^2 + original_inserter.insert_position[2]^2)) * 10 + 5 - TheThrower.insert_position = {0, ItsRange - 0.1} + TheThrower.insert_position = {0, ItsRange+0.2} end if (TheThrower.localised_description) then diff --git a/data.lua b/data.lua index 25dcbbc..1fe94a8 100644 --- a/data.lua +++ b/data.lua @@ -58,7 +58,8 @@ data:extend({ { type = "custom-input", name = "RTClick", - key_sequence = "mouse-button-1" + key_sequence = "", + linked_game_control = "open-gui" }, { type = "sprite", diff --git a/info.json b/info.json index a67057c..b7f3050 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "RenaiTransportation", - "version": "1.2.12", + "version": "1.3.0", "title": "Renai Transportation", "author": "Kiplacon", "factorio_version": "1.1", diff --git a/migrations/RT-1.2.12.lua b/migrations/RT-1.3.0.lua similarity index 100% rename from migrations/RT-1.2.12.lua rename to migrations/RT-1.3.0.lua diff --git a/script/event/interact.lua b/script/event/interact.lua index a3a485f..7582829 100644 --- a/script/event/interact.lua +++ b/script/event/interact.lua @@ -84,8 +84,8 @@ local function interact(event1) -- has .name = event ID number, .tick = tick num if (ThingHovering) then --|| Adjusting Thrower Range if (ThingHovering.type == "inserter" and string.find(ThingHovering.name, "RTThrower-") and ThingHovering.name ~= "RTThrower-PrimerThrower" and global.CatapultList[ThingHovering.unit_number].RangeAdjustable == true) then - CurrentRange = math.ceil(math.abs(ThingHovering.drop_position.x-ThingHovering.position.x + ThingHovering.drop_position.y-ThingHovering.position.y)) - if (CurrentRange >= ThingHovering.prototype.inserter_drop_position[2] + 0.1) then + local CurrentRange = math.ceil(math.abs(ThingHovering.drop_position.x-ThingHovering.position.x + ThingHovering.drop_position.y-ThingHovering.position.y)) + if (CurrentRange >= ThingHovering.prototype.inserter_drop_position[2]) then ThingHovering.drop_position = { ThingHovering.drop_position.x+(CurrentRange-2)*global.OrientationUnitComponents[ThingHovering.orientation].x, @@ -98,12 +98,12 @@ local function interact(event1) -- has .name = event ID number, .tick = tick num ThingHovering.drop_position.y - global.OrientationUnitComponents[ThingHovering.orientation].y } end - local NewRange = math.ceil(math.abs(ThingHovering.drop_position.x-ThingHovering.position.x + ThingHovering.drop_position.y-ThingHovering.position.y))-1 + local NewRange = math.ceil(math.abs(ThingHovering.drop_position.x-ThingHovering.position.x + ThingHovering.drop_position.y-ThingHovering.position.y)) ThingHovering.surface.create_entity ({ name = "flying-text", position = ThingHovering.drop_position, - text = "Range: "..NewRange + text = "Range: "..NewRange-1 }) player.play_sound{ path="utility/gui_click", @@ -458,6 +458,11 @@ local function interact(event1) -- has .name = event ID number, .tick = tick num {entity_number = 1, name = thrower, position = {0,0}, direction = 4, drop_position = {0,-1.201} } }) end + player.play_sound{ + path="utility/gui_click", + position=player.position, + volume_modifier=1 + } PlayerProperties.RangeAdjusting = true -- seems to immediately reset to false since the cursor stack changes to the blueprint but idk how to have the check go first and then set the global.RangeAdjusting elseif (player.is_cursor_blueprint() @@ -471,11 +476,11 @@ local function interact(event1) -- has .name = event ID number, .tick = tick num local thrower = player.get_blueprint_entities()[1] local OneD = player.get_blueprint_entities()[1].direction local CurrentRange = math.ceil(math.abs(thrower.drop_position.x-thrower.position.x + thrower.drop_position.y-thrower.position.y)) - if (CurrentRange >= thrower.prototype.inserter_drop_position[2] + 1.1) then + if (CurrentRange >= game.entity_prototypes[thrower.name].inserter_drop_position[2]+1) then WhereWeDroppin = { - thrower.drop_position.x+(CurrentRange-2)*global.OrientationUnitComponents[global.Dir2Ori[thrower.direction]].x, - thrower.drop_position.y+(CurrentRange-2)*global.OrientationUnitComponents[global.Dir2Ori[thrower.direction]].y + thrower.drop_position.x+(CurrentRange-3)*global.OrientationUnitComponents[global.Dir2Ori[thrower.direction]].x, + thrower.drop_position.y+(CurrentRange-3)*global.OrientationUnitComponents[global.Dir2Ori[thrower.direction]].y } else WhereWeDroppin = @@ -489,6 +494,11 @@ local function interact(event1) -- has .name = event ID number, .tick = tick num { {entity_number = 1, name = thrower.name, position = {0,0}, direction = OneD, drop_position = WhereWeDroppin } }) + player.play_sound{ + path="utility/gui_click", + position=player.position, + volume_modifier=1 + } PlayerProperties.RangeAdjusting = true end