My upcoming Scenario, The Persian Wars, Is my 1st SLIC trial. I have already correcty positioned the units and layed a base for city Placemnt, so I decided I'd start on slic. BUt already the Game ont load because of asyntax error in line 4.
Code:
scenario.slc
// Scenario script for GreecevsPersia, 490 BC - Alpha Version
// Make the Persians REALLY hate you
if(IsPlayerAlive(2)) { // if Persians aren't dead
LogRegardEvent(2, 1, -9999, 0, ID_AG_REGARD_EVENT_NEG, 9999);
#include "message.slc"
#include "AG_mod.slc"
#include "AG_func.slc"
Also, I have all my Civspecific Units Down in AG-mod, but thec changes DONT SHOW UP IN THE GAME. If Slic finds one error, does it stop working?
Code:
AG_mod.slc
//Mod Functions for GreecevsPersia, 490 BC
// Players are can not research past Siege Weapons, Hullmaking, Stirrup, and Ethics
int_f mod_CanPlayerHaveAdvance (int_t thePlayer, int_t theAdvance)
{
if (theAdvance == AdvanceDB(ADVANCE_SIEGE_WEAPONS) | |
theAdvance == AdvanceDB(ADVANCE_SIEGE_WEAPONS) | |
theAdvance == AdvanceDB(ADVANCE_HULL_MAKING) | |
theAdvance == AdvanceDB(ADVANCE_STIRRUP) | |
theAdvance == AdvanceDB(ADVANCE_ETHICS)) {
return 0;
} else {
return 1;
}
}
// Civ Special Units
} elseif ((tmpUnit == UnitDB(UNIT_PIKEMEN)) { // if hopite
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ROMANS")) {
return 1; // Neutral Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ENGLISH")) {
return 1; // Traitorous Greeks can build it
} else {
return 0; // other civs can't
}
} elseif ((tmpUnit == UnitDB(UNIT_MACHINE_GUNNER)) { // if 10000 Immortals
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_CHARIOT)) { // if Chariot
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_INFANTRYMAN)) { // if Spartan Hoplite
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_HOPLITE)) { // if Hoplite Militia
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ROMANS")) {
return 1; // Neutral Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ENGLISH")) {
return 1; // Traitorous Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_COMPOSITE_ARCHER)) { // if Persian Archer
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_TEUTONIC_KNIGHT)) { // if Greek Heavy Cavalry
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_JAVELIN_CAVALRY)) { // if Gr. Light Cavalry
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ROMANS")) {
return 1; // Neutral Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ENGLISH")) {
return 1; // Traitorous Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_HYPASPISTS)) { // if Elite Hoplite
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_HORSEMAN)) { // if Persian Heavy Cavalry
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_ARCHER)) { // if Gr. Archer
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ROMANS")) {
return 1; // Neutral Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ENGLISH")) {
return 1; // Traitorous Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_PARATROOPER)) { // if Militia
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_PEZHETEROI)) { // if Persian Infantry
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} else { // if other unit
return 1; // everyone can always build it
}
}
in AG_mod it says that there is a syntax error on line 19, but I can't find it. None of the instructions I gave it came through, Though I didn't check the research Technology one.
thanx for any help.
[This message has been edited by Chris B (edited March 13, 2001).]
Code:
scenario.slc
// Scenario script for GreecevsPersia, 490 BC - Alpha Version
// Make the Persians REALLY hate you
if(IsPlayerAlive(2)) { // if Persians aren't dead
LogRegardEvent(2, 1, -9999, 0, ID_AG_REGARD_EVENT_NEG, 9999);
#include "message.slc"
#include "AG_mod.slc"
#include "AG_func.slc"
Also, I have all my Civspecific Units Down in AG-mod, but thec changes DONT SHOW UP IN THE GAME. If Slic finds one error, does it stop working?
Code:
AG_mod.slc
//Mod Functions for GreecevsPersia, 490 BC
// Players are can not research past Siege Weapons, Hullmaking, Stirrup, and Ethics
int_f mod_CanPlayerHaveAdvance (int_t thePlayer, int_t theAdvance)
{
if (theAdvance == AdvanceDB(ADVANCE_SIEGE_WEAPONS) | |
theAdvance == AdvanceDB(ADVANCE_SIEGE_WEAPONS) | |
theAdvance == AdvanceDB(ADVANCE_HULL_MAKING) | |
theAdvance == AdvanceDB(ADVANCE_STIRRUP) | |
theAdvance == AdvanceDB(ADVANCE_ETHICS)) {
return 0;
} else {
return 1;
}
}
// Civ Special Units
} elseif ((tmpUnit == UnitDB(UNIT_PIKEMEN)) { // if hopite
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ROMANS")) {
return 1; // Neutral Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ENGLISH")) {
return 1; // Traitorous Greeks can build it
} else {
return 0; // other civs can't
}
} elseif ((tmpUnit == UnitDB(UNIT_MACHINE_GUNNER)) { // if 10000 Immortals
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_CHARIOT)) { // if Chariot
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_INFANTRYMAN)) { // if Spartan Hoplite
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_HOPLITE)) { // if Hoplite Militia
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ROMANS")) {
return 1; // Neutral Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ENGLISH")) {
return 1; // Traitorous Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_COMPOSITE_ARCHER)) { // if Persian Archer
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_TEUTONIC_KNIGHT)) { // if Greek Heavy Cavalry
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_JAVELIN_CAVALRY)) { // if Gr. Light Cavalry
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ROMANS")) {
return 1; // Neutral Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ENGLISH")) {
return 1; // Traitorous Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_HYPASPISTS)) { // if Elite Hoplite
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_HORSEMAN)) { // if Persian Heavy Cavalry
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_ARCHER)) { // if Gr. Archer
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("GREEKS")) {
return 1; // Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ROMANS")) {
return 1; // Neutral Greeks can build it
} elseif (PlayerCivilization(tmpCity.owner) == CivilizationIndex("ENGLISH")) {
return 1; // Traitorous Greeks can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_PARATROOPER)) { // if Militia
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} elseif ((tmpUnit == UnitDB(UNIT_PEZHETEROI)) { // if Persian Infantry
if (PlayerCivilization(tmpCity.owner) == CivilizationIndex("PERSIANS")) {
return 1; // Persians can build it
} else {
return 0; // other civs can't
} else { // if other unit
return 1; // everyone can always build it
}
}
in AG_mod it says that there is a syntax error on line 19, but I can't find it. None of the instructions I gave it came through, Though I didn't check the research Technology one.
thanx for any help.
[This message has been edited by Chris B (edited March 13, 2001).]
Comment