Thread: GMSI
View Single Post
Old 08-21-2009, 11:28 PM   #82
Gwypaas
User
 
Join Date: Oct 2007
Posts: 170

Submissions (2)

Gwypaas is on a distinguished road (11)

Default

I'm running into a problem when I'm using GMSI. (I'm using v2.1.18)

I have some code which should just insert an ability into a tower, that seems to work. But, the triggers somehow gets messed up, the code is shifted 1 row down in the list but the name stays and some triggers are just pointing to nothing which causes WE to crash.


My code: (I know some parts of it is not that nice coded but it works :P)
PHP Code:
include("dialog.gsl");
include(
"objects.gsl");
include(
"commaList.gsl");

string mapFile = (@args[0] == null?fileDialog("Choose a map",@inputPath,".w3x"):@args[0]); 
if(
mapFile == nullfail("Choose a map file!");

Map map loadMap(mapFilefalsefalse);

for(
string s:map.objects){ 
    if(!(
map.objects[s] instanceof Unit) ) continue;
        if(!(
map.objects[s].Hotkey == "T")) continue;
            if(!(
map.objects[s].rangeN1 >= 400)) continue;
                
map.objects[s].abilList listInsert(map.objects[s].abilList"A0H9");
                
echoln("set tower_ranges['"+getObjectId(map.objects[s])+"'] = "+map.objects[s].rangeN1+"  // "+map.objects[s].Name);
}


string outpath = @outputPath "/" + ("U-"+map.fileName) ;
echo(
"\n\nSaving map to " outpath +"\n\n");        
saveMap(map,outpath); 


Edit - I got another problem but this is with the IO library.

I have this code but it causes an syntax error.

Code:
PHP Code:
include("io.gsl");
Writer w

Error: script.SyntaxError: Syntax error in line 5 in file iotest.gsl: Writer ->w<- ; <EOF> (Identifyer)
49Insert semicolon ";" to finish previous statement
Gwypaas is offline   Reply With Quote