![]() |
|
|
#1 |
|
odd log entry (original unreal engine)
for a gametype i made, i made an actor that records the location of summoned playerstarts and a description of the location in a .ini file, and made it work on multiple maps by having the location and description saved in an array, both in a struct array, like this:
Code:
struct PSList
{
var config vector PlayerStarts[20];
var config string Description[20];
};
var config PSlist Maplist[20];
However, in my log file after trying it, i found a large number of the following error/warning: Warning: ImportText: Illegal array element I have no idea what this means, as I have never seen anything like it before, although im assuming it deals with the struct-in-array, leading me to assume that the best, maybe only, way to get rid of it is to get rid of the struct-array. However, I can't think of any other way to organize the list. Does anyone know what the error means, and how I can get rid of it (if i tried actually using it in the gametype, im assuming it would clutter the log file, as it seems to write several times whenever any of the functions that use the struct-array are accessed)
__________________
A handsome young cyborg named Ace Wooed women at every base, . But once ladies glanced at . His special enhancement They vanished with nary a trace. |
|
|
|
|
|
|
#2 |
|
Registered User
Join Date: May. 7th, 2004
Posts: 64
|
have you tried outputting the elements of the array to make sure they stored properly? it appears to me like some sort of typecasting issue or something -- like it doesn't know how to convert from the data you're trying to input to the data the array is set up to handle.
|
|
|
|
|
|
#3 |
|
ok, im for the most part a newb, so i dont know what you mean by outputting the array...
as for typecasting, there shouldn't be any. the vector array is being populated with vectors (mirroring the 'summon' command, i.e. the exec function sets it to about 72 units in front of the player), and description is being filled with strings, so there shouldn't be any typecasting at all (assuming i know what im talking about, that is)
__________________
A handsome young cyborg named Ace Wooed women at every base, . But once ladies glanced at . His special enhancement They vanished with nary a trace. |
|
|
|
|
|
|
#4 |
|
Registered User
Join Date: May. 7th, 2004
Posts: 64
|
what i mean is that somewhere in your code, you should do some logging i.e.
log(Description) or whatever before you put it into the array. you could also write a quick for loop to output the entire array each time you add an element. by output i mean log, so you can check the results. if you debug it in this way, you can see if you're trying to put something illegal into the array and if so, what it is. |
|
|
|
|
|
#5 |
|
actually, all those vars are config, and they are being saved into a .ini file (properly too. except that because its an array in a struct, there are no returns between entries, making it a huge mess). I did however, add a log in the loop where the playerstarts are supposed to be spawned, which ins't working...
Code:
for (I=0; I<20; I++)
{
if (MapList[Mapnum].PlayerStarts[I] != vect(0,0,0) )
{log("ADD START"); HSPlayerStarts[I]= Spawn(class'HSPlayerStart',,,MapList[Mapnum].PlayerStarts[I]); entries++;}
else
{log("BREAK"); break;}
}
__________________
A handsome young cyborg named Ace Wooed women at every base, . But once ladies glanced at . His special enhancement They vanished with nary a trace. |
|
|
|
|
|
|
#6 |
|
That's a bug in the old engine. You cannot have an array inside a struct.
__________________
Ride to the starlight... there, where heroes lie |
|
|
|
|
|
|
#7 |
|
dammit. is there some other way i can do something similar, other then making both of those have an array length of 400, and manually dividing it up for each map?
__________________
A handsome young cyborg named Ace Wooed women at every base, . But once ladies glanced at . His special enhancement They vanished with nary a trace. |
|
|
|
|
|
|
#8 |
|
Registered User
Join Date: May. 7th, 2004
Posts: 64
|
i'm guessing this won't work, but have you tried using dynamic arrays?
i.e. array<int> MyDynamicArray; then you can use MyDynamicArray.Length = 20, MyDynamicArray[1] = 15, etc. i'm almost sure this won't work, but maybe dynamic arrays won't have the same problem as static ones within structs? actually... maybe instead of making a struct you could make a whole new class? extend actor or whatever and call it NewMapInfo or something. then just say: var config NewMapInfo Maplist[20]; then within NewMapInfo you could have two vars that keep track of the description and player starts or whatever. i don't know if that's possible, but try it out! |
|
|
|
|
|
#9 |
|
im not familar with a dynamic array, but im guessing that it wouldhave the same issue. as for creating a new actor class, i think i would need 20 new classes, to be able to have the twenty needed copies of each array, and have all of them be saved into a .ini, which sounds rather messy. I could try making 20 arrays for each, and get rid of the struct that way. it would probably be just as messy, but it wouldn't require new classes or spawning
__________________
A handsome young cyborg named Ace Wooed women at every base, . But once ladies glanced at . His special enhancement They vanished with nary a trace. |
|
|
|
|
|
|
#10 |
|
You cannot use a dynamic array because they aren't supported in the old engine (at least, not from UnrealScript...). The only thing you can do is change the data type, by having something similar to this:
Code:
struct PSList_s
{
var config vector PlayerStart;
var config string Description;
};
var config PSList_s PSList[20];
var PSList Maplist[20];
__________________
Ride to the starlight... there, where heroes lie Last edited by Winged Unicorn; 24th Jun 2004 at 05:02 AM. |
|
|
|
|
|
|
#11 |
|
well, that won't work, because i needed the array in the struct, because i want to be able to save 20 starting places (as vectors) for 20 maps, in a .ini file, so what you just proposed wouldn't work. Also, for a single map, the .ini would be alot... 'cleaner', as i noticed that in a struct, there are no returns between the entries in the struct (so when i tried putting 40 vars in the one struct, it was a HORRIBLE mess). However, I'm currently working on just having 20 different arrays instead of the struct, and writing to/reading from them with functions. i think it will work.
__________________
A handsome young cyborg named Ace Wooed women at every base, . But once ladies glanced at . His special enhancement They vanished with nary a trace. |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|