<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=Hpl2%3ATutorials%3Alevel_editor%3Adynamic_curtains</id>
	<title>Hpl2:Tutorials:level editor:dynamic curtains - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.frictionalgames.com/page?action=history&amp;feed=atom&amp;title=Hpl2%3ATutorials%3Alevel_editor%3Adynamic_curtains"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:level_editor:dynamic_curtains&amp;action=history"/>
	<updated>2026-04-26T22:57:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:level_editor:dynamic_curtains&amp;diff=884&amp;oldid=prev</id>
		<title>Maintenance script: Upload from wiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:level_editor:dynamic_curtains&amp;diff=884&amp;oldid=prev"/>
		<updated>2020-07-09T13:49:01Z</updated>

		<summary type="html">&lt;p&gt;Upload from wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Dynamic Curtains ===&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
We can simulate the action of wind over curtains by using the plastic curtain from AMFP and the force function.&lt;br /&gt;
&lt;br /&gt;
=== 1. Get the files ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;You need a modified version of the curtains that better respond to force.&amp;lt;br /&amp;gt;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]&lt;br /&gt;
&lt;br /&gt;
''Note: If you want to create your own version, make sure its bodies respond properly to force&amp;lt;br /&amp;gt;and behave correctly when moving, no lag, no weird things. Also remove collision with player.'' &amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;The files for the curtains are inside '''/models/curtains'''&lt;br /&gt;
=== 2. Place the curtains. ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;Put the curtains wherever you want but not touching the wall or each other.&amp;lt;br /&amp;gt;Then resize its width all you want, remember the model is initially thin.&amp;lt;br /&amp;gt;''Note: '''Curtains_Dynamic_001.ent''' is transparent, the 002 is normal and the rest 003 and 004 are experimental copies, ignore those. ''&lt;br /&gt;
=== 3. Write the code. ===&lt;br /&gt;
&lt;br /&gt;
The code below starts a loop function that randomly pushes the curtains and plays the wind sound.&lt;br /&gt;
&lt;br /&gt;
Open your script file and add the following line inside your OnStart() function:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
WindLoop ( &amp;quot;&amp;quot; );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now copy&amp;amp;paste this other function and it's ready.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
void WindLoop  ( string &amp;amp;in rabbit )&lt;br /&gt;
{&lt;br /&gt;
        AddPropImpulse  ( &amp;quot;Curtain_1&amp;quot;,   2,   0.5,   0, &amp;quot;Local&amp;quot; );&lt;br /&gt;
        PlaySoundAtEntity ( &amp;quot;&amp;quot;, &amp;quot;TR_spooky_wind_whirl.snt&amp;quot;, &amp;quot;Curtain_1&amp;quot;, 0, false );&lt;br /&gt;
        AddTimer ( &amp;quot;&amp;quot;, RandFloat (3,5), &amp;quot;WindLoop&amp;quot; );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''That's the most basic way to do it using only one curtain, from here you can add all the curtains you want by copy&amp;amp;pasting the PropImpulse  and PlaySound  lines.&amp;lt;br /&amp;gt;Don't forget to change the name of the curtain. &amp;lt;br /&amp;gt;You can also change any given value -like the force- to get better results.''&lt;br /&gt;
&lt;br /&gt;
=== Extra Info ===&lt;br /&gt;
&lt;br /&gt;
- 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.&amp;lt;br /&amp;gt;- &amp;quot;Curtain_1&amp;quot; is the name of my curtain, yours may be different.&amp;lt;br /&amp;gt;- The original code in my mod is a little more complex, you may want to take a look.&lt;br /&gt;
&lt;br /&gt;
Amn.-&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
		
	</entry>
</feed>