Requesting following features

in this spoiler are the 4 animal flags just for you to see (the stag is on my other computer so can show you that!

Spoiler :


 

Attachments

  • 4 flags.jpg
    4 flags.jpg
    167.6 KB · Views: 100
I'm currently struggling with the catapult construction code (AI only). Because both beginGameTurn and beginPlayerTurn calls actually happen after units have moved. :)crazyeye: I know.)

This means that I can't prevent AI units on forest tiles from moving (to spawn the catapult). And if I disable the CyUnit.canMove() check we get units that are moving and picking up catapults as they move along... (Albeit with a mere 5% chance, by default.)

I don't even know if this really matters, since the AI unit doesn't have to "construct" the catapult anyway...

It would, however, be possible to disable a AI unit from moving altogether. For, lets say, the number of turns it takes to construct a catapult for the human player. This can be done by changing the UnitAITypes setting to "UNITAI_UNKNOWN" - temporarily.

But doing anything like this would still make most sense if the behavior was prompted by a war declaration. So this is basically what I propose:

Spoiler :
A AI player DOWs or gets DOWed. A index of all advanced swordsman units of that player are indexed - and any that are built in the course of the war are appended to the list also.

Every game turn the plots inhabited by these indexed units - and only these units - are checked for any forest present. And if forest is found, then the unit has its Unit AI settings disabled (and will thus be immobile). Only one unit per game turn would suffer this fate. Or only one unit would have to construct a catapult at any given time.

A countdown begins where the unit will only get its NO_UNITAI setting (the default) back once the specified turns have elapsed. And once its done the forest is removed and the catapult is spawned.

There could also be a counter that checks how many catapults have been spawned in this manner in the course of the war against a preset value. This way the AI won't lose its momentum in favor for turning forests into catapults on a large scale. (This may not be necessary though.)

Once the war is over the whole thing is scrapped - no more indexing of units or checking those units. All units get back their ability to move. No more catapult construction this time around.


Well, this is the alternative, at least. But since its quite a big programming project the whole thing could easily be simplified with simply giving the AI catapults on DOW. The only thing that needs to be checked is if the AI has the prerequisite technology.
 
ok if you think it is needed then do it! By the way... If a domestic revolt happens in a conquored city do the civ specific rebels spawn or the original founders of the city?
 
ok if you think it is needed then do it! By the way...
Oh, I am doing it already. :D The problem is that I may not have the time to do all these thing in the end... :p So it does make sense to keep things as simple as possible...

If a domestic revolt happens in a conquored city do the civ specific rebels spawn or the original founders of the city?
Eh, this is basically up to you. Define the rules for this as precisely as possible - before I start coding the new stuff. Right now I have my hands full with the catapult construction.
 
Ok, I have some code for mimicking conscious catapult construction for the AIs part. As its set up right now each AI player can only construct one catapult at a time - while construction is going on the rest of the advanced swordsmen units aren't even checked. Good?

What is the construction time for a catapult unit from a forest tile? Do we need a maximum number of catapults constructed from forests within one war? (Any period ranging from a DOW to a peace treaty.) Or should there rather be a maximum number - or portion - of catapult units for any one player? (A target number that prohibits any more catapults from being spawned once reached.)

This will require a lot of testing because so many things can happen in-game. Like units or players constructing a catapult being killed off. Stuff like that - we wouldn't wanna have catapults appearing from thin air at the end of some countdown!
 
Sounds good what ever you think is best!

how long do you think it will be untill I can test everything? Because I can't wait to delete the XML for the dummy buildings and finally do my playthrough!

But I still have alot to do... Animations need to be sorted out, and the flags have problems (I'm not sure what caused them but I think it is easily repairable), I'm thinking of making a custom intro screen, disabling "Play Now!"/"Custom Game" (how would I do this?) Final translations, I might do a new calander (would this affect The J's code?) and probs some other stuff I have overlooked
 
I fixed the flags :D they look great!

Also regarding TheJ's code: does the ERE have to be IN the senario (just dead) like the rebels will be?
 
Sounds good what ever you think is best!
Thats not actually very helpful, but sure.

how long do you think it will be untill I can test everything? Because I can't wait to delete the XML for the dummy buildings and finally do my playthrough!
Well, I've had a complete setup for you to test for a whole week now. But we keep adding stuff, so that means that I need to test things before submitting. But if we exclude the new rebel civs and the AI catapult construction thing for now (I'm still working on it) I could get the rest of the code in order right away. Like this morning. (I might be too busy this evening, tomorrow and the day after...)

Also regarding TheJ's code: does the ERE have to be IN the senario (just dead) like the rebels will be?
I don't actually think so. If I read the code correctly the new civ will be added in mid-game. I'm not sure what that will do with the rest of my own code, however. I might have to add some line in there... :p
 
Ok then, Can you send me all the powers and the comandeering code for me to test (exculding the Rebels and CC)
 
You can totally test the Rebels also, but since we haven't added any actual rebel civs yet it will be barbarian units instead. In fact, I'm gonna include the current Rebels code so that you can see for yourself what it does and if the likelihood of a rebellion needs to be lowered or increased.

I'll get to testing everything one last time and send you the work once verified. (You can easily disable the Rebels mod comp by commenting out the line Rebels.initEvent(iGameTurn) in the Event Manager.)

edit: Done!
 
ok btw I have 1 rebel civ: Rebels just so you know! I will get to testing everything quickly
 
Well, I don't have that Civ in my set of files... Should we add that one rebel civ first and test everything, or just add all of them in the next phase?
 
how do I see if the Roman's ability works (btw there are no exceptions) or the germaniac one for that matter?

We should add all of them in the next phase (I'll have created and tested them all by that time!)
 
how do I see if the Roman's ability works (btw there are no exceptions) or the germaniac one for that matter?
I think we have to take Asaf's word for it. :D But if you figure out the Python console you might be able to use some lines of code to get readouts (return values) from the game. This is basically how you can verify them.

We should add all of them in the next phase (I'll have created and tested them all by that time!)
Ok, make a good run of this testing session and I'll work on the catapult construction code (its another module :rolleyes:) in the meanwhile. Once you're done testing the code you already have and I've been able to test the AI catapult stuff, then we can start adding to the Rebels mod-comp.
 
ok then, At least I get get rid of those dummy buildings :rolleyes:
 
During testing out my flags I was testing them on the rebel civ and as it wasn't in the WBS I had to just use custom game, this meant I didn't have all the civs in game... It came up with the exceptions relating to the ones which were not in the game... This should mean I will be able to see if the game is pciking up the roman and germanic powers... just exclude them from a game!
 
During testing out my flags I was testing them on the rebel civ and as it wasn't in the WBS I had to just use custom game, this meant I didn't have all the civs in game... It came up with the exceptions relating to the ones which were not in the game... This should mean I will be able to see if the game is pciking up the roman and germanic powers... just exclude them from a game!
Yeah, this would mean that the code was firing but it couldn't be executed. This can however also be achieved by adding print lines into the code at key locations and follow what gets posted in the Python Debug log. But I don't think you need to worry about that.
 
I see you've been busy this weekend... nice work.
I'd be happy to try this Mod when it's done.

how do I see if the Roman's ability works (btw there are no exceptions) or the germaniac one for that matter?

I think we have to take Asaf's word for it. :D But if you figure out the Python console you might be able to use some lines of code to get readouts (return values) from the game. This is basically how you can verify them.

The problem here is that the game doesn't display this information. If you're at Police State, you won't see a '-50%' WW modifier anywhere, it will just include this in the calculation.

I guess I can add a displayed modifier for WW and maintenance , but it will not include the source (civic, building or Civ power), only the total modifier for a city.

Testing is a bit difficult here, but I guess you can do it by changing the modifier to something you won't miss (-90% or even -100%), and then you'll probably notice if it works.
 
I'm hacking away at the catapult code and just realized that the minor Civs in the scenario are always (?) at war with everyone. This means that I won't count wars with minor civs (or barbarians) as a cause for the (major) AI players to turn forest into catapult. Sounds ok?
 
Also, I've disallowed one single unit from constructing more than one catapult per "war" or offensive. This to prevent the first unit from getting bogged down in a forested region for the duration of the war... :p

Two more things to note at this stage: There is nothing "random" about the AI "behavior". If the conditions are met then one unit at the time will stay immobile in a forest, as simple as that. If the unit survives for enough turns (5 by default, right?) then the forest is removed and a catapult is spawned.

And the AI will "forget" about the construction countdown if the game (or the Python) is reloaded. I simply didn't go the extra distance to create custom stored values for this. The module is already at 200 lines... I doubt this glitch is noticeable for the human player, since the feature should be pretty rare in any case. This could be compensated for, however, with lowering the construction time for AI players. They don't choose to do any of it in the first place, so having a potentially useful unit immobilized for 5 turns may be a bit severe anyway. :rolleyes:

Just tell me if something needs to be changed. (I can store the construction timer in the actual plots as scriptData, if its required.)
 
Top Bottom