xtjoeytx / GServer-v2

GNU General Public License v3.0
7 stars 10 forks source link

Level manipulation additions #92

Closed xx-shitai-xx closed 1 year ago

xx-shitai-xx commented 1 year ago

Some functions to enable creation of a online in-game level editor

Closes #59 Closes #60

Adds:

level.links

    let level = findlevel('onlinestartlocal.nw');

    let links = level.links;
    links.add('dest' + i + '.nw', 0, 0, 2, 1, "playerx", "playery");

    let i = 0;
    for (let l of links) {
        sendtorc(i + ' link ' + l.newlevel);
        i++;
    }

    links.remove(0);

level.signs

    let level = findlevel('onlinestartlocal.nw');

    let signs = level.signs;
    signs.add(1, 2, "asd" + i);

    let i = 0;
    for (let s of signs) {
        sendtorc(i + ' sign ' + s.text);
        i++;
    }

    signs.remove(0);

level.chests

    let level = findlevel('onlinestartlocal.nw');

    let chests = level.chests;
    chests.add(1, 2, 11, 0);

    let i = 0;
    for (let c of chests) {
        sendtorc(i + ' chest ' + c.x + ' ' + c.y + ' type: ' + c.itemtype + ' ' + c.signid);
        i++;
    }

    chests.remove(0);

level.npcs - [ ] level.addnpc -> level.npcs.add

Fixes:

Todo: