Era question

As bugs and suggestions are fixed/implemented/rejected, they will be moved in here.
Post Reply
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

In the original prom games advancing eras would allow for different military units. Is that feature still available in the FAF version? If so what do you need to set your $config as? Have tried:

code: Select all

$config['er'][101]['troop0'] = 'unit desc';
$config['er'][201]['troop0'] = 'unit desc';
$config['er'][301]['troop0'] = 'unit desc';
Where 101, 201, 301 refers to the era, but doesn't seem to work properly. I always get the 301's values...

User avatar
The Beatles
Fear me for I am root
Posts: 6285
Joined: Tue May 24, 2005 8:12 pm

Post by The Beatles »

There is a short answer and a long answer...

1. Short answer: this feature has been partly compromised in favor of different troops per race. To reset it, look at the arrays in conf-proc.php ($racep, $erap) and move troops to $erap. (In for loop.) This is because currently the game fills out default values from the previous race, not previous era.

2. Long answer: Fill out each and every entry (num_eras * num_races), or at least the parts that change. I realize this is longer, but it is the most flexible solution if you want to vary both eras and races.
:wq
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

I am just looking at changing the military units as the eras change, races will remain the same. So given that, if I understand correctly, in conf-proc.php this code:

code: Select all

$racep = array('rname', 'offense', 'defense', 'bpt', 'costs', 'magic', 'ind', 'pci', 'expl', 'mkt', 'food', 'runes', 'farms');
$erap = array('ename', 'peasants', 'nfood', 'nrunes', 'wizards', 'homes', 'shops', 'industry', 'barracks', 'labs', 'nfarms', 'towers', 'empire');
foreach($config['troop'] as $num => $mktcost) {
	$racep[] = "troop$num";
	$erap[] = "o_troop$num";
	$erap[] = "d_troop$num";
}
Sould be changed to:

code: Select all

$racep = array('rname', 'offense', 'defense', 'bpt', 'costs', 'magic', 'ind', 'pci', 'expl', 'mkt', 'food', 'runes', 'farms');
$erap = array('ename', 'peasants', 'nfood', 'nrunes', 'wizards', 'homes', 'shops', 'industry', 'barracks', 'labs', 'nfarms', 'towers', 'empire');
foreach($config['troop'] as $num => $mktcost) {
	$erap[] = "troop$num";
	$erap[] = "o_troop$num";
	$erap[] = "d_troop$num";
}
I think I am missing something else though :blink:
User avatar
The Beatles
Fear me for I am root
Posts: 6285
Joined: Tue May 24, 2005 8:12 pm

Post by The Beatles »

No, that should be all. Have you tried it?
:wq
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

Yes, only seems to work for the admin user. New users always get the era 3 units no matter what era they are in.
User avatar
The Beatles
Fear me for I am root
Posts: 6285
Joined: Tue May 24, 2005 8:12 pm

Post by The Beatles »

Bizarre. We used to have it like that earlier, and we didn't have that issue. Have you tried signing up, or are you using admin-set-user?
:wq
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

Well what I did was made the code changes, then reset the database so it is like starting a new game. Then normal signups.

Very strange that the admin account is working but new signups are not. If I go in to the database and change the admin account era, everything works just fine. New signups always get the era 3 units though. Doesn't make since. Its got me stumped...
User avatar
The Beatles
Fear me for I am root
Posts: 6285
Joined: Tue May 24, 2005 8:12 pm

Post by The Beatles »

Not quite sure what you mean in your second paragraph, but then can't you just change the default era for normal users?
:wq
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

There were a few places in signup.php that was causing the era to be set wrong. Works properly now. Thanks Beatles.
User avatar
The Beatles
Fear me for I am root
Posts: 6285
Joined: Tue May 24, 2005 8:12 pm

Post by The Beatles »

Thanks for finding that! Would you mind please sending me the diff so we can fix it in the main FAF tree too?
:wq
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

I will email you the signup.php and you can have a look. Ours has been modded a bit so not sure if you want all the changes or not.
User avatar
The Beatles
Fear me for I am root
Posts: 6285
Joined: Tue May 24, 2005 8:12 pm

Post by The Beatles »

Thanks, got the email.

It seems to set the user's era to the default era rather than what they chose. Was the problem with the default era, then?
:wq
Turock
Forum Maniac
Posts: 289
Joined: Sat Jan 07, 2006 12:45 am
Contact:

Post by Turock »

Well, I had planned to have it so that as you advanced from one era to another your military units advanced and became stronger. Names changed and offense & defense changed a bit as well. Signup placed everyone in the same era, 1 by default. In order to advance to the next era required 3x maxturns to be used and a rune cost that was pretty great, about 16k scaled 1/1000 or something close to that. I'm not sure that I am going to run with that though. It was an idea I had. Might encounter balance issues, not sure.

Changing it so that players can choose an era and get the proper units should be much the same. Probably just need to look at the loadEra function, not positive though, hadn't gone that far.
Post Reply
  • Members connected in real time

    🔒 Close the panel of connected members