Jump to content

[Tutorial] Easy making of a Moving image billboard on a map.


Recommended Posts

Hello guys, Here today i got a very simple way of getting a billboard with a static image that moves (Yes it moves!, and it is noob-proof), using the UV-Scripted files from the wiki.

Lets do it by steps. (I'm going to make it as i did on my map, Intervalia 2.)


Download the "UV Scripted" Shader from the wiki..




Unzip it and add it to your map folder:



Edit meta and add the Lines requiered..

<script src="c_uv_scripted.lua" type="client" /> 
<file src="uv_scripted.fx" type="client" /> 
<file src="include/tex_matrix.fx" type="client" /> 
<file src="images/env3.bmp" type="client" /> 



Edit the image at "images" folder for the one you want!

(NOTE: EDIT THE BMP FILE, AND IF U CHANGE IT, SAVE IT AS BMP and make sure is is the same name!)

(I added this one in my case) <- Click for link



Open the "c_uv_scripted.lua" file with notepad, or your preferred lua editor.

Scroll down (or search) This lines:

            -- Create object with model 4729 (billboard)            local x,y,z = getElementPosition( getLocalPlayer() ) 
            createObject ( 4729, x-15, y, z+3 ) 


6#: Replace them with the following lines: (Keep it open on those lines, dont close it!)

            -- Create object with model 4729 (billboard) 
            createObject ( 4729, x, y, z, rx, ry, rz ) 

7#: Go to your map and create a billboard (Model "4729") where you want to place it, and get its coords. (After getting them, delete the object.)


8#: Now go back to the lines we placed on step 6, and replace the "X Y Z" with the "X Y Z" Values from the position, and the "RX RY RZ" values from the rotation ones. Save and close the file. (Told you to keep it open!)

In my case:


9#: Now profit! congratulations, it should have a pretty nice effect once you play the map.




Hope it helps.



Link to comment

Thanks Guys, i've put some hours of work on this tutorial.

Btw, Thanks for the help of Hunterix, here you got an extra:

Hello guys, if you want to add more shaders and make them global, just change these lines:

(Note that you will have to add more lines with createObject)

-- Apply to world texture 
engineApplyShaderToWorldTexture ( myShader, "bobo_2" ) 
-- Create object with model 4729 (billboard) 
createObject ( 4729, X, Y, Z, RX, RY, RZ ) 


-- Create object with model 4729 (billboard) 
createObject(4729, X, Y, Z, RX, RY, RZ ) 
-- Apply to world texture 
objectShader = createObject 
engineApplyShaderToWorldTexture ( myShader, "bobo_2",objectShader ) 

Link to comment
  • 2 years later...
  • 11 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...