Author Topic: Food no tradeable  (Read 598 times)

Luriant

  • Newbie
  • *
  • Posts: 9
  • Karma: +1/-0
    • View Profile
Food no tradeable
« on: April 09, 2015, 09:24:28 AM »
I'm editing the planet.as script, i want to test a game without orbital factories (limited to planets slots) and "infinite" trade.
I don't want to trade food between planets, each planet need their owns farms

But i can't edit the food to be no tradeable, i can't understand enough the code to edit the correct parameters. I always have problem with food tradeable to the galactic bank, in more or lesser quantity.

┬┐Any help with a novice programer?
The rest is easy, delete factory subsystems, ships, and modify governor to balance food/cities ratio in all worlds.

seronis

  • Distracted
  • ***
  • Posts: 338
  • Karma: +25/-0
    • View Profile
    • Steam Profile Link
Re: Food no tradeable
« Reply #1 on: May 14, 2015, 01:48:31 PM »
Well I notice this post is a little bit old but i'll still try to provide a bit of info.   First off you at least had the right file.  Planet.as.   In there the funciton you will be editing is the tick() function which handles all updates for the planet objects.  To stop food from being traded you just need to look for all the food related things.  The first major one is where the weight of potentially traded food is calculated on line 393/394 and where that value is added to the 'total weight' on line 405/411.  These weight values are the limits your space ports allow.  Since you want infinite trade you need to edit this either way but since you dont want food traded at all you should remove where its calculated and where its weight is added to the total for starters.  Dont forget to tweak/remove 438-442, 451, 458, and 465.

All line numbers are based on an unmodified install.

Any code/mods I post on this site should be considered Public Domain. Borrow it, steal it, shred it into little pieces to your hearts content. I dont require credit but I appreciate bug fixes and suggestions.

Luriant

  • Newbie
  • *
  • Posts: 9
  • Karma: +1/-0
    • View Profile
Re: Food no tradeable
« Reply #2 on: May 14, 2015, 02:19:15 PM »
Thanks for the reply, you make in 5 minutes what i can't in 5 hours :S .
Marking as anotations the line codes solved the problem, and food and population flow without problems.