Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiplacon authored Sep 2, 2022
1 parent 507989c commit 7d8b157
Show file tree
Hide file tree
Showing 22 changed files with 1,252 additions and 382 deletions.
8 changes: 8 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
---------------------------------------------------------------------------------------------------
Version: 1.1.0
Date: 9/1/2022
Additions:
- Programmable Zipline Controller and Zipline Terminal. These can be used to automatically move you around the powerline highway
- Pressing Interact (default F) on Bounce Pads and Directed Bounce Pads will now toggle their bounce ranges between 5, 10, and 15 tiles
Changes:
- Changed how ziplining, jumping, and such are tracked internally so that they hopefully don't interfere with each other as much and cause crashes.
---------------------------------------------------------------------------------------------------
Version: 1.0.6
Date: 8/18/2022
Bugfixes:
Expand Down
13 changes: 10 additions & 3 deletions control.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if script.active_mods["gvv"] then require("__gvv__.gvv")() end

-- Setup tables and stuff for new/existing saves ----
script.on_init(
require("script.event.init")
Expand Down Expand Up @@ -43,7 +44,7 @@ script.on_event(
script.on_event(defines.events.on_player_cursor_stack_changed, -- only has .player_index
function(event)
if (global.AllPlayers[event.player_index].RangeAdjusting == true) then
global.AllPlayers[event.player_index].RangeAdjusting = nil
global.AllPlayers[event.player_index].RangeAdjusting = false
end
end)

Expand Down Expand Up @@ -374,7 +375,8 @@ script.on_event(defines.events.on_player_changed_surface,
-- .surface_index :: uint: The surface index the player was on
function(event)
local player = game.players[event.player_index]
if (global.AllPlayers[event.player_index] and global.AllPlayers[event.player_index].sliding and global.AllPlayers[event.player_index].sliding == true and player.surface.name ~= global.AllPlayers[event.player_index].StartingSurface.name) then
local PlayerProperties = global.AllPlayers[event.player_index]
if (PlayerProperties and PlayerProperties.state == "zipline" and player.surface.name ~= PlayerProperties.zipline.StartingSurface.name) then
player.teleport(player.position, game.get_surface(event.surface_index))
end
end)
Expand Down Expand Up @@ -417,5 +419,10 @@ function(event)
end
end)

-- a bunch of functions used in various other places
-- a bunch of functions used in various other places
require("script.MiscFunctions")
require("script.GUIs")

script.on_event(defines.events.on_gui_click,
require("script.event.ClickGUI")
)
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.0.6",
"version": "1.1.0",
"title": "Renai Transportation",
"author": "Kiplacon",
"factorio_version": "1.1",
Expand Down
41 changes: 30 additions & 11 deletions locale/en/config.cfg

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions migrations/RT-1.1.0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
for each, FlyingItem in pairs(global.FlyingItems) do
if (FlyingItem.player) then
SwapBackFromGhost(FlyingItem.player, FlyingItem)
if (FlyingItem.sprite) then
rendering.destroy(FlyingItem.sprite)
rendering.destroy(FlyingItem.shadow)
end
global.FlyingItems[each] = nil
end
end

for ThePlayer, TheirProperties in pairs(global.AllPlayers) do
local player = game.players[ThePlayer]
if (player.character and string.find(player.character.name, "RTGhost")) then
SwapBackFromGhost(player)
end
player.character_running_speed_modifier = 0
player.teleport(player.surface.find_non_colliding_position("character", {player.position.x, player.position.y+2}, 0, 0.01))
global.AllPlayers[ThePlayer] = {state="default", PlayerLauncher={}, zipline={}, RangeAdjusting=false, SettingRampRange={SettingRange=false}, GUI={}}
end

for each, world in pairs(game.surfaces) do
for every, ZiplinePart in pairs(world.find_entities_filtered{name = {"RTZipline", "RTZiplinePowerDrain"}}) do
ZiplinePart.destroy()
end
end
96 changes: 96 additions & 0 deletions prototypes/BouncePlates/BouncePlate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,99 @@ for color, tint in pairs(colors) do
}
})
end


