[MOD 0.13.0] Satellite Radar

Topics and discussion about specific mods
seronis
Fast Inserter
Fast Inserter
Posts: 225
Joined: Fri Mar 04, 2016 8:04 pm
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by seronis »

Good changes. This is definitely my defacto radar mod now. Any chance you also mod Space Engineers ? I dont even have that game yet but considering getting it soon and for me it scratches the same type of playing 'itch'.

catalyst518
Inserter
Inserter
Posts: 36
Joined: Thu Apr 14, 2016 2:01 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by catalyst518 »

Update Released: Version 0.2.1

Download: SatelliteRadar_0.2.1.zip

Changes:

wild_dog
Inserter
Inserter
Posts: 21
Joined: Tue Apr 19, 2016 8:07 pm
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by wild_dog »

Hey man, love your idea, but I ran into a problem.

You coded the mod using game.player.gui.left.rocket_score to find the amount of satellites (if any) that have been launched.
However, if the map you are playing on has ever been played in multiplayer, this will not work, since game.player can't be used anymore (after all, there is no longer a THE player, there are/have been multiple)

I fixed this for me by replacing game.player with game.players[1].
This appears to be working consistently, even if you create a new map with only you in single player mode.

Since it appears that all players in the map have the same score, you don't need to index over all players to get the proper score (at this time).

Just thought I'd let you know so you could apply it in a future update for multiplayer compatibility.

Vas
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Tue Apr 12, 2016 11:02 pm
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Vas »

Another single player only mod? That sucks, I had to delete this from my server. :/
https://www.dropbox.com/s/hpcleidhodwo7 ... .35.27.png
Error while running the event handler: _ _ SatelliteRadar _ _/control.lua:6: Map doesn't contain 1 player, this function can't be used

EDIT: Wild dog's fix did not work, placing a new radar crashes the game with the same error.
You can get my mods by clicking here, and use discussions there or PMs here to suggest or report issues.
Want some blueprints made by me? Click here then!

wild_dog
Inserter
Inserter
Posts: 21
Joined: Tue Apr 19, 2016 8:07 pm
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by wild_dog »

Vas wrote:Another single player only mod? That sucks, I had to delete this from my server. :/
https://www.dropbox.com/s/hpcleidhodwo7 ... .35.27.png
Error while running the event handler: _ _ SatelliteRadar _ _/control.lua:6: Map doesn't contain 1 player, this function can't be used

EDIT: Wild dog's fix did not work, placing a new radar crashes the game with the same error.
Really? and the error was control.lua:6: even after you did what i did?

i have had to replace it in 6 instances on my side, in line 5, 7, 8, 15, 17, and 18, but that may not have been his latest version.
Lemme check and get back to you.

EDIT: on his latest release (0.2.1) i've had to eddit it at 3 lines, line 6, 8 and 9.

it became this:

Code: Select all

function CalculateLevel(a)
  satellites=0
  if game.players[1].gui.left.rocket_score==nil then
    satellites=0
  elseif tonumber(game.players[1].gui.left.rocket_score.rocket_count.caption)>=0 then
    satellites=tonumber(game.players[1].gui.left.rocket_score.rocket_count.caption)
  end
  satellites=satellites+a
  level=LevelEquation(satellites)
  if level<=0 then
    return 0
  elseif level>=maxlevel then
    return maxlevel
  else
    return level
  end
end
i tried to replace a radar and it seemed to work fine, though i have to admit that i only have 4 sats in orbit and no active other players so it might not be the best test.
could you link mod file that you fixed so i could take a look?

the only pitfall that i can think of right now is that you eddited it to player[1] when it should be playerS[1], but to say more i would need your mod file and latest crash report.

Vas
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Tue Apr 12, 2016 11:02 pm
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Vas »

I've updated this mod for multiplayer compatibility, and added this thread to the "homepage" in the info and updated the version number as well.

EDIT: Wild Dog, you were right, I did miss the S. :P I release this unofficial update so that no one makes the mistake again. xP
Attachments
SatelliteRadar_0.2.2.zip
Updated to multiplayer compatibility, added "homepage" to info.
(9.93 KiB) Downloaded 177 times
You can get my mods by clicking here, and use discussions there or PMs here to suggest or report issues.
Want some blueprints made by me? Click here then!

catalyst518
Inserter
Inserter
Posts: 36
Joined: Thu Apr 14, 2016 2:01 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by catalyst518 »

