View Single Post
PurpleJazz PurpleJazz's Avatar

JCF Member

Joined: Aug 2006

Posts: 823

PurpleJazz is OFF DA CHARTPurpleJazz is OFF DA CHARTPurpleJazz is OFF DA CHART

Jan 6, 2018, 10:38 AM
PurpleJazz is offline
Reply With Quote
Quote:
Originally Posted by AvalancheMaster View Post
Single Player indeed. I included that line, but it still doesn't seem to work.
My bad; I overlooked the fact that your code was probably intended for SP and forgot to accommodate it accordingly.

The following script has been tested and works perfectly for me, so if this still doesn't work it means that there may be an error elsewhere in your script.

Code:
void onLevelBegin() {
    for (int x = 0; x < jjLayerWidth[4]; x++) {
        for (int y = 0; y < jjLayerHeight[4]; y++) {
            if (jjEventGet(x,y) == AREA::SLIDE) {
                jjOBJ@ o = jjObjects[jjAddObject(OBJECT::STEADYLIGHT, (x*32)+16, (y*32)+16)]; //add in middle of tiles
                o.light = 20;
                o.lightType = 3;
                o.deactivates = false;
            }
        }
    }
}

void onLevelReload() {
    onLevelBegin(); //add lights again after death
}