You really seem to be getting the hang of the modmaking, SMIFFGIG's
Quote:
|
Originally posted by SMIFFGIG's
1.How do I make an event eg Reinforcements to appear at a certain point in the game or after a trigger.
|
Determine
when you want something to happen and
what you to happen. Then write the code for it. The when part goes into the condition part of if-statements, the what goes into the execution part of it. Example: in turn 15, you want to give 3 Legions to player 2, near his capital (
where you want something to happen would be a suitable 3rd question to ask). Then your code should look like this:
Code:
|
HandleEvent(BeginTurn) 'LOQ_ReinforcementExample' post {
if (player[0] == 2 && g.year == 15) {
city[0] = player[0].capital;
CreateUnit(2, UnitDB(UNIT_LEGION), city[0].location, 1);
CreateUnit(2, UnitDB(UNIT_LEGION), city[0].location, 1);
CreateUnit(2, UnitDB(UNIT_LEGION), city[0].location, 1);
}
} |
This will check at the start of every turn (BeginTurn) if the currently active player is player 1 (player[0] == 1) AND (&&) if the current turn is turn 15 (g.year == 15). If this is both the case, it will create a Legion, owned by player 2, 1 square away from the capital, and it will do this 3 times. The only 'hard' (not really) part here is to find a suitable location. This can be any tile on the map, but depending on exactly what you want it may require some extra coding to store this location correctly (in this case: 'city[0] = player[0].capital').
Quote:
|
4.Can i make it so that a unit dies after a certain amount of movement
|
That one's trickier but it's certainly possible. How to implement it depends on your meaning of 'movement'. A number of tiles, a number of turns, a number of movement points? You'll need to detect these and store them in a global variable. Then, everytime a unit moves, check if it has moved enough and if so, destroy it. It also depends a lot on whether you want this to go for one specific unit, one unit type, several unit types, all units, one civ, all civs, etc, etc. You'll need to flesh out/explain the idea a little better before any code can be written for this.
Quote:
|
5.Can I specify what barbarians appear
|
If you disable the creation of Barbarian units and do it entirely through SLIC (ala the code from Q1 only slightly more complex (with randomness involved)), yes. Without SLIC, I'm not sure. You'd have to check out the text files in the default\gamedata folder.
Quote:
|
6.Can I make it so city boarders are invisible?
|
No, not AFAIK.
Quote:
|
7. Finally can I make it so that u have an ally that are there and u can see all there stuff etc but they never do anything build etc.
|
Not sure exactly how you want this implement. I can think of a few things (e.g. turn off the AI for this player, then they won't do anything) but since I'm not sure exactly what you want, it's hard to say much about it.
If you haven't found it already, make sure you check out my and Immortal Wombat's guides as well, not just Peter's.