Repository navigation
AST.2
nasafrasa edited this page Apr 19, 2024
·
5 revisions
Here you will find a list of functions I commonly use in my map scripts.
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();
})
};function hardRemove(lookup: rm.LOOKUP, id: Array<string>){
id.forEach((env) =>{
const hR = new rm.Environment(env, lookup);
hR.active = false;
hR.push();
})
};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);
};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);
}