Skip to content
nasafrasa edited this page Apr 19, 2024 · 5 revisions

Functions

Here you will find a list of functions I commonly use in my map scripts.

ReMapper 3.1.2

softRemove

function softRemove(lookup: rm.LOOKUP, id: Array<string>){
    id.forEach((env) =>{
        const sR = new rm.Environment(env, lookup);
        sR.position = [-69420,-69420,-69420];
        sR.push();
    })
};

hardRemove

function hardRemove(lookup: rm.LOOKUP, id: Array<string>){
    id.forEach((env) =>{
        const hR = new rm.Environment(env, lookup);
        hR.active = false;
        hR.push();
    })
};

animateTrack

function animateTrack(time: number, duration: number, track: rm.TrackValue, anim: (x: rm.AnimationInternals.AbstractAnimation) => void) {
    const event = new rm.CustomEvent(time).animateTrack(track, duration);
    anim(event.animate);
    event.push(false);
};

laserMaker

function laserMaker(modelScenename: rm.ModelScene, lasers: number, environment: rm.Environment | rm.Geometry, type: number, name: string, scale?: rm.Vec3, anchor?: Vec3) {
    const laserTracks: string[] = [];
    const laserEnv = environment;
    laserEnv.lightID = 101;
    laserEnv.lightType = type;
    for (let i = 1; i <= lasers; i++) laserTracks.push(name + `${i}`);
    modelScenename.addPrimaryGroups(laserTracks, laserEnv, scale, anchor);
}

ReMapper 4.0.0

Clone this wiki locally