| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
hpl2:tutorials:level_editor:dynamic_curtains [2014/02/23 11:12] amn |
hpl2:tutorials:level_editor:dynamic_curtains [2014/02/23 11:19] (current) amn |
||
|---|---|---|---|
| Line 5: | Line 5: | ||
| We can simulate the action of wind over curtains by using the plastic curtain from AMFP and the force function. | We can simulate the action of wind over curtains by using the plastic curtain from AMFP and the force function. | ||
| - | 1. Get the files [[http://www.moddb.com/mods/the-raven|LINK]] | + | ==== 1. Get the files ==== |
| \\ | \\ | ||
| You need a modified version of the curtains that better respond to force.\\ | You need a modified version of the curtains that better respond to force.\\ | ||
| - | You can create your own version or just use the ones I already did in my mod. | + | You can create your own version or just use the ones I already did in my mod. [[http://www.moddb.com/mods/the-raven|LINK]] |
| - | Note: If you want to create your own version, make sure its bodies respond properly to force\\ | + | //Note: If you want to create your own version, make sure its bodies respond properly to force\\ |
| - | and behave correctly when moving, no lag, no weird things. Also remove collision with player.\\ | + | and behave correctly when moving, no lag, no weird things. Also remove collision with player.// \\ |
| \\ | \\ | ||
| The files for the curtains are inside **/models/curtains** | The files for the curtains are inside **/models/curtains** | ||
| - | + | ==== 2. Place the curtains. ==== | |
| - | 2. Place the curtains. | + | |
| \\ | \\ | ||
| Line 22: | Line 21: | ||
| Then resize its width all you want, remember the model is initially thin.\\ | Then resize its width all you want, remember the model is initially thin.\\ | ||
| //Note: **Curtains_Dynamic_001.ent** is transparent, the 002 is normal and the rest 003 and 004 are experimental copies, ignore those. // | //Note: **Curtains_Dynamic_001.ent** is transparent, the 002 is normal and the rest 003 and 004 are experimental copies, ignore those. // | ||
| - | + | ==== 3. Write the code. ==== | |
| - | 3. Write the code. | + | |
| The code below starts a loop function that randomly pushes the curtains and plays the wind sound. | The code below starts a loop function that randomly pushes the curtains and plays the wind sound. | ||
| Line 48: | Line 46: | ||
| You can also change any given value -like the force- to get better results.// | You can also change any given value -like the force- to get better results.// | ||
| - | Extra Info | + | ==== Extra Info ==== |
| - | - The sound **TR_spooky_wind_whirl . snt ** is the wind sound I used, you can use another one, remember to change the name in the function.\\ | + | - The sound **TR_spooky_wind_whirl.snt ** is the wind sound I used, you can use another one, remember to change the name in the function.\\ |
| - "Curtain_1" is the name of my curtain, yours may be different.\\ | - "Curtain_1" is the name of my curtain, yours may be different.\\ | ||
| - | - The original code in my mod is a little more complex, you may want to check it out. | + | - The original code in my mod is a little more complex, you may want to take a look. |
| Amn.- | Amn.- | ||