Is there a [Map Seed] value?

A place for discussion of making game modifications.
Jem
Posts: 31
Joined: Tue Aug 15, 2017 9:21 am

Is there a [Map Seed] value?

Postby Jem » Wed Jul 29, 2020 7:01 am

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. :)

User avatar
sven
Site Admin
Posts: 1620
Joined: Sat Jan 31, 2015 10:24 pm
Location: British Columbia, Canada
Contact:

Re: Is there a [Map Seed] value?

Postby sven » Fri Jul 31, 2020 2:28 am

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>

Jem
Posts: 31
Joined: Tue Aug 15, 2017 9:21 am

Re: Is there a [Map Seed] value?

Postby Jem » Fri Jul 31, 2020 5:32 am

Wow! Thank you kindly for the info!
I didn't know abt any of those. This sure opens up new ideas for me.


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 4 guests

cron