wild_dog wrote:
Just thought I'd let you know so you could apply it in a future update for multiplayer compatibility.
Vas wrote:I've updated this mod for multiplayer compatibility, and added this thread to the "homepage" in the info and updated the version number as well.
Thanks to you both for pointing this out. I've never played a multiplayer map and don't really intend to, so this could have been overlooked for a while. I've released an official patch with the changes you both figured out correctly.

catalyst518
Inserter
Inserter
Posts: 36
Joined: Thu Apr 14, 2016 2:01 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by catalyst518 »

Update Released: Version 0.2.2

Download: SatelliteRadar_0.2.2.zip

Changes:
  • Added multiplayer support. Thanks to Vas and wild_dog.
  • Added compatibility with Train tracker 1.0.0.
  • Updated info.json with link to this thread.

Qon
Smart Inserter
Smart Inserter
Posts: 2118
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Qon »

Bugs:
  • Makes all items made from radars into satellite radars. I see you have updated it for train tracker compatability, but this isn't the only mod that your mod destroys. Instead of making your mod compatible with each mod it destroys one by one as it is reported, try to make it compatible with all mods ever made or will be made in the future by at least checking if the item you are replacing is a regular radar or satellite radar. Whitelist instead of blacklist, please. It destroyed Train Tracker, STRS radars, Factorio Basics/Extended, Item Collector and every other radar mod or mod that makes things by modifying radars...
  • "Factorio Extended 0.1.3 - Upon reaching level 1 in Satellite Radar, all special radars (Mk2 and surveillance radars) will be replaced with the appropriate level of satellite radar."
    It was replaced with the same level as every other radar. This is not working. I'm not convinced even max level satellite radar is superior to the surveillance radar but I don't have the numbers.
  • Uninstalling will probably remove all radars since you chose to make each upgrade a separate item. Not sure if this can be fixed with the current API but it would be nice if it didn't destroy all my radars twice... Also it's messy. Isn't it possible to modify the radars instead of making new ones?
I haven't tested balance yet but from the numbers it sounds like these are a very expensive way to get very underwhelming results. All other radar mods I've tried are more powerful than this without sending a single rocket.

Also you say "tiles" in your description when I think you mean "chunks".

Qon
Smart Inserter
Smart Inserter
Posts: 2118
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Qon »

Qon wrote:Bugs:
  • Makes all items made from radars into satellite radars. I see you have updated it for train tracker compatability, but this isn't the only mod that your mod destroys. Instead of making your mod compatible with each mod it destroys one by one as it is reported, try to make it compatible with all mods ever made or will be made in the future by at least checking if the item you are replacing is a regular radar or satellite radar. Whitelist instead of blacklist, please. It destroyed Train Tracker, STRS radars, Factorio Basics/Extended, Item Collector and every other radar mod or mod that makes things by modifying radars...
Well this is easily fixed. My version is basically compatible with all mods ever made or ever will be made unless they do something that is inherently incompatible (also replaces vanilla radars instead of making a new entity type with separate recipe). So it works with all the things I listed above and the Ion cannon targeter too. And fusion power "safety zone" would probably also have been destroyed in the old version.

You name the radars things like "radar2" which could potentially collide with someone elses mod though. Qonsider naming it "satellite-radar-2" or similar instead in case someone makes a Mk2 radar and calls it "radar2" because think like you q:

Edit: please read http://freedomdefined.org/Licenses/NC
NC is not gaining you anything. No one will sell your mod. You are only potentially interfering with people who make youtube videos of your mod and other similar grayzones where someone might make an indirect profit. And with SA the NC spreads :/

If you decide to remove NC then I give v0.2.3 the CC BY-SA 4.0 license as well with this statement.

Edit: Bugfix. Use 0.2.4 instead of 0.2.3.
Edit: Bugfix. Use 0.2.5 instead of 0.2.4.
Attachments
SatelliteRadar_0.2.5.zip
Fixed an incomplete variable rename at control.lua:80
(9.58 KiB) Downloaded 184 times
SatelliteRadar_0.2.4.zip
Fixed a bug in 0.2.3 where more than normal radars were whitelisted.
(9.58 KiB) Downloaded 174 times

Shrooblord
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Thu May 12, 2016 12:57 pm
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Shrooblord »

Qon wrote:Qonsider
Lol

Thanks for your updates to another's mod, Qon! :D

Qon
Smart Inserter
Smart Inserter
Posts: 2118
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Qon »

Shrooblord wrote:
Qon wrote:Qonsider
Lol

Thanks for your updates to another's mod, Qon! :D
Glad you like it!

