66
  Modeling
  RWX scripting (Notepad++) (3) - examples
 
9. Modify the color of the model
 
The colors used in the rwx script are not the same as the colors used in the action command scripts in Activeworlds. For the rwx scripting, we use neither the RGB codes, neither the HTMLcodes. That makes it complicated.
Fortunately, there exists a webpage with the comparison of these codes on the website of Alusion.fr , owned by the citizen Heu (#348543).
 
alusion-fr.com/an1z4.htm
 
Here you have a list of the main colours :
For the basic colors, you can use 2 digits behind the komma; but for the other colors; you must use 6 digits behind the komma. Otherwise, when you build the object in your world, you will have an error message, and the object will not load !!!
Original model ma-ufo.rwx in the world Uberpath
Color RWX code
White 1.000000 1.000000 1.000000
Black 0.000000 0.000000 0.000000
   
Red 1.000000 0.000000 0.000000
Blue 0.000000 0.000000 1.000000
Yellow 1.000000 1.000000 0.000000
   
Forestgreen 0.000000 0.400000 0.000000
Green 0.000000 0.600000 0.000000
Lightgreen 0.000000 1.000000 0.000000
   
Orange 1.000000 0.600000 0.000000
Light Orange 1.000000 0.800000 0.200000
   
Pink 1.000000 0.600000 1.000000
Magenta 1.000000 0.000000 1.000000
   
Navy Blue 0.400000 0.400000 1.000000
Light Blue 0.800000 0.800000 1.000000
   
Purple 0.600000 0.200000 0.800000
Brown 0.600000 0.400000 0.200000
Salmon 1.000000 0.800000 0.600000
   
Dark Grey 0.200000 0.200000 0.200000
Grey 0.600000 0.600000 0.600000
Light Grey 0.800000 0.800000 0.800000

 

At the bottom of the rwx script of the ufo model, you will find the different components of the model
 
On line 431, we enter the rwx-color code
Example : a ufo model with another color
 
In this example, we will modify the color of a ufo model: ma-ufo.rwx
This model is part of the objectpath of the world Mars and is part of the Uberpath.
The bodywork of the current model is red, we will one in greenish color :
with rwx color code 0.400000 0.600000 0.600000
 
 
When loading the currrent model (ma-ufo.rwx) in a private world, you will have already an error message on line numbers 3300 4420 and 4606 telling that opcaitfix is wrong.
These line numbers correspond with the line numbers in Notepad++.
So, we will go to these line numbers and modifiy them into : opacityfix
 
step 1 : Copy the model ma-ufo.zip from the Uberpath
step 2 : Create a folder with the name ufo and paste the file into that folder
step 3 : Go to this folder , right-click upon the file and choose "extract/unzip here"
step 4 : Right-click upon file ma-ufo.rwx and rename it into ma-ufogr.rwx
step 5 : Right-click upon file ma-ufogr.rwx and choose "edit with Notepad++"
step 6 : Go to line numbers 3300 4420 and 4606 ,and modify into: opacityfix
step 7 : Go to the bottom of the rwx script (line 6158) . Here you see the different parts of the model : the joystick, the seat, the tank, ..., only the part "spiffship" is red.
step 8 : Copy the word "spiffship" , then press CTRL+F (=find) and paste this word in the search field , and you will see that this is at the start of the rwx script.
step 9 : Scroll down until you find an rwx command-line with "color"
On line 431, you will see : color 1. 0. 0. , this code corresponds with red.
step 10 : Modify line 431 into : color 0.400000 0.600000 0.600000
step 11 : Save the file , and close Notepad++
step 12 : Right-click upon file ma-ufogr.rwx , choose 7zip and "add to archive"
step 13 : Upload the model ma-ufogr.zip to your objectpath
New model : ma-ufogr.rwx