Well, seeing as a fully generic structloaderfromfile wouldn't be possible, I went and made this lil' utility to aid in the loadage of structs. I may have went too far though, and created another script... inside of Verge.
...
>_>
Yes, it's a script inside of a engine script designed specifically for loading files into structures. It takes a reference file, turns it into a dictionary, and runs off that dictionary on susceptible victim files, setting variables throughout verge, inside and out of structs.
....
I also thought it was a bit complicated and impractical to use. The test case:
# "defines"
MAX_STATS i:3
MAX_TEST i:5
# hammer time!
0 s:"pushstruct:test"
1 s:"setkey:i:0"
2 s:"string_1D:name:i"
3 s:"string_1D:zomg:i"
4 s:"int_1D:lala:i"
5 s:"int_1D:boogie:i"
6 s:"setkey:j:0"
7 s:"int_2D:stats:i:j:MAX_STATS"
8 s:"add:j:1"
9 s:"lessthan:j:MAX_STATS"
10 s:"goto:7"
11 s:"pushstruct:blarg"
12 s:"null"
13 s:"int_1D:holy:i"
14 s:"int_1D:moly:i"
15 s:"string_1D:ballsack:i"
16 s:"popstruct"
17 s:"add:i:1"
18 s:"lessthan:i:MAX_TEST"
19 s:"goto:2"
20 s:"popstruct"
21 s:"pushstruct:single"
22 s:"int:holy"
23 s:"int:moly"
24 s:"string:ballsack"
loads into these structs
struct _test_struct
{
string name;
string zomg;
int lala;
int boogie;
int stats[3];
_blarg blarg;
}
_test_struct test[5];
struct _blarg
{
int holy;
int moly;
string ballsack;
}
_blarg single;
with this data file:
# refer to test.dict for format
# or whatever
NAM1 OMG1 1 10
100, 101, 102
BLARG_STARTS_HERE
1000, 1001, BLARG1
NAM2 OMG2 2 20
200, 201, 202
BLARG_STARTS_HERE
2000, 2001, BLARG2
NAM3 OMG3 3 30
300, 301, 302
BLARG_STARTS_HERE
3000, 3001, BLARG3
NAM4 OMG4 4 40
400, 401, 402
BLARG_STARTS_HERE
4000, 4001, BLARG4
NAM5 OMG5 5 50
500, 501, 502
BLARG_STARTS_HERE
5000, 5001, BLARG5
1337
31337
lonelyface
END_OF_FILE
I have not tested all of the commands, too, so there may be debugging left still. But the point is, I think I have gone too far, and was wondering if the general opinion out there is that this would be useful or not.
Thoughts? Should I host it here? Will people actually use this monstrosity?