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 > player[] array
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
mapfi is offline mapfi
Prince
Zurich, Switzerland
Jul 2002
time: 06:22
  Old Post 07-10-2002 12:47
Edit/Delete Message Reply w/Quote
#1 Report this post to a moderator
player[] array Lose 30 kilos (of popups)

Ok, there's a question for the really experienced modders:

simple:
As far as I know, player[0] and [1] are used by the game - any event or function that uses player[2]?

not so simple:
What is the size of this array/the accessable numbers - unlimited?

hard:
When can I store values into this array by writing e.g. player[4] = 2; ? Anytime? Depending on the event? Depending on having assigned [2] and [3]?
Depending on system time?!!?? (the last one is my guess after the game's constantly been making fun of me!)

Immortal Wombat is offline Immortal Wombat
Prince
in perpetuity
Dec 2000
time: 05:22
  Old Post 07-10-2002 14:33 Visit Immortal Wombat's homepage!
Edit/Delete Message Reply w/Quote
#2 Report this post to a moderator
Get a bigger avatar today!

1. I don't think so. Only the diplomacy functions use player[1], nothing should need 3 players stored...

2. unlimited afaik. Certainly up to MaxPlayers in userprofile.txt

3. Yes, you can. Locutus does it in his capital code slic for the MedPack. Should work any time in the code.

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 07-10-2002 14:41
Edit/Delete Message Reply w/Quote
#3 Report this post to a moderator
Support Apolyton, buy Civilization 2

I think the player[] array is just a regular global array like all the others we create. The only difference is that information is given to them by the game engine.

quote:
any event or function that uses player[2]?
Only if there is a event hidden somewhere because any event known by the mods has it.

mapfi is offline mapfi
Prince
Zurich, Switzerland
Jul 2002
time: 06:22
  Old Post 07-10-2002 17:38
Edit/Delete Message Reply w/Quote
#4 Report this post to a moderator
Get a bigger avatar today!

So is there a restriction on read-access by message-strings then?

Or how can you explain that a player[3]=i in a begin turn handler and in the message sent at the same moment gives the errors:

line: (line number of the messagebox text) array: index out of bounds
(and then same line, value lookup failed)

mapfi is offline mapfi
Prince
Zurich, Switzerland
Jul 2002
time: 06:22
  Old Post 07-10-2002 21:52
Edit/Delete Message Reply w/Quote
#5 Report this post to a moderator
Support Apolyton, buy Galactic Civilizations

Ok, I found the solution to the problem I had. Now if anyone is going to write 'Duh, we all know that' I'll be really pissed. I was going nuts on this last night.

Reading the error messages carefully I might have guessed that the problem wasn't the assigning bit but the reading from the array.

Here's the thing:
while this won't work

code:
... player[3] = 5; Level = 6; message(tmpplayer,'Info'); ... messagebox 'Info' { text(ID_newINFO) //newINFO: player[3].civ_name_singular... ...

this will do the trick:
code:
... Level = 6; player[3] = 5; message(tmpplayer,'Info'); ... messagebox 'Info' { text(ID_newINFO) //newINFO: player[3].civ_name_singular... ...

Apparently the value gets kicked immeadetly when a next bit of code is executed.
Duh, we all knew that, didn't we!

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 08-10-2002 05:29
Edit/Delete Message Reply w/Quote
#6 Report this post to a moderator
Suffering from ads?

This really is a surprise for me! I would never had imagined.
Great Work and terrific thread about the slic crazy stuff. Deserves to be topped

PS: Shouldnt the comment numbers in that thread start from 0

Last edited by Pedrunn on 08-10-2002 at 05:40

mapfi is offline mapfi
Prince
Zurich, Switzerland
Jul 2002
time: 06:22
  Old Post 08-10-2002 22:35
Edit/Delete Message Reply w/Quote
#7 Report this post to a moderator
Get a bigger avatar today!

further testing has revealed more:
while

code:
player[3] = x; player[4] = y; message(...);

won't let you access player[3] in the message - it's lost for the reason above
but this will work in a event that uses player[0]
code:
player[0] = x; player[4] = y; message(...);

everything clear?

Pedrunn is offline Pedrunn
King
of Natal, Brazil
Jul 2001
time: 02:22
  Old Post 09-10-2002 02:44
Edit/Delete Message Reply w/Quote
#8 Report this post to a moderator
Lose 30 kilos (of popups)

This is great news for the religion info, isnt it!?!

  < Last Thread     Next Thread > Post New Thread     Post A Reply
All times are GMT. The time now is 05:22.
Apolyton Time is 00:22.
    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.0380 seconds (87.71% PHP - 12.29% 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