Jump to content

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


.:HyPeX:.

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.)

1#:

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

https://wiki.multitheftauto.com/wiki/Shader_examples

zwMhiqF.png

2#:

Unzip it and add it to your map folder:

nVmyPgS.png

3#:

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" /> 

4gr2tJo.png

4#:

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

r45OrMM.png

5#:

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 ) 

44j9AuT.png

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.)

t3HH8Re.png

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:

ySLIvOU.png

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

lda6VhR.png

CYpnUFW.png

62J1WUX.png

Hope it helps.

Greetz

HyPeX

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 ) 

With:

  
-- 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...