Cities Of Earth deprecated

by hyspeed

This mod presents a list of Cities to spawn on Earth. Each city may be a team (non-hostile). Resources are generated at each spawn. Players may also teleport to other players.

Content
3 years ago
0.16 - 1.1
163
Transportation

b Bug with Omni [title updated]

6 years ago
(updated 6 years ago)

how do i determine what my current coordinates are while playing? (for setting custom cities)
edit: nevermind, i found it at the bottom of your description page. (sorry).

6 years ago

Hi,

Your question, however, gave me the idea to optionally print a player's coordinates when they teleport. I may look into that.

thanks

6 years ago

oh good. that shouldn't be too difficult: just have to figure out what the correct event_trigger is. maybe event.on_player_teleport? lol. too easy?":

6 years ago

i had another idea on how to handle different scalings without having to have players manually modify city coordinates:

first, declare local variables for each set of coordinates read from mod-settings.
check if scale !=6 (factorio world default)
if not, apply arithmetic on local variable based on scale factor set in factorio world. this should make it so the coordinates apply to the base-scale of the map, but any changes to the scaling within factorio world get applied to the city coordinates.
just got to make sure the right maths is done :)

6 years ago

Yes, easy. I already have an event for "[player] teleported to [player]" and know the coordinates.
The difficult part is setting the option on or off. I'm thinking I'll add it to the player options, rather than the map options. But I haven't done that yet, so I'll learn that.

6 years ago

it may be possible to add a gui element (checkbox) to the interface you already have and use that, if it's checked, when the player teleports to a new city, if the option is checked, it'll print, otherwise not. ?I haven't done much gui programming with lua, but i imagine that'd work

6 years ago

noticed an actual bug earlier today when trying to teleport. think it's related to omnimatter removing oil patches. verified omnimatter compatability issue by removing all mods except: omniLib, omniMatter, factorio World, cities of earth, and RSO. attempting to teleport to a city causes crash:

"Error while running event CitiesOfEarth::on_gui_click(ID 1) Unknown entity name: crude-oil
stack traceback:
CitiesOfEarth/scripts/oarc_utils_coe.lua:26: in function 'GenerateStartingResrouces'
.....control.lua:60: in function chart_and_generate
control.lua:37:in function 'select city'
coe_gui.lua:12: in function 'on_gui_click'
control.lua:18: in function </CitiesOfEarth/control.lua:18>

error redacted slightly with reduced info to show just the lines to functions relevant to crash. 99% certain this is due to omnimatter removing oil patches. and cities of earth not handling that unexpected-removal properly

can try and use: if autoplace.controls != nil, then attempt_generation
otherwise: skip

6 years ago

haven't tested it to see how it handles with angels' mods yet, but i would imagine, if there's a similar issue that it could be resolved in the same way.

6 years ago

Hi, I see the bug, but haven't figured out a way to prevent it yet. I'll work on it more this weekend.

6 years ago

and i don't know how to access data.raw or check if a mod is enabled or if oil exists within control.lua so unfortunately, i have no idea, either..as far as i know: control.lua can't access globals

6 years ago

I got a great reply in for forums. I will be adding this check to the mod for oil and other resources:
if game.entity_prototypes["crude-oil"] then

New response