In my first attempt to write SLIC, I am trying to write code that will create a unit whenever & wherever you build a city. The unit you get will depend on technology as well as make the city start at an increased size. I am getting an error message that points to a syntax error in line 23 (I think where the unit creating process begins) and I can't figure it out. Please help! Here is the code:
This is my first attempt at SLIC and I wouldn't be suprised if there are many errors.
Code:
//Quickstart Mod SLIC
//events
HandleEvent(CreateCity) 'citycreate' post {
int_t a;
//set value of a
a = 1;
if(hasAdvance(player[0], AdvanceDB(ADVANCE_FEUDALISM))) {
a = 2;
}
if(hasAdvance(player[0], AdvanceDB(ADVANCE_GUNPOWDER))) {
a = 3;
}
if(hasAdvance(player[0], AdvanceDB(ADVANCE_ADV_INFANTRY_TACTICS))) {
a = 4;
}
//make free unit
if(a = 1) {
CreateUnit(player[0], UnitDB(UNIT_HOPLITE), city[0].location, 0);
}
if(a = 2) {
CreateUnit(player[0], UnitDB(UNIT_PIKEMEN), city[0].location, 0);
}
if(a = 3) {
CreateUnit(player[0], UnitDB(UNIT_INFANTRYMAN), city[0].location, 0);
}
if(a = 4) {
CreateUnit(player[0], UnitDB(UNIT_MARINE), city[0].location, 0);
}
//increase city size to 3 (5 if build with urban planner)
{AddPops(city[0], 4);
}
}

)
Thanks Cube.
).......
Actually I've been extremely busy with some real-life affairs and stuff (school, work, social live, you know the drill) but I'm slowly getting back to CtP. (BTW, I apologize for all unanswered emails, I'll deal with those later).
).
Comment