Another day, another problem. This time not (apparently) bugs in the coding of the software, but rather software design elements which aren't helping with campaign scenario development at all. Specifically regarding barbarians. But first, the current idea for PacCampaign Level 1 is:
1] Pac and some friends undertake an adventure to find land suitable for building a new civilization
2] They have come to Scenario Level 1 territory, where the land is not pleasing, so they decide to move on.
---Main Quest: If any Pac tribe member makes it to an exit tile, then Victory, scenario Level 1 is over and a message directs the player to continue to Scenario Level 2.
3] Pac and friends start looking for an exit. They encounter signs warning about barbarians and pirates. They hear the sounds of battle to the north and head that direction to see what is going on.
4] Several local tribes in the area are under attack from barbarians. The barbarians destroy from 1 up to 3 of 4 cities. (The Vampire's city being destroyed and the Werewolf's city NOT being destroyed will both be used as plot elements later on another level. The UN is largely irrelevant (heh) and so are the Hackers but I think that both being destroyed will add to the "excitement" of campaign level 1.)
---Optional quest: Pac and friends stay to help fight the barbarians. If all pirates are killed and Pac's tribe is still alive, then a dialog window states that a local tribe member approaches to thank Pac and tells him a secret which will lead to a bonus on the Level 2 map.
5] After the barbarians are destroyed, Pac and friends resume their travels by finding and moving onto an exit tile. Victory, level over, on to Level 2. (At this time, it is also possible for the barbarians to eliminate the other tribes, then Pac eliminates the barbarians and a conquest victory occurs since no players are left but Pac.)
One possible problem is that it is -possible- for Pac to go to war with the local tribes. It would make the "grateful tribe member" who rewards Pac seem odd, but other than that it wouldn't change much except that Pac's tribe might fail as in "Game over, LOSER!" The player could try again by restarting Level 1.
The main problem I'm experiencing is with the barbarians. The ratio of barbarians to Pac's and local tribe units should be such that Pac can achieve victory, but not
too easily. I first used "unleash.barbarians", then set a variable to their player number so that I can manually add more barbarian horsemen where and when needed. But using the "unleash" method results in seemingly random numbers of barbarian units appearing in random locations at random turn intervals, and that despite that the scenario has the barbarians setting at "HUTS_ONLY". Some times it's too many, sometimes too few. Sometimes there are also boats full of units which I'd rather avoid completely on Level 1 of the campaign. So I decided to "edit.create.player" the barbarian tribe instead of using "unleash". That worked and allowed me to place an exact number of pirates across specific tiles. BUT! The next issue was that while playing the level, Pac met the pirates and guess what they did? They issued a greeting message "At last I've found you! Now make it worth my while or be crushed!" or something to that effect. So I checked the Nations window/pane and sure enough, the "edit.create.player" method results in a barbarian tribe that is listed like a regular player in the Nations window (which I suspect is because the tribe does not have the ai.barb_type value set!) So I tried to set it to "Land" and GUESS WHAT? There doesn't seem to be any lua access to that setting at all.
So, I reverted to using the "unleash" method, to prevent any diplomacy between pirates and player tribes because that would be really weird if the local tribes allied with the pirates against Pac. Might be exciting though.
Now I'm trying to work out how best to ensure that the # of barbarian units is just the right amount, in just the right places for an exciting but not
too difficult first level of the campaign. I'll get it worked-out soon even if I have to, every turn, run through the whole list of all barbarian units and kill some from certain areas, add more to other areas and so on.
Allowing lua access to set ai.barb_type to Land would have made things a whole lot easier. (Assuming that that would hide the tribe from the Nations window etc.) Or perhaps set the flag automatically when the tribe is "Barbarian"?
Or allowing setting a flag to prevent a given tribe from participating in diplomacy (so that they are always hostile and at war.) <---- Edit/Update: This appears to be exactly the case already with manually created barbarian tribes. Even after making contact with them, the Nations window/pane always shows "no contact" and thus diplomacy is impossible.
Or allowing a fully manual mode for "unleash.barbarians" in which the tribe is created, no units appear automatically, units can be created via scripting. Perhaps "if scenario setting "barbarians" is "HUTS_ONLY"" then only manual/lua script creation of units?
EDIT: It just occurred to me that edit.create_player had a setting "better left as nil" that was not fully explained... I'll try it with "Land" and see what happens.
Edit 2: That's not it. The barbarians still show-up in the Nations window/pane like a regular tribe even when created with ai.barb_type set to Land.
Edit 3: Contactless Contact is the future!
Edit 4: I now think that diplomacy is -already- impossible with the barbarian tribe using edit.create_player. The greeting message they sent on first contact made me think that diplomacy would be possible, but the "no contact" despite having just made contact makes me think that the "no contact" -is- the method of preventing diplomacy with the barbarians... which makes the edit.create_player option more viable, but I'd still rather have the barbarian/pirate tribes not appear in the nation list because it seems like too much deviation from "standard" FreeCiv experience and might cause confusion for people who play either the campaign first, or FreeCiv generated games first, and then the other.