Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site forums as they ran on Ultimate Bulletin Board, 1998–2001. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 2005 site & forums

  Apolyton Civilization Site Forums
  CtP2-Creation
  SLIC for Mars

Post New Topic  Post A ReplyPost A Reply In A New Window

profile | register | preferences | faq | search next newest topic | next oldest topic bottom of page
Author
Topic:   SLIC for Mars Format for Better Printing
Immortal Wombat
Warlord
...of all Sussex
Dec 2000
posted April 03, 2001 15:20   Click Here to See the Profile for Immortal WombatClick Here to Email Immortal Wombat  send a private message to Immortal WombatSend a Message to UIN: 114083698
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Though directly related to my scenario, a SLIC question probably fits in better here.

I tried this SLIC to get a settler into every capital city every 24 turns, and I get no error messages, so far so good...
Then it doesn't work - no settlers, no errors, what am I doing wrong?

code:

HandleEvent(beginturn) 'settlercount' pre{
int_t SettlerCount;
city_t tmpCity;
int_t i;
(SettlerCount = SettlerCount + 1);
if(SettlerCount == 3){
for(i = 0; i < 8; i = i + 1){ //how do I get "number of players" instead of 8 ?
if(isplayeralive(i)){
tmpCity = player[i].capital;
createunit(player[i], UnitDB(UNIT_SETTLER), tmpCity.location, 0);
}
}
settlercount = 0;
}
}

Any ideas?

*cough* Dale *cough*
Thanks
Ben

Dale
Prince
Melbourne, Australia
Dec 2000
posted April 04, 2001 18:42   Click Here to See the Profile for DaleClick Here to Email Dale  send a private message to Dale Visit Dale's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
*cough* OK *cough*

Let's have a look shall we.......

code:

HandleEvent(beginturn) 'SettlerCaptialCreate' pre{ // SettlerCount won't work as it's a variable below
int_t SettlerCount;
city_t tmpCity;
int_t i;
int_t NumOfPlayers; // What it says
location_t tmpLoc; // Location of Capital
NumOfPlayers = preference("NumPlayers"); // How to 'get' # of players
if(IsHumanPlayer(player[0])) { // Increases SettlerCount only once per turn, not NumOfPlayers times per turn
SettlerCount = SettlerCount + 1; // Take out brackets
}
if(SettlerCount == 3){
for(i = 1; i < NumOfPlayers; i = i + 1){ // i=1 means don't do for barbs
if(IsPlayerAlive(i)){ // Note capital letters.....
GetCityByIndex(i, 0, tmpCity); // Get Capital city
tmpLoc = tmpCity.location; // Get location of city
CreateUnit(i, UnitDB(UNIT_SETTLER), tmpLoc, 0);
}
}
SettlerCount = 0;
}
}

------------------
Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back."

Immortal Wombat
Warlord
...of all Sussex
Dec 2000
posted April 05, 2001 05:50   Click Here to See the Profile for Immortal WombatClick Here to Email Immortal Wombat  send a private message to Immortal WombatSend a Message to UIN: 114083698
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Thanks a lot Dale, if I ask enough times I might get it right once in a while

One thing though, I read in the Activision documentation that Slic was case-insensitive, or is that just for ElSeiF statements ?

What was my code actually doing then? ?

Dale
Prince
Melbourne, Australia
Dec 2000
posted April 05, 2001 19:07   Click Here to See the Profile for DaleClick Here to Email Dale  send a private message to Dale Visit Dale's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Only some things are case-sensitive. For example, events are case sensitive, routines are case-sensitive, variables are case-sensitive. Plus, after doing a few years programming I'm just in the habit of using capitals.

Your script was actually doing this.

1. Enter the script and initialise the variables.
2. Pass over the SettlerCount = line as it was in brackets.
3. Check SettlerCount to see if it's 3, but it's never 3 (see line above).
4. Exit script.

------------------
Rommell to a sub-commander outside Tobruk: "Those Australians are in there somewhere. But where? Let's advance and wait till they shoot, then shoot back."

Immortal Wombat
Warlord
...of all Sussex
Dec 2000
posted April 09, 2001 05:13   Click Here to See the Profile for Immortal WombatClick Here to Email Immortal Wombat  send a private message to Immortal WombatSend a Message to UIN: 114083698
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Thanks for clearing those things up Dale, I might get the hang of this some time...

------------------
Whoever said SLIC was easy once you got used to it, was probably telling the truth. If anyone tells you that getting used to it was easy - they're lying
[This message has been edited by Immortal Wombat (edited April 10, 2001).]

