Author Topic: Sharing a few toys  (Read 5105 times)

Offline Scorrpio

  • Captain
  • ***
  • Posts: 88
    • View Profile
Sharing a few toys
« on: April 14, 2017, 02:46:44 am »
Per request, sharing some of the tools I wrote.   These are pretty basic stuff.   
You need some way to compile the C++ code and run the resulting executable.   And this is all command line, I don't do GUI  :)
I personally use cygwin64 terminal with GNU C++ and Netbeans IDE for editing.

In all the programs, main function has two strings: saveDir and ruleDir that should point to save and ruleset directories, respectively.   

By default, game.sav save file is used.

Research analyzer (rsrch.cpp)
Providing a target research topic:  right now, one has to type in an exact codename, such as STR_SCHOOLING_2
In the plans it to allow typing in translated name and do pattern search, but for the time being I just grep Piratez_lang   :)

Providing a research topic without options tells you what you need for it.
Options prepending the topic:
 -g  tells you what the topic is immediately needed for, as well as its list of 'give free'
 -t   lists all the research that needs the topic.

Working also with topic:
-k  lists requirements or dependents you already know.  By default they are skipped
-u  shows Bootypedia entry for the topic

Other options
-s [savename]    - use alternate save file (without .sav extension)
-c  cost analisys.    Shows cost distribution of projects not yet researched.   Providing a number, i.e. 20 will list topics with that cost.
-f   lists research that has facility requirements
-a  lists topics available to research or being researched.
-p  lists currently being researched topics
-n (works with -a) also lists topics that you could research if you had the requisite item (can be quite long)

rsrch -u -g STR_MAGICAL_GIRL -s Daily
    +1 others
   Magical Cake / STR_CAKE (5) [ ITEM MISSING ]
   Mercenary Shock Trooper / STR_MUTON_HEAVY (15) [ ITEM MISSING ]
   Mercenary Commando / STR_MUTON_NAVIGATOR (15)
   Mercenary Soldier / STR_MUTON_SOLDIER (10)
   Smuggler Captain / STR_SMUGGLER_CAPTAIN (15) [ ITEM MISSING ]
   Wand of Peace / STR_WAND_HARTO (10) [ ITEM MISSING ]
   These barely-adult girls have exactly that kind of immoral innocence about them that makes most males weak-kneed. They're also aggressively nice, playful and adaptive (see how she dresses after a few days here). What's perplexing though, they have no recollection of their identity or origin, or even the Well-wisher (whom they call the Goddess of Love, or of Cake), other than they found themselves aboard the ship with a deeply engraved mission of 'spreading love'. They also possess bits and pieces of strange knowledge and/or previous encounters.

rsrch -u STR_GRAVITY_PHYSICS -s Daily
Gravity Physics / STR_GRAVITY_PHYSICS (60)
   Implosion Bomb Launcher / STR_BOMB_LAUNCHER (0)
      Implosion Bomb Lnchr. Parts / STR_BOMB_LAUNCHER_PARTS (35) [ ITEM MISSING ]
   /Implosion Bomb Launcher
/Gravity Physics
   The Stellar Empire has mastered the use of antigravity, as can be witnessed in the easiness of use of the Grav Harness and antigrav vehicles. The body of knowledge we have secured will let us optimize our own antigravitic technologies.

Offline Scorrpio

  • Captain
  • ***
  • Posts: 88
    • View Profile
Re: Sharing a few toys
« Reply #1 on: April 14, 2017, 02:59:05 am »
Manufacture analyzer:   mfgr.cpp

This is not as interactive, it just analyzes  the ruleset, does not really look at save file
In the main, need to provide the path to ruleset files.

It also only looks at infinite manufactures that do not depend on dropped resources, and gives monthly profit based on 50 runt force, sorted by best profit.    I am almost afraid to post it here because... nerfs  :(
I want to expand it to show what profitable goodies you can make with stuff you have on hand.

Sample  output line:
2.84514e+06 : STR_ALIEN_ALLOYS_XXX,Plastasteel (x50),71597.2,225000

Basically says that 50 runts making Plastasteel will net you 2.84 million/month after runt salaries and requisite facility maintenance.

Offline wolfreal

  • Colonel
  • ****
  • Posts: 298
    • View Profile
Re: Sharing a few toys
« Reply #2 on: April 14, 2017, 03:05:59 am »
These are cool!. Thanks!.

Offline Scorrpio

  • Captain
  • ***
  • Posts: 88
    • View Profile
Re: Sharing a few toys
« Reply #3 on: April 14, 2017, 03:11:23 am »
And another interesting piece.   This was written more as a coding  experiment.    I do NOT use it for actual playing, as it is clearly a cheat.

Again -s option to specify save file name.   main needs save game and ruleset directories provided.

Other options: -m shows map.    You want to make your terminal window fairly wide for this.
A number after m (i.e. -m 2) shows only specific level of map

-p lists and shows  piles of stuff, inlcluding dead folks (I see dead people!) Piles over 50 items long are not listed cause that is usually the pile inside your craft.

Again, I do not use it in actual gameplay, but I wrote it and I am sharing it.  Use at your own discretion.

Offline Scorrpio

  • Captain
  • ***
  • Posts: 88
    • View Profile
Re: Sharing a few toys
« Reply #4 on: April 14, 2017, 03:23:00 am »
Oh, you might notice that  rsrch.cpp  can also double as a sort of inventory manager.

Boom Gun Shells / STR_BOOM_AMMO (0) [owned: 115]  [ KNOWN ]

Offline desert

  • Sergeant
  • **
  • Posts: 34
    • View Profile
Re: Sharing a few toys
« Reply #5 on: April 14, 2017, 03:57:09 pm »
Could Piratez developers easily integrate this sort of research listing into the release, with GUI being built in with the game inherently?

It's already possible to search research nodes and dependencies as is well-known, but for manufactures there already seems to be a function with similar formatting to your research grab [attached].

If it's not difficult to include, then it probably should be. Not to denigrate console-based processing, but a single right-click in this instance is less cumbersome.