Skip to content

Commit

Permalink
1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiplacon committed Jul 4, 2024
1 parent 17c28e7 commit 952dc35
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 23 deletions.
5 changes: 3 additions & 2 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 12 additions & 11 deletions control.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data-final-fixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "RenaiTransportation",
"version": "1.2.12",
"version": "1.3.0",
"title": "Renai Transportation",
"author": "Kiplacon",
"factorio_version": "1.1",
Expand Down
File renamed without changes.
24 changes: 17 additions & 7 deletions script/event/interact.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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",
Expand Down Expand Up @@ -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()
Expand All @@ -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 =
Expand All @@ -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
Expand Down

0 comments on commit 952dc35

Please sign in to comment.