I was seriously qonsidering not sharing my bugfixes with the community though because of the NC license. Maybe I won't do it another time. This time the changes was fairly small, but I want to avoid releasing things under NC if possible. Mods should be free. Mods restricting your freedom instead of increasing it is just backwards.

And I do like Q, but find it lacking in most words so I have to squeze it in whenever I can q:

TrojanEnder
Burner Inserter
Burner Inserter
Posts: 16
Joined: Fri May 06, 2016 8:41 pm
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by TrojanEnder »

Found a mod I'd like compatibility with. Orbital Ion Cannon has a recent feature with auto-targeting. It uses a radar type device kind of like the launch mod. As soon as I place it it get's replaced by your radar. Would love it if you could make this an exception. Thanks!

Qon
Smart Inserter
Smart Inserter
Posts: 2118
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Qon »

TrojanEnder wrote:Found a mod I'd like compatibility with. Orbital Ion Cannon has a recent feature with auto-targeting. It uses a radar type device kind of like the launch mod. As soon as I place it it get's replaced by your radar. Would love it if you could make this an exception. Thanks!
I have made unofficial updates to both mods. Read last post on page 2 in this thread for the sat radar update.
Satellite radar: compatability with ALL mods (past, present, future)

TrojanEnder
Burner Inserter
Burner Inserter
Posts: 16
Joined: Fri May 06, 2016 8:41 pm
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by TrojanEnder »

Qon wrote:
TrojanEnder wrote:Found a mod I'd like compatibility with. Orbital Ion Cannon has a recent feature with auto-targeting. It uses a radar type device kind of like the launch mod. As soon as I place it it get's replaced by your radar. Would love it if you could make this an exception. Thanks!
I have made unofficial updates to both mods. Read last post on page 2 in this thread for the sat radar update.
Satellite radar: compatability with ALL mods (past, present, future)
Skimmed everything looking for the solution. Should have seen this. Thanks! Wish there was an appropriate way to make this version even more visible.

User avatar
Wakaba-chan
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Mon May 30, 2016 6:39 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Wakaba-chan »

Hello,
Thank you for cool mod!
But tried it with Ion Cannon mod and your mod replaced all auto-tracking radars from that mod :c I wish I could have both of them in game. I corrected your control.lua like this

Code: Select all

function BuiltEntity(event)
  if event.created_entity.[b]name=="radar" [/b]and event.created_entity.name~="launch-control-center" and event.created_entity.name~="train-tracker" then  
    local e = event.created_entity
    local s = e.surface
    local p = e.position
    local f = e.force
    local d = e.direction
    level=CalculateLevel(0)
    if level>0 then
      e.destroy()
      s.create_entity{name = "radar"..level, position = p, force = f, direction = d}
    end
  end
end

script.on_event(defines.events.on_entity_died, function(event)
  local e = event.entity
  local X = e.position.x
  local Y = e.position.y
  local s = e.surface
  if [b]e.name=="radar" [/b]and e.name~="launch-control-center" and e.name~="train-tracker" then
    local ghost = s.find_entities_filtered({area={{X-0.5,Y-0.5},{X+0.5,Y+0.5}}, type = "entity-ghost"})
    if ghost[1]~= nil then
      ghost[1].destroy()
    end
    s.create_entity{name = "entity-ghost", position = {X,Y}, inner_name = "radar", force = e.force}
  end
end)
I.e. I changed "e.type = "radar" to "e.name = "radar" so that only vanilla radar would be replaced.
Is this correct? Or there are some more deep changes need to be done?

Qon
Smart Inserter
Smart Inserter
Posts: 2118
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Qon »

Wakaba-chan wrote:Hello,
Thank you for cool mod!
But tried it with Ion Cannon mod and your mod replaced all auto-tracking radars from that mod :c I wish I could have both of them in game. I corrected your control.lua like this

Code: Select all

function BuiltEntity(event)
  if event.created_entity.[b]name=="radar" [/b]and event.created_entity.name~="launch-control-center" and event.created_entity.name~="train-tracker" then  
    local e = event.created_entity
    local s = e.surface
    local p = e.position
    local f = e.force
    local d = e.direction
    level=CalculateLevel(0)
    if level>0 then
      e.destroy()
      s.create_entity{name = "radar"..level, position = p, force = f, direction = d}
    end
  end
end

