 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:22
|
|
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
|
|
Zurich, Switzerland
Jul 2002 time: 06:22
|
|
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!
|
|
|  |
 |
|
mapfi
|
|
Zurich, Switzerland
Jul 2002 time: 06:22
|
|
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?
|
|
|  |
All times are GMT. The time now is 05:22. Apolyton Time is 00:22. |
top of page
|
| archivepost |
|
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
|
|
|
|
|
|