Immortal Wombat
Warlord
...of all Sussex
Dec 2000
posted April 10, 2001 07:37   Click Here to See the Profile for Immortal WombatClick Here to Email Immortal Wombat  send a private message to Immortal WombatSend a Message to UIN: 114083698
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Problem Number 2:
Assume all the variables are defined at the top of the slc page. I'm sure I have pretty much used the code in the same way its used in Alex.scn and samurai scenario, and I'm fed up. Can you help again? thanks

code:

HandleEvent(BeginTurn) 'GiveResourcesA' pre {
int_t tmpPlayer;

player[0] = tmpPlayer; //player[0] - the player whose turn is beginning is stored
if(tmpPlayer == 1) { // if the stored player is player 1...
PwcountA = PwcountA + 1; //then their pw counter is added to
if(PwcountA == 3){ // if it is now 3...
player[0].publicworkslevel = tmpPwA; // then store it (Error: Symbol player is not a struct)
tmpPw2A = tmpPwA + 5000; // add 5000 to it, and store that as another variable
setPW(tmpPlayer, tmpPw2A); // make the player's pw the new variable
PwcountA = 0; // and set the counter to zero
}
}
}



kaan
Chieftain
Denmark
Mar 2001
posted April 10, 2001 08:41   Click Here to See the Profile for kaanClick Here to Email kaan  send a private message to kaan Visit kaan's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
player[0].publicworkslevel = tmpPwA;

needs to be:

tmpPwA = player[0].publicworkslevel;

you assign values from the left side of "=" to the right side.

you could put it like this:

tmpPwa "is set equal to" player[0].publicworkslevel

-klaus

kaan
Chieftain
Denmark
Mar 2001
posted April 10, 2001 09:12   Click Here to See the Profile for kaanClick Here to Email kaan  send a private message to kaan Visit kaan's Homepage!
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
these are my notes to all the code:

code:

HandleEvent(BeginTurn) 'GiveResourcesA' pre {
int_t tmpPlayer;
tmpPlayer = g.player; // g.player is the current player
if(tmpPlayer == 1) { // why player 1 ???
PwcountA = PwcountA + 1;
if(PwcountA == 3){ // this line will only run if
// tmpPlayer = 1 , see above
tmpPwA = tmpPlayer.publicworkslevel;
tmpPw2A = tmpPwA + 5000; // why not tmpPwA = tmpPwA + 5000;
setPW(tmpPlayer, tmpPw2A); // if above then
// setPW(tmpPlayer, tmpPwA);
PwcountA = 0;
}
}
}

-klaus

Immortal Wombat
Warlord
...of all Sussex
Dec 2000
posted April 11, 2001 13:09   Click Here to See the Profile for Immortal WombatClick Here to Email Immortal Wombat  send a private message to Immortal WombatSend a Message to UIN: 114083698
Edit/Delete Message    Reply To And Quote This Message
IP: Logged, Admin Access Only
Goddamnit, I HATE SLIC

but I'll carry on trying. There are too few things I find challenging

Thanks a lot klaus!!

quote:

Originally posted by kaan on 04-10-2001 09:12 AM
these are my notes to all the code:

code:

HandleEvent(BeginTurn) 'GiveResourcesA' pre {
int_t tmpPlayer;
tmpPlayer = g.player; // g.player is the current player
if(tmpPlayer == 1) { // why player 1 ???
PwcountA = PwcountA + 1;
if(PwcountA == 3){ // this line will only run if
// tmpPlayer = 1 , see above
tmpPwA = tmpPlayer.publicworkslevel;
tmpPw2A = tmpPwA + 5000; // why not tmpPwA = tmpPwA + 5000;
setPW(tmpPlayer, tmpPw2A); // if above then
// setPW(tmpPlayer, tmpPwA);
PwcountA = 0;
}
}
}


right...
player1 only because I need to have separate triggers to disable for each player, there will be duplicate triggers for each player.
tmpPw2 is in there so it is more easy for me to see where I'm going wrong.

Anyway, thanks a lot to you klaus, and Dale also for the first answer, things are looking up.

Ben

Apolyton Civilization Site Forums
> > > CtP2-Creation Forum

next newest topic | next oldest topictop of page

All times are EDT

Administrative Options: Close Topic | Archive/Move | Delete Topic | Top
Post New Topic  Post A ReplyPost A Reply In A New Window
Hop to:

Contact Us
Apolyton Civilization Site

Powered by: Ultimate Bulletin Board, Version 5.44a
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.

AltaVista Type or paste text or Web address (beginning with http://) here:
Powered
by Systran
Translate from: 

Front Page | Civilization III | Dinosaurs | Civilization II | Call to Power | Call to Power II | Alpha Centauri | Alternative Civs | Misc | Links | About ACS | GameStats
GameLeague | Scenario League | HAC | Civilization Scenario Collection | Spanish CivII Site | Clash of Civs | CtP Maps | Art of War | WesW's Ctp1/2 Site