script.on_event(defines.events.on_entity_died, function(event)
  local e = event.entity
  local X = e.position.x
  local Y = e.position.y
  local s = e.surface
  if [b]e.name=="radar" [/b]and e.name~="launch-control-center" and e.name~="train-tracker" then
    local ghost = s.find_entities_filtered({area={{X-0.5,Y-0.5},{X+0.5,Y+0.5}}, type = "entity-ghost"})
    if ghost[1]~= nil then
      ghost[1].destroy()
    end
    s.create_entity{name = "entity-ghost", position = {X,Y}, inner_name = "radar", force = e.force}
  end
end)
I.e. I changed "e.type = "radar" to "e.name = "radar" so that only vanilla radar would be replaced.
Is this correct? Or there are some more deep changes need to be done?
I also updated this mod. Read the posts just above yours. No, you can't use BB code within a code tag. Code tags are there so that

Code: Select all

[b][/b]
doesn't get converted to bold. It's their purpose.

And no, that won't work. There are other places that needs fixes and you can't check for name = "radar" on some of them, like you do on on_entity_died, because the mod replaces all "radar" with satellite radars when built. So no vanilla radar entities will ever be placed down. It also has a script for replacing all satellite radars when you send up satellites that you did not update. Your changes will not be sufficient. Your radars will not be upgraded automatically by launching satellites. If your radars get destroyed they will not have a radar ghost placed, so your qonstruction bots will not rebuild it.

Use my unofficial update version or diff my changes. Good luck :)

User avatar
Wakaba-chan
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Mon May 30, 2016 6:39 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Wakaba-chan »

Qon wrote:And no, that won't work. There are other places that needs fixes and you can't check for name = "radar" on some of them, like you do on on_entity_died, because the mod replaces all "radar" with satellite radars when built. So no vanilla radar entities will ever be placed down. It also has a script for replacing all satellite radars when you send up satellites that you did not update. Your changes will not be sufficient. Your radars will not be upgraded automatically by launching satellites. If your radars get destroyed they will not have a radar ghost placed, so your qonstruction bots will not rebuild it.

Use my unofficial update version or diff my changes. Good luck :)
Uh, sorry, my english is not very good, so I didn't understand the main point: is it possible that your mod will work with Ion Cannon mod or not? Thank you in advance for explanations.

-------
UPD: I mean, how to make them work together in correct way

Qon
Smart Inserter
Smart Inserter
Posts: 2118
Joined: Thu Mar 17, 2016 6:27 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Qon »

Wakaba-chan wrote:
Qon wrote:And no, that won't work. There are other places that needs fixes and you can't check for name = "radar" on some of them, like you do on on_entity_died, because the mod replaces all "radar" with satellite radars when built. So no vanilla radar entities will ever be placed down. It also has a script for replacing all satellite radars when you send up satellites that you did not update. Your changes will not be sufficient. Your radars will not be upgraded automatically by launching satellites. If your radars get destroyed they will not have a radar ghost placed, so your qonstruction bots will not rebuild it.

Use my unofficial update version or diff my changes. Good luck :)
Uh, sorry, my english is not very good, so I didn't understand the main point: is it possible that your mod will work with Ion Cannon mod or not? Thank you in advance for explanations.

-------
UPD: I mean, how to make them work together in correct way
Yes, my mod update should work with all radar mods! I have tested it with Orbital Ion Cannon and it works. :)

User avatar
Wakaba-chan
Long Handed Inserter
Long Handed Inserter
Posts: 96
Joined: Mon May 30, 2016 6:39 am
Contact:

Re: [MOD 0.12.x] Satellite Radar

Post by Wakaba-chan »

Qon wrote:
Wakaba-chan wrote:
Qon wrote:And no, that won't work. There are other places that needs fixes and you can't check for name = "radar" on some of them, like you do on on_entity_died, because the mod replaces all "radar" with satellite radars when built. So no vanilla radar entities will ever be placed down. It also has a script for replacing all satellite radars when you send up satellites that you did not update. Your changes will not be sufficient. Your radars will not be upgraded automatically by launching satellites. If your radars get destroyed they will not have a radar ghost placed, so your qonstruction bots will not rebuild it.

Use my unofficial update version or diff my changes. Good luck :)
Uh, sorry, my english is not very good, so I didn't understand the main point: is it possible that your mod will work with Ion Cannon mod or not? Thank you in advance for explanations.

-------
UPD: I mean, how to make them work together in correct way
Yes, my mod update should work with all radar mods! I have tested it with Orbital Ion Cannon and it works. :)
"Your update" - you mean 0.2.2 version, or something you mentioned above? (sorry, I didn't read all the thread :c)

Post Reply

Return to “Mods”