data:extend({

{ --------- Bounce plate entity 5 --------------
type = "simple-entity-with-owner",
name = "BouncePlate5",
icon = "__RenaiTransportation__/graphics/BouncePlates/BouncePlate/PlateIconn.png",
icon_size = 64,
flags = {"placeable-neutral", "player-creation"},
minable = {mining_time = 0.2, result = "BouncePlateItem"},
placeable_by = {item="BouncePlateItem", count=1},
max_health = 200,
collision_box = {{-0.25, -0.25}, {0.25, 0.25}}, --{{-0.35, -0.35}, {0.35, 0.35}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
fast_replaceable_group = "bouncers",
picture =
{
layers =
{
{
filename = "__RenaiTransportation__/graphics/BouncePlates/BouncePlate/shadow.png",
priority = "medium",
width = 66,
height = 76,
shift = util.by_pixel(8, -0.5),
scale = 0.5
},
{
filename = "__RenaiTransportation__/graphics/BouncePlates/BouncePlate/Plate.png",
priority = "medium",
width = 66,
height = 76,
shift = util.by_pixel(-0.5, -0.5),
scale = 0.5
}
}
},
radius_visualisation_specification =
{
sprite =
{
filename = "__RenaiTransportation__/graphics/testalt.png",
size = 640
},
draw_on_selection = true,
distance = 5
}
},
{ --------- Bounce plate entity 15 --------------
type = "simple-entity-with-owner",
name = "BouncePlate15",
icon = "__RenaiTransportation__/graphics/BouncePlates/BouncePlate/PlateIconn.png",
icon_size = 64,
flags = {"placeable-neutral", "player-creation"},
minable = {mining_time = 0.2, result = "BouncePlateItem"},
placeable_by = {item="BouncePlateItem", count=1},
max_health = 200,
collision_box = {{-0.25, -0.25}, {0.25, 0.25}}, --{{-0.35, -0.35}, {0.35, 0.35}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
fast_replaceable_group = "bouncers",
picture =
{
layers =
{
{
filename = "__RenaiTransportation__/graphics/BouncePlates/BouncePlate/shadow.png",
priority = "medium",
width = 66,
height = 76,
shift = util.by_pixel(8, -0.5),
scale = 0.5
},
{
filename = "__RenaiTransportation__/graphics/BouncePlates/BouncePlate/Plate.png",
priority = "medium",
width = 66,
height = 76,
shift = util.by_pixel(-0.5, -0.5),
scale = 0.5
}
}
},
radius_visualisation_specification =
{
sprite =
{
filename = "__RenaiTransportation__/graphics/testalt.png",
size = 640
},
draw_on_selection = true,
distance = 15
}
},

})
115 changes: 92 additions & 23 deletions prototypes/BouncePlates/DirectedBouncePlate.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,6 @@ data:extend({
}
}
},
activity_led_sprites =
{
filename = "__RenaiTransportation__/graphics/nothing.png",
priority = "medium",
width = 32,
height = 32,
shift = util.by_pixel(-0.5, -0.5),
scale = 0.5
},
activity_led_light_offsets =
{
{0.296875, -0.40625},
{0.25, -0.03125},
{-0.296875, -0.078125},
{-0.21875, -0.46875}
},
circuit_wire_connection_points =
{
ConnectionPoints,
ConnectionPoints,
ConnectionPoints,
ConnectionPoints
},
radius_visualisation_specification =
{
sprite =
Expand All @@ -96,6 +73,98 @@ data:extend({
distance = 10
}
},
{ --------- Bounce plate entity --------------
type = "simple-entity-with-owner",
name = "DirectedBouncePlate5",
icon = "__RenaiTransportation__/graphics/BouncePlates/DirectedBouncePlate/DirectedPlateIconn.png",
icon_size = 64,
flags = {"placeable-neutral", "player-creation"},
minable = {mining_time = 0.2, result = "DirectedBouncePlateItem"},
placeable_by = {item="DirectedBouncePlateItem", count=1},
max_health = 200,
collision_box = {{-0.25, -0.25}, {0.25, 0.25}}, --{{-0.35, -0.35}, {0.35, 0.35}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
fast_replaceable_group = "bouncers",
--item_slot_count = 18,
--circuit_wire_max_distance = 9,
picture =
{
sheets =
{
{
filename = "__RenaiTransportation__/graphics/BouncePlates/DirectedBouncePlate/DirectedPlateShadow.png",
priority = "medium",
width = 64,
height = 64,
shift = util.by_pixel(14,-0.5),
scale = 0.5
},
{
filename = "__RenaiTransportation__/graphics/BouncePlates/DirectedBouncePlate/DirectedPlate.png",
priority = "medium",
width = 64,
height = 64,
scale = 0.5
}
}
},
radius_visualisation_specification =
{
sprite =
{
filename = "__RenaiTransportation__/graphics/testalt.png",
size = 640
},
draw_on_selection = true,
distance = 5
}
},
{ --------- Bounce plate entity --------------
type = "simple-entity-with-owner",
name = "DirectedBouncePlate15",
icon = "__RenaiTransportation__/graphics/BouncePlates/DirectedBouncePlate/DirectedPlateIconn.png",
icon_size = 64,
flags = {"placeable-neutral", "player-creation"},
minable = {mining_time = 0.2, result = "DirectedBouncePlateItem"},
placeable_by = {item="DirectedBouncePlateItem", count=1},
max_health = 200,
collision_box = {{-0.25, -0.25}, {0.25, 0.25}}, --{{-0.35, -0.35}, {0.35, 0.35}},
selection_box = {{-0.5, -0.5}, {0.5, 0.5}},
fast_replaceable_group = "bouncers",
--item_slot_count = 18,
--circuit_wire_max_distance = 9,
picture =
{
sheets =
{
{
filename = "__RenaiTransportation__/graphics/BouncePlates/DirectedBouncePlate/DirectedPlateShadow.png",
priority = "medium",
width = 64,
height = 64,
shift = util.by_pixel(14,-0.5),
scale = 0.5
},
{
filename = "__RenaiTransportation__/graphics/BouncePlates/DirectedBouncePlate/DirectedPlate.png",
priority = "medium",
width = 64,
height = 64,
scale = 0.5
}
}
},
radius_visualisation_specification =
{
sprite =
{
filename = "__RenaiTransportation__/graphics/testalt.png",
size = 640
},
draw_on_selection = true,
distance = 15
}
},

{ --------- The Bounce plate item -------------
type = "item",
Expand Down
32 changes: 31 additions & 1 deletion prototypes/technology.lua
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ if (settings.startup["RTZiplineSetting"].value == true) then
time = 30
}
},

{
type = "technology",
name = "RTZiplineControlTech1",
Expand All @@ -416,7 +417,36 @@ if (settings.startup["RTZiplineSetting"].value == true) then
},
time = 30
}
}
},

{
type = "technology",
name = "RTProgrammableZiplineControlTech",
icon = "__RenaiTransportation__/graphics/zipline/terminaltech.png",
icon_size = 128,
effects =
{
{
type = "unlock-recipe",
recipe = "RTProgrammableZiplineControlsRecipe"
},
{
type = "unlock-recipe",
recipe = "RTZiplineTerminalRecipe"
}
},
prerequisites = {"RTZiplineTech", "electric-energy-distribution-1"},
unit =
{
count = 150,
ingredients =
{
{"automation-science-pack", 1},
{"logistic-science-pack", 1}
},
time = 30
}
}
})
end

Expand Down
Loading

0 comments on commit 7d8b157

Please sign in to comment.