Apolyton Archive  |  Preserved copy of the Apolyton Civilization Site and its forums as they stood in September 2005. Read-only; nothing here can be posted to or replied to.  |  Forum index |  About this archive |  The 1998–2001 UBB forums
Today on Apolyton WARDELL INTERVIEW PROMO A.C.S. HISTORY CHAPTER 4 GET CIV4 /w FREE PLUS! A.C.S. PHOTO GALLERY GET A.O.M. V1.1
Apolyton Civilization Forums
main| civ2| civ3| civ4| smac| ctp2| ron| moo3| galciv| galciv2| alt| about|
ApolytonPLUS | register | search | faq | new posts | pm (-/-) | upload | members
hall of fame new! | civgroups | civgroups news | interviews | the column | radio | chat | directory | news | store | PLUS
Apolyton Civilization Forums : Powered by vBulletin version 2.0.3 Apolyton Civilization Forums > Miscellaneous > Archive > CtP2-Creation/AI/Mods/Scenarios-Archive > SLIC for Mars
Show a Printable Version | Email This Page to Someone! | Receive updates to this thread | Report this to Apolyton news!

bottom of page
  
Author
Thread    < Last Thread     Next Thread > Post New Thread     Post A Reply
Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:14
Post  Old Post 04-04-2001 00:20 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
SLIC for Mars Support Apolyton, buy Civilization: The Boardgame

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 is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:14
Post  Old Post 05-04-2001 03:42
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Support Apolyton buy from Amazon

*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 is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:14
Post  Old Post 05-04-2001 14:50 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Got spare money?

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 is offline Dale
King
Sir! Why do you keep clicking on me?
Dec 2000
time: 15:14
Post  Old Post 06-04-2001 04:07
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Browse Apolyton AD-FREE

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 is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:14
Post  Old Post 09-04-2001 14:13 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton buy from Amazon

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 is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:14
Post  Old Post 10-04-2001 16:37 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Increase the size of your Attachments

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 is offline kaan
Prince
Aarhus
Mar 2001
time: 05:14
Post  Old Post 10-04-2001 17:41
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Support Apolyton, buy GURPS/ Alpha Centauri

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 is offline kaan
Prince
Aarhus
Mar 2001
time: 05:14
Post  Old Post 10-04-2001 18:12
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Tired of ads?

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 is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:14
Post  Old Post 11-04-2001 22:09 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#9 Report this post to a moderator
Got spare money?

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

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:14.
Apolyton Time is 00:14.
    top of page
Rate This Thread:
archivepost
Forum Jump:
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
 




Contact Us - Apolyton Civilization Site - Support Us!

Building a better Apolyton through better information. Click here and take our poll!
Non-US visitors, click here!

Powered by: vBulletin Version 2.0.3
Copyright ©2000, 2001, Jelsoft Enterprises Limited.

Page generated in 0.0392 seconds (87.40% PHP - 12.60% MySQL) with 31 queries
Page Loading Time:

Support Apolyton: Amazon USA | Amazon UK | Amazon DE | Amazon FR |
Support Apolyton and get FREE PLUS, Buy from Chips&Bits: Galactic Civilizations | Galactic Civilizations: Deluxe Edition | Call to Power 2 | Civilization: The Boardgame | GURPS/ Alpha Centauri | Alpha Centauri | Civilization IV | Civilization III: Complete |


Front Page | Civilization IV | Civilization III | Civilization II | Call to Power II | Alpha Centauri | Master of Orion III
Rise of Nations | Galactic Civilizations | Galactic Civilizations II | Misc
Alt.Civs | Civ I | C:CtP I | About | News | Directory | Apolyton Store | Forums | Chat | Columns | Interviews | Newsletter
Scenario League | CSC | Clash of Civs | Spanish Site | CtP Maps | Cradle of Civ | WesW's Ctp1/2 Site | Civ3 Haven

apolyton.net | apolyton.com | civilization2.net | civilization3.net | civilization4.net | civilizationiv.info | calltopower.net | galciv.net | galciv2.net | moo3.net