project-navigation
Personal tools

Author Topic: [MOD] Easy Radar Rangefinder  (Read 9232 times)

Offline Quizer

  • Squad Leader
  • ****
  • Posts: 130
    • View Profile
[MOD] Easy Radar Rangefinder
« on: January 20, 2013, 07:51:35 pm »
I made this mod to make it easier to see the radar range of a prospective base and optimize radar coverage. This mod lets you build a new base and immediately add either kind of radar (or both), without having to wait days for stuff to build while having to deal with UFOs.


This mod encompasses the following changes:

 - Radar and Advanced Radar base buildings no longer require the command center to work
 - Advanced Radar no longer requires Alien Detection to be researched to be built (it still requires its own tech, however, which is unlocked when you research Alien Detection)

 - Build time for Radar and Advanced Radar base buildings set to zero days
 - Build price for the above base buildings decreased by a factor of 100
 - Build price for a new base decreased by a factor of 100 (for all campaign difficulties)

 - Build time for Radar Tower installation set to zero days (the game only checks build progress at midnight, though)
 - Build price for Radar Tower installation decreased by a factor of 100

 - If you start a new game, you can build Advanced Radar immediately (Advanced Radar tech added to 'already researched at start of game' list - does not affect existing savegames)



Hopefully someone other than me will get some use out of this. Enjoy!



Questions for more experienced coders / scripters:

 - I've tried using the 'mandatory' flag to cause the game to build the radar and its prerequisites automatically when building a new base, but the game crashed on me when I selected 'Campaign' in the main menu when I did this. Can 'mandatory' be true for one building only?

 - I'd like to make Advanced Radar available in the build list of any savegame that is loaded with this mod active, without messing with what is already researched and what is not. At the moment, a new game started with this mod has the tech unlocked, a change which persists even after the game is loaded without the mod.

Offline H-Hour

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 1923
    • View Profile
Re: [MOD] Easy Radar Rangefinder
« Reply #1 on: January 20, 2013, 08:54:30 pm »
Cool Quizer. Thanks for redistribution. I've added it to the Available Mods sticky at the top of this forum.

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
Re: [MOD] Easy Radar Rangefinder
« Reply #2 on: January 20, 2013, 09:05:48 pm »
I made this mod to make it easier to see the radar range of a prospective base and optimize radar coverage. This mod lets you build a new base and immediately add either kind of radar (or both), without having to wait days for stuff to build while having to deal with UFOs.

CheatMOD....

- I've tried using the 'mandatory' flag to cause the game to build the radar and its prerequisites automatically when building a new base, but the game crashed on me when I selected 'Campaign' in the main menu when I did this. Can 'mandatory' be true for one building only?

Checked, it works perfectly. The only way I could make it shut down is adding mandatory flag to advanced radar and missing it from initial base template, but it is a scripting error, should work this way.

You need to add all mandatory buildings to basetemplate-s.

- I'd like to make Advanced Radar available in the build list of any savegame that is loaded with this mod active, without messing with what is already researched and what is not. At the moment, a new game started with this mod has the tech unlocked, a change which persists even after the game is loaded without the mod.

I don't see a good way for this. The whole system depends on research chain.

-geever

Offline Quizer

  • Squad Leader
  • ****
  • Posts: 130
    • View Profile
Re: [MOD] Easy Radar Rangefinder
« Reply #3 on: January 20, 2013, 09:42:13 pm »
CheatMOD....
This is really just intended to make testing base locations more convenient, though of course it's possible to abuse it in all sorts of fun ways. For example, you could load up your regular save and pop bases down everywhere to find out where all the UFOs currently in the air are, if any... (Though for that, it might be more convenient to just set the range of the radar tower to something ridiculous... can the engine handle a radar range greater than half the circumference of the planet, or will that make the game crash?)

Checked, it works perfectly. The only way I could make it shut down is adding mandatory flag to advanced radar and missing it from initial base template, but it is a scripting error, should work this way.
Yeah, that would explain it. I didn't bother to add the advanced radar to the initial layout.

If I'm using different layouts for the various difficulty levels, I need to add it to all of them, right?

I don't see a good way for this. The whole system depends on research chain.
If it is autobuilt with the mandatory flag, does it check requirements, or would that work around it?

Offline homunculus

  • Sergeant
  • *****
  • Posts: 387
    • View Profile
Re: [MOD] Easy Radar Rangefinder
« Reply #4 on: May 31, 2013, 06:10:38 pm »
me considering base placement one of the more interesting challenges in the game, i decided to try out this mod to experiment with some possible base placements more quickly.

tried the same way that i am enabling my own battlescape hud mod, with same version of 2.5-dev (that must be somewhat outdated by now), and it did something, but not what i would have expected.
there was blackness where the globe should have been in the geoscape, and the 'create installation' menu was empty, and the rest i didn't check, because that was probably not intended.

any instructions on how to get it to work correctly?

Offline Quizer

  • Squad Leader
  • ****
  • Posts: 130
    • View Profile
Re: [MOD] Easy Radar Rangefinder
« Reply #5 on: May 31, 2013, 09:05:13 pm »
I'll have to download a new build and see if this mod still works for me with all the changes that may have happened in the meantime.

I 'installed' the mod by putting it in the game folder where it is loaded automatically on startup. When I don't want to use it, I rename the file extension to something that will be ignored. I have never tried loading the mod by using the interface in-game. Try and see if you can get it to work just by putting the mod in the right place.

Offline homunculus

  • Sergeant
  • *****
  • Posts: 387
    • View Profile
Re: [MOD] Easy Radar Rangefinder
« Reply #6 on: June 01, 2013, 10:55:09 pm »
so, it is for 2.4, then?
i still have 2.4, perhaps i should try it there, no difference for base placements, i guess.

Offline Quizer

  • Squad Leader
  • ****
  • Posts: 130
    • View Profile
Re: [MOD] Easy Radar Rangefinder
« Reply #7 on: June 02, 2013, 09:33:23 pm »
No, I made this for 2.5dev, a build from January '13 or December '12, so probably pretty outdated by now. Maybe there were some changes to scripts/scripting - I have no idea.

Offline homunculus

  • Sergeant
  • *****
  • Posts: 387
    • View Profile
Re: [MOD] Easy Radar Rangefinder
« Reply #8 on: June 09, 2013, 01:21:29 pm »
It seems my own UFO:AI is even older, it says:
UFO: Alien Invasion 2.5-dev IA-32 Sep  5 2012 Win32 DEBUG

I put the radarmod.pk3 in UFOAI-2.5-dev\base
and then started ufo.exe in UFOAI-2.5-dev

and the result was the same, no geoscape, etc.

Offline Quizer

  • Squad Leader
  • ****
  • Posts: 130
    • View Profile
Re: [MOD] Easy Radar Rangefinder
« Reply #9 on: June 09, 2013, 03:08:34 pm »
In that case, you might want to try to update... Something critical might not be included in your older build that my mod assumes is there. They may not even have had the small radar tower installations back then, or something.