<?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%3Atutorial_6</id>
	<title>Hpl2:Tutorials:level editor:tutorial 6 - 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%3Atutorial_6"/>
	<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:level_editor:tutorial_6&amp;action=history"/>
	<updated>2026-05-04T10:24:11Z</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:tutorial_6&amp;diff=6827&amp;oldid=prev</id>
		<title>Darkfire: add clean up template</title>
		<link rel="alternate" type="text/html" href="https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:level_editor:tutorial_6&amp;diff=6827&amp;oldid=prev"/>
		<updated>2024-06-07T09:49:22Z</updated>

		<summary type="html">&lt;p&gt;add clean up template&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 09:49, 7 June 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Template:Cleanup}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Level Editor - Useful tricks (in progress) =&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= Level Editor - Useful tricks (in progress) =&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki:diff::1.12:old-877:rev-6827 --&gt;
&lt;/table&gt;</summary>
		<author><name>Darkfire</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.frictionalgames.com/page?title=Hpl2:Tutorials:level_editor:tutorial_6&amp;diff=877&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:tutorial_6&amp;diff=877&amp;oldid=prev"/>
		<updated>2020-07-09T13:49:00Z</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;= Level Editor - Useful tricks (in progress) =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
While The Basics and Light tutorial are great enough to create atmospheric maps, there are some things that can easily help achieve interesting results.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Billboards ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=Sw4du21rNqc Demonstration] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Step by step tutorial. Starting with easy way to setup and control billboards for your map, and continuing to more advanced effects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First make sure you have read and understood [http://wiki.frictionalgames.com/hpl2/tutorials/level_editor/tutorial_1#billboards_particles this].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;br /&amp;gt; ''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Start off by creating a billboard and a point light and connect the billboard into the point light. ''' This helps you control the color value of every billboard you duplicate from the original connected billboard. Keep all of the billboards colors at 1 value. (That one extra point light in the picture is useless for the first parts)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://i1237.photobucket.com/albums/ff478/Khyrpa/WikiTutorial/BB_01.jpg?nolink&amp;amp;800x489]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then align your billboards properly into your window. Some videos about creating billboards. These are done without the connection to light, but the placement should be okay:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[http://www.youtube.com/watch?v=Jb0xJRBO2d8&amp;amp;t=3m37s|Office hlp2 level editor[P2] (billboards, lighting)]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.youtube.com/watch?v=u8EhP59tmjA Billboard Action Amnesia level editor   ] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://i1237.photobucket.com/albums/ff478/Khyrpa/WikiTutorial/BB_02.jpg?direct&amp;amp;800x480]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then tinker with the color of the connected point light and adjust the lenght and width of the billboards. This is the hardest and time consuming part about billboards. Make sure to often check in game because billboards look different there and you can see if they look good from every angle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://i1237.photobucket.com/albums/ff478/Khyrpa/WikiTutorial/BB_03.jpg?direct&amp;amp;800x482]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''That was it for simple billboards, but if you continue, you get to the interesting parts!''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create nice billboards, not all of them should be of the same color, so create another point light and connect the billboards that you think need different colors to other point lights (here the billboards on the edges were picked). For simplicitys sake I keep them connected to only 2 point lights, but if you think you need more variation go for more. (Colors changed so you can see better what I did)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://i1237.photobucket.com/albums/ff478/Khyrpa/WikiTutorial/BB_04.jpg?direct&amp;amp;800x479]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Flicker effect''' &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You can create the flickering effect with various methods. First and easiest one would be to use the point lights own flickering settings inside the level editor. Tweak the Off Color and Diffuse Color to suit your liking. Example settings:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://i1237.photobucket.com/albums/ff478/Khyrpa/WikiTutorial/BB_05.jpg?nolink&amp;amp;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using the level editor only is not as interesting as randomly changing colors of billboards and every light that acts as the windows shine in sync with script.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So next phase would be to set up additional lights to the window, spot light and some ambient point lights in this case. Name them so you can easily track what they are. In this case I named mine like this:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
window_light_bright_1 (spot light with gobo ('''Rotate the gobo if its upside down'''), I want this bright)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
window_light_bright_2 (point light close to window, bright also)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
window_light_dark_1 (large point light)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://i1237.photobucket.com/albums/ff478/Khyrpa/WikiTutorial/BB_06.jpg?direct&amp;amp;800x480]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then the rest is up to script. Example script for controlling, very simple vers. You can tweak the ideas around alot. Like this one does not change the color of the lights into same color as the billboards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;void FlickerTimer(string &amp;amp;in asTimer) &lt;br /&gt;
{&lt;br /&gt;
float ftimer = RandFloat(0.6f,1.6f);&lt;br /&gt;
FadeLightTo(&amp;quot;bb_bright&amp;quot;, RandFloat(0.2f,0.3f), RandFloat(0.2f,0.35f), RandFloat(0.3f,0.39f), 1, -1, ftimer);&lt;br /&gt;
FadeLightTo(&amp;quot;bb_dark&amp;quot;, RandFloat(0.15f,0.29f), RandFloat(0.18f,0.35f), RandFloat(0.35f,0.39f), 1, -1, ftimer);&lt;br /&gt;
    for(int i=0;i&amp;lt;2;i++) FadeLightTo(&amp;quot;window_light_bright_&amp;quot;+i, RandFloat(0.55f,0.7f), RandFloat(0.69f,0.8f), RandFloat(0.8f,0.9f), 1, -1, ftimer);&lt;br /&gt;
    for(int i=0;i&amp;lt;2;i++) FadeLightTo(&amp;quot;window_light_dark_&amp;quot;+i, RandFloat(0.4f,0.5f), RandFloat(0.5f,0.6f), RandFloat(0.6f,0.7f), 1, -1, ftimer);&lt;br /&gt;
AddTimer(&amp;quot;repeat&amp;quot;, ftimer, &amp;quot;FlickerTimer&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then here is the one I used for the demonstration video clip. (Can cause performance issues when done with lots of billboards and particles, I haven't tested…). Minor tweaking, added spawn areas for particles and finetuned the script for long. The script could be done more efficient, if someone can, please edit!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://i1237.photobucket.com/albums/ff478/Khyrpa/WikiTutorial/BB_07.jpg?direct&amp;amp;800x483]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;void OnEnter()&lt;br /&gt;
{ &lt;br /&gt;
AddTimer(&amp;quot;start&amp;quot;, 0, &amp;quot;FlickerTimer&amp;quot;); //Starts the loop&lt;br /&gt;
SetLocalVarInt(&amp;quot;EventInt&amp;quot;, 1); //sets the timer to loop case 1&lt;br /&gt;
//Spawn particles to bb_particle_+i areas and fog_particle_+i areas&lt;br /&gt;
for(int i=0;i&amp;lt;3;i++) CreateParticleSystemAtEntityExt(&amp;quot;blue_particles&amp;quot;, &amp;quot;ps_light_dust_large.ps&amp;quot;, &amp;quot;bb_particle_&amp;quot;+i, true, 0.6f, 0.75f, 1.0f, 1, true, 1, 2, 8, 11);&lt;br /&gt;
for(int i=0;i&amp;lt;3;i++) CreateParticleSystemAtEntityExt(&amp;quot;blue_fog_particles&amp;quot;, &amp;quot;ps_area_fog.ps&amp;quot;, &amp;quot;fog_particle_&amp;quot;+i, true, 0.6f, 0.75f, 1.0f, 0.8f, true, 1, 2, 8, 11);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
void FlickerTimer(string &amp;amp;in asTimer)&lt;br /&gt;
{&lt;br /&gt;
//This stores the rand float into VarFloat so the amount can be checked later&lt;br /&gt;
SetLocalVarFloat(&amp;quot;CheckBrightness&amp;quot;, RandFloat(0.20f,0.32f));&lt;br /&gt;
//This takes the random float from VarFloat so it can be easily placed into functions&lt;br /&gt;
float fMainColor = GetLocalVarFloat(&amp;quot;CheckBrightness&amp;quot;);&lt;br /&gt;
//This is the color for the bloody red lights for case 2&lt;br /&gt;
float fBloodColor = RandFloat(0.3f,0.45f);&lt;br /&gt;
//This tells how long fading the lights in takes and when the loop timer triggers this again&lt;br /&gt;
float ftimer = RandFloat(0.4f,0.7f);&lt;br /&gt;
//This switch function is placed here so you can easily control the lights and later if necessary, add more cases to have more control&lt;br /&gt;
switch(GetLocalVarInt(&amp;quot;EventInt&amp;quot;))&lt;br /&gt;
{case 1: //This part loops forever when EventInt is 1&lt;br /&gt;
    //These 2 below are for the lights that only control billboards, billboards look brighter than the light source&lt;br /&gt;
    FadeLightTo(&amp;quot;bb_bright&amp;quot;, fMainColor+0.08f, fMainColor+0.05, fMainColor+0.1, 1, -1, ftimer);&lt;br /&gt;
    FadeLightTo(&amp;quot;bb_dark&amp;quot;, fMainColor+0.01f, fMainColor, fMainColor+0.04, 1, -1, ftimer);&lt;br /&gt;
  //To get greater sync and effect, I made these to check when the billboards were bright or dark&lt;br /&gt;
if(GetLocalVarFloat(&amp;quot;CheckBrightness&amp;quot;) &amp;lt;0.26f){&lt;br /&gt;
        for(int i=0;i&amp;lt;2;i++) FadeLightTo(&amp;quot;window_light_bright_&amp;quot;+i, fMainColor+0.22f, fMainColor+0.27f, fMainColor+0.43f, 1, -1, ftimer);&lt;br /&gt;
        for(int i=0;i&amp;lt;2;i++) FadeLightTo(&amp;quot;window_light_dark_&amp;quot;+i, fMainColor+0.13f, fMainColor+0.19f, fMainColor+0.24f, 1, -1, ftimer);&lt;br /&gt;
    }&lt;br /&gt;
  //If you dont use something similar to this, the change in lights stay way too small and it can look stupid&lt;br /&gt;
if(GetLocalVarFloat(&amp;quot;CheckBrightness&amp;quot;)&amp;gt;= 0.26f){&lt;br /&gt;
        for(int i=0;i&amp;lt;2;i++) FadeLightTo(&amp;quot;window_light_bright_&amp;quot;+i, fMainColor+0.31f, fMainColor+0.36f, fMainColor+0.58f, 1, -1, ftimer);&lt;br /&gt;
        for(int i=0;i&amp;lt;2;i++) FadeLightTo(&amp;quot;window_light_dark_&amp;quot;+i, fMainColor+0.2f, fMainColor+0.27f, fMainColor+0.3f, 1, -1, ftimer);&lt;br /&gt;
    }&lt;br /&gt;
    break;&lt;br /&gt;
case 2: //Changes colors to red when EventInt is 2&lt;br /&gt;
    FadeLightTo(&amp;quot;bb_bright&amp;quot;, fBloodColor+0.08f, fBloodColor-0.3f, fBloodColor-0.3f, 1, -1, ftimer+0.3f);&lt;br /&gt;
    FadeLightTo(&amp;quot;bb_dark&amp;quot;, fBloodColor+0.02f, fBloodColor-0.3f, fBloodColor-0.3f, 1, -1, ftimer+0.3f);&lt;br /&gt;
for(int i=0;i&amp;lt;2;i++) FadeLightTo(&amp;quot;window_light_bright_&amp;quot;+i, fBloodColor+0.28f, fBloodColor-0.3f, fBloodColor-0.3f, 1, -1, ftimer+0.5f);&lt;br /&gt;
for(int i=0;i&amp;lt;2;i++) FadeLightTo(&amp;quot;window_light_dark_&amp;quot;+i, fBloodColor+0.15f, fBloodColor-0.3f, fBloodColor-0.3f, 1, -1, ftimer+0.5f);&lt;br /&gt;
    break;&lt;br /&gt;
}&lt;br /&gt;
//This is the actual loop here, there is nothing that will stop this timer so it will all the time (unless RemoveTimer is used)&lt;br /&gt;
AddTimer(&amp;quot;repeat&amp;quot;, ftimer, &amp;quot;FlickerTimer&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
//Below is the script I used to jump to case 2 and red lighting, (Interact callback set inside level editor)&lt;br /&gt;
void Touched(string &amp;amp;in asEntity)&lt;br /&gt;
{&lt;br /&gt;
//Sets EventInt to 2 so case 2: is triggered when the looping timer next time triggers&lt;br /&gt;
SetLocalVarInt(&amp;quot;EventInt&amp;quot;, 2);&lt;br /&gt;
//just a quick effect to make things look better for demonstrations sake...&lt;br /&gt;
StartScreenShake(0.01f, 0.9f, 0.2f, 0.2f);&lt;br /&gt;
//destroyParticles, removes the old light particles outta the way. Takes a long time for the fog to disappear, but I can't help that&lt;br /&gt;
DestroyParticleSystem(&amp;quot;blue_particles&amp;quot;);&lt;br /&gt;
DestroyParticleSystem(&amp;quot;blue_fog_particles&amp;quot;);&lt;br /&gt;
//create new ones, this had to be placed inside the callback because looping timer would just create new ones ontop each time it loops&lt;br /&gt;
for(int i=0;i&amp;lt;3;i++) CreateParticleSystemAtEntityExt(&amp;quot;red_particles&amp;quot;, &amp;quot;ps_light_dust_large.ps&amp;quot;, &amp;quot;bb_particle_&amp;quot;+i, true, 1.0f, 0.1f, 0.1f, 1, true, 1, 2, 8, 11);&lt;br /&gt;
for(int i=0;i&amp;lt;3;i++) CreateParticleSystemAtEntityExt(&amp;quot;red_particles&amp;quot;, &amp;quot;ps_area_fog.ps&amp;quot;, &amp;quot;fog_particle_&amp;quot;+i, true, 1.0f, 0.1f, 0.1f, 0.9f, true, 1, 2, 8, 11);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So in the end that loop could control all the billboards and lights needed in a map. The flickering effect might be very small buff to levels looks for the headache it could cause, but keeping billboards connected into lights makes changing colors '''MILLION ''' times more pleasant. It can also be used to for example: cool scares and changing light coming from outside from day to night&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>
		
	</entry>
</feed>