Quote:
Originally Posted by samich
You can change level links via script? How would you go about doing that, if you don't mind me asking? I haven't done much level manipulation via script.
|
You have like a template level. You always load that one file as a text (using
loadLines() or whatever you want to use) and have the script look for a certain warp you want to manipulate (lets say the format is 'LINK 30 30 some_level.nw' ; I'm not too sure didn't check it). After you've found that / them, you simply alter the Level name like:
PHP Code:
temp.newlevel = "new_level.nw";
temp.line = yourFoundLINKLocationInsideTheFile.tokenize();
// LINK x y levelname
temp.line = temp.line[0] SPC temp.line[1] SPC temp.line[2] SPC temp.newlevel
and save those edited lines via
saveLines() as a new level. Make sure to keep your level template unedited - it's a template
TBH I've never really tried editing the links directly like that, but that's the way that I can think of right now. Probably would end up changing it all again