Page 1 of 1
Is there a [Map Seed] value?
Posted: Wed Jul 29, 2020 7:01 am
by Jem
Greetings, I was working on a delay counter for when other species sent "offer_to_join_empire" reuqest, and even after rejected, will keep repeat same request every turn after.
It sorta worked but didn't take note for 'other' species, or in new game in same session of same species that had sent offer before, bizzare but possible.
So, I'm curious if anyone know if there's this variable [map seed]? So I can put it in a local array of MapSeed, Race, OfferYear, OfferTurn to stop 'nagging' offers.
Re: Is there a [Map Seed] value?
Posted: Fri Jul 31, 2020 2:28 am
by sven
Jem wrote:So, I'm curious if anyone know if there's this variable [map seed]? So I can put it in a local array of MapSeed, Race, OfferYear, OfferTurn to stop 'nagging' offers.
There's is a map seed of the sort you're looking for, it's stored in "galaxy.base_year_seed". But what you probably want to do for a hack like this is to add a variable to one of the "game state" tables. You could, for example, make a new array that's part of "galaxy", which is a global table that stores all sorts of galaxy info. Or you could write something right to the "empire" table of the empire you want to inhibit offers for. In general, you can always add new fields to any of the game state objects without getting in trouble -- the only potential problem is if you pick a field name that I'm already using for something else. But as long as you use a descriptive name, you should be safe from that. I'd just initialize a new table with some code like this, and then use it for whatever:
Code: Select all
if not galaxy.jems_table
galaxy.jems_table={}
end
local jems_table=galaxy.jems_table
<do whatever>
Re: Is there a [Map Seed] value?
Posted: Fri Jul 31, 2020 5:32 am
by Jem
Wow! Thank you kindly for the info!
I didn't know abt any of those. This sure opens up new ideas for me.