I started a scenario (inspired by Civ2 scenario Prince of Darkness by Techumseh -
http://csc.apolyton.net/scenarios/prince.shtml ), but I am running into a few issues, some of which have to do with the constraints listed here. I don't really care for the contest and might end up making a modmod instead, but I'd rather not and I believe some of the points may be interesting for others.
I've been working with the patch "c" version, then been internet less for two weeks, so a few things may be obsolete as I haven't had time yet to check the latest patch.
Some are minor remarks, some are more serious issues:
- Determining scenario name: Instead of using a specific enum, I just check for my WBSave name. This is more flexible and would allow several winners for the contest (but expanding the enim would work too).
- setFoundDisabled doesn't prevent the barbarians from spawning cities in the Cult scenario.
- I can't seem to access getName() for units. I can make do with getID() but that leads to some problems regarding save/open. Am I doing something wrong or is only setName available from Python? I guess I could use pUnit.scenarioCounter().
- onUnitMove seems to never get called. I suppose it'd slow down the game too much? I can work around using warning posts, but these are improvements, which means it's not practical when I'd like an atRange from a city. I can circumvent this by checking all units in given plots every turn, but would like to be sure that onUnitMove is indeed disabled, so I'm not doing something complex for no good reason.
- Ring of Carcer and Goblin Forts are a problem with the worldbuilder: I create a map, put a Ring, save, quit, load, save, and every save in the WB adds one Brigit in the Ring. Same with goblin archers in the forts. It's possible to delete them by manually editing the WBSave but I don't know whether I should put zero or one of Brigit in the WB file, as I don't know if the duplication is made on open or on save?
-I'm trying to use a big unit or "something" to make a tile impassable until "something" happens. I thought using a held Meshabber of Dis would do (the tile being "the Gates of Dis"). The beast seems to vanish after one or two turns of play however. I can use something different, but wonder why the Meshabber disappears. Particularly because I'd like him to appear/be unheld late game by scripting, and if he vanishes immediately afterwards, it won't work.
-I suppose I can't get a regular nuke effect out of a new (one use) spell with the constraints? I'll have to kill units by python instead?
-Is there a way to give a city to a player? I want a barbarian city to 'surrender' when a player comes near. I currently do it by killing all units in it, gifting a unit to the player nearby, popping up some text, and hoping he won't be stupid and will take the city. But this leads to discontent and may have side effects like destroying some buildings (I know I could add them back in the onCityTaken(?) function). Funny thing is, I tried to kill all the barb units in the city, then put one player unit in the city, and when I do that, the barbs don't die and no unit is created, no error is reported either. If I don't put a new unit in the city but beside it, the player can take it easily. Any ideas about how to better do this?
-Another question, does the ai know how to do MASSIVE sea attacks? The goal of the scenario is to prevent Infernals from conquering the world, so if the player fails, they should conquer it. But there are seas and other such obstacles. In his Civ2 scenario, Techumseh would create lots of flying hyper strong untis with almost infinite range. I can definitely spawn hordes of flying promoted combat boosted demons, or spawn them from everywhere, but I'd rather have them board ships. However I am not sure that, if I spawned one transport ship per turn in every coastal city and a good amount of troops, the ai would use them to actually kill the other players. Can I trust the ai? If not, is it possible to give the various units orders to attack every city by sea and see them actually perform the orders? I don't think there's a ATTACK_SEA_LEMMING ai?
In addition to this, I had to do a few changes outside the sf file:
- I'd like to keep some persistent data, so save/load would be nice to use. I don't know of mods that use this function however, so I am not sure whether it works. The way I envisoned this requires the ScenarioFunction class to actually hold some data, which means it has to be a singleton... Actually, it would probably be much easier to use if it was a singleton created by a factory which decides which subclass to use based on the scenario instead of doing "if" in every function.
I suppose I can use the ScenarioCounter though, but what type is this? I have one side quest (and ideally one more per playable nation but I'll probably not get there anytime soon), so I'd use it as a bitfield. Is it 32 bits? 64? Mind you I can probably get around most of this (except a hidden delay counter) with setPythonActive on some plots.
- I tried to factor the Mercurian gate effect into a function. It's just to avoid copy-paste, I can do it without modifying the events py, but it's not as clean as making it a function. (I just wanted the Mercurian Gate to be created by an event with a choice from the player, but the player can't take control of the Mercurians.)
- onUnitKilled doesn't pass the attacker to sf. I must shamefully admit that I use this to prevent NPCs from killing one unit which the storyline says can only be killed by the player. The issue is that I can balance land units easily enough, but ships are much much harder to balance: They all have about the same strength, and even a heroic buccaneer combat1 frigate manages to get killed by nasty Lanun triremes

If I boost the ship too much, the player's ship, which is supposed to be the best in the game, will then have trouble beating it (unless you play a nation that has access to fireball/maelstrom or such spells that can damage the other ship a little bit first).
- I start the game with Hyborem alive and well, in the fabled city of Dis. I want him to grow a bit by conquering some independant cities. Right now, these cities are barbarians. I come across a few problems with barbarians however:
--Hyborem doesn't attack them. He just moves along like they were old friends. How can I force him to be at war with them?
--I suppose I'll probably have to convert the Riders and other nasty Armageddon Counter spawned units to be under Hyborem control. Any better way than checking all barb units on the start of every turn?
--Also, is there a possibility to change the graphics of some barbarian archers so they aren't orcish? I can use barbarian bloodpets to avoid having orcish warriors, or elven archers instead of goblin archers, but I'd rather have some regular-looking (Bannor?) models. Is there a way to do this in the constraints of the scenario?
Last, a small question about war/peace. I've seen it's possible to control the war/peace by scenario, be permanent or not, but I'd like some playres (Hyborem, Sheaim, Illians) to be permanently at war against everyone else (including the barbs), and the other nations to be able to declare war on each other if they want to. The idea is its better to cooperate, but if you're the Bannor and your Calabim neighbours want to declare war on you, they can, so you'd better be at least a little diplomat. If someone has been nice enough to read to this point, do they have a hint for this too?
Sorry for the length of the post, and thanks again Kael and team for this great mod.