Plazma Burst 2 Map Editor Manual
Map Editor Manual v.5.7.0
Map Editor Manual v.5.7.0
  • Map Editor Manual v.5.7.0
  • Changelogs
  • Credits / Special thanks
  • Plazma Burst 2 Official Website
  • Laserguide's Map mapping Tools
  • [Old version] pdf takeaway edition
  • ALE Improvements
  • 🗺️The Surface of the level editor
    • Old level editor
    • New level editor
    • Map Edit Page
  • 🛠️The tools
    • Free Edit tool
      • The Shortcuts
    • Add Wall
    • Add Movable
    • Add Region
    • Add Background
    • Add Pushing area
    • Add Water
    • Add Player
    • Add Actor (enemy)
    • Add Vehicle
    • Add Decoration
    • Add Weapon
    • Add Lamp
    • Add Barrel
    • Add Trigger
    • Add Timer
    • Add Engine Mark
    • Scale Selection Tool
    • Add Song
  • 🪑Tables of Level Editor
    • Character Data Table
    • Character Skin Color Table
    • Trigger Action Table
      • Movable
        • Basic Movable Tutorial
      • Region
      • Vehicle
      • Character
      • Gravity
      • Scenario
        • Tutorial 9 & 50
      • Gun
      • Barrel
      • Trigger
      • Timer
      • Decoration
        • Blending Mode
      • Gravitator area field
      • Gameplay
      • Sound
      • Interface
      • Light
      • Trigger execution
      • Var
        • Inventory Info Tutorial
        • Synchronization of variables
        • Key binding in multiplayer
      • Session vars
      • URL
        • URL Request Tutorial
      • AI
      • Environment
      • Text-to-speech
      • Map preview
      • Experience
      • Array
        • What is array?
        • Matrix Coloring System
      • Graphics
      • Water
      • Miscellaneous
    • Engine Mark Table
      • Sky Code Table
    • Sound Library Table
    • Newer Weaponry Data
      • Weaponry Data
    • Projectiles Model Table
    • Text-to-speech Voice Table
    • Application Table
  • 🐛tables of debug
    • Cheat Codes
    • Error Codes Identification
  • 🔫Secret Weaponry
    • Campaign Maps
    • Alternate method to add Water UID
    • "Fake" Collision
    • Secret Theme "4"
    • More Accurate Snipping
      • History of contributions.
    • Custom Image in Theme Purple/Green
    • Check map
    • Phsc's image import to map source
    • XML Output in Map Editor
    • createColorMatrix Script
  • ☑️Approval-Military
    • Map Approval Requirements
    • Custom Decoration Guidelines
  • 🧘‍♀️Inspirational
    • Trivia
    • Resi Map making inspiration
    • Max Teabag Map making inspiration
    • Reject Map making basics
    • Illijah's Map making experience
  • Placeholder
Powered by GitBook
On this page

Was this helpful?

  1. Secret Weaponry

createColorMatrix Script

2 Input and 2 Output colors -> matrix supported flash format —— N0N4M3_

This script uses the original color of the weapon, and the final result of color, to convert into flash supported matrix.

The way to execute the script is by pasting this function just below the function:

createColorMatrix([76, 76, 76], [32, 32, 32], [96, 95, 77], [128, 32, 0]);

//([first input RGB], [first output RGB], [second input RGB], [second output RGB]);

Anyways, here's the code you had to paste in console, at the advanced level editor:

function solveSystem(x1, x2, r1, r2) {
	let x = x1 - x2;
	let r = r1 - r2;
	let m = r / x;
	let b = r1 - m * x1;
	
	return [m, b];
}

function createColorMatrix(input1, output1, input2, output2) {
	let mainColor = Math.max(Math.abs(input1[0] - input2[0]), Math.abs(input1[1] - input2[1]), Math.abs(input1[2] - input2[2]));
	
	if (mainColor == Math.abs(input1[0] - input2[0])) {
		mainColor = 0;
	}
	
	if (mainColor == Math.abs(input1[1] - input2[1])) {
		mainColor = 1;
	}
	
	if (mainColor == Math.abs(input1[2] - input2[2])) {
		mainColor = 2;
	}
	
	let solution1 = solveSystem(input1[mainColor], input2[mainColor], output1[0], output2[0]);
	let solution2 = solveSystem(input1[mainColor], input2[mainColor], output1[1], output2[1]);
	let solution3 = solveSystem(input1[mainColor], input2[mainColor], output1[2], output2[2]);
	
	let matrix = [];
	
	if (mainColor == 0) {
		matrix.push(solution1[0]);
		matrix.push(0);
		matrix.push(0);
		matrix.push(0);
		matrix.push(solution1[1]);
		
		matrix.push(solution2[0]);
		matrix.push(0);
		matrix.push(0);
		matrix.push(0);
		matrix.push(solution2[1]);
		
		matrix.push(solution3[0]);
		matrix.push(0);
		matrix.push(0);
		matrix.push(0);
		matrix.push(solution3[1]);
		
		matrix.push(0);
		matrix.push(0);
		matrix.push(0);
		matrix.push(1);
		matrix.push(0);
	}
	
	if (mainColor == 1) {
		matrix.push(0);
		matrix.push(solution1[0]);
		matrix.push(0);
		matrix.push(0);
		matrix.push(solution1[1]);
		
		matrix.push(0);
		matrix.push(solution2[0]);
		matrix.push(0);
		matrix.push(0);
		matrix.push(solution2[1]);
		
		matrix.push(0);
		matrix.push(solution3[0]);
		matrix.push(0);
		matrix.push(0);
		matrix.push(solution3[1]);
		
		matrix.push(0);
		matrix.push(0);
		matrix.push(0);
		matrix.push(1);
		matrix.push(0);
	}
	
	if (mainColor == 2) {
		matrix.push(0);
		matrix.push(0);
		matrix.push(solution1[0]);
		matrix.push(0);
		matrix.push(solution1[1]);
		
		matrix.push(0);
		matrix.push(0);
		matrix.push(solution2[0]);
		matrix.push(0);
		matrix.push(solution2[1]);
		
		matrix.push(0);
		matrix.push(0);
		matrix.push(solution3[0]);
		matrix.push(0);
		matrix.push(solution3[1]);
		
		matrix.push(0);
		matrix.push(0);
		matrix.push(0);
		matrix.push(1);
		matrix.push(0);
	}
	
	let name = prompt("Variable name:", "_color");
	
	if (name) {
		let str = 'VarSetValue( "' + name + '", "' + matrix.join(", ") + '" );\nop349( "' + name + '", ", " );\nop403( "#gun*1", "' + name + '" );';
		let textarea = document.createElement("textarea");
		
		document.body.append(textarea);
		textarea.value = str;
		textarea.select();
		document.execCommand("copy");
		textarea.remove();
	}

    window.alert("The code is copied to your clipboard! \nAdd a trigger, switch to text list and paste it to see it works! \nRemember to manually set the guns!");
}

createColorMatrix([76, 76, 76], [32, 32, 32], [96, 95, 77], [128, 32, 0]); //change the numbers to your likings!

After executing this code, it will prompt you to set a variable name of your choice, after that, the code will automatically be pasted onto your clipboard.

Prepare an empty trigger, set it into text mode, paste it, change the guns if you want, then save. Your guns should be color filtered to your likings.

PreviousXML Output in Map EditorNextMap Approval Requirements

Last updated 1 year ago

Was this helpful?

🔫