<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.hard-light.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Axem</id>
	<title>FreeSpace Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.hard-light.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Axem"/>
	<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php/Special:Contributions/Axem"/>
	<updated>2026-11-15T10:11:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Tutorial_-_In-Mission_Jumps&amp;diff=58257</id>
		<title>Tutorial - In-Mission Jumps</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Tutorial_-_In-Mission_Jumps&amp;diff=58257"/>
		<updated>2018-07-15T19:28:53Z</updated>

		<summary type="html">&lt;p&gt;Axem: Shamlessly plugging :)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Today we&#039;re gonna look at how to make in-mission subspace jumps!&lt;br /&gt;
&lt;br /&gt;
They&#039;re easy to make and contain 57% of your daily spinning blue content.&lt;br /&gt;
&lt;br /&gt;
All you need is a FreeSpace Open, version 3.6.12 at the very least.&lt;br /&gt;
&lt;br /&gt;
== Capital Ship Micro Jumps ==&lt;br /&gt;
&lt;br /&gt;
=== Setting up the mission ===&lt;br /&gt;
&lt;br /&gt;
First lets set up a super simple mission! Open up FRED and make something like this.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_000.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a link to the blank mission if you&#039;re too lazy to make it yourself.&lt;br /&gt;
&lt;br /&gt;
[[https://sectorgame.com/fsfiles/repo/download/ZGF0YS9BeGVtL090aGVyL0luTWlzc2lvbkp1bXBUdXRvcmlhbC9heGVtX21pY3JvanVtcF9ibGFuay5mczI=/h/c4035bdfe9c8946fbd04ed460d23f7bc Blank Mission]]&lt;br /&gt;
&lt;br /&gt;
Okay, so now let&#039;s start some magic. Let&#039;s move Aquinas Station about 30 klicks out. Then let&#039;s make a new Aeolus cruiser. We&#039;re going to name it Ascendant#2. We&#039;ll place Ascendant#2 close to Aquinas Station.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_001.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_002.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
For ship names, FreeSpace will ignore anything past the # sign. Older missions that might have tried this would have used non-ASCII characters, like a &amp;quot;á&amp;quot; or &amp;quot;ó&amp;quot;. Since those characters aren&#039;t in the font files, they show up as blanks. But if FreeSpace ever gets true TTF support, guess which missions are going to look pretty funny!&lt;br /&gt;
&lt;br /&gt;
NOTE: This happens in wing names too to a certain detriment. Naming a wing Alpha#2 will make the fighter names be Alpha#2 1, Alpha #2 2 and etc. But since anything past the # will be ignored, in game all you&#039;re going to see is Alpha, Alpha, Alpha, and Alpha. So its not a good idea to do this for fighters. We&#039;ll get around that later.&lt;br /&gt;
&lt;br /&gt;
So for Ascendant#2&#039;s arrival cue, we&#039;re going to set it to when Ascendant has departed. You can insert a delay, but for these relatively small distances for FTL, its going to be near instant anyway.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_003.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Then we&#039;ll make the Ascendant&#039;s depart cue to leave after 5 seconds.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_004.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Okay, let&#039;s go run the mission real quick. We should have the Ascendant warp out and then warp in again, right next to Aquinas Station.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Gee Axem, I&#039;m not THAT dumb. I could have figured that out by myself!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I see I have underestimated you. Let&#039;s kick it up a notch. Let&#039;s increase the depart time for the Ascendant to 30 seconds.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_040.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Now lets add a hostile cruiser, a Fenris. Let&#039;s name it the Gosforth. And since we&#039;re going to be lazy with this, lets just tell it to attack the Ascendant.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_041.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
The resulting battle should now damage the Ascendant to a degree. Let&#039;s replay this mission now!&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_005.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
To no one&#039;s surprise, the Ascendant takes out the Gosforth in under 30 seconds. Without beams. With that task finished, the Ascendant warps to Aquinas Station...&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_006.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
and is miraculously healed from its injuries...&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_007.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Makes sense, the two ships are technically different to the game. So let&#039;s fix this with some events now!&lt;br /&gt;
&lt;br /&gt;
===Using ship-copy-damage===&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to make two events. &amp;quot;Make Ascendant Warp Out&amp;quot; and &amp;quot;Copy Damage&amp;quot;. Copy Damage will be chained to the warp out event, with a delay of around 3 seconds. Set up the events inside like so. You can see I&#039;ve basically moved the departure cue to its own event and I&#039;m just referencing that event now.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_008.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
You can find &#039;&#039;&#039;ship-copy-damage&#039;&#039;&#039; under Change -&amp;gt; Special.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ship-copy-damage&#039;&#039;&#039; copies the damage stats for one ship and modifies them to any number of ships. The only requirement is that our original ship must present in the mission. It can&#039;t have already left. But anyone that is on the receiving end doesn&#039;t have to be there yet.&lt;br /&gt;
&lt;br /&gt;
Now why is there a delay? Why not just put ship-copy-damage right with our depart event? Well it takes time for the ship to speed up and actually depart. In that time the ship can take damage. So if we fire it too early, the damage won&#039;t be totally accurate. So we&#039;ll put up a small delay before we actually copy the damage. Not that it matters here too much... Hey let&#039;s add a second hostile Fenris, the Ledberg.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_009.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Play time!&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_010.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
So the Ascdendant was leaving with around 82% hull...&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_011.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
and arrives with 81% hull! (Also note the damage on the flak cannon, damage from subsystems carries over too!)&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_012.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Something must have hit it on its way out. Man, if you had had used the ship-copy-damage too early, you would have people calling you names because that ship healed itself by 1%.&lt;br /&gt;
&lt;br /&gt;
Well, now you know how to make larger ships micro-jump! That ends this episode of... Oh, you were here looking for how to do player micro-jumping.&lt;br /&gt;
&lt;br /&gt;
Okay, let&#039;s do that too. Why should the Ascendant be the only ship that saves itself 17 minutes by warping there. And here I am using my sub-light drives like a sucker.&lt;br /&gt;
&lt;br /&gt;
== Player In-Game Jumps ==&lt;br /&gt;
&lt;br /&gt;
This is the mission file at this stage. It includes everything for the capital ship micro-jump tutorial.&lt;br /&gt;
&lt;br /&gt;
[https://sectorgame.com/fsfiles/repo/download/ZGF0YS9BeGVtL090aGVyL0luTWlzc2lvbkp1bXBUdXRvcmlhbC9heGVtX21pY3JvanVtcF9wbGF5ZXJibGFuay5mczI=/h/cbeecfcfe112798e9476e9dd8c963126 Blank Player Jump Mission]&lt;br /&gt;
&lt;br /&gt;
===A MUCH EASIER WAY===&lt;br /&gt;
&lt;br /&gt;
This tutorial was originally written in 2011. In 2018, lua scripting has come a long way and the rest of the tutorial can now be one in a single scripted sexp. Please see [https://github.com/AxemP/AxemFS2Scripts this GitHub page] for an in-mission jump script (as well as many others). The rest of the tutorial is left here as a testament to how much work this stuff used to be.&lt;br /&gt;
&lt;br /&gt;
===The Thought Process===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s think about how we want the micro jump to work.&lt;br /&gt;
&lt;br /&gt;
Obviously we want to press something and have a warp effect appear, then we have something like a fade to white, maybe a subspace corridor, then another fade to white and we appear at our destination. Sounds simple enough!&lt;br /&gt;
&lt;br /&gt;
Let&#039;s go in order here.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Obviously we want to press something...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
What key? Alt-J? Sounds cool. But wait, that basically ends the mission anyway. Hey can&#039;t we just never-warp the player, like in that SOC mission? We can! Problem solved, right?&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_042.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_043.jpg]]&lt;br /&gt;
&lt;br /&gt;
Oh, that doesn&#039;t look good. It would be kind of odd for that to pop up while you activate your jump drive... and jump.&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s scrap that event and go to the Misc screen on Alpha 1&#039;s Ship Editor. We&#039;re going to tick the &amp;quot;No Subspace Drive&amp;quot; box. So now when he hit Alt-J, the game sees that box and goes &amp;quot;You don&#039;t have a Subspace drive, so I&#039;m not going to do anything!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_045.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
===Serious SEXPs are Serious===&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s get real serious with events here. Make the following events. Don&#039;t worry about the chain delays right now, we&#039;ll go through each event one by one.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_013.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
First, &amp;quot;Pressed Alt-J&amp;quot;. We&#039;re going to use this event to lock the player from his controls. We don&#039;t want him moving around and missing the warp vortex. So let&#039;s use &#039;&#039;&#039;player-use-ai&#039;&#039;&#039;, clear Alpha 1&#039;s goals (Alpha 1 actually receives orders when you tell Alpha or Everyone to do something, so we need to clear those), and tell Alpha 1 to play dead with a priority so high that the player cannot tell himself to do anything. Then let&#039;s lock all our weapons and afterburner to make it complete. The AI sexps can be found in AI and IFF and the lock sexps can be found in Subsystems and Cargo.&lt;br /&gt;
&lt;br /&gt;
Now when we tell the ai-player to play-dead, he&#039;s going to stop. This might be odd, since ships still have speed when they warp. So let&#039;s use &#039;&#039;&#039;ship-lat-maneuver&#039;&#039;&#039;. It allows us to tell ships to move any way we want, but there is a catch. Any movement from the player or AI can completely stop this. Since the ai is set to play-dead, we shouldn&#039;t have any problems. I&#039;ve set the sexp to make Alpha 1 use 33% forward thrust for 15000 ms (15 seconds, that should be good for our entire sequence). ship-lat-maneuver can be found Coordinate Manipulation.&lt;br /&gt;
&lt;br /&gt;
Also give it some directive text so our player knows he can jump and what button to press. If you didn&#039;t already know, the $ signs around a key will change if someone has remapped it. So if I remapped Alt-J to Spacebar, it would show up as &amp;quot;Jump to Aquinas Station, Press Spacebar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_014.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Next, Warm Up! We&#039;ll use this to play the subspace warm up sound and flash a gauge. Delay here is 0, so it could be put in with the last event, but I got limited space here. &#039;&#039;&#039;hud-display gauge&#039;&#039;&#039; can be found in Hud and &#039;&#039;&#039;play-sound-from-file&#039;&#039;&#039; can be found in Music and Sound.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;hud-display-gauge&#039;&#039;&#039; only works with the warpout gauge right now. Basically you put in how long you want it to appear in milliseconds and select warpout. For here we&#039;re going to go with 4 seconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;play-sound-from-file&#039;&#039;&#039; lets us play... sounds from a file. Madness, I know. We just tell it what sound to play and that&#039;s it! The FS2 sound used for subspace drive warm up is called rev1.wav, so we&#039;ll put that in. It can play anything from a sounds or music folder, but only one sound at a time. One other thing to remember is that this sexp will make the sound play as music. So if you have your music volume turned down, you won&#039;t hear anything from that sexp. &lt;br /&gt;
&lt;br /&gt;
Alternatively, you can make a training message, assign it to play rev1.wav using the training-msg sexp instead, and it will play on the voice channel. This might be required if you are already using play-sound-from-file for something else like music.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cool note from the future:&#039;&#039;&#039; In builds 3.6.16 and beyond, you can also use play-sound-from-table using the sound index 50. There are a bunch of coordinates that appear with the sexp, but you can safely ignore them since the sound isn&#039;t a true 3d sound (which requires those).&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_015.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
===warp-effect and Relative Coordinates===&lt;br /&gt;
&lt;br /&gt;
Now for the fun part. Show Warp 1. Can you find the magical &#039;&#039;&#039;warp-effect&#039;&#039;&#039; sexp in Special? There&#039;s a lot of arguments here! Let&#039;s look at what the arguments do for a second.&lt;br /&gt;
&lt;br /&gt;
* 1:  Origin X&lt;br /&gt;
* 2:  Origin Y&lt;br /&gt;
* 3:  Origin Z&lt;br /&gt;
&lt;br /&gt;
These are where the effect will appear.&lt;br /&gt;
&lt;br /&gt;
* 4:  Location X&lt;br /&gt;
* 5:  Location Y&lt;br /&gt;
* 6:  Location Z&lt;br /&gt;
&lt;br /&gt;
These are where the effect is going to point.&lt;br /&gt;
&lt;br /&gt;
*7:  Radius&lt;br /&gt;
&lt;br /&gt;
This is how big the effect is going to be.&lt;br /&gt;
&lt;br /&gt;
* 8:  Duration in seconds (values smaller than 4 are ignored)&lt;br /&gt;
&lt;br /&gt;
Gee, I wonder.&lt;br /&gt;
&lt;br /&gt;
* 9:  Warp opening sound (index into sounds.tbl)&lt;br /&gt;
* 10: Warp closing sound (index into sounds.tbl)&lt;br /&gt;
&lt;br /&gt;
For reference 45 is a warp sound for fighter arrivals, 46 is a warp sound for fighters departures (45 and 46 are the same sound in FS2, warp_1.wav), 69 is a warp sound for capital ships arriving (warp_open.wav) and 70 is a warp sound for capital ships warp vortices closing (warp_close.wav).&lt;br /&gt;
&lt;br /&gt;
* 11: Type (0 for standard blue [default], 1 for Knossos green)&lt;br /&gt;
&lt;br /&gt;
Self explanatory as well.&lt;br /&gt;
&lt;br /&gt;
* 12: Shape (0 for 2-D [default], 1 for 3-D)&lt;br /&gt;
&lt;br /&gt;
It&#039;s probably a good idea to keep this at zero. If its 0 and people have the 3d warp flag on, the game will turn it into a 3d effect anyway.&lt;br /&gt;
&lt;br /&gt;
Ok, so now lets set the Delay to 4 so the effect appears when our hud gauge is finished flashing.&lt;br /&gt;
&lt;br /&gt;
==== Making Mistakes ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;NOW WE ARE GOING TO MAKE SOME MISTAKES.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;You don&#039;t need to do this part unless you like redoing work.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Making the warp effect appear infront of the player is easy, but you need to understand WHY some certain sexps act the way they do. To do that, we&#039;re going to take chances and make mistakes!&lt;br /&gt;
&lt;br /&gt;
Origin of our effect should be about 100m in front of the player. So you might think X and Y should just be Alpha 1&#039;s position, and then we add 100 to the Z coordinate. Let&#039;s try that and see what happens. For now we&#039;ll just change the Origin and Location and leave the rest as default.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_016.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Let&#039;s try this in game.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_017.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Hey wait! That worked just like we wanted. Why did I say this was wrong? Let&#039;s try it again only move the player a bit.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_018.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
We... missed the warp hole. Why? Because we&#039;re using a global coordinate system here. Let&#039;s look at what we told FRED.&lt;br /&gt;
&lt;br /&gt;
* Origin X = &#039;&#039;&#039;get-object-x&#039;&#039;&#039; Alpha 1&lt;br /&gt;
* Origin Y = &#039;&#039;&#039;get-object-y&#039;&#039;&#039; Alpha 1&lt;br /&gt;
* Origin Z = &#039;&#039;&#039;get-object-z&#039;&#039;&#039; Alpha 1 + 100&lt;br /&gt;
&lt;br /&gt;
So if we never move from 0,0,0, then the warp origin appears at 0,0,100. Which as we can see from the pic, is exactly where the player is facing. &lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_019.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
But if we rotate the player a bit...&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_020.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
The player&#039;s location didn&#039;t change, so the warp effect is still going to appear at 0,0,100. But the player isn&#039;t facing 0,0,100 anymore.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at the &#039;&#039;&#039;get-object-*&#039;&#039;&#039; sexp a little closer...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;get-object-z&#039;&#039;&#039;&lt;br /&gt;
* Returns the absolute Z coordinate of a set of coordinates relative to a particular object (or object&#039;s subsystem).  The input coordinates are the coordinates relative to the object&#039;s position and orientation.  If no input coordinates are specified, the coordinate returned is the coordinate of the object (or object&#039;s subsystem) itself.  Takes 1 to 5 arguments...&lt;br /&gt;
* 1: The name of a ship, wing, or waypoint.&lt;br /&gt;
* 2: A ship subsystem (or &amp;quot;&amp;lt;none&amp;gt;&amp;quot; if the first argument is not a ship - optional).&lt;br /&gt;
* 3: The relative X coordinate (optional).&lt;br /&gt;
* 4: The relative Y coordinate (optional).&lt;br /&gt;
* 5: The relative Z coordinate (optional).&lt;br /&gt;
&lt;br /&gt;
Look at those WORDS. What on Earth do they mean? Well first, if there are no optional arguments, the sexp just returns the global coordinate of the ship or subsystem. Thats what we were going before. But if the relative X Y Z coordinates are there, it will return a coordinate that is X, Y, Z from the ship, taking in account its own position and orientation.&lt;br /&gt;
&lt;br /&gt;
Well that was easy, we just need to do something like this then, right?&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_021.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Let&#039;s try it out.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_022.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
We&#039;re still off! But why?!&lt;br /&gt;
&lt;br /&gt;
If we look at the sexp, we see we&#039;re only changing the Z coordinate. So the sexp is keeping the warp effect on X=0 and Y=0. Here&#039;s a pic to show this.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_023.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Warp Point:1 is where we want our warp effect to appear, but Warp Point:2 is where the game is calculating it to be. The solution is easy. We just tack on the rest the same optional arguments to &#039;&#039;&#039;get-object-x&#039;&#039;&#039; and &#039;&#039;&#039;-y&#039;&#039;&#039;! It should look something like this.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_046.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Basically we tell the game to place a warp effect so that its X, Y, and Z coordinates are 0,0,100 from the player. Easy peasey. Let&#039;s try it.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_024.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Hooray! I moved my fighter so he&#039;s facing something totally different, and yet the warp effect still appears directly in front of me.&lt;br /&gt;
&lt;br /&gt;
MISTAKE TIME IS OVER. Add that stuff to your event now! Then lets tweak the size of the effect so it doesn&#039;t completely block our view at first. And modify the sounds so they are the fighter style ones, 45, and 46.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_025.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Fading Through Space and Time ===&lt;br /&gt;
&lt;br /&gt;
Now lets move on to the most easiest event ever. Fade Out 1. Chain delay it for 2 seconds. And add in a &#039;&#039;&#039;fade-out&#039;&#039;&#039; sexp for 1000 ms, set the second argument to fade to white. &#039;&#039;&#039;fade-out&#039;&#039;&#039; is found in the cutscenes event menu.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_026.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
The fade out will help with our transition into subspace. The subspace corridor is optional, but you might want it there for rule of cool. If you&#039;re jumping across the system you might want a quick flash to one. We&#039;re going to add one to this example anyway.&lt;br /&gt;
&lt;br /&gt;
So in our next event, Subspace Corridor, we&#039;ll put in a Chain Delay of 1, so as soon as the fade out is finished, we&#039;ll fade into the subspace corridor. We&#039;ll use the &#039;&#039;&#039;mission-set-subspace&#039;&#039;&#039; sexp to put us in subspace for a bit. The &#039;&#039;&#039;mission-set-subspace&#039;&#039;&#039; sexp is found in Backgrounds and Nebula. Set it to 1 and we&#039;ll be set. And for fun let&#039;s turn shields off, those don&#039;t work in subspace!&lt;br /&gt;
&lt;br /&gt;
And finally let&#039;s move the player far far away so he doesn&#039;t see anything that might ruin the experience. Even though we made the background a subspace corridor, everyone is still around fighting. So we&#039;re going to move him to 0,50000,0 and make him face 0,50000,1000. So the player will be 50km above everyone and since the controls are still locked, he can&#039;t see the battle still going on below him. This is where you would make ships depart if you weren&#039;t going to see them for the rest of the mission (such as if you were going from planet to planet in a mission).&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_027.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Ok, so lets make a new Fade Out event for our transition back to normal space. Name it Fade Out 2 and chain delay it by 5 seconds. We&#039;re going to cram the last warp effect and fade out sexps together here. Just copy and paste them.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_048.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Time for Fade In + Move Player. Chain Delay of 1 here people. Now we&#039;re going to move and orient the player, make another warp effect and fade back in. We&#039;ll do all the moving and stuff first so the fade in only starts after we&#039;re finished goofing around. I put a pair of waypoints down to use as an anchor. You can just key in the coordinates yourself, but if you need to move the warp in position, its a lot easier to do by just moving a waypoint. The first waypoint is going to be where we drop Alpha 1 and the second will be what he&#039;s going to face.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_047.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Set up your sexps like so.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_028.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_029.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to make our warp effect real short and we&#039;ll keep the default sounds so you hear the closing one when the vortex starts to close. You&#039;re sick of hearing the normal effect by now, aren&#039;t you? This is also where you would set up ships to instantly arrive or change backgrounds if you wanted.&lt;br /&gt;
&lt;br /&gt;
Then finally in Regain Player Control, we set a chain delay of 1 and we remove the locks on weapons and give control back to the player. And shields. Can&#039;t forget shields.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_030.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Let&#039;s give it a whirl!&lt;br /&gt;
&lt;br /&gt;
===Finishing It Off===&lt;br /&gt;
&lt;br /&gt;
Cool, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But we left before the battle was over. Command would not look too kindly on this! (If you did stay, then kudos)&lt;br /&gt;
&lt;br /&gt;
Let&#039;s set up some events to only allow the player to leave after the two Fenrises have been killed.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_031.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Boy, that was easy. But we are missing one thing.&lt;br /&gt;
&lt;br /&gt;
The way the key-press sexp works is that as soon as you press a key, a key-pressed check against the key will remain true even if you pressed it once 15 minutes ago. So if we chain &amp;quot;Pressed Alt-J&amp;quot; under Kill Fenrises, and we press Alt-J before the Fenrises are dead, nothing happens. But as soon as those Fenrises die, the game goes down the chain and checks to see if Alt-J was ever pressed. And it was. So it warps you right away! The key-reset sexp will reset the key pressed status. So lets set up this chain.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_032.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Now what happens if we want to jump out in the end? We don&#039;t actually have a subspace drive on our fighter. By using the &#039;&#039;&#039;force-jump&#039;&#039;&#039; sexp, you can force the player to jump into subspace, even if he doesn&#039;t have a subspace drive. Set up the events like we did before. Remember to &#039;&#039;&#039;key-reset&#039;&#039;&#039;! The only caveat is that you cannot cancel a forced-jump by hitting escape. Oh well...&lt;br /&gt;
&lt;br /&gt;
== Jumping In Other Fighters==&lt;br /&gt;
&lt;br /&gt;
Now what about my fighter friends? They didn&#039;t warp. There&#039;s a few things you can do here. Fighters are pretty small, so you can modify their position at the same time as the player without too much notice. But if you MUST do all the proper warp effects for your wingmen, we&#039;re going to go into AXEM&#039;S PERFECT FRED CLASS.&lt;br /&gt;
&lt;br /&gt;
A degree in conditional arguments is required to make sense of this. If you don&#039;t know what those are, then you&#039;re done here.&lt;br /&gt;
&lt;br /&gt;
I&#039;m going to fly through this, so hold on to your hats.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_033.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
First we kill the AI in the rest of Alpha wing.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_034.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Then we make the warp effects appear.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_035.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Then we move them somewhere safe for a bit. We&#039;ll make them go -50000m down so the player won&#039;t see them. Collisions shouldn&#039;t be a big deal, but we can make them invulnerable if you wish. Just remember to take that off later.&lt;br /&gt;
&lt;br /&gt;
Next we&#039;ll need to place them by the player. Let&#039;s use waypoints like we did with the player. We won&#039;t bother with orientation too much.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_036.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Now we move them by the player once he&#039;s been placed and do a bunch of other stuff, like clear the play dead orders. (Which just got cut off from the last pic :( )&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_037.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_038.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_039.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
And that, as they say, is that. If you give it a try, the fighters should warp out with you and warp in when you warp in.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a link to the mission file so you can see what the finished product looks like and identify anything you might have done wrong.&lt;br /&gt;
&lt;br /&gt;
[https://sectorgame.com/fsfiles/repo/download/ZGF0YS9BeGVtL090aGVyL0luTWlzc2lvbkp1bXBUdXRvcmlhbC9heGVtX21pY3JvanVtcF9wbGF5ZXJfZmluYWwuZnMy/h/c9069b7c68ece4ef96e3417aaf179ea6 Finished Tutorial Missile File]&lt;br /&gt;
&lt;br /&gt;
[[Category:FRED Examples]][[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Tutorial_-_In-Mission_Jumps&amp;diff=58256</id>
		<title>Tutorial - In-Mission Jumps</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Tutorial_-_In-Mission_Jumps&amp;diff=58256"/>
		<updated>2018-07-15T19:21:23Z</updated>

		<summary type="html">&lt;p&gt;Axem: Replaced dead links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Today we&#039;re gonna look at how to make in-mission subspace jumps!&lt;br /&gt;
&lt;br /&gt;
They&#039;re easy to make and contain 57% of your daily spinning blue content.&lt;br /&gt;
&lt;br /&gt;
All you need is a FreeSpace Open, version 3.6.12 at the very least.&lt;br /&gt;
&lt;br /&gt;
== Capital Ship Micro Jumps ==&lt;br /&gt;
&lt;br /&gt;
=== Setting up the mission ===&lt;br /&gt;
&lt;br /&gt;
First lets set up a super simple mission! Open up FRED and make something like this.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_000.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a link to the blank mission if you&#039;re too lazy to make it yourself.&lt;br /&gt;
&lt;br /&gt;
[[https://sectorgame.com/fsfiles/repo/download/ZGF0YS9BeGVtL090aGVyL0luTWlzc2lvbkp1bXBUdXRvcmlhbC9heGVtX21pY3JvanVtcF9ibGFuay5mczI=/h/c4035bdfe9c8946fbd04ed460d23f7bc Blank Mission]]&lt;br /&gt;
&lt;br /&gt;
Okay, so now let&#039;s start some magic. Let&#039;s move Aquinas Station about 30 klicks out. Then let&#039;s make a new Aeolus cruiser. We&#039;re going to name it Ascendant#2. We&#039;ll place Ascendant#2 close to Aquinas Station.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_001.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_002.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
For ship names, FreeSpace will ignore anything past the # sign. Older missions that might have tried this would have used non-ASCII characters, like a &amp;quot;á&amp;quot; or &amp;quot;ó&amp;quot;. Since those characters aren&#039;t in the font files, they show up as blanks. But if FreeSpace ever gets true TTF support, guess which missions are going to look pretty funny!&lt;br /&gt;
&lt;br /&gt;
NOTE: This happens in wing names too to a certain detriment. Naming a wing Alpha#2 will make the fighter names be Alpha#2 1, Alpha #2 2 and etc. But since anything past the # will be ignored, in game all you&#039;re going to see is Alpha, Alpha, Alpha, and Alpha. So its not a good idea to do this for fighters. We&#039;ll get around that later.&lt;br /&gt;
&lt;br /&gt;
So for Ascendant#2&#039;s arrival cue, we&#039;re going to set it to when Ascendant has departed. You can insert a delay, but for these relatively small distances for FTL, its going to be near instant anyway.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_003.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Then we&#039;ll make the Ascendant&#039;s depart cue to leave after 5 seconds.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_004.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Okay, let&#039;s go run the mission real quick. We should have the Ascendant warp out and then warp in again, right next to Aquinas Station.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Gee Axem, I&#039;m not THAT dumb. I could have figured that out by myself!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
I see I have underestimated you. Let&#039;s kick it up a notch. Let&#039;s increase the depart time for the Ascendant to 30 seconds.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_040.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Now lets add a hostile cruiser, a Fenris. Let&#039;s name it the Gosforth. And since we&#039;re going to be lazy with this, lets just tell it to attack the Ascendant.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_041.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
The resulting battle should now damage the Ascendant to a degree. Let&#039;s replay this mission now!&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_005.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
To no one&#039;s surprise, the Ascendant takes out the Gosforth in under 30 seconds. Without beams. With that task finished, the Ascendant warps to Aquinas Station...&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_006.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
and is miraculously healed from its injuries...&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_007.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Makes sense, the two ships are technically different to the game. So let&#039;s fix this with some events now!&lt;br /&gt;
&lt;br /&gt;
===Using ship-copy-damage===&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to make two events. &amp;quot;Make Ascendant Warp Out&amp;quot; and &amp;quot;Copy Damage&amp;quot;. Copy Damage will be chained to the warp out event, with a delay of around 3 seconds. Set up the events inside like so. You can see I&#039;ve basically moved the departure cue to its own event and I&#039;m just referencing that event now.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_008.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
You can find &#039;&#039;&#039;ship-copy-damage&#039;&#039;&#039; under Change -&amp;gt; Special.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;ship-copy-damage&#039;&#039;&#039; copies the damage stats for one ship and modifies them to any number of ships. The only requirement is that our original ship must present in the mission. It can&#039;t have already left. But anyone that is on the receiving end doesn&#039;t have to be there yet.&lt;br /&gt;
&lt;br /&gt;
Now why is there a delay? Why not just put ship-copy-damage right with our depart event? Well it takes time for the ship to speed up and actually depart. In that time the ship can take damage. So if we fire it too early, the damage won&#039;t be totally accurate. So we&#039;ll put up a small delay before we actually copy the damage. Not that it matters here too much... Hey let&#039;s add a second hostile Fenris, the Ledberg.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_009.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Play time!&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_010.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
So the Ascdendant was leaving with around 82% hull...&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_011.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
and arrives with 81% hull! (Also note the damage on the flak cannon, damage from subsystems carries over too!)&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_012.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Something must have hit it on its way out. Man, if you had had used the ship-copy-damage too early, you would have people calling you names because that ship healed itself by 1%.&lt;br /&gt;
&lt;br /&gt;
Well, now you know how to make larger ships micro-jump! That ends this episode of... Oh, you were here looking for how to do player micro-jumping.&lt;br /&gt;
&lt;br /&gt;
Okay, let&#039;s do that too. Why should the Ascendant be the only ship that saves itself 17 minutes by warping there. And here I am using my sub-light drives like a sucker.&lt;br /&gt;
&lt;br /&gt;
== Player In-Game Jumps ==&lt;br /&gt;
&lt;br /&gt;
This is the mission file at this stage. It includes everything for the capital ship micro-jump tutorial.&lt;br /&gt;
&lt;br /&gt;
[https://sectorgame.com/fsfiles/repo/download/ZGF0YS9BeGVtL090aGVyL0luTWlzc2lvbkp1bXBUdXRvcmlhbC9heGVtX21pY3JvanVtcF9wbGF5ZXJibGFuay5mczI=/h/cbeecfcfe112798e9476e9dd8c963126 Blank Player Jump Mission]&lt;br /&gt;
&lt;br /&gt;
===The Thought Process===&lt;br /&gt;
&lt;br /&gt;
Let&#039;s think about how we want the micro jump to work.&lt;br /&gt;
&lt;br /&gt;
Obviously we want to press something and have a warp effect appear, then we have something like a fade to white, maybe a subspace corridor, then another fade to white and we appear at our destination. Sounds simple enough!&lt;br /&gt;
&lt;br /&gt;
Let&#039;s go in order here.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Obviously we want to press something...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
What key? Alt-J? Sounds cool. But wait, that basically ends the mission anyway. Hey can&#039;t we just never-warp the player, like in that SOC mission? We can! Problem solved, right?&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_042.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_043.jpg]]&lt;br /&gt;
&lt;br /&gt;
Oh, that doesn&#039;t look good. It would be kind of odd for that to pop up while you activate your jump drive... and jump.&lt;br /&gt;
&lt;br /&gt;
Ok, let&#039;s scrap that event and go to the Misc screen on Alpha 1&#039;s Ship Editor. We&#039;re going to tick the &amp;quot;No Subspace Drive&amp;quot; box. So now when he hit Alt-J, the game sees that box and goes &amp;quot;You don&#039;t have a Subspace drive, so I&#039;m not going to do anything!&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_045.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
===Serious SEXPs are Serious===&lt;br /&gt;
&lt;br /&gt;
Now let&#039;s get real serious with events here. Make the following events. Don&#039;t worry about the chain delays right now, we&#039;ll go through each event one by one.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_013.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
First, &amp;quot;Pressed Alt-J&amp;quot;. We&#039;re going to use this event to lock the player from his controls. We don&#039;t want him moving around and missing the warp vortex. So let&#039;s use &#039;&#039;&#039;player-use-ai&#039;&#039;&#039;, clear Alpha 1&#039;s goals (Alpha 1 actually receives orders when you tell Alpha or Everyone to do something, so we need to clear those), and tell Alpha 1 to play dead with a priority so high that the player cannot tell himself to do anything. Then let&#039;s lock all our weapons and afterburner to make it complete. The AI sexps can be found in AI and IFF and the lock sexps can be found in Subsystems and Cargo.&lt;br /&gt;
&lt;br /&gt;
Now when we tell the ai-player to play-dead, he&#039;s going to stop. This might be odd, since ships still have speed when they warp. So let&#039;s use &#039;&#039;&#039;ship-lat-maneuver&#039;&#039;&#039;. It allows us to tell ships to move any way we want, but there is a catch. Any movement from the player or AI can completely stop this. Since the ai is set to play-dead, we shouldn&#039;t have any problems. I&#039;ve set the sexp to make Alpha 1 use 33% forward thrust for 15000 ms (15 seconds, that should be good for our entire sequence). ship-lat-maneuver can be found Coordinate Manipulation.&lt;br /&gt;
&lt;br /&gt;
Also give it some directive text so our player knows he can jump and what button to press. If you didn&#039;t already know, the $ signs around a key will change if someone has remapped it. So if I remapped Alt-J to Spacebar, it would show up as &amp;quot;Jump to Aquinas Station, Press Spacebar&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_014.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Next, Warm Up! We&#039;ll use this to play the subspace warm up sound and flash a gauge. Delay here is 0, so it could be put in with the last event, but I got limited space here. &#039;&#039;&#039;hud-display gauge&#039;&#039;&#039; can be found in Hud and &#039;&#039;&#039;play-sound-from-file&#039;&#039;&#039; can be found in Music and Sound.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;hud-display-gauge&#039;&#039;&#039; only works with the warpout gauge right now. Basically you put in how long you want it to appear in milliseconds and select warpout. For here we&#039;re going to go with 4 seconds.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;play-sound-from-file&#039;&#039;&#039; lets us play... sounds from a file. Madness, I know. We just tell it what sound to play and that&#039;s it! The FS2 sound used for subspace drive warm up is called rev1.wav, so we&#039;ll put that in. It can play anything from a sounds or music folder, but only one sound at a time. One other thing to remember is that this sexp will make the sound play as music. So if you have your music volume turned down, you won&#039;t hear anything from that sexp. &lt;br /&gt;
&lt;br /&gt;
Alternatively, you can make a training message, assign it to play rev1.wav using the training-msg sexp instead, and it will play on the voice channel. This might be required if you are already using play-sound-from-file for something else like music.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Cool note from the future:&#039;&#039;&#039; In builds 3.6.16 and beyond, you can also use play-sound-from-table using the sound index 50. There are a bunch of coordinates that appear with the sexp, but you can safely ignore them since the sound isn&#039;t a true 3d sound (which requires those).&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_015.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
===warp-effect and Relative Coordinates===&lt;br /&gt;
&lt;br /&gt;
Now for the fun part. Show Warp 1. Can you find the magical &#039;&#039;&#039;warp-effect&#039;&#039;&#039; sexp in Special? There&#039;s a lot of arguments here! Let&#039;s look at what the arguments do for a second.&lt;br /&gt;
&lt;br /&gt;
* 1:  Origin X&lt;br /&gt;
* 2:  Origin Y&lt;br /&gt;
* 3:  Origin Z&lt;br /&gt;
&lt;br /&gt;
These are where the effect will appear.&lt;br /&gt;
&lt;br /&gt;
* 4:  Location X&lt;br /&gt;
* 5:  Location Y&lt;br /&gt;
* 6:  Location Z&lt;br /&gt;
&lt;br /&gt;
These are where the effect is going to point.&lt;br /&gt;
&lt;br /&gt;
*7:  Radius&lt;br /&gt;
&lt;br /&gt;
This is how big the effect is going to be.&lt;br /&gt;
&lt;br /&gt;
* 8:  Duration in seconds (values smaller than 4 are ignored)&lt;br /&gt;
&lt;br /&gt;
Gee, I wonder.&lt;br /&gt;
&lt;br /&gt;
* 9:  Warp opening sound (index into sounds.tbl)&lt;br /&gt;
* 10: Warp closing sound (index into sounds.tbl)&lt;br /&gt;
&lt;br /&gt;
For reference 45 is a warp sound for fighter arrivals, 46 is a warp sound for fighters departures (45 and 46 are the same sound in FS2, warp_1.wav), 69 is a warp sound for capital ships arriving (warp_open.wav) and 70 is a warp sound for capital ships warp vortices closing (warp_close.wav).&lt;br /&gt;
&lt;br /&gt;
* 11: Type (0 for standard blue [default], 1 for Knossos green)&lt;br /&gt;
&lt;br /&gt;
Self explanatory as well.&lt;br /&gt;
&lt;br /&gt;
* 12: Shape (0 for 2-D [default], 1 for 3-D)&lt;br /&gt;
&lt;br /&gt;
It&#039;s probably a good idea to keep this at zero. If its 0 and people have the 3d warp flag on, the game will turn it into a 3d effect anyway.&lt;br /&gt;
&lt;br /&gt;
Ok, so now lets set the Delay to 4 so the effect appears when our hud gauge is finished flashing.&lt;br /&gt;
&lt;br /&gt;
==== Making Mistakes ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;NOW WE ARE GOING TO MAKE SOME MISTAKES.&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;You don&#039;t need to do this part unless you like redoing work.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Making the warp effect appear infront of the player is easy, but you need to understand WHY some certain sexps act the way they do. To do that, we&#039;re going to take chances and make mistakes!&lt;br /&gt;
&lt;br /&gt;
Origin of our effect should be about 100m in front of the player. So you might think X and Y should just be Alpha 1&#039;s position, and then we add 100 to the Z coordinate. Let&#039;s try that and see what happens. For now we&#039;ll just change the Origin and Location and leave the rest as default.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_016.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Let&#039;s try this in game.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_017.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Hey wait! That worked just like we wanted. Why did I say this was wrong? Let&#039;s try it again only move the player a bit.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_018.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
We... missed the warp hole. Why? Because we&#039;re using a global coordinate system here. Let&#039;s look at what we told FRED.&lt;br /&gt;
&lt;br /&gt;
* Origin X = &#039;&#039;&#039;get-object-x&#039;&#039;&#039; Alpha 1&lt;br /&gt;
* Origin Y = &#039;&#039;&#039;get-object-y&#039;&#039;&#039; Alpha 1&lt;br /&gt;
* Origin Z = &#039;&#039;&#039;get-object-z&#039;&#039;&#039; Alpha 1 + 100&lt;br /&gt;
&lt;br /&gt;
So if we never move from 0,0,0, then the warp origin appears at 0,0,100. Which as we can see from the pic, is exactly where the player is facing. &lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_019.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
But if we rotate the player a bit...&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_020.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
The player&#039;s location didn&#039;t change, so the warp effect is still going to appear at 0,0,100. But the player isn&#039;t facing 0,0,100 anymore.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s take a look at the &#039;&#039;&#039;get-object-*&#039;&#039;&#039; sexp a little closer...&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;get-object-z&#039;&#039;&#039;&lt;br /&gt;
* Returns the absolute Z coordinate of a set of coordinates relative to a particular object (or object&#039;s subsystem).  The input coordinates are the coordinates relative to the object&#039;s position and orientation.  If no input coordinates are specified, the coordinate returned is the coordinate of the object (or object&#039;s subsystem) itself.  Takes 1 to 5 arguments...&lt;br /&gt;
* 1: The name of a ship, wing, or waypoint.&lt;br /&gt;
* 2: A ship subsystem (or &amp;quot;&amp;lt;none&amp;gt;&amp;quot; if the first argument is not a ship - optional).&lt;br /&gt;
* 3: The relative X coordinate (optional).&lt;br /&gt;
* 4: The relative Y coordinate (optional).&lt;br /&gt;
* 5: The relative Z coordinate (optional).&lt;br /&gt;
&lt;br /&gt;
Look at those WORDS. What on Earth do they mean? Well first, if there are no optional arguments, the sexp just returns the global coordinate of the ship or subsystem. Thats what we were going before. But if the relative X Y Z coordinates are there, it will return a coordinate that is X, Y, Z from the ship, taking in account its own position and orientation.&lt;br /&gt;
&lt;br /&gt;
Well that was easy, we just need to do something like this then, right?&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_021.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Let&#039;s try it out.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_022.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
We&#039;re still off! But why?!&lt;br /&gt;
&lt;br /&gt;
If we look at the sexp, we see we&#039;re only changing the Z coordinate. So the sexp is keeping the warp effect on X=0 and Y=0. Here&#039;s a pic to show this.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_023.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Warp Point:1 is where we want our warp effect to appear, but Warp Point:2 is where the game is calculating it to be. The solution is easy. We just tack on the rest the same optional arguments to &#039;&#039;&#039;get-object-x&#039;&#039;&#039; and &#039;&#039;&#039;-y&#039;&#039;&#039;! It should look something like this.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_046.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Basically we tell the game to place a warp effect so that its X, Y, and Z coordinates are 0,0,100 from the player. Easy peasey. Let&#039;s try it.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_024.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Hooray! I moved my fighter so he&#039;s facing something totally different, and yet the warp effect still appears directly in front of me.&lt;br /&gt;
&lt;br /&gt;
MISTAKE TIME IS OVER. Add that stuff to your event now! Then lets tweak the size of the effect so it doesn&#039;t completely block our view at first. And modify the sounds so they are the fighter style ones, 45, and 46.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_025.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
=== Fading Through Space and Time ===&lt;br /&gt;
&lt;br /&gt;
Now lets move on to the most easiest event ever. Fade Out 1. Chain delay it for 2 seconds. And add in a &#039;&#039;&#039;fade-out&#039;&#039;&#039; sexp for 1000 ms, set the second argument to fade to white. &#039;&#039;&#039;fade-out&#039;&#039;&#039; is found in the cutscenes event menu.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_026.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
The fade out will help with our transition into subspace. The subspace corridor is optional, but you might want it there for rule of cool. If you&#039;re jumping across the system you might want a quick flash to one. We&#039;re going to add one to this example anyway.&lt;br /&gt;
&lt;br /&gt;
So in our next event, Subspace Corridor, we&#039;ll put in a Chain Delay of 1, so as soon as the fade out is finished, we&#039;ll fade into the subspace corridor. We&#039;ll use the &#039;&#039;&#039;mission-set-subspace&#039;&#039;&#039; sexp to put us in subspace for a bit. The &#039;&#039;&#039;mission-set-subspace&#039;&#039;&#039; sexp is found in Backgrounds and Nebula. Set it to 1 and we&#039;ll be set. And for fun let&#039;s turn shields off, those don&#039;t work in subspace!&lt;br /&gt;
&lt;br /&gt;
And finally let&#039;s move the player far far away so he doesn&#039;t see anything that might ruin the experience. Even though we made the background a subspace corridor, everyone is still around fighting. So we&#039;re going to move him to 0,50000,0 and make him face 0,50000,1000. So the player will be 50km above everyone and since the controls are still locked, he can&#039;t see the battle still going on below him. This is where you would make ships depart if you weren&#039;t going to see them for the rest of the mission (such as if you were going from planet to planet in a mission).&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_027.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Ok, so lets make a new Fade Out event for our transition back to normal space. Name it Fade Out 2 and chain delay it by 5 seconds. We&#039;re going to cram the last warp effect and fade out sexps together here. Just copy and paste them.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_048.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Time for Fade In + Move Player. Chain Delay of 1 here people. Now we&#039;re going to move and orient the player, make another warp effect and fade back in. We&#039;ll do all the moving and stuff first so the fade in only starts after we&#039;re finished goofing around. I put a pair of waypoints down to use as an anchor. You can just key in the coordinates yourself, but if you need to move the warp in position, its a lot easier to do by just moving a waypoint. The first waypoint is going to be where we drop Alpha 1 and the second will be what he&#039;s going to face.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_047.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Set up your sexps like so.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_028.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_029.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
We&#039;re going to make our warp effect real short and we&#039;ll keep the default sounds so you hear the closing one when the vortex starts to close. You&#039;re sick of hearing the normal effect by now, aren&#039;t you? This is also where you would set up ships to instantly arrive or change backgrounds if you wanted.&lt;br /&gt;
&lt;br /&gt;
Then finally in Regain Player Control, we set a chain delay of 1 and we remove the locks on weapons and give control back to the player. And shields. Can&#039;t forget shields.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_030.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Let&#039;s give it a whirl!&lt;br /&gt;
&lt;br /&gt;
===Finishing It Off===&lt;br /&gt;
&lt;br /&gt;
Cool, wasn&#039;t it?&lt;br /&gt;
&lt;br /&gt;
But we left before the battle was over. Command would not look too kindly on this! (If you did stay, then kudos)&lt;br /&gt;
&lt;br /&gt;
Let&#039;s set up some events to only allow the player to leave after the two Fenrises have been killed.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_031.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Boy, that was easy. But we are missing one thing.&lt;br /&gt;
&lt;br /&gt;
The way the key-press sexp works is that as soon as you press a key, a key-pressed check against the key will remain true even if you pressed it once 15 minutes ago. So if we chain &amp;quot;Pressed Alt-J&amp;quot; under Kill Fenrises, and we press Alt-J before the Fenrises are dead, nothing happens. But as soon as those Fenrises die, the game goes down the chain and checks to see if Alt-J was ever pressed. And it was. So it warps you right away! The key-reset sexp will reset the key pressed status. So lets set up this chain.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_032.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Now what happens if we want to jump out in the end? We don&#039;t actually have a subspace drive on our fighter. By using the &#039;&#039;&#039;force-jump&#039;&#039;&#039; sexp, you can force the player to jump into subspace, even if he doesn&#039;t have a subspace drive. Set up the events like we did before. Remember to &#039;&#039;&#039;key-reset&#039;&#039;&#039;! The only caveat is that you cannot cancel a forced-jump by hitting escape. Oh well...&lt;br /&gt;
&lt;br /&gt;
== Jumping In Other Fighters==&lt;br /&gt;
&lt;br /&gt;
Now what about my fighter friends? They didn&#039;t warp. There&#039;s a few things you can do here. Fighters are pretty small, so you can modify their position at the same time as the player without too much notice. But if you MUST do all the proper warp effects for your wingmen, we&#039;re going to go into AXEM&#039;S PERFECT FRED CLASS.&lt;br /&gt;
&lt;br /&gt;
A degree in conditional arguments is required to make sense of this. If you don&#039;t know what those are, then you&#039;re done here.&lt;br /&gt;
&lt;br /&gt;
I&#039;m going to fly through this, so hold on to your hats.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_033.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
First we kill the AI in the rest of Alpha wing.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_034.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Then we make the warp effects appear.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_035.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Then we move them somewhere safe for a bit. We&#039;ll make them go -50000m down so the player won&#039;t see them. Collisions shouldn&#039;t be a big deal, but we can make them invulnerable if you wish. Just remember to take that off later.&lt;br /&gt;
&lt;br /&gt;
Next we&#039;ll need to place them by the player. Let&#039;s use waypoints like we did with the player. We won&#039;t bother with orientation too much.&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_036.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Now we move them by the player once he&#039;s been placed and do a bunch of other stuff, like clear the play dead orders. (Which just got cut off from the last pic :( )&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_037.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_038.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:axm_ingamejumptut_039.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
And that, as they say, is that. If you give it a try, the fighters should warp out with you and warp in when you warp in.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a link to the mission file so you can see what the finished product looks like and identify anything you might have done wrong.&lt;br /&gt;
&lt;br /&gt;
[https://sectorgame.com/fsfiles/repo/download/ZGF0YS9BeGVtL090aGVyL0luTWlzc2lvbkp1bXBUdXRvcmlhbC9heGVtX21pY3JvanVtcF9wbGF5ZXJfZmluYWwuZnMy/h/c9069b7c68ece4ef96e3417aaf179ea6 Finished Tutorial Missile File]&lt;br /&gt;
&lt;br /&gt;
[[Category:FRED Examples]][[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Game_settings.tbl&amp;diff=44756</id>
		<title>Game settings.tbl</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Game_settings.tbl&amp;diff=44756"/>
		<updated>2015-06-14T23:40:25Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* #GRAPHICS SETTINGS */ Adding new pain flash factors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SCP_table}}&lt;br /&gt;
&lt;br /&gt;
{{TableVersion|11089}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;game_settings.tbl&#039;&#039;&#039;, also known as mod.tbl, defines options that can be changed globally.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table is one of the [[Modular Tables]] and can be extended with xxx-mod.tbm&lt;br /&gt;
&lt;br /&gt;
[[Tables|List of Tables]]&lt;br /&gt;
&lt;br /&gt;
==#CAMPAIGN SETTINGS==&lt;br /&gt;
Optional. This group contains various Campaign related settings and overrides.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===$Default Campaign File Name:===&lt;br /&gt;
Defines which campaign will be selected by default for new pilots. A file extension is not needed and, if present, is removed by the code.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;String&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===#Ignored Campaign File Names===&lt;br /&gt;
Optional. Defines which campaigns, if present, will not appear in the Campaign Room. Only single-player campaigns can be ignored. &#039;&#039;File extensions are required.&#039;&#039;&lt;br /&gt;
{{Table371|As of 3.7.1, file extensions are not required and, if present, are removed by the code.}}&lt;br /&gt;
====$Campaign File Name:====&lt;br /&gt;
File name of the campaign to ignore. Multiple entries may exist.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;String&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===$Red-alert applies to delayed ships:===&lt;br /&gt;
Controls whether red-alert saved statistics (hitpoints, weapons, subsystem strengths) will be restored for ships that are not present at mission start.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Boolean&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;NO&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==#HUD SETTINGS==&lt;br /&gt;
Optional. This group contains various HUD behavior settings and overrides&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===$Directive Wait Time:===&lt;br /&gt;
*Defines how long the game will wait before displaying a directive.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Integer&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
*Values: &#039;&#039;&#039;&#039;&#039;Greater than or equal to 0 ms&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===$Cutscene camera displays HUD:===&lt;br /&gt;
Show the HUD when the cutscene camera is enabled.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Boolean&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;NO&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In earlier versions of the code, this option was controlled by $Cutscene camera disables HUD: and had a default of YES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===$Full color head animations:===&lt;br /&gt;
Enables full-color head ANIs. Normal head ANIs will appear in gray.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Boolean&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;NO&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In earlier versions of the code, this option was controlled by $Color head animations with hud colors: and had a default of YES.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==#SEXP SETTINGS==&lt;br /&gt;
Optional. This group contains SEXP settings and overrides.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===$Loop SEXPs Then Arguments:===&lt;br /&gt;
Flips how when-argument settings loop. See: [http://www.hard-light.net/forums/index.php?topic=79602.0 SEXP Argument changes via mod.tbl] &lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Boolean&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;NO&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===$Use Alternate Chaining Behavior:===&lt;br /&gt;
When set, this makes the event chaining behavior act as people expected it to be in [http://scp.indiegames.us/mantis/view.php?id=82 Mantis #82].&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Boolean&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;NO&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==#GRAPHICS SETTINGS==&lt;br /&gt;
Optional. This group contains settings related to graphics.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===$Enable External Shaders:===&lt;br /&gt;
Enables the use of external shader files. By default, the engine will use the built-in shaders.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Boolean&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;NO&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===$Default Detail Level:===&lt;br /&gt;
{{Table3615|&lt;br /&gt;
Determines which graphics detail level preset (low, medium, high, very high) acts as the default for new pilots.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Integer&#039;&#039;&#039;&#039;&#039; (0-3)&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;3&#039;&#039;&#039;&#039;&#039; (very high)&amp;lt;br&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
===$Briefing Window FOV:===&lt;br /&gt;
{{Table371|&lt;br /&gt;
Determines the FOV in the briefing Icon window. Retail default for this is 0.29375, previous versions of FSO used a value of 0.5.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Float&#039;&#039;&#039;&#039;&#039; (0.0 to 1.0)&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;0.29375&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
===$Generic Pain Flash Factor:===&lt;br /&gt;
{{Table373|&lt;br /&gt;
Determines the intensity of the pain red flash when the player is hit.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Float&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;1.0&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
===$Shield Pain Flash Factor:===&lt;br /&gt;
{{Table373|&lt;br /&gt;
Determines the intensity of a pain flash when the player&#039;s shields are hit. Color will match the current ships shield color defined in ships.tbl. A value of 0 will give retail behavior (no shield effect). Positive values will cause the effect to start at full intensity at full shields and go to next to no intensity at zero shields. Negative values will cause no effect at full shields and full effect at no shields. Values should be kept between -1.0 and 1.0 for good pilot visibility.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Float&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;0.0&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
==#SOUND SETTINGS==&lt;br /&gt;
Optional. This group contains sound-related settings&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===$Default Sound Volume:===&lt;br /&gt;
{{Table371|&lt;br /&gt;
*Defines the default sound fx volume for new pilots.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Float&#039;&#039;&#039;&#039;&#039;, between 0.0 and 1.0&amp;lt;br&amp;gt;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;1.0&#039;&#039;&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
===$Default Music Volume:===&lt;br /&gt;
{{Table371|&lt;br /&gt;
*Defines the default music volume for new pilots.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Float&#039;&#039;&#039;&#039;&#039;, between 0.0 and 1.0&amp;lt;br&amp;gt;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;0.5&#039;&#039;&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
===$Default Voice Volume:===&lt;br /&gt;
{{Table371|&lt;br /&gt;
*Defines the default voice volume for new pilots.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Float&#039;&#039;&#039;&#039;&#039;, between 0.0 and 1.0&amp;lt;br&amp;gt;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;0.7&#039;&#039;&#039;&#039;&#039;}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==#FRED SETTINGS==&lt;br /&gt;
Optional. This group contains settings for FRED. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===$Disable Hard Coded Message Head Ani Files:===&lt;br /&gt;
{{table371|&lt;br /&gt;
If set, FRED will not fill the head ani selection in the Event Editor with the retail head ani filenames.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Boolean&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;NO&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
==#OTHER SETTINGS==&lt;br /&gt;
Optional. This group contains miscellaneous settings. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===$Fixed Turret Collisions:===&lt;br /&gt;
Makes all hits to a turret&#039;s barrels count as hits to the turret subsystem. By default, this does not happen unless the point of impact falls inside the model radius of the turret&#039;s base.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Boolean&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;NO&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===$Damage Impacted Subsystem First:===&lt;br /&gt;
If set, a hit to a physical subsystem will always deal damage to that subsystem first, even if another subsystem is closer to the point of impact. By default, the closest subsystem will always receive damage first.&lt;br /&gt;
*Syntax: &#039;&#039;&#039;&#039;&#039;Boolean&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
*Default Value: &#039;&#039;&#039;&#039;&#039;NO&#039;&#039;&#039;&#039;&#039;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===$Default ship select effect:===&lt;br /&gt;
{{Table3615|&lt;br /&gt;
*This specifies which effect to use for ship select animations when no .ani can be found, or the -ship_choice_3d commandline flag is active. This will default to the FS2 effect.&lt;br /&gt;
*Possible options are &amp;quot;FS2&amp;quot;, &amp;quot;FS1&amp;quot;, and &amp;quot;off&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
===$Default weapon select effect:===&lt;br /&gt;
{{Table3615|&lt;br /&gt;
*This specifies which effect to use for weapon select animations when no .ani can be found, or the -weapon_choice_3d commandline flag is active. This will default to the FS2 effect.&lt;br /&gt;
*Possible options are &amp;quot;FS2&amp;quot;, &amp;quot;FS1&amp;quot;, and &amp;quot;off&amp;quot;}}&lt;br /&gt;
&lt;br /&gt;
===$Weapons inherit parent collision group:===&lt;br /&gt;
{{Table3615|&lt;br /&gt;
*When set to true, Weapons fired by a ship will inherit their parents&#039; collision group setting. Default is false.}}&lt;br /&gt;
&lt;br /&gt;
===$Flight controls follow eyepoint orientation:===&lt;br /&gt;
{{Table371|&lt;br /&gt;
*Specifies that if the player ship&#039;s eyepoint happens to rotate into a non-standard orientation, pitch and yaw axes should stay relative to the eyepoint orientation, not the ship. Note that this does not affect the pitch/yaw turning speed, which always remains relative to the ship. Default is false.}}&lt;br /&gt;
&lt;br /&gt;
===$Beams Use Damage Factors:===&lt;br /&gt;
{{Table371|&lt;br /&gt;
*Specifies that beam weapons will use the tabled damage factors for Armour, Shields and Subsystems. Default is false (i.e. all factors are treated as 1.0)}}&lt;br /&gt;
&lt;br /&gt;
==#END==&lt;br /&gt;
Required. The last line of the table must be #END&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Sample Entry==&lt;br /&gt;
&lt;br /&gt;
    #CAMPAIGN SETTINGS&lt;br /&gt;
    $Default Campaign File Name: NewCampaignFile&lt;br /&gt;
    &lt;br /&gt;
    #Ignored Campaign File Names&lt;br /&gt;
    $Campaign File Name: FreeSpace2.fc2&lt;br /&gt;
    &lt;br /&gt;
    #HUD SETTINGS&lt;br /&gt;
    $Directive Wait Time: 5000&lt;br /&gt;
    &lt;br /&gt;
    #SEXP SETTINGS&lt;br /&gt;
    $Loop SEXPs Then Arguments: True&lt;br /&gt;
    &lt;br /&gt;
    #OTHER SETTINGS&lt;br /&gt;
    $Self Praise Percentage: 75&lt;br /&gt;
    &lt;br /&gt;
    #END&lt;br /&gt;
&lt;br /&gt;
[[Category:Tables]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Scripting.tbl&amp;diff=44755</id>
		<title>Scripting.tbl</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Scripting.tbl&amp;diff=44755"/>
		<updated>2015-06-14T23:32:54Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Actions */ Adding new Afterburner and Beam Fire conditionals&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SCP_table}}&lt;br /&gt;
&lt;br /&gt;
{{TableVersion|11242}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;scripting.tbl&#039;&#039;&#039; is used for scripting special features like alternate HUDs or ship viewer into the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table is one of the [[Modular Tables]] and can be extended with xxx-sct.tbm&lt;br /&gt;
&lt;br /&gt;
[[Tables|List of Tables]]&lt;br /&gt;
&lt;br /&gt;
==General Info==&lt;br /&gt;
*Scripting table consist of several sections identified by a hash mark preceeding the section name (i.g. #Global Hooks)&lt;br /&gt;
*All sections &#039;&#039;must&#039;&#039; end with #&#039;&#039;&#039;End&#039;&#039;&#039;&lt;br /&gt;
*All sections are optional&lt;br /&gt;
*Most entries are optional&lt;br /&gt;
*Scripting hooks are &#039;&#039;&#039;not&#039;&#039;&#039; executed on a separate thread (at least as of this writing). They are executed at given points in the code, and all other execution will not take place until a scripting hook has finished. Therefore, large and complicated scripts will most likely cause noticeable lag or slowdown when executed.&lt;br /&gt;
{{Template:Note|1=Information on this page does not apply to pre-3.6.10 builds}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Useful references==&lt;br /&gt;
*&#039;&#039;&#039;[[FS2 Open Lua Scripting]]&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;[[Scripting API]]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!---*&#039;&#039;&#039;[http://fs2source.warpcore.org/temp/scripting.html Scripting.html]&#039;&#039;&#039; - Link OOA ---&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Scripting functions]]&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;[[Command-Line_Reference#-output_scripting|Command-Line Reference for creating scripting.html]]&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;[http://lua-users.org/wiki/ Lua-Users Wiki]&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;[http://www.lua.org/manual/5.0/ Reference manual for Lua 5.0]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
===Frames===&lt;br /&gt;
One of the most important things to understand when reading this guide is the concept of &amp;quot;frames&amp;quot;. (Experienced modders can probably skip this part) In gameplay, motion is achieved by making incremental changes every fraction of a second. A ship will be moved slightly, and then drawn to the screen. This happens 30-120 times a second; anything lower, and the game will become choppy and difficult to play.&lt;br /&gt;
&lt;br /&gt;
There is also a difference in the moving of objects in-game, and the moving of objects onscreen. All ships are first &amp;quot;moved&amp;quot;, in memory. This probably consists of physics calculations, that change the ship&#039;s position based on if their engines are turned on, or if they run into another object. After this, the game then renders the now-moved ships to what is referred to as a &amp;quot;backbuffer&amp;quot; - a place in memory that takes the place of the computer screen. Once rendering has finished, the backbuffer is instantly drawn to the screen. This prevents objects from flickering as they are drawn. You do not have to worry about flipping the backbuffer in scripting; FS2_Open will take care of that for you.&lt;br /&gt;
&lt;br /&gt;
For scripting, &#039;&#039;&#039;it is important to understand that each block of code will therefore be executed several times a second, but only once per frame&#039;&#039;&#039;. However, the exact number of times per second will depend on how much work the computer has to do (And therefore how much time it takes) for each frame. To determine how much time you should consider to have passed, you must use the ba.getFrametime() function; which will return the approximate time the frame will take, in seconds. In addition, if you &amp;quot;move&amp;quot; a ship after it has already been rendered, the change will not become apparent until the next frame.&lt;br /&gt;
&lt;br /&gt;
This does mean that if you want to make a block of text move across the screen, at a rate of 5 pixels per second, all you have to do is multiply the speed by the frametime:&lt;br /&gt;
&amp;lt;pre&amp;gt;#Global Hooks&lt;br /&gt;
$Global: [&lt;br /&gt;
   --If the g_WheeXPosition variable does not exist,&lt;br /&gt;
   --it means we are on the first frame.&lt;br /&gt;
   --If that is the case, set it to zero.&lt;br /&gt;
   if not g_WheeXPosition then&lt;br /&gt;
      g_WheeXPosition = 0&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   --Move the text&lt;br /&gt;
   g_WheeXPosition = g_WheeXPosition + (5 * ba.getFrametime())&lt;br /&gt;
&lt;br /&gt;
   --Draw &amp;quot;WHEE!!!&amp;quot;&lt;br /&gt;
   gr.drawString(&amp;quot;WHEE!!!&amp;quot;, g_WheeXPosition, 10)&lt;br /&gt;
]&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hooks===&lt;br /&gt;
Scripting &amp;quot;hooks&amp;quot; form the basis of the scripting system. A &amp;quot;hook&amp;quot; simply refers to a point in the code where code to execute scripting has been added. The hook may then be added to a table, or added to a SEXP. In general usage, &amp;quot;hook&amp;quot; refers to an entry in scripting.tbl.&lt;br /&gt;
&lt;br /&gt;
All hooks take the form of an identifer (such as $Global:), followed by brackets to determine what type of scripting is being executed. A lack of brackets also indicates a type of scripting execution. All current bracket configurations are listed below. Note that &amp;quot;$Hook:&amp;quot; is used merely as a placeholder, and should be replaced with the actual hook name ($Global:, $HUD:, $On Frame:, etc).&lt;br /&gt;
#&amp;lt;pre&amp;gt;$Hook: scripting&amp;lt;/pre&amp;gt;Specifies one line of LUA scripting. In addition, the return value of that line will be passed to the interpreter and used (if applicable). Specifying a variable or value on this line will result in it being returned, as well.&lt;br /&gt;
#&amp;lt;pre&amp;gt;$Hook: [scripting]&amp;lt;/pre&amp;gt;A single set of brackets specifies a block of LUA scripting. Does not return a value unless explicitly specified. (Explicit specification is not possible at this time; but may be implemented in the future if/when more future hooks take a return value.)&lt;br /&gt;
#&amp;lt;pre&amp;gt;$Hook: [[scriptfilename.lua]]&amp;lt;/pre&amp;gt;Double brackets specify a file. This file is read out of the data/scripts directory, and must include the file extension. You may specify a compiled lua file as a target as well; this may result in crossplatform issues for a mod, however.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====+Override====&lt;br /&gt;
Some hooks additionally take a +Override: field. This field uses the same bracket configurations as above. If a hook includes a +Override field, this hook always determines whether the default FS2_Open behavior that the hook is associated with will function, or will be disabled. This should be used in cases where scripting will replace the original FS2_Open behavior. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;$HUD: [&lt;br /&gt;
    gr.setColor(255, 255, 255, 255)&lt;br /&gt;
    gr.drawString(&amp;quot;HUD Disabled&amp;quot;, 50, 50)&lt;br /&gt;
 ]&lt;br /&gt;
    +Override: true&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally, override hooks are (by convention) executed before FS2_Open behavior. The HUD hook override, for example, is executed before any part of the HUD is actually drawn.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sections==&lt;br /&gt;
&lt;br /&gt;
===#Global Hooks===&lt;br /&gt;
Global hooks are the simplest form of scripting hooks available. They are at preset locations in the code, and are generally executed every time that point is reached. Exceptions to this rule (such as the HUD hook) only depend on one or two variables to determine execution. All other scripting execution is determined by the modder.&lt;br /&gt;
Note that, as with other tables, the game expects these entries in precisely the order given here; if this is not followed, the parser will throw an error.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====$Global:====&lt;br /&gt;
Script in this section is executed almost immediately before each frame is drawn. This means that any scripting elements will be drawn, or take effect, after everything else, except for the &amp;quot;On Frame&amp;quot; conditional hook. It is not used with the standalone server. In addition, note that use of this hook should generally be avoided, since all scripting will have to be processed every frame.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====$Splash:====&lt;br /&gt;
This hook is executed once, when the splash images (PreLoad and PreLoadLogo) would be drawn. This hook should generally be used only for drawing the splash screen; any initialization could should be placed in GameInit. This hook is executed before virtually any other subsystem has been loaded, aside from the graphics and filesystem subsystems, so scripting elements such as the table and mission libraries will be nonfunctional.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====+Override:=====&lt;br /&gt;
Executed just before default splash images are loaded and displayed. Note that the frame is still drawn regardless; it is not necessary to flip the backbuffer manually.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====$GameInit:====&lt;br /&gt;
This hook is executed once, after all of the Freespace2 subsystems have been initialized. It is executed before the game switches to the main hall or, in the case of standalone server mode, begins the game.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====$Simulation:====&lt;br /&gt;
This hook is executed only during missions. It is executed after all damage, movement, physics, SEXPs, and other &amp;quot;physical&amp;quot; in-game changes have been applied. It is executed before anything has been rendered. This hook should be used only for damage, movement, and physics related scripting, as if the game needs to be rendered without any in-game time having been passed, this function will not be called.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====$HUD:====&lt;br /&gt;
The HUD hook is executed after the HUD has been drawn. Note that if the HUD is turned off, this hook will be disabled as well, until the HUD is turned back on.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====+Override:=====&lt;br /&gt;
Executed immediately before anything on the HUD is drawn, and controls whether the default FS2_Open is drawn.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===#State Hooks===&lt;br /&gt;
In Freespace2, a &amp;quot;state&amp;quot; more or less refers to a room. It may also refer to a separate mode - playing a mission is the GS_STATE_GAME_PLAY state. The main menu is the GS_STATE_MAIN_MENU state. This section should only exist in 3.6.9. It is included here for the sake of documentation; it has since been removed (Dec 2006) and superseded by the conditional hook system.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====$State:=====&lt;br /&gt;
Specifies the state name. A full list of states is located here: &#039;&#039;[[List of Game States]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====$Hook:=====&lt;br /&gt;
Executed after all of the state code has been executed, but before the game frame is actually drawn.&lt;br /&gt;
&lt;br /&gt;
======+Override:======&lt;br /&gt;
Determines whether the specified state is handled at all by Freespace. If true, then none of the loading or exit code for the state will be specified as well.&lt;br /&gt;
&lt;br /&gt;
===#Conditional Hooks===&lt;br /&gt;
Scripting hooks have been available since Sep 2006. They consist of any number of conditions, followed by any number of actions. All available conditions and actions are located in the file generated by -output_scripting.&lt;br /&gt;
&lt;br /&gt;
One way to think of conditional scripting is like this: The condition specifies the object that the action will apply to, or the place that the action will occur in. All conditions must be met for their associated actions to execute. Actions are associated with a set of conditions by simply adding them after that set of conditions. (Obviously, you may want to space out each pair of action/condition sets in the TBL to make it easier to read.)&lt;br /&gt;
&lt;br /&gt;
The flexibility of conditional scripting comes in due to its inherent scalability. If you specify a mission and ship condition with a warpin action, that script will only be executed when the ship warps in on that particular mission. Removing the mission field will make that warpin scripting apply to the ship for all missions; or removing the ship field will make the warpin scripting apply to all ships in that mission.&lt;br /&gt;
&lt;br /&gt;
This prompts the question: if this is all conditional scripting does, why not just use the global hook? &lt;br /&gt;
#Organization - conditional scripting is generally easier to read and modify because it is grouped in a standardized manner.&lt;br /&gt;
#Speed - All conditions can be evaluated by FS2_Open itself, without invoking the Lua interpreter at all.&lt;br /&gt;
#Scalability - As of the time of this writing, you can only have one global hook. Modular tables will simply replace it. With conditional scripting, if you want to specify additional actions for a set of conditions in a modular table file, you may do so.&lt;br /&gt;
&lt;br /&gt;
;Format&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;$Condition:&#039;&#039;&#039;: Where &amp;quot;$Condition:&amp;quot; is one of several conditions specified in scripting.html, such as $State: or $Ship:. Takes a value representing the object the condition should be checked against (such as a state, ship, or mission name)&lt;br /&gt;
;&#039;&#039;&#039;$Condition:&#039;&#039;&#039;: ...&lt;br /&gt;
;&#039;&#039;&#039;...&#039;&#039;&#039;:&lt;br /&gt;
;&#039;&#039;&#039;$Action:&#039;&#039;&#039;: Where &amp;quot;$Action:&amp;quot; is one of several actions specified in scripting.html, such as $On Frame or $On Warp In. Takes a scripting hook, using the bracket configuration outlined at the top of this article.&lt;br /&gt;
;&#039;&#039;&#039;$Condition:&#039;&#039;&#039;: ...&lt;br /&gt;
;&#039;&#039;&#039;...&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
A brief description of all Conditions and Actions at the time of this writing:&lt;br /&gt;
&lt;br /&gt;
====Conditions====&lt;br /&gt;
&lt;br /&gt;
=====$State:=====&lt;br /&gt;
Controls execution based on what state FS2_Open is in, such as the main hall, options screen, or in a mission.&lt;br /&gt;
*The full list of states can be found here: &#039;&#039;[[List of Game States]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====$Campaign:=====&lt;br /&gt;
Controls execution based on the current campaign&#039;s filename. (It is under consideration to change this to the campaign&#039;s name, instead).&lt;br /&gt;
&lt;br /&gt;
=====$Mission:=====&lt;br /&gt;
Controls execution based on the filename of the last mission to have started. This condition will remain true even after the mission has been exited until another mission is started.&lt;br /&gt;
&lt;br /&gt;
=====$Object Type:=====&lt;br /&gt;
Defines a specific object type that the action will apply for, such as a &amp;quot;Ship&amp;quot;, &amp;quot;Asteroid&amp;quot;, or &amp;quot;Jump Node&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====$Ship:=====&lt;br /&gt;
Defines a specific ship (name) that the action will apply for.&lt;br /&gt;
&lt;br /&gt;
=====$Ship class:=====&lt;br /&gt;
Defines a specific ship class (name) that the action will apply for.&lt;br /&gt;
&lt;br /&gt;
=====$Ship type:=====&lt;br /&gt;
Defines a specific ship type (name) that the action will apply for.&lt;br /&gt;
&lt;br /&gt;
=====$Weapon class:=====&lt;br /&gt;
Defines a specific weapon class (name) that the action will apply for.&lt;br /&gt;
&lt;br /&gt;
=====$KeyPress:=====&lt;br /&gt;
Defines a specific key that the action will apply for.&lt;br /&gt;
*Experimental.&lt;br /&gt;
&lt;br /&gt;
=====$Action:=====&lt;br /&gt;
{{Table371|&lt;br /&gt;
Defines a specific control that the action will apply for. For example &amp;quot;Fire Primary Weapon&amp;quot; or &amp;quot;Match Target Speed&amp;quot;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
=====$On Game Init:=====&lt;br /&gt;
Executes immediately after game has been started.&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Splash Screen:=====&lt;br /&gt;
Executes when initial game splash screen is shown&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On State Start:=====&lt;br /&gt;
Executed when specified game state starts&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Frame:=====&lt;br /&gt;
Executes immediately after the global scripting hook, which is right before the frame is drawn.&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Key Pressed:=====&lt;br /&gt;
Executed when specified key is pressed&lt;br /&gt;
::* &#039;&#039;&#039;Key&#039;&#039;&#039;, The pressed key&lt;br /&gt;
&lt;br /&gt;
=====$On Key Released:=====&lt;br /&gt;
Executed when specified key is released&lt;br /&gt;
::* &#039;&#039;&#039;Key&#039;&#039;&#039;, The released key&lt;br /&gt;
&lt;br /&gt;
=====$On Mouse Moved:=====&lt;br /&gt;
Executed when mouse is moved&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Mouse Pressed:=====&lt;br /&gt;
Executed when mouse button is pressed&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Mouse Released:=====&lt;br /&gt;
Executed when mouse button is released&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On State End:=====&lt;br /&gt;
Executed when specified game state ends&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Mission Start:=====&lt;br /&gt;
Executed when mission starts&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Gameplay Start:=====&lt;br /&gt;
{{Table3615|&lt;br /&gt;
Executed when the gameplay part of a mission starts&lt;br /&gt;
::* No associated hook variables.}}&lt;br /&gt;
&lt;br /&gt;
=====$On HUD Draw:=====&lt;br /&gt;
Executed after the HUD has been drawn. Note that if the HUD is turned off, this hook will be disabled as well, until the HUD is turned back on&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the viewer (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Ship Collision:=====&lt;br /&gt;
Executes when the specified object collides with a ship. Sets a handle in the HookVariables library with the name of the object type (&amp;quot;Weapon&amp;quot;, &amp;quot;Debris&amp;quot;, and so on) with the type of the object. If both objects are ships, the other object gains the name &amp;quot;ShipB&amp;quot;. (If both ship objects define a collision hook, the variables will be swapped for the other ship, so the ship that the script is executing for will always be called &amp;quot;Script&amp;quot;.) The override will disable FS2_Open code, as well as the other object&#039;s collision code. If both objects have an override set, only one of the objects&#039; hooks will be used (Chosen arbitrarily). Note that the override receives the same variables.&lt;br /&gt;
::* When colliding something other than other ship:&lt;br /&gt;
::** &#039;&#039;&#039;Ship&#039;&#039;&#039;, the ship (object)&lt;br /&gt;
::** &#039;&#039;&#039;Debris&#039;&#039;&#039;, &#039;&#039;&#039;Asteroid&#039;&#039;&#039;, &#039;&#039;&#039;Weapon&#039;&#039;&#039;, depending what it collided with (object)&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the object referred by the condition (object)&lt;br /&gt;
::** &#039;&#039;&#039;Object&#039;&#039;&#039;, the ship (object)&lt;br /&gt;
::* When colliding with other ship:&lt;br /&gt;
::** &#039;&#039;&#039;Ship&#039;&#039;&#039;, the ship (object) referred by the condition (object)&lt;br /&gt;
::** &#039;&#039;&#039;ShipB&#039;&#039;&#039;, the other ship (object)&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the ship (object) referred by the condition (object)&lt;br /&gt;
::** &#039;&#039;&#039;Object&#039;&#039;&#039;, the other ship (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Weapon Collision:=====&lt;br /&gt;
Like the ship collision hook, but for weapons.&lt;br /&gt;
::* When colliding something other than other weapon:&lt;br /&gt;
::** &#039;&#039;&#039;Weapon&#039;&#039;&#039;, the weapon (object)&lt;br /&gt;
::** &#039;&#039;&#039;Debris&#039;&#039;&#039;, &#039;&#039;&#039;Asteroid&#039;&#039;&#039;, &#039;&#039;&#039;Ship&#039;&#039;&#039;, depending what it collided with (object)&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the object the weapon collided with (object)&lt;br /&gt;
::** &#039;&#039;&#039;Object&#039;&#039;&#039;, the weapon (object)&lt;br /&gt;
::* When colliding with other weapon:&lt;br /&gt;
::** &#039;&#039;&#039;Weapon&#039;&#039;&#039;, the weapon (object) referred by the condition&lt;br /&gt;
::** &#039;&#039;&#039;WeaponB&#039;&#039;&#039;, the other weapon (object)&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the weapon (object) referred by the condition&lt;br /&gt;
::** &#039;&#039;&#039;Object&#039;&#039;&#039;, the other weapon (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Debris Collision:=====&lt;br /&gt;
Like the ship collision hook, except for debris.&lt;br /&gt;
::* &#039;&#039;&#039;Debris&#039;&#039;&#039;, the debris (object)&lt;br /&gt;
::* &#039;&#039;&#039;Weapon&#039;&#039;&#039;, &#039;&#039;&#039;Ship&#039;&#039;&#039;, depending what it collided with (object)&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the object the debris collided with (object)&lt;br /&gt;
::* &#039;&#039;&#039;Object&#039;&#039;&#039;, the debris (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Asteroid Collision:=====&lt;br /&gt;
Like the ship collision hook, only for asteroids.&lt;br /&gt;
::* &#039;&#039;&#039;Asteroid&#039;&#039;&#039;, the asteroid (object)&lt;br /&gt;
::* &#039;&#039;&#039;Weapon&#039;&#039;&#039;, &#039;&#039;&#039;Ship&#039;&#039;&#039;, depending what it collided with (object)&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the object the asteroid collided with (object)&lt;br /&gt;
::* &#039;&#039;&#039;Object&#039;&#039;&#039;, the asteroid (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Object Render:=====&lt;br /&gt;
Executes when the specified object is rendered. The override is run before the object is rendered, and both the hook and its override receive an &amp;quot;Object&amp;quot; variable of the object to be rendered.&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the object rendered (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Warp In:=====&lt;br /&gt;
Run when a ship has begun warping in, immediately after everything has been set up for per-frame processing. This hook is only executed once, when the ship begins warping in. An override will disable _all_ behavior related to warpin. Both the hook and an override receive an &amp;quot;Object&amp;quot; handle in the HookVariables library, with the type of the object that is warping in.&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the object warping in (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Warp Out:=====&lt;br /&gt;
Same as warping in, except for warping out.&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the object warping out (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Death:=====&lt;br /&gt;
*Currently only valid for ships.&lt;br /&gt;
Receives &amp;quot;Self&amp;quot; and &amp;quot;Killer&amp;quot; variables of the object and killer, respectively. Overriding it will override all default death behavior.&lt;br /&gt;
::* For asteroids:&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the asteroid (object)&lt;br /&gt;
::* For ships:&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the ship (object)&lt;br /&gt;
::** &#039;&#039;&#039;Killer&#039;&#039;&#039;, the other object (object) - NOTE, not guaranteed to exists&lt;br /&gt;
&lt;br /&gt;
=====$On Mission End:=====&lt;br /&gt;
Run on mission end.&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
=====$On Weapon Equipped:=====&lt;br /&gt;
{{Table3613|&lt;br /&gt;
Runs once each frame, for every ship that has the weapon defined in the $Weapon class condition equipped.&lt;br /&gt;
::* &#039;&#039;&#039;User&#039;&#039;&#039;, the ship carrying the weapon&lt;br /&gt;
::* &#039;&#039;&#039;Target&#039;&#039;&#039;, the ships&#039; current target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Weapon Fired:=====&lt;br /&gt;
{{Table3613|&lt;br /&gt;
Runs once when a ship fires a weapon defined in the $Weapon class condition&lt;br /&gt;
::* &#039;&#039;&#039;User&#039;&#039;&#039;, the ship carrying the weapon&lt;br /&gt;
::* &#039;&#039;&#039;Target&#039;&#039;&#039;, the ships&#039; current target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Weapon Selected:=====&lt;br /&gt;
{{Table3613|&lt;br /&gt;
Runs once when a bank with a weapon defined in the $Weapon class condition is selected&lt;br /&gt;
::* &#039;&#039;&#039;User&#039;&#039;&#039;, the ship carrying the weapon&lt;br /&gt;
::* &#039;&#039;&#039;Target&#039;&#039;&#039;, the ships&#039; current target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Weapon Deselected:=====&lt;br /&gt;
{{Table3613|&lt;br /&gt;
Runs once when a bank with a weapon defined in the $Weapon class condition is deselected&lt;br /&gt;
::* &#039;&#039;&#039;User&#039;&#039;&#039;, the ship carrying the weapon&lt;br /&gt;
::* &#039;&#039;&#039;Target&#039;&#039;&#039;, the ships&#039; current target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Turret Fired:=====&lt;br /&gt;
{{Table3615|&lt;br /&gt;
Executed when a turret fires.&lt;br /&gt;
::* &#039;&#039;&#039;Ship&#039;&#039;&#039;, the parent ship&lt;br /&gt;
::* &#039;&#039;&#039;Weapon&#039;&#039;&#039;, the weapon which was fired&lt;br /&gt;
::* &#039;&#039;&#039;Target&#039;&#039;&#039;, the intended target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Ship Arrive:=====&lt;br /&gt;
{{Table371|&lt;br /&gt;
Executed when a ship arrives.&lt;br /&gt;
::* &#039;&#039;&#039;Ship&#039;&#039;&#039;, the arriving ship&lt;br /&gt;
::* &#039;&#039;&#039;Parent&#039;&#039;&#039;, the ship acting as the anchor when arrival location is &amp;quot;in front of ship&amp;quot;, &amp;quot;near ship&amp;quot; or &amp;quot;docking bay&amp;quot;; nil or invalid handle otherwise&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Action:=====&lt;br /&gt;
{{Table371|&lt;br /&gt;
Executed when an action is triggered, regardless of which key or button it is bound to. Does currently not trigger on mouse or joystick movements.&lt;br /&gt;
::* &#039;&#039;&#039;Action&#039;&#039;&#039;, the textual description of the action (for example &amp;quot;Fire Primary Weapon&amp;quot; or &amp;quot;Match Target Speed&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Action Stopped:=====&lt;br /&gt;
{{Table371|&lt;br /&gt;
Executed when a continuous action is released (for example &amp;quot;Fire Primary Weapon&amp;quot;, &amp;quot;Turn Left&amp;quot; or &amp;quot;Afterburner&amp;quot;).&lt;br /&gt;
::* &#039;&#039;&#039;Action&#039;&#039;&#039;, the textual description of the action&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Message Received:=====&lt;br /&gt;
{{Table371|&lt;br /&gt;
Executed when the player receives a message.&lt;br /&gt;
::* &#039;&#039;&#039;Name&#039;&#039;&#039;, the message name that was received. The message handle can be accessed with mn.Messages[hv.Name]&lt;br /&gt;
::* &#039;&#039;&#039;Message&#039;&#039;&#039;, the message text that would be displayed on the message gauge. Takes in account scrambled messages and variable replacements.&lt;br /&gt;
::* &#039;&#039;&#039;SenderString&#039;&#039;&#039;, the displayed string that shows the origin of the message.&lt;br /&gt;
::* &#039;&#039;&#039;Builtin&#039;&#039;&#039;, boolean, true if the message was a builtin message (eg: automatic messages from Command or wingmen)&lt;br /&gt;
::* &#039;&#039;&#039;Sender&#039;&#039;&#039;, object handle of the ship that sent the message. This might not always be valid, so check is :isValid() if you need to use it&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On HUD Message Received:=====&lt;br /&gt;
{{Table371|&lt;br /&gt;
Executed when the HUD should display a message. This is similar to $On Message Received but it will also receive messages that were not generated by a message (e.g &amp;quot;Firing artillery&amp;quot; for SSM strikes).&lt;br /&gt;
::* &#039;&#039;&#039;Text&#039;&#039;&#039;, the plain text of the message&lt;br /&gt;
::* &#039;&#039;&#039;SourceType&#039;&#039;&#039;, a number representing the type of the sender. The number can be one of the following:&lt;br /&gt;
:::* &#039;&#039;0&#039;&#039; A message sent by the computer&lt;br /&gt;
:::* &#039;&#039;1&#039;&#039; A training message&lt;br /&gt;
:::* &#039;&#039;2&#039;&#039; A message from a hidden source&lt;br /&gt;
:::* &#039;&#039;3&#039;&#039; An important message (this type is currently unused)&lt;br /&gt;
:::* &#039;&#039;4&#039;&#039; An failed message (this type is currently unused)&lt;br /&gt;
:::* &#039;&#039;5&#039;&#039; An satisfied message (this type is currently unused)&lt;br /&gt;
:::* &#039;&#039;6&#039;&#039; An message sent by (Terran) command&lt;br /&gt;
:::* &#039;&#039;7&#039;&#039; A multiplayer message&lt;br /&gt;
:::* &#039;&#039;&amp;amp;ge;8&#039;&#039; When the type is grater or equal to 8 then the source is one of the teams in the mission. You can get a team handle using mn.Team[hv.SourceType - 7] (as lua uses 1 based indexes)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Afterburner Engage:=====&lt;br /&gt;
{{Table373|&lt;br /&gt;
Executed when a ship engages its afterburner.&lt;br /&gt;
::* &#039;&#039;&#039;Ship&#039;&#039;&#039;, the ship object of the ship engaging its afterburner&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Afterburner End:=====&lt;br /&gt;
{{Table373|&lt;br /&gt;
Executed when a ship stops its afterburner.&lt;br /&gt;
::* &#039;&#039;&#039;Ship&#039;&#039;&#039;, the ship object of the ship stopping its afterburner&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Beam Fire:=====&lt;br /&gt;
{{Table373|&lt;br /&gt;
Executed when a beam is fired. This will occur after warm up is complete, as the beam starts to render and give damage.&lt;br /&gt;
::* &#039;&#039;&#039;Beam&#039;&#039;&#039;, the beam object being fired&lt;br /&gt;
::* &#039;&#039;&#039;User&#039;&#039;&#039;, the parent ship object firing the beam&lt;br /&gt;
::* &#039;&#039;&#039;Target&#039;&#039;&#039;, the target object that the beam is trying to hit. Not guaranteed to exist!&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Misc. Hook Variables:==&lt;br /&gt;
&lt;br /&gt;
===Viewer===&lt;br /&gt;
*Active if (non-player) viewing object is valid&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
*Active if player obj is valid &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
See [[:Category:Scripting Examples|Scripting Examples category]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tables]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Tutorial_-_FSOpen_and_LUA_3_-_Conditional_Actions_and_Hooks&amp;diff=44365</id>
		<title>Tutorial - FSOpen and LUA 3 - Conditional Actions and Hooks</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Tutorial_-_FSOpen_and_LUA_3_-_Conditional_Actions_and_Hooks&amp;diff=44365"/>
		<updated>2014-12-02T01:12:31Z</updated>

		<summary type="html">&lt;p&gt;Axem: Another new LUA tutorial!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;So we have the basics on how the scripts in FreeSpace work. A script gets called, and we modify things, commonly with handles of objects within FreeSpace. So far we&#039;ve only really called our scripts through the script-eval*. But there are so many other ways to call a script. Probably the best way will be through conditional hooks.&lt;br /&gt;
&lt;br /&gt;
(Technically we run part of our script in On Game Init where we define the actual functions)&lt;br /&gt;
&lt;br /&gt;
As I alluded to in the first tutorial, conditional hooks only occur when a certain action happens. You can look at the [[scripting.tbl | page]] on the wiki for a complete list of conditional hooks and any hook variables and are associated with it. So we can use that fact to introduce some real fun with the game. Before these would require actual code requests, but with the magic of Lua, we can just script it!&lt;br /&gt;
&lt;br /&gt;
Instead of this tutorial being overbearing with me rambling on for paragraphs, I&#039;m just going to post some excessively documented scripts and hopefully it should be enough for you to see how and why certain things are done.&lt;br /&gt;
&lt;br /&gt;
The two scripts I&#039;m going to cover is a healing beam and remote activated warheads (think like the Infyrno/Piranha, only the detonation would happen after impact).&lt;br /&gt;
&lt;br /&gt;
First, we will need some new weapons...&lt;br /&gt;
&lt;br /&gt;
== Weapons Table ==&lt;br /&gt;
(These two entries require assets from the 2014 mediavps)&lt;br /&gt;
&amp;lt;pre&amp;gt;#Primary Weapons&lt;br /&gt;
&lt;br /&gt;
$Name:							HealBeam#Tutorial&lt;br /&gt;
$Model File:					none&lt;br /&gt;
@Laser Bitmap:               	laserglow01&lt;br /&gt;
@Laser Color:					0, 255, 54&lt;br /&gt;
@Laser Length:					0.0&lt;br /&gt;
@Laser Head Radius:				0.3&lt;br /&gt;
@Laser Tail Radius:				0.3&lt;br /&gt;
$Mass:                          100.0&lt;br /&gt;
$Velocity:                      1600.0&lt;br /&gt;
$Fire Wait:                     30.0&lt;br /&gt;
$Damage:                        50&lt;br /&gt;
$Armor Factor:                  0.0&lt;br /&gt;
$Shield Factor:                 0.0&lt;br /&gt;
$Subsystem Factor:              0.0&lt;br /&gt;
$Lifetime:                      25.0&lt;br /&gt;
$Energy Consumed:               0.30&lt;br /&gt;
$Cargo Size:                    0.0&lt;br /&gt;
$Homing:                        NO&lt;br /&gt;
$LaunchSnd:                     124&lt;br /&gt;
$ImpactSnd:                     88&lt;br /&gt;
$Flags:                         (&amp;quot;Big Ship&amp;quot; &amp;quot;huge&amp;quot; &amp;quot;beam&amp;quot;)&lt;br /&gt;
$Impact Explosion:              ExpMissileHit1&lt;br /&gt;
$Impact Explosion Radius:       60.0&lt;br /&gt;
$BeamInfo:&lt;br /&gt;
	+Type:						0&lt;br /&gt;
	+Life:		  				7.5&lt;br /&gt;
	+Warmup:		  			3500&lt;br /&gt;
	+Warmdown:					3500&lt;br /&gt;
	+Radius:		  			120.0&lt;br /&gt;
	+PCount:					20&lt;br /&gt;
	+PRadius:					5.0&lt;br /&gt;
	+PAngle:					60.0&lt;br /&gt;
	+PAni:						particle_green&lt;br /&gt;
	+Miss Factor:				1.0 1.1 1.1 1.7 1.4&lt;br /&gt;
	+BeamSound:					115				;; the looping beam-firing sound&lt;br /&gt;
	+WarmupSound:				154				;; associated warmup sound&lt;br /&gt;
	+WarmdownSound:				158				;; associated warmdown sound&lt;br /&gt;
	+Muzzleglow:				beamglow3&lt;br /&gt;
	+Shots:						0&lt;br /&gt;
	+ShrinkFactor:				0.0&lt;br /&gt;
	+ShrinkPct:					0.0&lt;br /&gt;
	$Section:&lt;br /&gt;
		+Width:					45.0&lt;br /&gt;
		+Texture:				TerBeam1Core&lt;br /&gt;
		+RGBA Inner:			255 255 255 255&lt;br /&gt;
		+RGBA Outer:			150 150 150 10&lt;br /&gt;
		+Flicker:				0.0&lt;br /&gt;
		+Zadd:					4.0&lt;br /&gt;
		+Translation:			10&lt;br /&gt;
	$Section:&lt;br /&gt;
		+Width:					70.0&lt;br /&gt;
		+Texture:				TerBeam2Core&lt;br /&gt;
		+RGBA Inner:			160 160 0 255&lt;br /&gt;
		+RGBA Outer:			60 60 0 10&lt;br /&gt;
		+Flicker:				0.45&lt;br /&gt;
		+Zadd:					3.0&lt;br /&gt;
		+Translation:			7&lt;br /&gt;
	$Section:&lt;br /&gt;
		+Width:					80.0&lt;br /&gt;
		+Texture:				TerBeam2Glow&lt;br /&gt;
		+RGBA Inner:			255 255 255 255	&lt;br /&gt;
		+RGBA Outer:			150 150 150 10&lt;br /&gt;
		+Flicker:				0.4&lt;br /&gt;
		+Zadd:					2.0&lt;br /&gt;
		+Translation:			5&lt;br /&gt;
	$Section:	&lt;br /&gt;
		+Width:					100.0&lt;br /&gt;
		+Texture:				TerBeam2GlowHaze&lt;br /&gt;
		+RGBA Inner:			255 0 0 255&lt;br /&gt;
		+RGBA Outer:			60 0 0 10&lt;br /&gt;
		+Flicker:				0.5&lt;br /&gt;
		+Zadd:					0.0&lt;br /&gt;
		+Translation:			2&lt;br /&gt;
&lt;br /&gt;
#End&lt;br /&gt;
&lt;br /&gt;
#Secondary Weapons&lt;br /&gt;
&lt;br /&gt;
$Name:                                  Harpoon-RC#Tutorial&lt;br /&gt;
+Title:                                 XSTR(&amp;quot;GTM-19c Harpoon-Claymore&amp;quot;, -1)&lt;br /&gt;
+Description:&lt;br /&gt;
XSTR(&lt;br /&gt;
&amp;quot;Standard Issue&lt;br /&gt;
Fast Target Lock&lt;br /&gt;
Remote Control Detonate&amp;quot;, -1)&lt;br /&gt;
$end_multi_text&lt;br /&gt;
+Tech Title:				   XSTR(&amp;quot;GTM-19c Harpoon-Claymore&amp;quot;, -1)&lt;br /&gt;
+Tech Anim:					   Tech_Harpoon&lt;br /&gt;
+Tech Description:&lt;br /&gt;
XSTR(&lt;br /&gt;
&amp;quot;A modified version of the Harpoon missile. This variant has an armor piercing nosecose that embeds itself in the hull of an enemy ship, allowing the pilot to detonate the warhead at their discretion. While it has a limited role in an active combat zone, it is a favorite for cloak and dagger types in Special Operations.&amp;quot;, -1)&lt;br /&gt;
$end_multi_text&lt;br /&gt;
$Model File:							crossbow.pof&lt;br /&gt;
$Mass:									15.0&lt;br /&gt;
$Velocity:								250.0&lt;br /&gt;
$Fire Wait:								2.0&lt;br /&gt;
$Damage:								100													;; damage applied when within inner radius&lt;br /&gt;
$Blast Force:							60.0&lt;br /&gt;
$Inner Radius:							20.0                                       ;; radius at which damage is full (0 for impact only)&lt;br /&gt;
$Outer Radius:							40.0                                       ;; max radius for attenuated damage &lt;br /&gt;
$Shockwave Speed:						0                                         ;; velocity of shockwave.  0 for none.&lt;br /&gt;
$Armor Factor:							0.0&lt;br /&gt;
$Shield Factor:							0.0&lt;br /&gt;
$Subsystem Factor:						0.0&lt;br /&gt;
$Lifetime:								5.0&lt;br /&gt;
$Energy Consumed:						0.0													;; Energy used when fired&lt;br /&gt;
$Cargo Size:							2.5													;; Amount of space taken up in weapon cargo&lt;br /&gt;
$Homing:								YES&lt;br /&gt;
	;; the following indented fields are only required when $Homing is YES&lt;br /&gt;
	+Type:								ASPECT												;; Legal: HEAT, ASPECT&lt;br /&gt;
	+Turn Time:							1.0&lt;br /&gt;
	+Min Lock Time:						2.0													;; Minimum lock time (in seconds)&lt;br /&gt;
	+Lock Pixels/Sec:					70                                        ;; Pixels moved per sec while locking&lt;br /&gt;
	+Catch-up Pixels/Sec:				100													;; Pixels moved per sec while catching up&lt;br /&gt;
	+Catch-up Penalty:					30														;; Extra pixels to move after catching up&lt;br /&gt;
$LaunchSnd:								91                                        ;; The sound it makes when fired&lt;br /&gt;
$ImpactSnd:								88                                        ;; The sound it makes when it hits something&lt;br /&gt;
$FlyBySnd:								-1&lt;br /&gt;
$Rearm Rate:							2.0													;; number of missiles/sec that are rearmed&lt;br /&gt;
$Flags:									( &amp;quot;player allowed&amp;quot;)&lt;br /&gt;
$Trail:&lt;br /&gt;
	+Start Width:	0.3&lt;br /&gt;
	+End Width:		0&lt;br /&gt;
	+Start Alpha:	1.0&lt;br /&gt;
	+End Alpha:		0.0&lt;br /&gt;
	+Max Life:		2.5&lt;br /&gt;
	+Bitmap:		missiletrail06&lt;br /&gt;
$Icon:									iconCrossbow&lt;br /&gt;
$Anim:									cross&lt;br /&gt;
$Impact Explosion:						ExpMissileHit1&lt;br /&gt;
$Impact Explosion Radius:	9.92&lt;br /&gt;
$Piercing Impact Explosion:			exp06&lt;br /&gt;
$Piercing Impact Radius:			4.96&lt;br /&gt;
$Piercing Impact Velocity:			20&lt;br /&gt;
$Piercing Impact Splash Velocity:	-5&lt;br /&gt;
$Piercing Impact Variance:			0.1&lt;br /&gt;
$Piercing Impact Particles:			5&lt;br /&gt;
$Thruster Flame Effect:		missilethruster06&lt;br /&gt;
$Thruster Glow Effect:		missileglow06&lt;br /&gt;
&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Healing Beam Script ==&lt;br /&gt;
&amp;lt;pre&amp;gt;#Conditional Hooks&lt;br /&gt;
$Application: FS2_Open&lt;br /&gt;
$On Game Init:&lt;br /&gt;
[&lt;br /&gt;
function BeamHeal(ship) --We&#039;re expecting a ship type handle to be passed through&lt;br /&gt;
	&lt;br /&gt;
	if ship:isValid() then --Always check to see if these things are valid to be used!&lt;br /&gt;
	&lt;br /&gt;
		local healStep = ship.HitpointsMax * 0.002 --The heal rate is proportional to max health, so all ships heal to the max within the same amount of time. Alternatively healStep could be the damage of the weapon.&lt;br /&gt;
		--I&#039;ll leave that as a fun excercise for you to try! (Hint: you&#039;ll need an additional argument to get passed through in the function)&lt;br /&gt;
		&lt;br /&gt;
		if ship.HitpointsLeft &amp;lt;= ship.HitpointsMax then --It would be a good idea to only try to heal ships that have less than max health!&lt;br /&gt;
		&lt;br /&gt;
		--The ship in question will get its HP healed by healStep, so we should take what the end result would be after healing and make sure it won&#039;t go over the maximum amount of HP. If it doesn&#039;t we can just heal like normal, but if it does go over, we should just make it cap at max HP.&lt;br /&gt;
		&lt;br /&gt;
		--Mind you we could just heal and check afterwards if HP is over MaxHP, but it&#039;s probably better to ensure we touch ship properties as little as possible.&lt;br /&gt;
		&lt;br /&gt;
			if ship.HitpointsLeft + healStep &amp;lt;= ship.HitpointsMax then&lt;br /&gt;
				ship.HitpointsLeft = ship.HitpointsLeft + healStep&lt;br /&gt;
			else&lt;br /&gt;
				ship.HitpointsLeft = ship.HitpointsMax&lt;br /&gt;
			end&lt;br /&gt;
		&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--In a ship&#039;s handle, there are all the normal attributes, but if we use [] indices on the ship handle, we get the subsystem handles.&lt;br /&gt;
		--So ship[&amp;quot;communications&amp;quot;] should give us the communications subsystem. But does our ship have engine or engine01 and engine02?&lt;br /&gt;
		--Instead of explicitly going after the names of subsystem, we can just go through the whole thing with numerical indices.&lt;br /&gt;
			&lt;br /&gt;
		--for you people with some lua knowledge already, &amp;quot;for k,v in pairs()&amp;quot; won&#039;t work for these &amp;quot;virtual indexed&amp;quot; type of tables (they are slow for real time actions, so don&#039;t use them if you can avoid it!)&lt;br /&gt;
		--the best way is to go through these type of tables is to get the size of the table, assign it to a variable, then do a for loop through everything&lt;br /&gt;
		--real time looping should always be done with a numerical loop!&lt;br /&gt;
		&lt;br /&gt;
		local numSubsys = #ship  --#ship is the number of subsystems on the ship that we should heal&lt;br /&gt;
		&lt;br /&gt;
		for i=1, numSubsys do&lt;br /&gt;
		&lt;br /&gt;
		--We&#039;ll do the same type of checks on HP here as we did with the main health.&lt;br /&gt;
		&lt;br /&gt;
			if ship[i].HitpointsLeft &amp;lt;= ship[i].HitpointsMax then&lt;br /&gt;
				if ship[i].HitpointsLeft + healStep &amp;lt;= ship[i].HitpointsMax then&lt;br /&gt;
					ship[i].HitpointsLeft = ship[i].HitpointsLeft + healStep&lt;br /&gt;
				else&lt;br /&gt;
					ship[i].HitpointsLeft = ship[i].HitpointsMax&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
$Weapon class: HealBeam#Tutorial&lt;br /&gt;
$On Ship Collision:&lt;br /&gt;
[&lt;br /&gt;
--[[&lt;br /&gt;
	Here the the conditional hook is Weapon Class, and we&#039;ve defined it to only look at the HealBeam#Tutorial class.&lt;br /&gt;
	We change the $Weapon class: to weapons to make other weapons heal.&lt;br /&gt;
	Our action is On Ship Collision, and one of the hook variables for that action is hv.Object, which is the Object that has been collided with. So this bit of code will only run with HealBeam#Tutorial collides with a ship!&lt;br /&gt;
]]--&lt;br /&gt;
&lt;br /&gt;
	BeamHeal(hv.Object)&lt;br /&gt;
		&lt;br /&gt;
]&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Remote Activated Warhead Detonation Script==&lt;br /&gt;
&amp;lt;pre&amp;gt;#Conditional Hooks&lt;br /&gt;
$Application: FS2_Open&lt;br /&gt;
$On Game Init:&lt;br /&gt;
[&lt;br /&gt;
	&lt;br /&gt;
RCD = {} --Empty table object to get us started. Read up on Lua&#039;s Object Oriented flavored methods for more info on this sort of thing.&lt;br /&gt;
&lt;br /&gt;
function RCD:Init()&lt;br /&gt;
&lt;br /&gt;
	--But just a quick FYI, when we&#039;re within a function using that special colon operator, like we are right now, &amp;quot;self&amp;quot; is a special local variable that fills in for the parent object. So if we do &amp;quot;self.Enabled = true&amp;quot; this is the same as &amp;quot;RCD.Enabled = true&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	--The colon operator also inserts self into the first argument of the function. Again, check out the lua documentation for more on that!&lt;br /&gt;
	&lt;br /&gt;
	--We don&#039;t need to worry about defining variables as local if we&#039;re defining variables that are members of a larger table object. These variables are already local to just this table/object/class/whatever anyway!&lt;br /&gt;
	&lt;br /&gt;
	self.Enabled = true		--We may wish to stop our script, so let&#039;s have an enabled variable&lt;br /&gt;
	self.List = {}			--List will contain the list of ships that we hit and the local offsets of the hit.&lt;br /&gt;
	self.ExecuteKey = &amp;quot;D&amp;quot;	--When we hit the ExecuteKey, we will detonate all charges&lt;br /&gt;
	self.CheatKey = &amp;quot;5&amp;quot;		--Cheating to give ourselves the weapon... for test purposes of course!&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
function RCD:AddToList(weapon, object)&lt;br /&gt;
&lt;br /&gt;
	--We&#039;re expected to get a weapon and the object that the weapon has hit&lt;br /&gt;
&lt;br /&gt;
	local t = {} --t is going to be our temporary table before we officially insert it into self.List&lt;br /&gt;
	&lt;br /&gt;
	t.Damage = weapon.Class.Damage --Damage taken from the weapon, note that in the table the hull/shield/subsystem factors are all zero, so the initial hit will do no damage, but the actual damage will still get stored in here&lt;br /&gt;
	&lt;br /&gt;
	--Time for some 3d math, folks!&lt;br /&gt;
	--Small 3d math function reference&lt;br /&gt;
	--To go from a local relative offset to a global world vector:&lt;br /&gt;
	--globalVector = referenceOrientation:unrotateVector(localVector)&lt;br /&gt;
&lt;br /&gt;
	--To go from a global world vector to a local relative offset:&lt;br /&gt;
	--localVector = referenceOrientation:rotateVector(globalVector)&lt;br /&gt;
	&lt;br /&gt;
	--weapon.Position is a global world vector, and because our target is going to be flying around a lot, when we choose to detonate, that position will be too far away to damage our target. So we will use those functions to discover the local relative position to the hit object, and when we want to detonate we&#039;ll run the function in reverse to get the global world coordinates again.&lt;br /&gt;
&lt;br /&gt;
	t.Offset = object.Orientation:rotateVector(weapon.Position) - object.Position&lt;br /&gt;
	&lt;br /&gt;
	t.Object = object:getSignature() --Rather than saving an entire ship handle, which can get big and clumsy, we&#039;ll just grab the object signature&lt;br /&gt;
&lt;br /&gt;
	self.List[#self.List+1] = t --table[#table+1] is a easy build up a continous numerical table&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
function RCD:CauseDamage()&lt;br /&gt;
	&lt;br /&gt;
	--There is no createExplosion() function, so we&#039;ll have to use the SEXP with mn.runSEXP()&lt;br /&gt;
	&lt;br /&gt;
	local listLength = #self.List --First find out how many charges we&#039;ve got to blow up&lt;br /&gt;
	&lt;br /&gt;
	for i = 1, listLength do&lt;br /&gt;
	&lt;br /&gt;
		local boom = self.List[i] --self.List[i] is so tedious to type&lt;br /&gt;
		local target = mn.getObjectFromSignature(boom.Object) --We need this to get the global position&lt;br /&gt;
		local pos = target.Position + target.Orientation:unrotateVector(boom.Offset) --And now we unrotate the offset from last time&lt;br /&gt;
		&lt;br /&gt;
		--Boom!&lt;br /&gt;
		mn.runSEXP(&amp;quot;( explosion-effect &amp;quot; .. pos.x .. &amp;quot; &amp;quot; .. pos.y .. &amp;quot; &amp;quot; .. pos.z .. &amp;quot; &amp;quot; .. boom.Damage .. &amp;quot; 10 100 10 100 0 0 7 )&amp;quot;)&lt;br /&gt;
		&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	--After we&#039;ve gone through the entire list, we will revert the list back to an empty object&lt;br /&gt;
	self.List = {}&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
$On Gameplay Start:&lt;br /&gt;
[&lt;br /&gt;
	--On Gameplay Start will only occur right after the briefing is done, as gameplay begins.&lt;br /&gt;
	RCD:Init()&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
$Weapon class: Harpoon-RC#Tutorial&lt;br /&gt;
$On Ship Collision:&lt;br /&gt;
[&lt;br /&gt;
&lt;br /&gt;
	--For the Harpoon-RC#Tutorial, upon hitting a ship we should...&lt;br /&gt;
	--Add it to a list!&lt;br /&gt;
	if RCD.Enabled then&lt;br /&gt;
		RCD:AddToList(hv.Weapon, hv.Object)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
$State: GS_STATE_GAME_PLAY&lt;br /&gt;
$On Key Released:&lt;br /&gt;
[&lt;br /&gt;
	&lt;br /&gt;
	--During gameplay, when any key is released, this block of code will be run. The important hook variable here is hv.Key, so we check that to see if it matches any keys and if so, we&#039;ll do run some functions.&lt;br /&gt;
&lt;br /&gt;
	if RCD.Enabled then&lt;br /&gt;
		if hv.Key == RCD.ExecuteKey then&lt;br /&gt;
			RCD:CauseDamage()&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--Comment out this part if we want to not allow cheating, this is only for testing anyway...&lt;br /&gt;
		if hv.Key == RCD.CheatKey then&lt;br /&gt;
			hv.Player.SecondaryBanks[1].WeaponClass = tb.WeaponClasses[&amp;quot;Harpoon-RC#Tutorial&amp;quot;]&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here&#039;s a [http://lazymodders.fsmods.net/files/LuaTutorial.rar link to a complete sample mod] with a test mission.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you&#039;re unfamiliar with anything I did, check out the [http://www.lua.org/docs.html Lua Documentation website] or shoot me (Axem) a PM on the hard-light forums.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re curious about the fastest methods to do certain things in Lua during time-critical events (such as during On HUD Draw or On Frame), check out [http://springrts.com/wiki/Lua_Performance these benchmarks] done on some various methods.&lt;br /&gt;
&lt;br /&gt;
Hopefully this gets you on your way to crafting fun and amazing scripts for FreeSpace!&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44364</id>
		<title>User:Axem</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44364"/>
		<updated>2014-12-02T00:54:08Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Tutorials */ Another fun tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About Axem!==&lt;br /&gt;
Hello! I am Axem, friendly administrator on the HLP forums. I can FRED (make missions), model, UVMap, texture, script and make rough effects. Just don&#039;t ask me to do any of it for you, I&#039;ve got enough to do! But I can help guide you to the right path. Below you&#039;ll find some of the stuff I&#039;ve done here over the years.&lt;br /&gt;
&lt;br /&gt;
==My Campaigns==&lt;br /&gt;
*[[Shadows of Kraken]]&lt;br /&gt;
*[[Just Another Day]]&lt;br /&gt;
*[[Just Another Day 2: Electric Boogaloo]]&lt;br /&gt;
*[[Just Another Day 3: Shivans on a Plane]]&lt;br /&gt;
*[[Vassago&#039;s Dirge]]&lt;br /&gt;
*[[Just Another Day 2.21: You Are (Not) Alpha 1]]&lt;br /&gt;
&lt;br /&gt;
==Projects I Help With==&lt;br /&gt;
*[[Diaspora]]&lt;br /&gt;
*[[Blue Planet]]&lt;br /&gt;
*[[Wings of Dawn]]&lt;br /&gt;
&lt;br /&gt;
==My Ships==&lt;br /&gt;
&lt;br /&gt;
*[[GTC Cretheus]]&lt;br /&gt;
*[[SC Lamia]]&lt;br /&gt;
*[[SGs Asura]] (textured by Nighteyes)&lt;br /&gt;
*[[UES Aranyaka]]&lt;br /&gt;
&lt;br /&gt;
Other WIPS can be seen on my [http://p3d.in/u/Axem p3d page]&lt;br /&gt;
&lt;br /&gt;
==Helpful Pages I&#039;ve Done==&lt;br /&gt;
===Tutorials===&lt;br /&gt;
*[[Tutorial - Conditional Arguments]]&lt;br /&gt;
*[[Tutorial - Directive-is-variable SEXP]]&lt;br /&gt;
*[[Tutorial - Mission Infrastructure]]&lt;br /&gt;
*[[Tutorial - PCS2 Kitbashing]]&lt;br /&gt;
*[[Tutorial - Custom HUD Gauges]]&lt;br /&gt;
*[[Tutorial - Fun with Simulated Hull]]&lt;br /&gt;
*[[Tutorial - Bitwise Operations]]&lt;br /&gt;
*[[Tutorial - FSOpen and LUA #1 - SEXP Library]]&lt;br /&gt;
*[[Tutorial - FSOpen and LUA 2 - Hook Variables and Handles]]&lt;br /&gt;
*[[Tutorial - FSOpen and LUA 3 - Conditional Actions and Hooks]]&lt;br /&gt;
&lt;br /&gt;
===SEXP Reference===&lt;br /&gt;
*[[Advanced Cutscene SEXP Reference]]&lt;br /&gt;
===Script Reference===&lt;br /&gt;
*[[Script - Journal/Fluff Viewer]]&lt;br /&gt;
*[[Script - System Viewer]]&lt;br /&gt;
*[[Script - Interface Monitor]]&lt;br /&gt;
*[[Script - Scripted Message Gauge]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Tutorial_-_FSOpen_and_LUA_2_-_Hook_Variables_and_Handles&amp;diff=44349</id>
		<title>Tutorial - FSOpen and LUA 2 - Hook Variables and Handles</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Tutorial_-_FSOpen_and_LUA_2_-_Hook_Variables_and_Handles&amp;diff=44349"/>
		<updated>2014-11-03T01:33:10Z</updated>

		<summary type="html">&lt;p&gt;Axem: New LUA tutorial!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the last tutorial, we concerned ourselves with a very simple sexp library that really requires next to no real Lua knowledge at all. We&#039;re going to take one of the examples from the last tutorial and actually add a few Lua specific things.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;function Lockdown(name)&lt;br /&gt;
&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-primary-weapon !&amp;quot; .. name .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-secondary-weapon !&amp;quot; .. name .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-afterburner !&amp;quot; .. name .. &amp;quot;! )&amp;quot;) &lt;br /&gt;
mn.runSEXP(&amp;quot;(disable-ets !&amp;quot; .. name .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(player-use-ai )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(add-goal !&amp;quot; .. name .. &amp;quot;! ( ai-play-dead 200 ) )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-perspective ( true) )&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember that? That&#039;s the function we were using to lock the player&#039;s ship down so we could do cutscene stuff. But couldn&#039;t we do something where it could just automatically affect the player&#039;s ship without needing us to input the player&#039;s ship name? It could save me like 5 seconds!&lt;br /&gt;
&lt;br /&gt;
== Hook Variables ==&lt;br /&gt;
&lt;br /&gt;
Of course there is. And we can do this through what is called a hook variable. Hook variables are variables that hook on to a well-defined situation or action. Most hook variables are specific to an $Action, but there are two that are nearly always valid in a gameplay setting. Player and Viewer. Player will return the player&#039;s object (or ship) if it is valid, and Viewer will return the non-player ship we are viewing from (when using target camera commands). We&#039;re just interested in the Player hook variable. All hook variables are part of the hv library, so we would refer to the player&#039;s ship with hv.Player.&lt;br /&gt;
&lt;br /&gt;
A complete listing of hook variables and which $Action they apply to can be found here, on the [[Scripting.tbl#Actions| scripting.tbl page.]]&lt;br /&gt;
&lt;br /&gt;
So on a line before we start the mn.runSEXPs let us add…&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;local player = hv.Player&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Whoa, there I go again, adding new things without warning. What&#039;s local player and why are we assigning it as hv.Player?&lt;br /&gt;
&lt;br /&gt;
Adding the word local in front of a variable declaration will make that variable local (which means it can only be used in the current block of code). It is good practice to use local variables whenever possible. By default, variables are global in Lua (in contrast to C related languages where variables are already local by default). By making the variable local, we can assign it a generic name without worrying that it might conflict with something else in another script. Also Lua accesses local variables faster than a global variable, so we&#039;re doing this not only for us, but for our precious CPU cycles!&lt;br /&gt;
&lt;br /&gt;
== Handles ==&lt;br /&gt;
&lt;br /&gt;
Okay, so we have this player variable. What can we do with it? Remember that scripting.html we might have generated in the last tutorial? (If not, open your launcher, go to the Dev Tool section, tick generate scripting.html, run the game, quit, and there should be a scripting.html in your root FreeSpace directory). Navigate over to it and open it up. Player is a &amp;quot;ship&amp;quot; type handle. A handle is our fancy name for these special variables that contain a lot of &amp;quot;user data&amp;quot;, or what is specific to FreeSpace. If we scroll down a bit, in the types listing, we will find a ship type link.&lt;br /&gt;
&lt;br /&gt;
If we click it we&#039;ll get jumped to ship:object. The :object part means that ship is sort of a sub-type of object. Everything in object also applies to ship. But that&#039;s not important now. Look at all of these fun properties we can use and abuse. Most of these properties are bi-directional. You can read a property or assign something a new value on the fly.&lt;br /&gt;
&lt;br /&gt;
The listings here tell you what type of data will get returned if you try and read data from it, and what type of data is expected when you try and assign it a value. 99.999% of the time, those two are the same thing.&lt;br /&gt;
&lt;br /&gt;
So what were we doing here again? Oh, right. We want to get the player&#039;s ship&#039;s name. Why look, here is a Name property. (Name is one of the few properties that I would highly highly super strictly never write to, missions aren&#039;t going to take the name change very nicely!) So how do we access the property? Just like this…&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;player.Name&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So let&#039;s just add this stuff to our script from last time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;function Lockdown(name)&lt;br /&gt;
&lt;br /&gt;
local player = hv.Player&lt;br /&gt;
name = player.Name&lt;br /&gt;
&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-primary-weapon !&amp;quot; .. name .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-secondary-weapon !&amp;quot; .. name  .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-afterburner !&amp;quot; .. name  .. &amp;quot;! )&amp;quot;) &lt;br /&gt;
mn.runSEXP(&amp;quot;(disable-ets !&amp;quot; .. name  .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(player-use-ai )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(add-goal !&amp;quot; .. name  .. &amp;quot;! ( ai-play-dead 200 ) )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-perspective ( true) )&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Hey hold on, why doesn&#039;t name have local in front of it? Well, because name was defined as an argument to the function, the variable name is already local to the function. Adding local in front of name would just confuse Lua anyway.&lt;br /&gt;
&lt;br /&gt;
So now when the function runs, it take the player&#039;s handle, throws it into this local variable, then when we&#039;re constructing the string for runSEXP to use, we&#039;re using the Name property from the player&#039;s handle. So wait, why do we even need that name argument? Couldn&#039;t we just modify the function declaration to be&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;function Lockdown()&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And then make name a local variable to keep it simple?&lt;br /&gt;
&lt;br /&gt;
Sure, but let&#039;s add some intelligence to this function. Let&#039;s say if we leave the argument blank, the function will lockdown the player, but if we have a ship name in there, we mean THAT ship (maybe we want to lock down an AI friend?)&lt;br /&gt;
&lt;br /&gt;
So remember what I said last tutorial about empty arguments?&lt;br /&gt;
&lt;br /&gt;
&amp;quot;NOTE: If the argument is empty and does NOT have anything in it, the argument will then &amp;quot;contain&amp;quot; a special value called nil. Nil is Lua&#039;s version of null (or empty), it basically means it does not exist. Using something that is nil will result in errors everywhere! In a later tutorial we&#039;ll do checks for nil, for now just be mindful of the arguments you pass through functions.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So we&#039;ll check if name is nil or not. For that we need an if statement! There&#039;s a few ways we can check to see if a variable is carrying something useful for us to use. Generally if its &amp;quot;carrying&amp;quot; nil, then it&#039;s not useful. To find out if we entered something into name we could go…&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if name ~= nil then&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So if name is not nil then we do stuff. But there&#039;s a slightly easier way to type that…&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if name then&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When an if statement evaluates just a lone variable, no comparisons attached or anything it will only return false if the variable is nil or false. So if name contains useful, it would pass the logic test and go through. But we don&#039;t want to know if a variable contains something useful, we&#039;re interested in the opposite.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if not name then&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now with the not operator, we&#039;ve flipped the logic around. Now we&#039;ll only pass the logic test if name is nil or false. And so we will write…&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if not name and hv.Player:isValid() then&lt;br /&gt;
  local player = hv.Player&lt;br /&gt;
  name = player.Name&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Yeesh, what&#039;s this new stuff again? Well, we want to make sure the player is actually a valid handle to use. Otherwise, we get errors. But we couldn&#039;t just do the same thing as we did with name. hv.Player won&#039;t be nil or false if a player dies. The handle just becomes invalid, so while it would pass that logic test, but the data inside is all messed up and wrong. So many handles have a :isValid() check to it that determines if the handle is safe to use.&lt;br /&gt;
&lt;br /&gt;
Well I hope this guides you on your way to lua scripting. The next tutorial will conditional actions and keeping your scripts efficient.&lt;br /&gt;
&lt;br /&gt;
Final Script:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;function Lockdown(name)&lt;br /&gt;
&lt;br /&gt;
if not name and hv.Player:isValid() then&lt;br /&gt;
   local player = hv.Player&lt;br /&gt;
   name = player.Name&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-primary-weapon !&amp;quot; .. name .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-secondary-weapon !&amp;quot; .. name  .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-afterburner !&amp;quot; .. name  .. &amp;quot;! )&amp;quot;) &lt;br /&gt;
mn.runSEXP(&amp;quot;(disable-ets !&amp;quot; .. name  .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(player-use-ai )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(add-goal !&amp;quot; .. name  .. &amp;quot;! ( ai-play-dead 200 ) )&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-perspective ( true) )&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function UnLockdown(name)&lt;br /&gt;
&lt;br /&gt;
if not name and hv.Player:isValid() then&lt;br /&gt;
   local player = hv.Player&lt;br /&gt;
   name = player.Name&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
mn.runSEXP(&amp;quot;(unlock-primary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(unlock-secondary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(unlock-afterburner !&amp;quot; .. name .. &amp;quot;!)&amp;quot; ) &lt;br /&gt;
mn.runSEXP(&amp;quot;(enable-ets !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(player-not-use-ai)&amp;quot;) &lt;br /&gt;
mn.runSEXP(&amp;quot;(clear-goals !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
mn.runSEXP(&amp;quot;(lock-perspective ( false ) )&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44348</id>
		<title>User:Axem</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44348"/>
		<updated>2014-11-03T01:19:28Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Tutorials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About Axem!==&lt;br /&gt;
Hello! I am Axem, friendly administrator on the HLP forums. I can FRED (make missions), model, UVMap, texture, script and make rough effects. Just don&#039;t ask me to do any of it for you, I&#039;ve got enough to do! But I can help guide you to the right path. Below you&#039;ll find some of the stuff I&#039;ve done here over the years.&lt;br /&gt;
&lt;br /&gt;
==My Campaigns==&lt;br /&gt;
*[[Shadows of Kraken]]&lt;br /&gt;
*[[Just Another Day]]&lt;br /&gt;
*[[Just Another Day 2: Electric Boogaloo]]&lt;br /&gt;
*[[Just Another Day 3: Shivans on a Plane]]&lt;br /&gt;
*[[Vassago&#039;s Dirge]]&lt;br /&gt;
*[[Just Another Day 2.21: You Are (Not) Alpha 1]]&lt;br /&gt;
&lt;br /&gt;
==Projects I Help With==&lt;br /&gt;
*[[Diaspora]]&lt;br /&gt;
*[[Blue Planet]]&lt;br /&gt;
*[[Wings of Dawn]]&lt;br /&gt;
&lt;br /&gt;
==My Ships==&lt;br /&gt;
&lt;br /&gt;
*[[GTC Cretheus]]&lt;br /&gt;
*[[SC Lamia]]&lt;br /&gt;
*[[SGs Asura]] (textured by Nighteyes)&lt;br /&gt;
*[[UES Aranyaka]]&lt;br /&gt;
&lt;br /&gt;
Other WIPS can be seen on my [http://p3d.in/u/Axem p3d page]&lt;br /&gt;
&lt;br /&gt;
==Helpful Pages I&#039;ve Done==&lt;br /&gt;
===Tutorials===&lt;br /&gt;
*[[Tutorial - Conditional Arguments]]&lt;br /&gt;
*[[Tutorial - Directive-is-variable SEXP]]&lt;br /&gt;
*[[Tutorial - Mission Infrastructure]]&lt;br /&gt;
*[[Tutorial - PCS2 Kitbashing]]&lt;br /&gt;
*[[Tutorial - Custom HUD Gauges]]&lt;br /&gt;
*[[Tutorial - Fun with Simulated Hull]]&lt;br /&gt;
*[[Tutorial - Bitwise Operations]]&lt;br /&gt;
*[[Tutorial - FSOpen and LUA #1 - SEXP Library]]&lt;br /&gt;
*[[Tutorial - FSOpen and LUA 2 - Hook Variables and Handles]]&lt;br /&gt;
&lt;br /&gt;
===SEXP Reference===&lt;br /&gt;
*[[Advanced Cutscene SEXP Reference]]&lt;br /&gt;
===Script Reference===&lt;br /&gt;
*[[Script - Journal/Fluff Viewer]]&lt;br /&gt;
*[[Script - System Viewer]]&lt;br /&gt;
*[[Script - Interface Monitor]]&lt;br /&gt;
*[[Script - Scripted Message Gauge]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44347</id>
		<title>User:Axem</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44347"/>
		<updated>2014-11-03T01:19:02Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Tutorials */ Adding a new tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About Axem!==&lt;br /&gt;
Hello! I am Axem, friendly administrator on the HLP forums. I can FRED (make missions), model, UVMap, texture, script and make rough effects. Just don&#039;t ask me to do any of it for you, I&#039;ve got enough to do! But I can help guide you to the right path. Below you&#039;ll find some of the stuff I&#039;ve done here over the years.&lt;br /&gt;
&lt;br /&gt;
==My Campaigns==&lt;br /&gt;
*[[Shadows of Kraken]]&lt;br /&gt;
*[[Just Another Day]]&lt;br /&gt;
*[[Just Another Day 2: Electric Boogaloo]]&lt;br /&gt;
*[[Just Another Day 3: Shivans on a Plane]]&lt;br /&gt;
*[[Vassago&#039;s Dirge]]&lt;br /&gt;
*[[Just Another Day 2.21: You Are (Not) Alpha 1]]&lt;br /&gt;
&lt;br /&gt;
==Projects I Help With==&lt;br /&gt;
*[[Diaspora]]&lt;br /&gt;
*[[Blue Planet]]&lt;br /&gt;
*[[Wings of Dawn]]&lt;br /&gt;
&lt;br /&gt;
==My Ships==&lt;br /&gt;
&lt;br /&gt;
*[[GTC Cretheus]]&lt;br /&gt;
*[[SC Lamia]]&lt;br /&gt;
*[[SGs Asura]] (textured by Nighteyes)&lt;br /&gt;
*[[UES Aranyaka]]&lt;br /&gt;
&lt;br /&gt;
Other WIPS can be seen on my [http://p3d.in/u/Axem p3d page]&lt;br /&gt;
&lt;br /&gt;
==Helpful Pages I&#039;ve Done==&lt;br /&gt;
===Tutorials===&lt;br /&gt;
*[[Tutorial - Conditional Arguments]]&lt;br /&gt;
*[[Tutorial - Directive-is-variable SEXP]]&lt;br /&gt;
*[[Tutorial - Mission Infrastructure]]&lt;br /&gt;
*[[Tutorial - PCS2 Kitbashing]]&lt;br /&gt;
*[[Tutorial - Custom HUD Gauges]]&lt;br /&gt;
*[[Tutorial - Fun with Simulated Hull]]&lt;br /&gt;
*[[Tutorial - Bitwise Operations]]&lt;br /&gt;
*[[Tutorial - FSOpen and LUA #1 - SEXP Library]]&lt;br /&gt;
*[[Tutorial - FSOpen and LUA #2 - Hook Variables and Handles]]&lt;br /&gt;
&lt;br /&gt;
===SEXP Reference===&lt;br /&gt;
*[[Advanced Cutscene SEXP Reference]]&lt;br /&gt;
===Script Reference===&lt;br /&gt;
*[[Script - Journal/Fluff Viewer]]&lt;br /&gt;
*[[Script - System Viewer]]&lt;br /&gt;
*[[Script - Interface Monitor]]&lt;br /&gt;
*[[Script - Scripted Message Gauge]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Tutorial_-_FSOpen_and_LUA&amp;diff=44320</id>
		<title>Tutorial - FSOpen and LUA</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Tutorial_-_FSOpen_and_LUA&amp;diff=44320"/>
		<updated>2014-10-05T16:24:33Z</updated>

		<summary type="html">&lt;p&gt;Axem: Oops forgot a pic&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;One of the coolest things that&#039;s been added to FreeSpace Open is the Lua scripting language. It allows a certain amount of freedom that SEXPs don&#039;t allow, but on the other hand Lua is a lot more, let&#039;s say, risky. FreeSpace has a lot of error checking and can handle any dumb SEXP efforts with a shrug. Lua runs a more unregulated campaign and, if you&#039;re not careful, can spew out baffling error messages that leave you clueless even after an hour on Google.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a lot of basic Lua tutorials around the internet, so I&#039;m not going to get into the specifics too much. Read up on them if you&#039;re curious. There&#039;s just very little in the way of how FreeSpace and Lua interact with each other. If I want to do X with Lua, how would you even begin?&lt;br /&gt;
&lt;br /&gt;
First we need a few tools. First is a good text editor, I suggest Notepad++! You should also generate a scripting.html file from FreeSpace. Go into your launcher and in the Dev Tool section, tick the &amp;quot;Output scripting to scripting.html&amp;quot; box. Run FreeSpace and then just quit. In your FreeSpace directory will be a scripting.html file. This will be very valuable to us, it lists all of the game accessible information we can use for our nefarious purposes.&lt;br /&gt;
&lt;br /&gt;
So what is our first project going to be? A super lame &amp;quot;Hello World&amp;quot; script? Those are so overdone. Let&#039;s do something that is still simple but is also something you could actually use in your campaign, a SEXP library.&lt;br /&gt;
&lt;br /&gt;
The concept of a SEXP library is simple: we have some SEXPs that we want to use in multiple missions, and instead of copy and pasting them in multiple missions, we will store them in a Lua function that can be called upon in any mission and be executed.&lt;br /&gt;
&lt;br /&gt;
The SEXP library we make will contain 2 groups of SEXPs: 1. Lockdown the player&#039;s fighter&#039;s for in-game cutscenes and 2. Properly cloaking a ship (linking the stealth with the visual effect).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. In-game Cutscene Lockdown ==&lt;br /&gt;
&lt;br /&gt;
We&#039;ve all been there haven&#039;t we? Make an in-game cutscene. Watch it, and accidently slip and press primary fire and hear your Subachs fire. Press an ETS key and hear that immersion breaking sound. It&#039;s terrible. So what do you do? Add 5 sexps that lock player weapons, afterburner, ETS etc etc. Such a pain, right? Let&#039;s rectify this by allowing us to combine all the sexps we would use into a single Lua function. That way we can just use a single script-eval function and, presto! Those sexps will all get run, no muss, no fuss.&lt;br /&gt;
	&lt;br /&gt;
There&#039;s quite a few ways you can run Lua scripts. This will not be the only correct way to do things, but it’s a way that I feel is easily readable and accessible. You could stuff all your scripts into a single scripting.tbl, but it might get pretty large and unwieldy if you add a lot of Lua. I like to just create smaller modular scripting tables.&lt;br /&gt;
	&lt;br /&gt;
Below is the basic framework of a script, saved as sexplibrary-sct.tbm. The -sct.tbm will clue FreeSpace in that this is a Lua scripting file.&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;#Conditional Hooks&lt;br /&gt;
$Application: FS2_Open&lt;br /&gt;
$On Game Init:&lt;br /&gt;
[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
]&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
First we need to tell the game what type of hook we&#039;re going to run. There are Global Hooks, State Hooks, and Conditional Hooks. Global Hooks run regardless of state or condition. I&#039;d advise staying away from Global Hooks unless you really know what you&#039;re doing. State Hooks aren&#039;t really used anymore, the Conditional Hooks are more flexible and better. Conditional Hooks will only check actions that we define later if the condition is met. There&#039;s also other game-wise benefits to using Conditional Hooks, [[Scripting.tbl#.23Conditional_Hooks|this part]] from the scripting.tbl wiki page sums it up well enough.&lt;br /&gt;
	&lt;br /&gt;
So I put down &#039;&#039;#Conditional Hooks&#039;&#039;, and the condition is &#039;&#039;$Application: FS2_Open&#039;&#039;, and our action is &#039;&#039;$On Game Init:&#039;&#039;. So basically when our application is FS2_Open (which will be… always), during game initialization do this stuff between the square brackets. And then of course our &#039;&#039;#End&#039;&#039; token.&lt;br /&gt;
	&lt;br /&gt;
I like to put down any function definitions in &#039;&#039;$On Game Init&#039;&#039;. That way all the functions will be ready for any script to use right away. If you&#039;re really paranoid about memory usage, you could move it to an initialization function, but you still need to define it somewhere!&lt;br /&gt;
	&lt;br /&gt;
So next we should define the Lua function that will house our SEXPs.&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;function Lockdown(name)&lt;br /&gt;
	&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
Function will define Lockdown as the function and the () is where we would put in any additional arguments. Our additional argument here is just name, it will be the name of the ship that we lockdown. And the Lua interpreter needs to know when to stop the function, so that&#039;s where the end comes in.&lt;br /&gt;
	&lt;br /&gt;
Now we need to think what sexps we would call for &#039;&#039;Lockdown()&#039;&#039;.&lt;br /&gt;
	&lt;br /&gt;
*Lock-primary-weapon&lt;br /&gt;
*Lock-secondary-weapon&lt;br /&gt;
*Lock-afterburner&lt;br /&gt;
*Disable-ETS&lt;br /&gt;
*Player-use-AI&lt;br /&gt;
*Add-Goal ai-play-dead on the player&lt;br /&gt;
**(alternatively ship-immobile if you&#039;re not going to use the player&#039;s ship in the cutscene)&lt;br /&gt;
*Lock-perspective&lt;br /&gt;
	&lt;br /&gt;
That&#039;s 7 sexps, surely this will increase our FREDding power by 700%!&lt;br /&gt;
	&lt;br /&gt;
If we look in the scripting.html and go into the mission library section, we&#039;ll find this cute little function.&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;boolean &#039;&#039;&#039;&#039;&#039;runSEXP&#039;&#039;&#039;(&#039;&#039;string&#039;&#039;)&lt;br /&gt;
:Runs the defined SEXP script&lt;br /&gt;
:&#039;&#039;&#039;Returns&#039;&#039;&#039;: if the operation was successful&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;runSEXP&#039;&#039;, as the name implies, allows us to run a SEXP as if it was being called by a mission event. Which is funny because this function will get called by a mission event anyway! The argument to &#039;&#039;runSEXP&#039;&#039; (the part that goes in the ()) is the same text that FRED writes to events. If we make an event that is just lock-primary-weapon and look at it in a text editor, it looks like…&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;$Formula: ( when &lt;br /&gt;
	   ( true ) &lt;br /&gt;
	   ( lock-primary-weapon &amp;quot;Alpha 1&amp;quot; ) &lt;br /&gt;
	)&lt;br /&gt;
	+Name: Lock Primary Weapon&lt;br /&gt;
	+Repeat Count: 1&lt;br /&gt;
	+Interval: 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
But all we&#039;re really interested in is...&lt;br /&gt;
&amp;lt;pre&amp;gt;(lock-primary-weapon &amp;quot;Alpha 1&amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your sexps have line breaks in them, be sure to take those out so they are all on one line. Lua would think we&#039;re done with the sexp long before we actually are.&lt;br /&gt;
	&lt;br /&gt;
So our first runSEXP function would look like…&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;mn.runSEXP(&amp;quot;(lock-primary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
Wait, hold on. What&#039;s this extra stuff I just sprung in front of you? Why is that mn there? And why are there EXCLAIMATION MARKS!! AND DOTS!&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;runSEXP&#039;&#039; is a function that is part of a larger library, the mission library. The mission library&#039;s internal name is just mn. Anytime we want to use a function inside a library, we need to add mn. in front of it so the Lua interpreter knows where to look.&lt;br /&gt;
	&lt;br /&gt;
Now the argument for &#039;&#039;runSEXP&#039;&#039; is a string, and Lua sees everything between two &amp;quot; as a string. So if we were to just run&lt;br /&gt;
&amp;lt;pre&amp;gt;mn.runSEXP(&amp;quot;(lock-primary-weapon &amp;quot;Alpha 1&amp;quot;)&amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Lua Interpreter would see &amp;quot;lock-primary-weapon&amp;quot; and &amp;quot;&amp;quot;. It doesn&#039;t see the Alpha 1 because it&#039;s in the middle of two pairs of &amp;quot;s. So there&#039;s a bit of sly substitution that goes on, all !s are replaced with &amp;quot;s during evaluation. So if you&#039;re using the &#039;&#039;runSEXP&#039;&#039; or &#039;&#039;evaluateSEXP&#039;&#039; functions, replace those &amp;quot;s in the SEXP with !s.&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;name&#039;&#039; is a variable that has the argument that we specified before in the function definition. If we were to go...&lt;br /&gt;
&amp;lt;pre&amp;gt;Lockdown(&#039;Alpha 1&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then &#039;&#039;name&#039;&#039; inside the function will be replace with &amp;quot;Alpha 1&amp;quot;. The &#039;&#039;..&#039;&#039; is called a concatenation operator. Concatenation is when you combine two strings together. So we combine the &amp;quot;lock-primary-weapon !&amp;quot; string with the name variable, and then combine that with the last &amp;quot;!&amp;quot;.&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If the argument is empty and does NOT have anything in it, the argument will then &amp;quot;contain&amp;quot; a special value called nil. &#039;&#039;&#039;Nil&#039;&#039;&#039; is Lua&#039;s version of null (or empty), it basically means it does not exist. Using something that is nil will result in errors everywhere! In a later tutorial we&#039;ll do checks for nil, for now just be mindful of the arguments you pass through functions.&lt;br /&gt;
	&lt;br /&gt;
So that&#039;s one line, let us do the same thing to other lines. It would probably be a good idea to create the sexps first in a mission, save the mission and then copy and paste the relevant lines into your script. The game expects SEXPs to be without syntax errors because FRED knows how to do it without any reminders. We fleshy humans aren&#039;t that good, so take all precautions!&lt;br /&gt;
	&lt;br /&gt;
So here&#039;s the full function, plus another function that undoes the SEXPs.&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;function Lockdown(name)&lt;br /&gt;
	&lt;br /&gt;
	mn.runSEXP(&amp;quot;(lock-primary-weapon !&amp;quot; .. name .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(lock-secondary-weapon !&amp;quot; .. name .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(lock-afterburner !&amp;quot; .. name .. &amp;quot;! )&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(disable-ets !&amp;quot; .. name .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(player-use-ai )&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(add-goal !&amp;quot; .. name .. &amp;quot;! ( ai-play-dead 200 ) )&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(lock-perspective ( true) )&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
function UnLockdown(name)&lt;br /&gt;
	&lt;br /&gt;
	mn.runSEXP(&amp;quot;(unlock-primary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(unlock-secondary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(unlock-afterburner !&amp;quot; .. name .. &amp;quot;!)&amp;quot; ) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(enable-ets !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(player-not-use-ai)&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(clear-goals !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(lock-perspective ( false ) )&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To use these functions within the game, we need to call the script-eval sexp. And it would look something like…&lt;br /&gt;
&lt;br /&gt;
[[file:Lockdown.png]]&lt;br /&gt;
	&lt;br /&gt;
Notice how I used a single quotation mark instead of a double one. The reason for this is pretty much the same as using the ! before. It’s a way to define the boundaries of a string without actually breaking the string in the process.&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
It&#039;s sort of hard to show these functions off with screenshots, so you&#039;ll just have to try them yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Cloaking Ships + Stealth ==&lt;br /&gt;
&lt;br /&gt;
	There&#039;s a neat sexp in the special-effects category, ship-effect. Some of the options are cloak and decloak. The only problem is that if you cloak a ship, the effect is only visual! You can still target it. How lame is that? Sure we could just do a lot of ship-effects + ship-stealthy, but why couldn&#039;t we just do both at the same time like the Lockdown functions?&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;function Cloak(name)&lt;br /&gt;
	&lt;br /&gt;
	mn.runSEXP(&amp;quot;(ship-effect !Cloak! 1000 !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(ship-stealthy !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(friendly-stealth-invisible !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
function Decloak(name)&lt;br /&gt;
	&lt;br /&gt;
	mn.runSEXP(&amp;quot;(ship-effect !Decloak! 1000 !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(ship-unstealthy !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(friendly-stealth-visible !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
See how easy that was? Especially without me having to explain every detail?&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
So this is a good start into Lua with FreeSpace without actually needing to know Lua. In the next tutorial, we&#039;ll actually get into things like object handles and unique Lua magic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Full Table use for Tutorial ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#Conditional Hooks&lt;br /&gt;
$Application: FS2_Open&lt;br /&gt;
$On Game Init:&lt;br /&gt;
[&lt;br /&gt;
&lt;br /&gt;
function Lockdown(name)&lt;br /&gt;
&lt;br /&gt;
   mn.runSEXP(&amp;quot;(lock-primary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(lock-secondary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(lock-afterburner !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(disable-ets !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(player-use-ai)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(add-goal !&amp;quot; .. name .. &amp;quot;! ( ai-play-dead 200 ))&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(lock-perspective (true))&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function UnLockdown(name)&lt;br /&gt;
&lt;br /&gt;
   mn.runSEXP(&amp;quot;(unlock-primary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(unlock-secondary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(unlock-afterburner !&amp;quot; .. name .. &amp;quot;!)&amp;quot; ) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(enable-ets !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(player-not-use-ai)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(clear-goals !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(lock-perspective (false))&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Cloak(name)&lt;br /&gt;
&lt;br /&gt;
   mn.runSEXP(&amp;quot;(ship-effect !Cloak! 1000 !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(ship-stealthy !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(friendly-stealth-invisible !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Decloak(name)&lt;br /&gt;
&lt;br /&gt;
   mn.runSEXP(&amp;quot;(ship-effect !Decloak! 1000 !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(ship-unstealthy !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(friendly-stealth-visible !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
]&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=File:Lockdown.png&amp;diff=44319</id>
		<title>File:Lockdown.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=File:Lockdown.png&amp;diff=44319"/>
		<updated>2014-10-05T16:23:29Z</updated>

		<summary type="html">&lt;p&gt;Axem: For LUA tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For LUA tutorial&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Tutorial_-_FSOpen_and_LUA&amp;diff=44318</id>
		<title>Tutorial - FSOpen and LUA</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Tutorial_-_FSOpen_and_LUA&amp;diff=44318"/>
		<updated>2014-10-05T16:23:16Z</updated>

		<summary type="html">&lt;p&gt;Axem: FreeSpace Lua Tutorial!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;One of the coolest things that&#039;s been added to FreeSpace Open is the Lua scripting language. It allows a certain amount of freedom that SEXPs don&#039;t allow, but on the other hand Lua is a lot more, let&#039;s say, risky. FreeSpace has a lot of error checking and can handle any dumb SEXP efforts with a shrug. Lua runs a more unregulated campaign and, if you&#039;re not careful, can spew out baffling error messages that leave you clueless even after an hour on Google.&lt;br /&gt;
&lt;br /&gt;
There&#039;s a lot of basic Lua tutorials around the internet, so I&#039;m not going to get into the specifics too much. Read up on them if you&#039;re curious. There&#039;s just very little in the way of how FreeSpace and Lua interact with each other. If I want to do X with Lua, how would you even begin?&lt;br /&gt;
&lt;br /&gt;
First we need a few tools. First is a good text editor, I suggest Notepad++! You should also generate a scripting.html file from FreeSpace. Go into your launcher and in the Dev Tool section, tick the &amp;quot;Output scripting to scripting.html&amp;quot; box. Run FreeSpace and then just quit. In your FreeSpace directory will be a scripting.html file. This will be very valuable to us, it lists all of the game accessible information we can use for our nefarious purposes.&lt;br /&gt;
&lt;br /&gt;
So what is our first project going to be? A super lame &amp;quot;Hello World&amp;quot; script? Those are so overdone. Let&#039;s do something that is still simple but is also something you could actually use in your campaign, a SEXP library.&lt;br /&gt;
&lt;br /&gt;
The concept of a SEXP library is simple: we have some SEXPs that we want to use in multiple missions, and instead of copy and pasting them in multiple missions, we will store them in a Lua function that can be called upon in any mission and be executed.&lt;br /&gt;
&lt;br /&gt;
The SEXP library we make will contain 2 groups of SEXPs: 1. Lockdown the player&#039;s fighter&#039;s for in-game cutscenes and 2. Properly cloaking a ship (linking the stealth with the visual effect).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 1. In-game Cutscene Lockdown ==&lt;br /&gt;
&lt;br /&gt;
We&#039;ve all been there haven&#039;t we? Make an in-game cutscene. Watch it, and accidently slip and press primary fire and hear your Subachs fire. Press an ETS key and hear that immersion breaking sound. It&#039;s terrible. So what do you do? Add 5 sexps that lock player weapons, afterburner, ETS etc etc. Such a pain, right? Let&#039;s rectify this by allowing us to combine all the sexps we would use into a single Lua function. That way we can just use a single script-eval function and, presto! Those sexps will all get run, no muss, no fuss.&lt;br /&gt;
	&lt;br /&gt;
There&#039;s quite a few ways you can run Lua scripts. This will not be the only correct way to do things, but it’s a way that I feel is easily readable and accessible. You could stuff all your scripts into a single scripting.tbl, but it might get pretty large and unwieldy if you add a lot of Lua. I like to just create smaller modular scripting tables.&lt;br /&gt;
	&lt;br /&gt;
Below is the basic framework of a script, saved as sexplibrary-sct.tbm. The -sct.tbm will clue FreeSpace in that this is a Lua scripting file.&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;#Conditional Hooks&lt;br /&gt;
$Application: FS2_Open&lt;br /&gt;
$On Game Init:&lt;br /&gt;
[&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
]&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
First we need to tell the game what type of hook we&#039;re going to run. There are Global Hooks, State Hooks, and Conditional Hooks. Global Hooks run regardless of state or condition. I&#039;d advise staying away from Global Hooks unless you really know what you&#039;re doing. State Hooks aren&#039;t really used anymore, the Conditional Hooks are more flexible and better. Conditional Hooks will only check actions that we define later if the condition is met. There&#039;s also other game-wise benefits to using Conditional Hooks, [[Scripting.tbl#.23Conditional_Hooks|this part]] from the scripting.tbl wiki page sums it up well enough.&lt;br /&gt;
	&lt;br /&gt;
So I put down &#039;&#039;#Conditional Hooks&#039;&#039;, and the condition is &#039;&#039;$Application: FS2_Open&#039;&#039;, and our action is &#039;&#039;$On Game Init:&#039;&#039;. So basically when our application is FS2_Open (which will be… always), during game initialization do this stuff between the square brackets. And then of course our &#039;&#039;#End&#039;&#039; token.&lt;br /&gt;
	&lt;br /&gt;
I like to put down any function definitions in &#039;&#039;$On Game Init&#039;&#039;. That way all the functions will be ready for any script to use right away. If you&#039;re really paranoid about memory usage, you could move it to an initialization function, but you still need to define it somewhere!&lt;br /&gt;
	&lt;br /&gt;
So next we should define the Lua function that will house our SEXPs.&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;function Lockdown(name)&lt;br /&gt;
	&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
Function will define Lockdown as the function and the () is where we would put in any additional arguments. Our additional argument here is just name, it will be the name of the ship that we lockdown. And the Lua interpreter needs to know when to stop the function, so that&#039;s where the end comes in.&lt;br /&gt;
	&lt;br /&gt;
Now we need to think what sexps we would call for &#039;&#039;Lockdown()&#039;&#039;.&lt;br /&gt;
	&lt;br /&gt;
*Lock-primary-weapon&lt;br /&gt;
*Lock-secondary-weapon&lt;br /&gt;
*Lock-afterburner&lt;br /&gt;
*Disable-ETS&lt;br /&gt;
*Player-use-AI&lt;br /&gt;
*Add-Goal ai-play-dead on the player&lt;br /&gt;
**(alternatively ship-immobile if you&#039;re not going to use the player&#039;s ship in the cutscene)&lt;br /&gt;
*Lock-perspective&lt;br /&gt;
	&lt;br /&gt;
That&#039;s 7 sexps, surely this will increase our FREDding power by 700%!&lt;br /&gt;
	&lt;br /&gt;
If we look in the scripting.html and go into the mission library section, we&#039;ll find this cute little function.&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;boolean &#039;&#039;&#039;&#039;&#039;runSEXP&#039;&#039;&#039;(&#039;&#039;string&#039;&#039;)&lt;br /&gt;
:Runs the defined SEXP script&lt;br /&gt;
:&#039;&#039;&#039;Returns&#039;&#039;&#039;: if the operation was successful&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;runSEXP&#039;&#039;, as the name implies, allows us to run a SEXP as if it was being called by a mission event. Which is funny because this function will get called by a mission event anyway! The argument to &#039;&#039;runSEXP&#039;&#039; (the part that goes in the ()) is the same text that FRED writes to events. If we make an event that is just lock-primary-weapon and look at it in a text editor, it looks like…&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;$Formula: ( when &lt;br /&gt;
	   ( true ) &lt;br /&gt;
	   ( lock-primary-weapon &amp;quot;Alpha 1&amp;quot; ) &lt;br /&gt;
	)&lt;br /&gt;
	+Name: Lock Primary Weapon&lt;br /&gt;
	+Repeat Count: 1&lt;br /&gt;
	+Interval: 1&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
But all we&#039;re really interested in is...&lt;br /&gt;
&amp;lt;pre&amp;gt;(lock-primary-weapon &amp;quot;Alpha 1&amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
If your sexps have line breaks in them, be sure to take those out so they are all on one line. Lua would think we&#039;re done with the sexp long before we actually are.&lt;br /&gt;
	&lt;br /&gt;
So our first runSEXP function would look like…&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;mn.runSEXP(&amp;quot;(lock-primary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
Wait, hold on. What&#039;s this extra stuff I just sprung in front of you? Why is that mn there? And why are there EXCLAIMATION MARKS!! AND DOTS!&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;runSEXP&#039;&#039; is a function that is part of a larger library, the mission library. The mission library&#039;s internal name is just mn. Anytime we want to use a function inside a library, we need to add mn. in front of it so the Lua interpreter knows where to look.&lt;br /&gt;
	&lt;br /&gt;
Now the argument for &#039;&#039;runSEXP&#039;&#039; is a string, and Lua sees everything between two &amp;quot; as a string. So if we were to just run&lt;br /&gt;
&amp;lt;pre&amp;gt;mn.runSEXP(&amp;quot;(lock-primary-weapon &amp;quot;Alpha 1&amp;quot;)&amp;quot;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
The Lua Interpreter would see &amp;quot;lock-primary-weapon&amp;quot; and &amp;quot;&amp;quot;. It doesn&#039;t see the Alpha 1 because it&#039;s in the middle of two pairs of &amp;quot;s. So there&#039;s a bit of sly substitution that goes on, all !s are replaced with &amp;quot;s during evaluation. So if you&#039;re using the &#039;&#039;runSEXP&#039;&#039; or &#039;&#039;evaluateSEXP&#039;&#039; functions, replace those &amp;quot;s in the SEXP with !s.&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;name&#039;&#039; is a variable that has the argument that we specified before in the function definition. If we were to go...&lt;br /&gt;
&amp;lt;pre&amp;gt;Lockdown(&#039;Alpha 1&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then &#039;&#039;name&#039;&#039; inside the function will be replace with &amp;quot;Alpha 1&amp;quot;. The &#039;&#039;..&#039;&#039; is called a concatenation operator. Concatenation is when you combine two strings together. So we combine the &amp;quot;lock-primary-weapon !&amp;quot; string with the name variable, and then combine that with the last &amp;quot;!&amp;quot;.&lt;br /&gt;
	&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If the argument is empty and does NOT have anything in it, the argument will then &amp;quot;contain&amp;quot; a special value called nil. &#039;&#039;&#039;Nil&#039;&#039;&#039; is Lua&#039;s version of null (or empty), it basically means it does not exist. Using something that is nil will result in errors everywhere! In a later tutorial we&#039;ll do checks for nil, for now just be mindful of the arguments you pass through functions.&lt;br /&gt;
	&lt;br /&gt;
So that&#039;s one line, let us do the same thing to other lines. It would probably be a good idea to create the sexps first in a mission, save the mission and then copy and paste the relevant lines into your script. The game expects SEXPs to be without syntax errors because FRED knows how to do it without any reminders. We fleshy humans aren&#039;t that good, so take all precautions!&lt;br /&gt;
	&lt;br /&gt;
So here&#039;s the full function, plus another function that undoes the SEXPs.&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;function Lockdown(name)&lt;br /&gt;
	&lt;br /&gt;
	mn.runSEXP(&amp;quot;(lock-primary-weapon !&amp;quot; .. name .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(lock-secondary-weapon !&amp;quot; .. name .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(lock-afterburner !&amp;quot; .. name .. &amp;quot;! )&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(disable-ets !&amp;quot; .. name .. &amp;quot;! )&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(player-use-ai )&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(add-goal !&amp;quot; .. name .. &amp;quot;! ( ai-play-dead 200 ) )&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(lock-perspective ( true) )&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
function UnLockdown(name)&lt;br /&gt;
	&lt;br /&gt;
	mn.runSEXP(&amp;quot;(unlock-primary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(unlock-secondary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(unlock-afterburner !&amp;quot; .. name .. &amp;quot;!)&amp;quot; ) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(enable-ets !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(player-not-use-ai)&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(clear-goals !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
	mn.runSEXP(&amp;quot;(lock-perspective ( false ) )&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
To use these functions within the game, we need to call the script-eval sexp. And it would look something like…&lt;br /&gt;
	[PIC]&lt;br /&gt;
	&lt;br /&gt;
Notice how I used a single quotation mark instead of a double one. The reason for this is pretty much the same as using the ! before. It’s a way to define the boundaries of a string without actually breaking the string in the process.&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
It&#039;s sort of hard to show these functions off with screenshots, so you&#039;ll just have to try them yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== 2. Cloaking Ships + Stealth ==&lt;br /&gt;
&lt;br /&gt;
	There&#039;s a neat sexp in the special-effects category, ship-effect. Some of the options are cloak and decloak. The only problem is that if you cloak a ship, the effect is only visual! You can still target it. How lame is that? Sure we could just do a lot of ship-effects + ship-stealthy, but why couldn&#039;t we just do both at the same time like the Lockdown functions?&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
&amp;lt;pre&amp;gt;function Cloak(name)&lt;br /&gt;
	&lt;br /&gt;
	mn.runSEXP(&amp;quot;(ship-effect !Cloak! 1000 !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(ship-stealthy !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(friendly-stealth-invisible !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
function Decloak(name)&lt;br /&gt;
	&lt;br /&gt;
	mn.runSEXP(&amp;quot;(ship-effect !Decloak! 1000 !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(ship-unstealthy !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	mn.runSEXP(&amp;quot;(friendly-stealth-visible !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
	&lt;br /&gt;
end&amp;lt;/pre&amp;gt;&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
See how easy that was? Especially without me having to explain every detail?&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
So this is a good start into Lua with FreeSpace without actually needing to know Lua. In the next tutorial, we&#039;ll actually get into things like object handles and unique Lua magic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Full Table use for Tutorial ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#Conditional Hooks&lt;br /&gt;
$Application: FS2_Open&lt;br /&gt;
$On Game Init:&lt;br /&gt;
[&lt;br /&gt;
&lt;br /&gt;
function Lockdown(name)&lt;br /&gt;
&lt;br /&gt;
   mn.runSEXP(&amp;quot;(lock-primary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(lock-secondary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(lock-afterburner !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(disable-ets !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(player-use-ai)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(add-goal !&amp;quot; .. name .. &amp;quot;! ( ai-play-dead 200 ))&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(lock-perspective (true))&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function UnLockdown(name)&lt;br /&gt;
&lt;br /&gt;
   mn.runSEXP(&amp;quot;(unlock-primary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(unlock-secondary-weapon !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(unlock-afterburner !&amp;quot; .. name .. &amp;quot;!)&amp;quot; ) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(enable-ets !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(player-not-use-ai)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(clear-goals !&amp;quot; .. name .. &amp;quot;!)&amp;quot;)&lt;br /&gt;
   mn.runSEXP(&amp;quot;(lock-perspective (false))&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Cloak(name)&lt;br /&gt;
&lt;br /&gt;
   mn.runSEXP(&amp;quot;(ship-effect !Cloak! 1000 !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(ship-stealthy !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(friendly-stealth-invisible !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Decloak(name)&lt;br /&gt;
&lt;br /&gt;
   mn.runSEXP(&amp;quot;(ship-effect !Decloak! 1000 !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(ship-unstealthy !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
   mn.runSEXP(&amp;quot;(friendly-stealth-visible !&amp;quot; .. name .. &amp;quot;!)&amp;quot;) &lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
]&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44317</id>
		<title>User:Axem</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44317"/>
		<updated>2014-10-05T16:06:10Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Tutorials */ Nu tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About Axem!==&lt;br /&gt;
Hello! I am Axem, friendly administrator on the HLP forums. I can FRED (make missions), model, UVMap, texture, script and make rough effects. Just don&#039;t ask me to do any of it for you, I&#039;ve got enough to do! But I can help guide you to the right path. Below you&#039;ll find some of the stuff I&#039;ve done here over the years.&lt;br /&gt;
&lt;br /&gt;
==My Campaigns==&lt;br /&gt;
*[[Shadows of Kraken]]&lt;br /&gt;
*[[Just Another Day]]&lt;br /&gt;
*[[Just Another Day 2: Electric Boogaloo]]&lt;br /&gt;
*[[Just Another Day 3: Shivans on a Plane]]&lt;br /&gt;
*[[Vassago&#039;s Dirge]]&lt;br /&gt;
*[[Just Another Day 2.21: You Are (Not) Alpha 1]]&lt;br /&gt;
&lt;br /&gt;
==Projects I Help With==&lt;br /&gt;
*[[Diaspora]]&lt;br /&gt;
*[[Blue Planet]]&lt;br /&gt;
*[[Wings of Dawn]]&lt;br /&gt;
&lt;br /&gt;
==My Ships==&lt;br /&gt;
&lt;br /&gt;
*[[GTC Cretheus]]&lt;br /&gt;
*[[SC Lamia]]&lt;br /&gt;
*[[SGs Asura]] (textured by Nighteyes)&lt;br /&gt;
*[[UES Aranyaka]]&lt;br /&gt;
&lt;br /&gt;
Other WIPS can be seen on my [http://p3d.in/u/Axem p3d page]&lt;br /&gt;
&lt;br /&gt;
==Helpful Pages I&#039;ve Done==&lt;br /&gt;
===Tutorials===&lt;br /&gt;
*[[Tutorial - Conditional Arguments]]&lt;br /&gt;
*[[Tutorial - Directive-is-variable SEXP]]&lt;br /&gt;
*[[Tutorial - Mission Infrastructure]]&lt;br /&gt;
*[[Tutorial - PCS2 Kitbashing]]&lt;br /&gt;
*[[Tutorial - Custom HUD Gauges]]&lt;br /&gt;
*[[Tutorial - Fun with Simulated Hull]]&lt;br /&gt;
*[[Tutorial - Bitwise Operations]]&lt;br /&gt;
*[[Tutorial - FSOpen and LUA #1 - SEXP Library]]&lt;br /&gt;
&lt;br /&gt;
===SEXP Reference===&lt;br /&gt;
*[[Advanced Cutscene SEXP Reference]]&lt;br /&gt;
===Script Reference===&lt;br /&gt;
*[[Script - Journal/Fluff Viewer]]&lt;br /&gt;
*[[Script - System Viewer]]&lt;br /&gt;
*[[Script - Interface Monitor]]&lt;br /&gt;
*[[Script - Scripted Message Gauge]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Tutorial_-_Bitwise_Operations&amp;diff=44177</id>
		<title>Tutorial - Bitwise Operations</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Tutorial_-_Bitwise_Operations&amp;diff=44177"/>
		<updated>2014-08-03T14:34:31Z</updated>

		<summary type="html">&lt;p&gt;Axem: Bitwise operations tutorial for FRED&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Get wise with bitwise!&lt;br /&gt;
&lt;br /&gt;
If you have any sort of computer science background, the term bitwise should come second-nature to you. If you&#039;re not, then here&#039;s a quick rundown.&lt;br /&gt;
&lt;br /&gt;
==Bitwise Basics==&lt;br /&gt;
&lt;br /&gt;
Computer programs don&#039;t store numbers as the numbers we know in base-10, they store them as bytes. What&#039;s a byte? A byte is a bunch of 1s and 0s bunched together. The single element (the 1 or 0) is just called a bit. The computer program looks at the bits in the byte and reconstructs the number we&#039;re looking for by using each bit&#039;s place value as a power of two.&lt;br /&gt;
&lt;br /&gt;
Huh?!&lt;br /&gt;
&lt;br /&gt;
In our traditional base-10 math, if we have the number 150, we could break it up into 100 + 50 + 2. We could then express each of those numbers as a number times a power of ten. So 152 = 100 + 50 + 2 = (1 x 10^2) + (5 x 10^1) + (0 x 10^0). To express that we can just go 1 5 0. Which is stupidly obvious.&lt;br /&gt;
&lt;br /&gt;
What if we&#039;re restricted to base 2 (aka binary, just a 1 or 0, like computers) and have the number 12? Powers of 2 are 1, 2, 4, 8, 16, 32, 64 … etc etc. So to get 12 out of that we could just go 8 + 4. So our base 2 number would look like (1x2^3) + (1x2^2) + (0x2^1) + (0x2^0). Or just 1 1 0 0. That 12 is actually being store as 1100 inside the computer program.&lt;br /&gt;
&lt;br /&gt;
==Using in FRED==&lt;br /&gt;
&lt;br /&gt;
Imagine we have a campaign going with 4 persistent ships. &lt;br /&gt;
&lt;br /&gt;
[[file:Bitwise1.png|600px]]&lt;br /&gt;
&lt;br /&gt;
Our wonderful fleet.&lt;br /&gt;
&lt;br /&gt;
How could we easily keep track if they are alive or dead? (Let&#039;s pretend that the health of each ship doesn&#039;t matter, just if they&#039;re alive or dead.) is-previous-event-false ShipAWasDestroyed? Sure, but if our campaign is going to be long, you&#039;re going to be checking a lot of previous events. Put its status in a variable? This is good, but updating 4 variables throughout a campaign? What a… pain.&lt;br /&gt;
&lt;br /&gt;
Hey, look at that bitwise example above. If our variable&#039;s bits corresponded to the status of our ships, that could work. So 1 1 1 1 would be all four ships are alive. 1 0 1 0 would be 2 ships alive, 2 dead, 0 1 0 1 would be the other 2 ships alive and the other 2 dead. Let&#039;s see how we could accomplish this.&lt;br /&gt;
&lt;br /&gt;
When we make a new integer variable in FRED, a common default value is 0, but inside FRED there&#039;s quite a few more zeroes. An integer variable inside FRED is 4 bytes, or 32 bits. This means FRED really is storing 0000 0000  0000 0000  0000 0000  0000 0000 for the default value of 0 (spaces added to help with readability). So we could theoretically store 32 ships with this system, but we&#039;ll just stick to 4 for the time being.&lt;br /&gt;
&lt;br /&gt;
So when we store our ship&#039;s status, we want 1 1 1 1 since they are all alive. We would NOT just type in 1111, because in binary that is actually 0100 0101 0111. Not quite what we&#039;re looking for. Constructing the number in binary and be tricky for people unfamiliar with binary (FYI its 15). So maybe instead of making each bit &amp;quot;is this ship alive?&amp;quot; we could just think of each bit as &amp;quot;is this ship dead?&amp;quot; That way we can just keep our initial value at zero.&lt;br /&gt;
&lt;br /&gt;
Now how do we modify our variable properly if a ship dies? This nifty set-bit sexp. Now the set-bit operator only returns the value of a variable after a specific bit is set. Set-bit by itself doesn&#039;t modify the variable, we still need to use the modify-variable sexp first. But it&#039;s still simple enough to use.&lt;br /&gt;
&lt;br /&gt;
[[file:Bitwise2.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Modify FleetStatus to be FleetStatus with Bit Index 0, 1, 2 or 3 set&amp;quot; (Quick note, computers love to start counting at 0, so index 0 is technically the first bit)&lt;br /&gt;
&lt;br /&gt;
Then at the beginning of each mission (or the arrival cue) we just check a bit&#039;s status with is-bit-set to see if it should arrive.&lt;br /&gt;
&lt;br /&gt;
[[file:Bitwise3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
Yes, using bit-wise operations with integer variables allows you to cram 32 true/false variables into that single variable.&lt;br /&gt;
&lt;br /&gt;
To get into some real advanced things, you can also play with bitwise AND, OR and XOR operators. Check out [http://en.wikipedia.org/wiki/Bitwise_operation this wikipedia article] for more great info on those. &lt;br /&gt;
&lt;br /&gt;
If you need more than true or false, you could do similar things with string-get/set-substring. It works similar to the bitwise operators, it only affects a desired section of the variable. For instance you could store things like morale levels for a squad of fighters, a rough health status for turrets, or responses when a player was asked a question. Things can get pretty complicated though, so take things nice and slow.&lt;br /&gt;
&lt;br /&gt;
[[Category:FRED Examples]][[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=File:Bitwise3.png&amp;diff=44176</id>
		<title>File:Bitwise3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=File:Bitwise3.png&amp;diff=44176"/>
		<updated>2014-08-03T14:30:36Z</updated>

		<summary type="html">&lt;p&gt;Axem: Part of bitwise operation tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Part of bitwise operation tutorial&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=File:Bitwise2.png&amp;diff=44175</id>
		<title>File:Bitwise2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=File:Bitwise2.png&amp;diff=44175"/>
		<updated>2014-08-03T14:30:28Z</updated>

		<summary type="html">&lt;p&gt;Axem: Part of bitwise operation tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Part of bitwise operation tutorial&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=File:Bitwise1.png&amp;diff=44174</id>
		<title>File:Bitwise1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=File:Bitwise1.png&amp;diff=44174"/>
		<updated>2014-08-03T14:30:16Z</updated>

		<summary type="html">&lt;p&gt;Axem: Part of bitwise operation tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Part of bitwise operation tutorial&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44173</id>
		<title>User:Axem</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44173"/>
		<updated>2014-08-03T14:28:18Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Tutorials */ Bitwise stuff&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About Axem!==&lt;br /&gt;
Hello! I am Axem, friendly administrator on the HLP forums. I can FRED (make missions), model, UVMap, texture, script and make rough effects. Just don&#039;t ask me to do any of it for you, I&#039;ve got enough to do! But I can help guide you to the right path. Below you&#039;ll find some of the stuff I&#039;ve done here over the years.&lt;br /&gt;
&lt;br /&gt;
==My Campaigns==&lt;br /&gt;
*[[Shadows of Kraken]]&lt;br /&gt;
*[[Just Another Day]]&lt;br /&gt;
*[[Just Another Day 2: Electric Boogaloo]]&lt;br /&gt;
*[[Just Another Day 3: Shivans on a Plane]]&lt;br /&gt;
*[[Vassago&#039;s Dirge]]&lt;br /&gt;
*[[Just Another Day 2.21: You Are (Not) Alpha 1]]&lt;br /&gt;
&lt;br /&gt;
==Projects I Help With==&lt;br /&gt;
*[[Diaspora]]&lt;br /&gt;
*[[Blue Planet]]&lt;br /&gt;
*[[Wings of Dawn]]&lt;br /&gt;
&lt;br /&gt;
==My Ships==&lt;br /&gt;
&lt;br /&gt;
*[[GTC Cretheus]]&lt;br /&gt;
*[[SC Lamia]]&lt;br /&gt;
*[[SGs Asura]] (textured by Nighteyes)&lt;br /&gt;
*[[UES Aranyaka]]&lt;br /&gt;
&lt;br /&gt;
Other WIPS can be seen on my [http://p3d.in/u/Axem p3d page]&lt;br /&gt;
&lt;br /&gt;
==Helpful Pages I&#039;ve Done==&lt;br /&gt;
===Tutorials===&lt;br /&gt;
*[[Tutorial - Conditional Arguments]]&lt;br /&gt;
*[[Tutorial - Directive-is-variable SEXP]]&lt;br /&gt;
*[[Tutorial - Mission Infrastructure]]&lt;br /&gt;
*[[Tutorial - PCS2 Kitbashing]]&lt;br /&gt;
*[[Tutorial - Custom HUD Gauges]]&lt;br /&gt;
*[[Tutorial - Fun with Simulated Hull]]&lt;br /&gt;
*[[Tutorial - Bitwise Operations]]&lt;br /&gt;
&lt;br /&gt;
===SEXP Reference===&lt;br /&gt;
*[[Advanced Cutscene SEXP Reference]]&lt;br /&gt;
===Script Reference===&lt;br /&gt;
*[[Script - Journal/Fluff Viewer]]&lt;br /&gt;
*[[Script - System Viewer]]&lt;br /&gt;
*[[Script - Interface Monitor]]&lt;br /&gt;
*[[Script - Scripted Message Gauge]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Scripting.tbl&amp;diff=44130</id>
		<title>Scripting.tbl</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Scripting.tbl&amp;diff=44130"/>
		<updated>2014-07-19T16:58:14Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Actions */ Added On Message Received&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SCP_table}}&lt;br /&gt;
&lt;br /&gt;
{{TableVersion|4500}}&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;scripting.tbl&#039;&#039;&#039; is used for scripting special features like alternate HUDs or ship viewer into the game.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This table is one of the [[Modular Tables]] and can be extended with xxx-sct.tbm&lt;br /&gt;
&lt;br /&gt;
[[Tables|List of Tables]]&lt;br /&gt;
&lt;br /&gt;
==General Info==&lt;br /&gt;
*Scripting table consist of several sections identified by a hash mark preceeding the section name (i.g. #Global Hooks)&lt;br /&gt;
*All sections &#039;&#039;must&#039;&#039; end with #&#039;&#039;&#039;End&#039;&#039;&#039;&lt;br /&gt;
*All sections are optional&lt;br /&gt;
*Most entries are optional&lt;br /&gt;
*Scripting hooks are &#039;&#039;&#039;not&#039;&#039;&#039; executed on a separate thread (at least as of this writing). They are executed at given points in the code, and all other execution will not take place until a scripting hook has finished. Therefore, large and complicated scripts will most likely cause noticeable lag or slowdown when executed.&lt;br /&gt;
{{Template:Note|1=Information on this page does not apply to pre-3.6.10 builds}}&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Useful references==&lt;br /&gt;
*&#039;&#039;&#039;[[FS2 Open Lua Scripting]]&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;[[Scripting API]]&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;!---*&#039;&#039;&#039;[http://fs2source.warpcore.org/temp/scripting.html Scripting.html]&#039;&#039;&#039; - Link OOA ---&amp;gt;&lt;br /&gt;
*&#039;&#039;&#039;[[Scripting functions]]&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;[[Command-Line_Reference#-output_scripting|Command-Line Reference for creating scripting.html]]&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;[http://lua-users.org/wiki/ Lua-Users Wiki]&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;[http://www.lua.org/manual/5.0/ Reference manual for Lua 5.0]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
&lt;br /&gt;
===Frames===&lt;br /&gt;
One of the most important things to understand when reading this guide is the concept of &amp;quot;frames&amp;quot;. (Experienced modders can probably skip this part) In gameplay, motion is achieved by making incremental changes every fraction of a second. A ship will be moved slightly, and then drawn to the screen. This happens 30-120 times a second; anything lower, and the game will become choppy and difficult to play.&lt;br /&gt;
&lt;br /&gt;
There is also a difference in the moving of objects in-game, and the moving of objects onscreen. All ships are first &amp;quot;moved&amp;quot;, in memory. This probably consists of physics calculations, that change the ship&#039;s position based on if their engines are turned on, or if they run into another object. After this, the game then renders the now-moved ships to what is referred to as a &amp;quot;backbuffer&amp;quot; - a place in memory that takes the place of the computer screen. Once rendering has finished, the backbuffer is instantly drawn to the screen. This prevents objects from flickering as they are drawn. You do not have to worry about flipping the backbuffer in scripting; FS2_Open will take care of that for you.&lt;br /&gt;
&lt;br /&gt;
For scripting, &#039;&#039;&#039;it is important to understand that each block of code will therefore be executed several times a second, but only once per frame&#039;&#039;&#039;. However, the exact number of times per second will depend on how much work the computer has to do (And therefore how much time it takes) for each frame. To determine how much time you should consider to have passed, you must use the ba.getFrametime() function; which will return the approximate time the frame will take, in seconds. In addition, if you &amp;quot;move&amp;quot; a ship after it has already been rendered, the change will not become apparent until the next frame.&lt;br /&gt;
&lt;br /&gt;
This does mean that if you want to make a block of text move across the screen, at a rate of 5 pixels per second, all you have to do is multiply the speed by the frametime:&lt;br /&gt;
&amp;lt;pre&amp;gt;#Global Hooks&lt;br /&gt;
$Global: [&lt;br /&gt;
   --If the g_WheeXPosition variable does not exist,&lt;br /&gt;
   --it means we are on the first frame.&lt;br /&gt;
   --If that is the case, set it to zero.&lt;br /&gt;
   if not g_WheeXPosition then&lt;br /&gt;
      g_WheeXPosition = 0&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   --Move the text&lt;br /&gt;
   g_WheeXPosition = g_WheeXPosition + (5 * ba.getFrametime())&lt;br /&gt;
&lt;br /&gt;
   --Draw &amp;quot;WHEE!!!&amp;quot;&lt;br /&gt;
   gr.drawString(&amp;quot;WHEE!!!&amp;quot;, g_WheeXPosition, 10)&lt;br /&gt;
]&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Hooks===&lt;br /&gt;
Scripting &amp;quot;hooks&amp;quot; form the basis of the scripting system. A &amp;quot;hook&amp;quot; simply refers to a point in the code where code to execute scripting has been added. The hook may then be added to a table, or added to a SEXP. In general usage, &amp;quot;hook&amp;quot; refers to an entry in scripting.tbl.&lt;br /&gt;
&lt;br /&gt;
All hooks take the form of an identifer (such as $Global:), followed by brackets to determine what type of scripting is being executed. A lack of brackets also indicates a type of scripting execution. All current bracket configurations are listed below. Note that &amp;quot;$Hook:&amp;quot; is used merely as a placeholder, and should be replaced with the actual hook name ($Global:, $HUD:, $On Frame:, etc).&lt;br /&gt;
#&amp;lt;pre&amp;gt;$Hook: scripting&amp;lt;/pre&amp;gt;Specifies one line of LUA scripting. In addition, the return value of that line will be passed to the interpreter and used (if applicable). Specifying a variable or value on this line will result in it being returned, as well.&lt;br /&gt;
#&amp;lt;pre&amp;gt;$Hook: [scripting]&amp;lt;/pre&amp;gt;A single set of brackets specifies a block of LUA scripting. Does not return a value unless explicitly specified. (Explicit specification is not possible at this time; but may be implemented in the future if/when more future hooks take a return value.)&lt;br /&gt;
#&amp;lt;pre&amp;gt;$Hook: [[scriptfilename.lua]]&amp;lt;/pre&amp;gt;Double brackets specify a file. This file is read out of the data/scripts directory, and must include the file extension. You may specify a compiled lua file as a target as well; this may result in crossplatform issues for a mod, however.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====+Override====&lt;br /&gt;
Some hooks additionally take a +Override: field. This field uses the same bracket configurations as above. If a hook includes a +Override field, this hook always determines whether the default FS2_Open behavior that the hook is associated with will function, or will be disabled. This should be used in cases where scripting will replace the original FS2_Open behavior. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;$HUD: [&lt;br /&gt;
    gr.setColor(255, 255, 255, 255)&lt;br /&gt;
    gr.drawString(&amp;quot;HUD Disabled&amp;quot;, 50, 50)&lt;br /&gt;
 ]&lt;br /&gt;
    +Override: true&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Additionally, override hooks are (by convention) executed before FS2_Open behavior. The HUD hook override, for example, is executed before any part of the HUD is actually drawn.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Sections==&lt;br /&gt;
&lt;br /&gt;
===#Global Hooks===&lt;br /&gt;
Global hooks are the simplest form of scripting hooks available. They are at preset locations in the code, and are generally executed every time that point is reached. Exceptions to this rule (such as the HUD hook) only depend on one or two variables to determine execution. All other scripting execution is determined by the modder.&lt;br /&gt;
Note that, as with other tables, the game expects these entries in precisely the order given here; if this is not followed, the parser will throw an error.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====$Global:====&lt;br /&gt;
Script in this section is executed almost immediately before each frame is drawn. This means that any scripting elements will be drawn, or take effect, after everything else, except for the &amp;quot;On Frame&amp;quot; conditional hook. It is not used with the standalone server. In addition, note that use of this hook should generally be avoided, since all scripting will have to be processed every frame.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====$Splash:====&lt;br /&gt;
This hook is executed once, when the splash images (PreLoad and PreLoadLogo) would be drawn. This hook should generally be used only for drawing the splash screen; any initialization could should be placed in GameInit. This hook is executed before virtually any other subsystem has been loaded, aside from the graphics and filesystem subsystems, so scripting elements such as the table and mission libraries will be nonfunctional.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====+Override:=====&lt;br /&gt;
Executed just before default splash images are loaded and displayed. Note that the frame is still drawn regardless; it is not necessary to flip the backbuffer manually.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====$GameInit:====&lt;br /&gt;
This hook is executed once, after all of the Freespace2 subsystems have been initialized. It is executed before the game switches to the main hall or, in the case of standalone server mode, begins the game.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====$Simulation:====&lt;br /&gt;
This hook is executed only during missions. It is executed after all damage, movement, physics, SEXPs, and other &amp;quot;physical&amp;quot; in-game changes have been applied. It is executed before anything has been rendered. This hook should be used only for damage, movement, and physics related scripting, as if the game needs to be rendered without any in-game time having been passed, this function will not be called.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====$HUD:====&lt;br /&gt;
The HUD hook is executed after the HUD has been drawn. Note that if the HUD is turned off, this hook will be disabled as well, until the HUD is turned back on.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====+Override:=====&lt;br /&gt;
Executed immediately before anything on the HUD is drawn, and controls whether the default FS2_Open is drawn.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===#State Hooks===&lt;br /&gt;
In Freespace2, a &amp;quot;state&amp;quot; more or less refers to a room. It may also refer to a separate mode - playing a mission is the GS_STATE_GAME_PLAY state. The main menu is the GS_STATE_MAIN_MENU state. This section should only exist in 3.6.9. It is included here for the sake of documentation; it has since been removed and superseded by the conditional hook system.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=====$State:=====&lt;br /&gt;
Specifies the state name. A full list of states is located here: &#039;&#039;[[List of Game States]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====$Hook:=====&lt;br /&gt;
Executed after all of the state code has been executed, but before the game frame is actually drawn.&lt;br /&gt;
&lt;br /&gt;
======+Override:======&lt;br /&gt;
Determines whether the specified state is handled at all by Freespace. If true, then none of the loading or exit code for the state will be specified as well.&lt;br /&gt;
&lt;br /&gt;
===#Conditional Hooks===&lt;br /&gt;
Scripting hooks are only available in HEAD builds. They consist of any number of conditions, followed by any number of actions. All available conditions and actions are located in the file generated by -output_scripting.&lt;br /&gt;
&lt;br /&gt;
One way to think of conditional scripting is like this: The condition specifies the object that the action will apply to, or the place that the action will occur in. All conditions must be met for their associated actions to execute. Actions are associated with a set of conditions by simply adding them after that set of conditions. (Obviously, you may want to space out each pair of action/condition sets in the TBL to make it easier to read.)&lt;br /&gt;
&lt;br /&gt;
The flexibility of conditional scripting comes in due to its inherent scalability. If you specify a mission and ship condition with a warpin action, that script will only be executed when the ship warps in on that particular mission. Removing the mission field will make that warpin scripting apply to the ship for all missions; or removing the ship field will make the warpin scripting apply to all ships in that mission.&lt;br /&gt;
&lt;br /&gt;
This prompts the question: if this is all conditional scripting does, why not just use the global hook? &lt;br /&gt;
#Organization - conditional scripting is generally easier to read and modify because it is grouped in a standardized manner.&lt;br /&gt;
#Speed - All conditions can be evaluated by FS2_Open itself, without invoking the Lua interpreter at all.&lt;br /&gt;
#Scalability - As of the time of this writing, you can only have one global hook. Modular tables will simply replace it. With conditional scripting, if you want to specify additional actions for a set of conditions in a modular table file, you may do so.&lt;br /&gt;
&lt;br /&gt;
;Format&lt;br /&gt;
&lt;br /&gt;
;&#039;&#039;&#039;$Condition:&#039;&#039;&#039;: Where &amp;quot;$Condition:&amp;quot; is one of several conditions specified in scripting.html, such as $State: or $Ship:. Takes a value representing the object the condition should be checked against (such as a state, ship, or mission name)&lt;br /&gt;
;&#039;&#039;&#039;$Condition:&#039;&#039;&#039;: ...&lt;br /&gt;
;&#039;&#039;&#039;...&#039;&#039;&#039;:&lt;br /&gt;
;&#039;&#039;&#039;$Action:&#039;&#039;&#039;: Where &amp;quot;$Action:&amp;quot; is one of several actions specified in scripting.html, such as $On Frame or $On Warp In. Takes a scripting hook, using the bracket configuration outlined at the top of this article.&lt;br /&gt;
;&#039;&#039;&#039;$Condition:&#039;&#039;&#039;: ...&lt;br /&gt;
;&#039;&#039;&#039;...&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
A brief description of all Conditions and Actions at the time of this writing:&lt;br /&gt;
&lt;br /&gt;
====Conditions====&lt;br /&gt;
&lt;br /&gt;
=====$State:=====&lt;br /&gt;
Controls execution based on what state FS2_Open is in, such as the main hall, options screen, or in a mission.&lt;br /&gt;
*The full list of states can be found here: &#039;&#039;[[List of Game States]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====$Campaign:=====&lt;br /&gt;
Controls execution based on the current campaign&#039;s filename. (It is under consideration to change this to the campaign&#039;s name, instead).&lt;br /&gt;
&lt;br /&gt;
=====$Mission:=====&lt;br /&gt;
Controls execution based on the filename of the last mission to have started. This condition will remain true even after the mission has been exited until another mission is started.&lt;br /&gt;
&lt;br /&gt;
=====$Object Type:=====&lt;br /&gt;
Defines a specific object type that the action will apply for, such as a &amp;quot;Ship&amp;quot;, &amp;quot;Asteroid&amp;quot;, or &amp;quot;Jump Node&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=====$Ship:=====&lt;br /&gt;
Defines a specific ship (name) that the action will apply for.&lt;br /&gt;
&lt;br /&gt;
=====$Ship class:=====&lt;br /&gt;
Defines a specific ship class (name) that the action will apply for.&lt;br /&gt;
&lt;br /&gt;
=====$Ship type:=====&lt;br /&gt;
Defines a specific ship type (name) that the action will apply for.&lt;br /&gt;
&lt;br /&gt;
=====$Weapon class:=====&lt;br /&gt;
Defines a specific weapon class (name) that the action will apply for.&lt;br /&gt;
&lt;br /&gt;
=====$KeyPress:=====&lt;br /&gt;
Defines a specific key that the action will apply for.&lt;br /&gt;
*Experimental.&lt;br /&gt;
&lt;br /&gt;
=====$Action:=====&lt;br /&gt;
{{Table371|&lt;br /&gt;
Defines a specific control that the action will apply for. For example &amp;quot;Fire Primary Weapon&amp;quot; or &amp;quot;Match Target Speed&amp;quot;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Actions====&lt;br /&gt;
&lt;br /&gt;
=====$On Game Init:=====&lt;br /&gt;
Executes immediately after game has been started.&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Splash Screen:=====&lt;br /&gt;
Executes when initial game splash screen is shown&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On State Start:=====&lt;br /&gt;
Executed when specified game state starts&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Frame:=====&lt;br /&gt;
Executes immediately after the global scripting hook, which is right before the frame is drawn.&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Key Pressed:=====&lt;br /&gt;
Executed when specified key is pressed&lt;br /&gt;
::* &#039;&#039;&#039;Key&#039;&#039;&#039;, The pressed key&lt;br /&gt;
&lt;br /&gt;
=====$On Key Released:=====&lt;br /&gt;
Executed when specified key is released&lt;br /&gt;
::* &#039;&#039;&#039;Key&#039;&#039;&#039;, The released key&lt;br /&gt;
&lt;br /&gt;
=====$On Mouse Moved:=====&lt;br /&gt;
Executed when mouse is moved&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Mouse Pressed:=====&lt;br /&gt;
Executed when mouse button is pressed&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Mouse Released:=====&lt;br /&gt;
Executed when mouse button is released&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On State End:=====&lt;br /&gt;
Executed when specified game state ends&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Mission Start:=====&lt;br /&gt;
Executed when mission starts&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
&lt;br /&gt;
=====$On Gameplay Start:=====&lt;br /&gt;
{{Table3615|&lt;br /&gt;
Executed when the gameplay part of a mission starts&lt;br /&gt;
::* No associated hook variables.}}&lt;br /&gt;
&lt;br /&gt;
=====$On HUD Draw:=====&lt;br /&gt;
Executed after the HUD has been drawn. Note that if the HUD is turned off, this hook will be disabled as well, until the HUD is turned back on&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the viewer (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Ship Collision:=====&lt;br /&gt;
Executes when the specified object collides with a ship. Sets a handle in the HookVariables library with the name of the object type (&amp;quot;Weapon&amp;quot;, &amp;quot;Debris&amp;quot;, and so on) with the type of the object. If both objects are ships, the other object gains the name &amp;quot;ShipB&amp;quot;. (If both ship objects define a collision hook, the variables will be swapped for the other ship, so the ship that the script is executing for will always be called &amp;quot;Script&amp;quot;.) The override will disable FS2_Open code, as well as the other object&#039;s collision code. If both objects have an override set, only one of the objects&#039; hooks will be used (Chosen arbitrarily). Note that the override receives the same variables.&lt;br /&gt;
::* When colliding something other than other ship:&lt;br /&gt;
::** &#039;&#039;&#039;Ship&#039;&#039;&#039;, the ship (object)&lt;br /&gt;
::** &#039;&#039;&#039;Debris&#039;&#039;&#039;, &#039;&#039;&#039;Asteroid&#039;&#039;&#039;, &#039;&#039;&#039;Weapon&#039;&#039;&#039;, depending what it collided with (object)&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the object referred by the condition (object)&lt;br /&gt;
::** &#039;&#039;&#039;Object&#039;&#039;&#039;, the ship (object)&lt;br /&gt;
::* When colliding with other ship:&lt;br /&gt;
::** &#039;&#039;&#039;Ship&#039;&#039;&#039;, the ship (object) referred by the condition (object)&lt;br /&gt;
::** &#039;&#039;&#039;ShipB&#039;&#039;&#039;, the other ship (object)&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the ship (object) referred by the condition (object)&lt;br /&gt;
::** &#039;&#039;&#039;Object&#039;&#039;&#039;, the other ship (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Weapon Collision:=====&lt;br /&gt;
Like the ship collision hook, but for weapons.&lt;br /&gt;
::* When colliding something other than other weapon:&lt;br /&gt;
::** &#039;&#039;&#039;Weapon&#039;&#039;&#039;, the weapon (object)&lt;br /&gt;
::** &#039;&#039;&#039;Debris&#039;&#039;&#039;, &#039;&#039;&#039;Asteroid&#039;&#039;&#039;, &#039;&#039;&#039;Ship&#039;&#039;&#039;, depending what it collided with (object)&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the object the weapon collided with (object)&lt;br /&gt;
::** &#039;&#039;&#039;Object&#039;&#039;&#039;, the weapon (object)&lt;br /&gt;
::* When colliding with other weapon:&lt;br /&gt;
::** &#039;&#039;&#039;Weapon&#039;&#039;&#039;, the weapon (object) referred by the condition&lt;br /&gt;
::** &#039;&#039;&#039;WeaponB&#039;&#039;&#039;, the other weapon (object)&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the weapon (object) referred by the condition&lt;br /&gt;
::** &#039;&#039;&#039;Object&#039;&#039;&#039;, the other weapon (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Debris Collision:=====&lt;br /&gt;
Like the ship collision hook, except for debris.&lt;br /&gt;
::* &#039;&#039;&#039;Debris&#039;&#039;&#039;, the debris (object)&lt;br /&gt;
::* &#039;&#039;&#039;Weapon&#039;&#039;&#039;, &#039;&#039;&#039;Ship&#039;&#039;&#039;, depending what it collided with (object)&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the object the debris collided with (object)&lt;br /&gt;
::* &#039;&#039;&#039;Object&#039;&#039;&#039;, the debris (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Asteroid Collision:=====&lt;br /&gt;
Like the ship collision hook, only for asteroids.&lt;br /&gt;
::* &#039;&#039;&#039;Asteroid&#039;&#039;&#039;, the asteroid (object)&lt;br /&gt;
::* &#039;&#039;&#039;Weapon&#039;&#039;&#039;, &#039;&#039;&#039;Ship&#039;&#039;&#039;, depending what it collided with (object)&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the object the asteroid collided with (object)&lt;br /&gt;
::* &#039;&#039;&#039;Object&#039;&#039;&#039;, the asteroid (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Object Render:=====&lt;br /&gt;
Executes when the specified object is rendered. The override is run before the object is rendered, and both the hook and its override receive an &amp;quot;Object&amp;quot; variable of the object to be rendered.&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the object rendered (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Warp In:=====&lt;br /&gt;
Run when a ship has begun warping in, immediately after everything has been set up for per-frame processing. This hook is only executed once, when the ship begins warping in. An override will disable _all_ behavior related to warpin. Both the hook and an override receive an &amp;quot;Object&amp;quot; handle in the HookVariables library, with the type of the object that is warping in.&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the object warping in (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Warp Out:=====&lt;br /&gt;
Same as warping in, except for warping out.&lt;br /&gt;
::* &#039;&#039;&#039;Self&#039;&#039;&#039;, the object warping out (object)&lt;br /&gt;
&lt;br /&gt;
=====$On Death:=====&lt;br /&gt;
*Currently only valid for ships.&lt;br /&gt;
Receives &amp;quot;Self&amp;quot; and &amp;quot;Killer&amp;quot; variables of the object and killer, respectively. Overriding it will override all default death behavior.&lt;br /&gt;
::* For asteroids:&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the asteroid (object)&lt;br /&gt;
::* For ships:&lt;br /&gt;
::** &#039;&#039;&#039;Self&#039;&#039;&#039;, the ship (object)&lt;br /&gt;
::** &#039;&#039;&#039;Killer&#039;&#039;&#039;, the other object (object) - NOTE, not guaranteed to exists&lt;br /&gt;
&lt;br /&gt;
=====$On Mission End:=====&lt;br /&gt;
Run on mission end.&lt;br /&gt;
::* No associated hook variables.&lt;br /&gt;
=====$On Weapon Equipped:=====&lt;br /&gt;
{{Table3613|&lt;br /&gt;
Runs once each frame, for every ship that has the weapon defined in the $Weapon class condition equipped.&lt;br /&gt;
::* &#039;&#039;&#039;User&#039;&#039;&#039;, the ship carrying the weapon&lt;br /&gt;
::* &#039;&#039;&#039;Target&#039;&#039;&#039;, the ships&#039; current target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Weapon Fired:=====&lt;br /&gt;
{{Table3613|&lt;br /&gt;
Runs once when a ship fires a weapon defined in the $Weapon class condition&lt;br /&gt;
::* &#039;&#039;&#039;User&#039;&#039;&#039;, the ship carrying the weapon&lt;br /&gt;
::* &#039;&#039;&#039;Target&#039;&#039;&#039;, the ships&#039; current target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Weapon Selected:=====&lt;br /&gt;
{{Table3613|&lt;br /&gt;
Runs once when a bank with a weapon defined in the $Weapon class condition is selected&lt;br /&gt;
::* &#039;&#039;&#039;User&#039;&#039;&#039;, the ship carrying the weapon&lt;br /&gt;
::* &#039;&#039;&#039;Target&#039;&#039;&#039;, the ships&#039; current target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Weapon Deselected:=====&lt;br /&gt;
{{Table3613|&lt;br /&gt;
Runs once when a bank with a weapon defined in the $Weapon class condition is deselected&lt;br /&gt;
::* &#039;&#039;&#039;User&#039;&#039;&#039;, the ship carrying the weapon&lt;br /&gt;
::* &#039;&#039;&#039;Target&#039;&#039;&#039;, the ships&#039; current target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Turret Fired:=====&lt;br /&gt;
{{Table3615|&lt;br /&gt;
Executed when a turret fires.&lt;br /&gt;
::* &#039;&#039;&#039;Ship&#039;&#039;&#039;, the parent ship&lt;br /&gt;
::* &#039;&#039;&#039;Weapon&#039;&#039;&#039;, the weapon which was fired&lt;br /&gt;
::* &#039;&#039;&#039;Target&#039;&#039;&#039;, the intended target&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Ship Arrive:=====&lt;br /&gt;
{{Table371|&lt;br /&gt;
Executed when a ship arrives.&lt;br /&gt;
::* &#039;&#039;&#039;Ship&#039;&#039;&#039;, the arriving ship&lt;br /&gt;
::* &#039;&#039;&#039;Parent&#039;&#039;&#039;, the ship acting as the anchor when arrival location is &amp;quot;in front of ship&amp;quot;, &amp;quot;near ship&amp;quot; or &amp;quot;docking bay&amp;quot;; nil or invalid handle otherwise&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Action:=====&lt;br /&gt;
{{Table371|&lt;br /&gt;
Executed when an action is triggered, regardless of which key or button it is bound to. Does currently not trigger on mouse or joystick movements.&lt;br /&gt;
::* &#039;&#039;&#039;Action&#039;&#039;&#039;, the textual description of the action (for example &amp;quot;Fire Primary Weapon&amp;quot; or &amp;quot;Match Target Speed&amp;quot;)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Action Stopped:=====&lt;br /&gt;
{{Table371|&lt;br /&gt;
Executed when a continuous action is released (for example &amp;quot;Fire Primary Weapon&amp;quot;, &amp;quot;Turn Left&amp;quot; or &amp;quot;Afterburner&amp;quot;).&lt;br /&gt;
::* &#039;&#039;&#039;Action&#039;&#039;&#039;, the textual description of the action&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=====$On Message Received:=====&lt;br /&gt;
{{Table371|&lt;br /&gt;
Executed when the player receives a message.&lt;br /&gt;
::* &#039;&#039;&#039;Name&#039;&#039;&#039;, the message name that was received. The message handle can be accessed with mn.Messages[hv.Name]&lt;br /&gt;
::* &#039;&#039;&#039;Message&#039;&#039;&#039;, the message text that would be displayed on the message gauge. Takes in account scrambled messages and variable replacements.&lt;br /&gt;
::* &#039;&#039;&#039;SenderString&#039;&#039;&#039;, the displayed string that shows the origin of the message.&lt;br /&gt;
::* &#039;&#039;&#039;Builtin&#039;&#039;&#039;, boolean, true if the message was a builtin message (eg: automatic messages from Command or wingmen)&lt;br /&gt;
::* &#039;&#039;&#039;Sender&#039;&#039;&#039;, object handle of the ship that sent the message. This might not always be valid, so check is :isValid() if you need to use it&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Misc. Hook Variables:==&lt;br /&gt;
&lt;br /&gt;
===Viewer===&lt;br /&gt;
*Active if (non-player) viewing object is valid&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Player===&lt;br /&gt;
*Active if player obj is valid &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
See [[:Category:Scripting Examples|Scripting Examples category]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Tables]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Scripted_Message_Gauge&amp;diff=44118</id>
		<title>Script - Scripted Message Gauge</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Scripted_Message_Gauge&amp;diff=44118"/>
		<updated>2014-07-06T19:08:49Z</updated>

		<summary type="html">&lt;p&gt;Axem: Correcting some minor terminology&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Scripted Message Gauge is a LUA script that enables messages to be displayed in a different fashion. Instead of the default way of a message line appearing right away with a backlog, the message will be drawn one character at a time with a background that enables messages to be seen more easily against a bright background.&lt;br /&gt;
&lt;br /&gt;
The script requires code added in rev 10756 or 3.7.2 RC3 or later.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link=&lt;br /&gt;
&lt;br /&gt;
[http://www.mediafire.com/download/d5nplmsz43d32ip/ScriptedMessagev1.2.rar Download Link]&lt;br /&gt;
&lt;br /&gt;
=Required File=&lt;br /&gt;
&lt;br /&gt;
All required files are included in the above download.&lt;br /&gt;
&lt;br /&gt;
*/config/&lt;br /&gt;
**axmessage.cfg&lt;br /&gt;
*/interface/&lt;br /&gt;
**messagebox.png&lt;br /&gt;
*/scripts/&lt;br /&gt;
**dkjson.lua [[http://dkolf.de/src/dkjson-lua.fsl/home]]&lt;br /&gt;
*/tables/&lt;br /&gt;
**axmsg-mod.tbm&lt;br /&gt;
**axmsg-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
axmessage.cfg is a JSON configuration file&lt;br /&gt;
&lt;br /&gt;
==Default==&lt;br /&gt;
===TitleFont===&lt;br /&gt;
Integer or String, Font index or name used for the displayed sender&#039;s name. Default is 3.&lt;br /&gt;
&lt;br /&gt;
===TextFont===&lt;br /&gt;
Integer or String, Font index or name used for the displayed message text. Default is 1.&lt;br /&gt;
&lt;br /&gt;
===Image===&lt;br /&gt;
Filename, Image to use as the background for the message text. Default is messagebox.&lt;br /&gt;
&lt;br /&gt;
===Speed===&lt;br /&gt;
Integer, The time it will take 1 character to draw in seconds. Default is 0.03.&lt;br /&gt;
&lt;br /&gt;
===Length===&lt;br /&gt;
Integer, The script uses length to guess how long a message should be displayed for. Normal behavior will have a message be displayed for (Length * Number of characters in message) seconds. Default is 0.07.&lt;br /&gt;
&lt;br /&gt;
===AfterVoice===&lt;br /&gt;
Integer, If a non-generic voice file is used in a message, this is the amount of extra time the message will be visible for after the voice file is over. Default is 1.5.&lt;br /&gt;
&lt;br /&gt;
===TitleColor===&lt;br /&gt;
RGBA, If monochrome is false, this is the RGBA color the sender&#039;s name will be.&lt;br /&gt;
&lt;br /&gt;
===TextColor===&lt;br /&gt;
RGBA, If monochrome is false, this is the RGBA color the message text will be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Position==&lt;br /&gt;
===Origin===&lt;br /&gt;
Percent, Percent, Percent based positioning similar to how the new hud positioning works.&lt;br /&gt;
===Offset===&lt;br /&gt;
Integer, integer, The offset in pixels from the origin, similar to how the new hud positioning works.&lt;br /&gt;
===HeadAni===&lt;br /&gt;
Integer, integer, The offset in pixels for the talking head message gauges. This does not work (yet).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Backlog==&lt;br /&gt;
===Enabled===&lt;br /&gt;
Boolean, activates the backlog feature. Previously received messages will have a similar behavior to the old message gauge.&lt;br /&gt;
===Origin===&lt;br /&gt;
Percent, Percent, Percent based positioning similar to how the new hud positioning works.&lt;br /&gt;
===Offset===&lt;br /&gt;
Integer, integer, The offset in pixels from the origin, similar to how the new hud positioning works.&lt;br /&gt;
===Height===&lt;br /&gt;
Integer, How height of the area that the backlog will be confined to. The message backlog will start at the bottom and gradually work its way up.&lt;br /&gt;
&lt;br /&gt;
==Offsets==&lt;br /&gt;
===Sender===&lt;br /&gt;
X,Y offset where the Sender text will be drawn from the position&lt;br /&gt;
===Text===&lt;br /&gt;
X,Y offset where the message text will be drawn from the position&lt;br /&gt;
&lt;br /&gt;
==Monochrome==&lt;br /&gt;
Boolean, turns monochrome on or off. See behavior for a detailed explanation&lt;br /&gt;
&lt;br /&gt;
==GenericFiles==&lt;br /&gt;
Array, filenames, A list of files (minus the file extensions) that will cause the script to use generic guessing for the message length and not the actual voice file length. These are the message beeps and alarms when there&#039;s no voice acting.&lt;br /&gt;
&lt;br /&gt;
==MinVertRes==&lt;br /&gt;
Integer, optional, the vertical resolution must be at least this for the script to activate.&lt;br /&gt;
&lt;br /&gt;
=Behavior=&lt;br /&gt;
==Message Length==&lt;br /&gt;
There are a few ways the script calculates how long a message should be visible. If there is no voice file or the voice file is in the generic list, the message will be displayed for (Length * Number of Characters in Message). If a modifier makes the message longer, the length will be extended as well (but it will not be shortened).&lt;br /&gt;
&lt;br /&gt;
If there is a VoiceFile attached to the message, the message will be displayed for (VoiceFile Length + AfterVoice).&lt;br /&gt;
&lt;br /&gt;
==Changing the Text Draw Speed in FRED==&lt;br /&gt;
By putting !s and .s at the beginning of messages names in FRED, the text draw speed will be modified.&lt;br /&gt;
&lt;br /&gt;
*!!! = Draws instantly&lt;br /&gt;
*!! = Draws 66% faster&lt;br /&gt;
*! = Draws 33% faster&lt;br /&gt;
*. = Draws 33% slower&lt;br /&gt;
*.. = Draws 66% slower&lt;br /&gt;
*... = Draws 100% slower&lt;br /&gt;
&lt;br /&gt;
The characters must be at the start of the message. So &amp;lt;pre&amp;gt;!!!Holley says sup&amp;lt;/pre&amp;gt; would work. &amp;lt;pre&amp;gt;Holley says sup!!!&amp;lt;/pre&amp;gt; would not.&lt;br /&gt;
&lt;br /&gt;
==Monochrome Mode==&lt;br /&gt;
&lt;br /&gt;
If monochrome mode is false, the image is drawn as-is in full color without any game added-transparency. TitleColor and TextColor will be used to color the sender name and text.&lt;br /&gt;
&lt;br /&gt;
If monochrome mode is true:&lt;br /&gt;
*The image will be colored the same color as the talking head hud gauge. An additional dark gray copy of the image is drawn underneath to minimize washout.&lt;br /&gt;
*The text will be colored the same as the default message lines hud gauge. The alpha is increased to max for maximum readability.&lt;br /&gt;
*If the talking head hud gauge and message lines hud gauge are the same color (eg you selected Amber/Green/Blue in the HUD config) the text will be brightened so its slightly easier to read.&lt;br /&gt;
&lt;br /&gt;
=Limitations=&lt;br /&gt;
&lt;br /&gt;
The gauge does not brighten or dim with the Increase HUD Contrast command (L key).&lt;br /&gt;
&lt;br /&gt;
The text doesn&#039;t scale like the rest of the retail hud. So using &amp;lt;pre&amp;gt;$Scale Gauges: No&amp;lt;/pre&amp;gt; in a hud gauges table will do nothing. This may change in the future.&lt;br /&gt;
&lt;br /&gt;
=Using In-Game=&lt;br /&gt;
&lt;br /&gt;
The script needs no special activation. When the script initializes in a mission, it turns off the retail message lines gauge.&lt;br /&gt;
&lt;br /&gt;
In order for the scripted messages gauge to be visible during in-game cutscenes where the disable-hud-except-messages is used, you need to use the included -mod.tbm file. It puts the control of HUD visibility on manual FREDder control, so the HUD may be visible during cutscenes where a camera sexp is used without any disable-hud sexps. Just add disable-hud or disable-hud-except-messages.&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Tutorial_-_Fun_with_Simulated_Hull&amp;diff=44096</id>
		<title>Tutorial - Fun with Simulated Hull</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Tutorial_-_Fun_with_Simulated_Hull&amp;diff=44096"/>
		<updated>2014-06-30T16:28:16Z</updated>

		<summary type="html">&lt;p&gt;Axem: Forgot a small link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Let us suppose we have a daring mission idea here. You, a pirate, needs some cash. Well there&#039;s this mostly abandoned container depot that might have credits. To make things nice and random, let&#039;s have each container have a random amount of credits. When we send a transport to dock with the container, it&#039;ll take those credits from the container and add them to a stockpile. And maybe after docking with like 4 containers, the GTVA notices us and sends some goons out to take care of us.&lt;br /&gt;
&lt;br /&gt;
So how would we do this? There&#039;s a few ways we could do this. One is make variables for each container and link them to containers by careful use of arguments and *-variable-by-index sexps. Or we could just set the cargo of each container to be a value and just grab that info with things like string-to-int sexps. But I think we should stick with something a little more simpler, sim-hits.&lt;br /&gt;
&lt;br /&gt;
Just what is sim-hits? It’s a special, mostly invisible subsystem that all ships have. Way back in semi-ancient history, simulated hull was added so you could have a mock dogfight outside of a simulator setting. Weapons with a &amp;quot;training&amp;quot; flag wouldn&#039;t do real damage, just damage to your sim-hits subsystem. Though the oddest part about the simulated hull subsystem is that it starts at 0%, unlike anything else sane at 100%.&lt;br /&gt;
&lt;br /&gt;
Since its invisible to the player and isn&#039;t affected by 99.9% of all weapons, I find it a great ship-specific variable to use for fun and profit.&lt;br /&gt;
&lt;br /&gt;
==Invisible Variable==&lt;br /&gt;
&lt;br /&gt;
So here is how we will use sim-hits in our scenario:&lt;br /&gt;
&lt;br /&gt;
When the mission starts, we give each container a random amount of sim-hits integrity, from 1 to 100.&lt;br /&gt;
Since sim-hits is a subsystem and is limited to 0 - 100, we set the cargo for each container to be (sim-hits-left * 10) to give a nice healthy amount of credits. Using string concatenate we&#039;ll add on CR as well to make it look nice.&lt;br /&gt;
When we order a freighter to dock, we&#039;ll take that sim-hits total, multiply it by 10 and add it to our stock of credits.&lt;br /&gt;
Then we set the sim-hits of the container to zero and mark its cargo as empty. This way we can go something like &amp;quot;2350/891200 credits stolen&amp;quot; at the end to help the player know how well he did.&lt;br /&gt;
&lt;br /&gt;
Okay, let&#039;s get to it!&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our mission space. Just the player, a Posedion-class freighter, and a bunch of containers.&lt;br /&gt;
&lt;br /&gt;
[[File:Simhits1.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the setup to making the containers get the sim-hits value and setting the cargo with a properly scaled number. All of the containers are in that in-sequence sexp, I make the event repeat 15 times so I can hit each one with a unique sim-hits (Though if you have this [[Game_settings.tbl#.24Loop_SEXPs_Then_Arguments:|game settings]] flag on, you could do it in just one pass).&lt;br /&gt;
&lt;br /&gt;
[[File:Simhits2.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The dummyNumber variable is a string variable that gets the scaled amount from us doing sim-hits-left * 10. Then dummyNumber gets concatenated with &amp;quot; CR&amp;quot; and is set as the cargo for the player to scan.&lt;br /&gt;
&lt;br /&gt;
And now for the event where our freighter docks with a container. Again we&#039;ll need to make this one trigger 15 times, once for each container.&lt;br /&gt;
&lt;br /&gt;
[[File:Simhits3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s similar to setting that first event up. When Cohort docks, add (sim-hits-left * 10) to the total number of credits, use that to generate a new cargo string and then set the container as empty with no sim-hits left. And we also send a message so we&#039;ve got an update on our scavenging right there too. That collapsed modify-variable near the bottom just increments a variable called numDocked by 1 so we know when to send in the GTVA.&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it! Just 2 events that generates a number specific to each container and then accesses it for us to use elsewhere.&lt;br /&gt;
&lt;br /&gt;
Of course there&#039;s so much more you can use sim-hits for.&lt;br /&gt;
&lt;br /&gt;
==Flag Variables==&lt;br /&gt;
&lt;br /&gt;
If you&#039;re making a complex conversation with the prompt box, you might want to ask a question or two to a ship and also have that question you asked exhaust itself so you don&#039;t ask the same thing twice. Here in a future mission for JAD, you can see how I used it. When I select an option with the Prompt Box, proBoxValue returns the line number that I selected. So when its 1, I selected line 1, and it sets that bit within the sim-hits of my target. Since sim-hits only goes up to 100, I only have room for 5 bits, but that’s still good enough for me.&lt;br /&gt;
&lt;br /&gt;
In the event that decides what lines to draw, it checks to see if those bits are active within that target.&lt;br /&gt;
&lt;br /&gt;
[[File:Simhits4.png|600px]]&lt;br /&gt;
&lt;br /&gt;
You could also use it for other things like to decide which fighters go renegade, or if a ship likes you or anything else you might need to store simple yes/no information in.&lt;br /&gt;
&lt;br /&gt;
==State Variables==&lt;br /&gt;
&lt;br /&gt;
In JAD:XA, the gauntlet has a boss trio, Trinitiel, that has a teamwork system built into them. To kill all three, you need to destroy each one&#039;s weakpoint core. When you destroy the core on one of them, that one goes to sleep for a bit, and one of other two goes into a heal mode to restore their sleeping brother. Then when he&#039;s healed, they go back to attacking you.&lt;br /&gt;
&lt;br /&gt;
Sounds sort of simple when you just plan it out like that, but to make sure everyone is doing what they are supposed to, we need to keep track of their state. We could do that with a normal variable, but by embedding it into their sim-hits subsystem, we can just go &amp;quot;whoever has sim-hits 50 and this happens to them, do this then&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Simhits6.png|600px]]&lt;br /&gt;
[[File:Simhits5.png|600px]]&lt;br /&gt;
&lt;br /&gt;
You can see in this pic the different &amp;quot;Modes&amp;quot; the boss has. Everything from attacking the player, to healing a brother, to playing dead or self-destructing. (Keen players who see this may notice that they never teleported or tried to avoid the player,  that is what we in the business call, cut content.)&lt;br /&gt;
&lt;br /&gt;
Hopefully this will help assist you in any weird missions you might be planning, or maybe even inspire you!&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Tutorial_-_Fun_with_Simulated_Hull&amp;diff=44095</id>
		<title>Tutorial - Fun with Simulated Hull</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Tutorial_-_Fun_with_Simulated_Hull&amp;diff=44095"/>
		<updated>2014-06-30T16:23:46Z</updated>

		<summary type="html">&lt;p&gt;Axem: Fun with simulated hull tutorial!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Let us suppose we have a daring mission idea here. You, a pirate, needs some cash. Well there&#039;s this mostly abandoned container depot that might have credits. To make things nice and random, let&#039;s have each container have a random amount of credits. When we send a transport to dock with the container, it&#039;ll take those credits from the container and add them to a stockpile. And maybe after docking with like 4 containers, the GTVA notices us and sends some goons out to take care of us.&lt;br /&gt;
&lt;br /&gt;
So how would we do this? There&#039;s a few ways we could do this. One is make variables for each container and link them to containers by careful use of arguments and *-variable-by-index sexps. Or we could just set the cargo of each container to be a value and just grab that info with things like string-to-int sexps. But I think we should stick with something a little more simpler, sim-hits.&lt;br /&gt;
&lt;br /&gt;
Just what is sim-hits? It’s a special, mostly invisible subsystem that all ships have. Way back in semi-ancient history, simulated hull was added so you could have a mock dogfight outside of a simulator setting. Weapons with a &amp;quot;training&amp;quot; flag wouldn&#039;t do real damage, just damage to your sim-hits subsystem. Though the oddest part about the simulated hull subsystem is that it starts at 0%, unlike anything else sane at 100%.&lt;br /&gt;
&lt;br /&gt;
Since its invisible to the player and isn&#039;t affected by 99.9% of all weapons, I find it a great ship-specific variable to use for fun and profit.&lt;br /&gt;
&lt;br /&gt;
==Invisible Variable==&lt;br /&gt;
&lt;br /&gt;
So here is how we will use sim-hits in our scenario:&lt;br /&gt;
&lt;br /&gt;
When the mission starts, we give each container a random amount of sim-hits integrity, from 1 to 100.&lt;br /&gt;
Since sim-hits is a subsystem and is limited to 0 - 100, we set the cargo for each container to be (sim-hits-left * 10) to give a nice healthy amount of credits. Using string concatenate we&#039;ll add on CR as well to make it look nice.&lt;br /&gt;
When we order a freighter to dock, we&#039;ll take that sim-hits total, multiply it by 10 and add it to our stock of credits.&lt;br /&gt;
Then we set the sim-hits of the container to zero and mark its cargo as empty. This way we can go something like &amp;quot;2350/891200 credits stolen&amp;quot; at the end to help the player know how well he did.&lt;br /&gt;
&lt;br /&gt;
Okay, let&#039;s get to it!&lt;br /&gt;
&lt;br /&gt;
Here&#039;s our mission space. Just the player, a Posedion-class freighter, and a bunch of containers.&lt;br /&gt;
&lt;br /&gt;
[[File:Simhits1.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the setup to making the containers get the sim-hits value and setting the cargo with a properly scaled number. All of the containers are in that in-sequence sexp, I make the event repeat 15 times so I can hit each one with a unique sim-hits (Though if you have this game_settings.tbl flag on, you could do it in just one pass).&lt;br /&gt;
&lt;br /&gt;
[[File:Simhits2.png|600px]]&lt;br /&gt;
&lt;br /&gt;
The dummyNumber variable is a string variable that gets the scaled amount from us doing sim-hits-left * 10. Then dummyNumber gets concatenated with &amp;quot; CR&amp;quot; and is set as the cargo for the player to scan.&lt;br /&gt;
&lt;br /&gt;
And now for the event where our freighter docks with a container. Again we&#039;ll need to make this one trigger 15 times, once for each container.&lt;br /&gt;
&lt;br /&gt;
[[File:Simhits3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s similar to setting that first event up. When Cohort docks, add (sim-hits-left * 10) to the total number of credits, use that to generate a new cargo string and then set the container as empty with no sim-hits left. And we also send a message so we&#039;ve got an update on our scavenging right there too. That collapsed modify-variable near the bottom just increments a variable called numDocked by 1 so we know when to send in the GTVA.&lt;br /&gt;
&lt;br /&gt;
And that&#039;s it! Just 2 events that generates a number specific to each container and then accesses it for us to use elsewhere.&lt;br /&gt;
&lt;br /&gt;
Of course there&#039;s so much more you can use sim-hits for.&lt;br /&gt;
&lt;br /&gt;
==Flag Variables==&lt;br /&gt;
&lt;br /&gt;
If you&#039;re making a complex conversation with the prompt box, you might want to ask a question or two to a ship and also have that question you asked exhaust itself so you don&#039;t ask the same thing twice. Here in a future mission for JAD, you can see how I used it. When I select an option with the Prompt Box, proBoxValue returns the line number that I selected. So when its 1, I selected line 1, and it sets that bit within the sim-hits of my target. Since sim-hits only goes up to 100, I only have room for 5 bits, but that’s still good enough for me.&lt;br /&gt;
&lt;br /&gt;
In the event that decides what lines to draw, it checks to see if those bits are active within that target.&lt;br /&gt;
&lt;br /&gt;
[[File:Simhits4.png|600px]]&lt;br /&gt;
&lt;br /&gt;
You could also use it for other things like to decide which fighters go renegade, or if a ship likes you or anything else you might need to store simple yes/no information in.&lt;br /&gt;
&lt;br /&gt;
==State Variables==&lt;br /&gt;
&lt;br /&gt;
In JAD:XA, the gauntlet has a boss trio, Trinitiel, that has a teamwork system built into them. To kill all three, you need to destroy each one&#039;s weakpoint core. When you destroy the core on one of them, that one goes to sleep for a bit, and one of other two goes into a heal mode to restore their sleeping brother. Then when he&#039;s healed, they go back to attacking you.&lt;br /&gt;
&lt;br /&gt;
Sounds sort of simple when you just plan it out like that, but to make sure everyone is doing what they are supposed to, we need to keep track of their state. We could do that with a normal variable, but by embedding it into their sim-hits subsystem, we can just go &amp;quot;whoever has sim-hits 50 and this happens to them, do this then&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:Simhits6.png|600px]]&lt;br /&gt;
[[File:Simhits5.png|600px]]&lt;br /&gt;
&lt;br /&gt;
You can see in this pic the different &amp;quot;Modes&amp;quot; the boss has. Everything from attacking the player, to healing a brother, to playing dead or self-destructing. (Keen players who see this may notice that they never teleported or tried to avoid the player,  that is what we in the business call, cut content.)&lt;br /&gt;
&lt;br /&gt;
Hopefully this will help assist you in any weird missions you might be planning, or maybe even inspire you!&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=File:Simhits5.png&amp;diff=44094</id>
		<title>File:Simhits5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=File:Simhits5.png&amp;diff=44094"/>
		<updated>2014-06-30T16:22:49Z</updated>

		<summary type="html">&lt;p&gt;Axem: For sim hits variable tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For sim hits variable tutorial&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=File:Simhits6.png&amp;diff=44093</id>
		<title>File:Simhits6.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=File:Simhits6.png&amp;diff=44093"/>
		<updated>2014-06-30T16:19:23Z</updated>

		<summary type="html">&lt;p&gt;Axem: For sim hits variable tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For sim hits variable tutorial&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=File:Simhits4.png&amp;diff=44092</id>
		<title>File:Simhits4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=File:Simhits4.png&amp;diff=44092"/>
		<updated>2014-06-30T16:19:08Z</updated>

		<summary type="html">&lt;p&gt;Axem: For sim hits variable tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For sim hits variable tutorial&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=File:Simhits3.png&amp;diff=44091</id>
		<title>File:Simhits3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=File:Simhits3.png&amp;diff=44091"/>
		<updated>2014-06-30T16:18:57Z</updated>

		<summary type="html">&lt;p&gt;Axem: For sim hits variable tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For sim hits variable tutorial&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=File:Simhits2.png&amp;diff=44090</id>
		<title>File:Simhits2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=File:Simhits2.png&amp;diff=44090"/>
		<updated>2014-06-30T16:18:48Z</updated>

		<summary type="html">&lt;p&gt;Axem: For sim hits variable tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For sim hits variable tutorial&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=File:Simhits1.jpg&amp;diff=44089</id>
		<title>File:Simhits1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=File:Simhits1.jpg&amp;diff=44089"/>
		<updated>2014-06-30T16:18:35Z</updated>

		<summary type="html">&lt;p&gt;Axem: For sim hits variable tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For sim hits variable tutorial&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44088</id>
		<title>User:Axem</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44088"/>
		<updated>2014-06-30T16:17:10Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Tutorials */ adding fun with sim hits tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About Axem!==&lt;br /&gt;
Hello! I am Axem, friendly administrator on the HLP forums. I can FRED (make missions), model, UVMap, texture, script and make rough effects. Just don&#039;t ask me to do any of it for you, I&#039;ve got enough to do! But I can help guide you to the right path. Below you&#039;ll find some of the stuff I&#039;ve done here over the years.&lt;br /&gt;
&lt;br /&gt;
==My Campaigns==&lt;br /&gt;
*[[Shadows of Kraken]]&lt;br /&gt;
*[[Just Another Day]]&lt;br /&gt;
*[[Just Another Day 2: Electric Boogaloo]]&lt;br /&gt;
*[[Just Another Day 3: Shivans on a Plane]]&lt;br /&gt;
*[[Vassago&#039;s Dirge]]&lt;br /&gt;
*[[Just Another Day 2.21: You Are (Not) Alpha 1]]&lt;br /&gt;
&lt;br /&gt;
==Projects I Help With==&lt;br /&gt;
*[[Diaspora]]&lt;br /&gt;
*[[Blue Planet]]&lt;br /&gt;
*[[Wings of Dawn]]&lt;br /&gt;
&lt;br /&gt;
==My Ships==&lt;br /&gt;
&lt;br /&gt;
*[[GTC Cretheus]]&lt;br /&gt;
*[[SC Lamia]]&lt;br /&gt;
*[[SGs Asura]] (textured by Nighteyes)&lt;br /&gt;
*[[UES Aranyaka]]&lt;br /&gt;
&lt;br /&gt;
Other WIPS can be seen on my [http://p3d.in/u/Axem p3d page]&lt;br /&gt;
&lt;br /&gt;
==Helpful Pages I&#039;ve Done==&lt;br /&gt;
===Tutorials===&lt;br /&gt;
*[[Tutorial - Conditional Arguments]]&lt;br /&gt;
*[[Tutorial - Directive-is-variable SEXP]]&lt;br /&gt;
*[[Tutorial - Mission Infrastructure]]&lt;br /&gt;
*[[Tutorial - PCS2 Kitbashing]]&lt;br /&gt;
*[[Tutorial - Custom HUD Gauges]]&lt;br /&gt;
*[[Tutorial - Fun with Simulated Hull]]&lt;br /&gt;
&lt;br /&gt;
===SEXP Reference===&lt;br /&gt;
*[[Advanced Cutscene SEXP Reference]]&lt;br /&gt;
===Script Reference===&lt;br /&gt;
*[[Script - Journal/Fluff Viewer]]&lt;br /&gt;
*[[Script - System Viewer]]&lt;br /&gt;
*[[Script - Interface Monitor]]&lt;br /&gt;
*[[Script - Scripted Message Gauge]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=44074</id>
		<title>Script - System Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=44074"/>
		<updated>2014-06-22T16:04:28Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Using In-Game */ Oops, bad tag.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The System Viewer is a LUA script that allows a modder to create a map that can be used for reference purposes or for in-game navigational purposes. The configuration files are done in JSON and I would recommend using [http://www.jsoneditoronline.org/ this site] to edit them.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link=&lt;br /&gt;
&lt;br /&gt;
LINK&lt;br /&gt;
&lt;br /&gt;
=Required Files=&lt;br /&gt;
&lt;br /&gt;
All required files are included in the above download, including some sample files for demonstration and to inspire. The following files are the required files needed to make the script work if the modder wishes to remove the other files.&lt;br /&gt;
&lt;br /&gt;
*/config/&lt;br /&gt;
**imonitor.cfg (if imonitor-sct.tbm is to be used)&lt;br /&gt;
*/interface/&lt;br /&gt;
**axui_box1.png&lt;br /&gt;
**axui_cancel.png (+c and h variants)&lt;br /&gt;
**axui_exit.png&lt;br /&gt;
**axui_jumpto.png (+c and h variants)&lt;br /&gt;
**axui_return.png (+c and h variants)&lt;br /&gt;
**cb_sidetab.png (+c and h variants)&lt;br /&gt;
*/scripts/&lt;br /&gt;
**dkjson.lua [[http://dkolf.de/src/dkjson-lua.fsl/home]]&lt;br /&gt;
*/tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**sysviewer-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
&lt;br /&gt;
==Demonstration Files==&lt;br /&gt;
*/interface/&lt;br /&gt;
**nav_asteroids.png&lt;br /&gt;
**nav_node.png&lt;br /&gt;
**nav_node_big.png&lt;br /&gt;
**nav_orion.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_planet_g.png&lt;br /&gt;
**nav_planet_p.png&lt;br /&gt;
**nav_planet_r.png&lt;br /&gt;
**nav_planet_y.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_star_b.png&lt;br /&gt;
**nav_star_r.png&lt;br /&gt;
**nav_star_w.png&lt;br /&gt;
**nav_star_y.png&lt;br /&gt;
**nav_sys_vega.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
The system viewer requires 2 configuration files (3 if an out-of-mission interface is desired). These files must be placed in the /config/ directory.&lt;br /&gt;
&lt;br /&gt;
==Interface Monitor==&lt;br /&gt;
&lt;br /&gt;
imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in [[Script - Interface Monitor]].&lt;br /&gt;
&lt;br /&gt;
==Campaign Configuration File==&lt;br /&gt;
&lt;br /&gt;
Used to decide which system config that gets loaded during a campaign.&lt;br /&gt;
&lt;br /&gt;
==System Configuration File==&lt;br /&gt;
&lt;br /&gt;
Contains all the information to draw systems&lt;br /&gt;
&lt;br /&gt;
=Campaign Configuration File=&lt;br /&gt;
&lt;br /&gt;
A file with the format &amp;lt;pre&amp;gt;sysview_[CAMPAIGN_FILENAME]_config.cfg&amp;lt;/pre&amp;gt; placed in the /config/ folder will be loaded when the System Viewer starts. Eg: sysview_Freespace2_config.cfg. The file is a JSON file with 2 required fields.&lt;br /&gt;
==&amp;quot;File&amp;quot;:==&lt;br /&gt;
This will tell the script which system file to look at and load.&lt;br /&gt;
==&amp;quot;Default&amp;quot;:==&lt;br /&gt;
This will load the specified system that the script will load by default.&lt;br /&gt;
==&amp;quot;[missionfilename].fs2&amp;quot;:==&lt;br /&gt;
This will load the specified system when the mission&#039;s filename matches the one being played (or to be played next if the script was activated in the mainhall screen)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;sm01-01.fs2&amp;quot;: Vega1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=System Configuration File=&lt;br /&gt;
&lt;br /&gt;
This file contains the information the script uses to draw the system.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;[Internal Name]&amp;quot;==&lt;br /&gt;
Object. The name of the object that contains the system configuration is used internally to change to keep track of the different systems in the file&lt;br /&gt;
===&amp;quot;Name&amp;quot;===&lt;br /&gt;
String, the displayed name. Drawn in the upper left corner in large text&lt;br /&gt;
===&amp;quot;Description&amp;quot;===&lt;br /&gt;
String, a subtitle to the name. Drawn below name in slightly smaller text&lt;br /&gt;
===&amp;quot;Background&amp;quot;===&lt;br /&gt;
Filename, the background that will be used in the system viewer screen. The view will be bound to this image (so its a good idea to make this a large image).&lt;br /&gt;
====&amp;quot;Elements&amp;quot;====&lt;br /&gt;
Object, this contains all the visible elements the player can interact with.&lt;br /&gt;
=====&amp;quot;[Internal Name]&amp;quot;=====&lt;br /&gt;
Object, this contains all the information to draw this element. The object&#039;s name will be the internal name for this element. This will be the name that gets written to a SEXP variable, navsys_destination, if the modder is using this as a navigational system. If this element is named &amp;quot;Player&amp;quot; it will be moved to navsys_destination as well.&lt;br /&gt;
=====&amp;quot;Name&amp;quot;=====&lt;br /&gt;
String, the name that will be drawn below the bitmap.&lt;br /&gt;
=====&amp;quot;Visible&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw this element.&lt;br /&gt;
=====&amp;quot;Bitmap&amp;quot;=====&lt;br /&gt;
Filename, should be in a folder with other graphic files (effects or maps etc). This is the bitmap that will be drawn. The script will also attempt to use the filename plus _h and _c for highlighted and clicked graphics.&lt;br /&gt;
=====&amp;quot;LargeBitmap&amp;quot;=====&lt;br /&gt;
Filename, will be drawn in the middle of the screen if this element is clicked.&lt;br /&gt;
=====&amp;quot;ShipClass&amp;quot;=====&lt;br /&gt;
String, if LargeBitmap is absent and ShipClass has a valid ship class, a rotating tech room style model will be rendered when an element is clicked on.&lt;br /&gt;
=====&amp;quot;ModelOrientation&amp;quot;=====&lt;br /&gt;
Array, 3 integers: pitch, bank, heading. If ShipClass was specified, this will be the default orientation in degrees that the model will be rendered as. Default is 17,0,180&lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;RotationSpeed&amp;quot;=====&lt;br /&gt;
Integer, the rotation speed of a model being rendered. No effect on Bitmaps. The Y-Axis is used as the rotation axis. Value is in degrees/second. Default is ~30 degrees/second.&lt;br /&gt;
=====&amp;quot;ShowOrbit&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw the circular orbit for this element. This does not allow hyperbolic or elliptical orbits. Optional.&lt;br /&gt;
=====&amp;quot;Selectable&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click on the object which will bring up detailed information about this object. Optional.&lt;br /&gt;
=====&amp;quot;CanJump&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click a &amp;quot;Jump To&amp;quot; button if this was activated during gameplay. Upon clicking JumpTo, the internal name for the element will be written to the SEXP Variable, navsys_destination, if it exists. It will also close the viewer. Optional.&lt;br /&gt;
=====&amp;quot;ForceJump&amp;quot;=====&lt;br /&gt;
Boolean, if true and the player clicks the &amp;quot;Jump To&amp;quot; button, it will force the player to jump out, ending the mission. Optional.&lt;br /&gt;
=====&amp;quot;Orbits&amp;quot;=====&lt;br /&gt;
String, internal name of another element. This will cause this element to have its orbit centered on the specified parent&#039;s orbit.&lt;br /&gt;
=====&amp;quot;Orbit&amp;quot;=====&lt;br /&gt;
Object. Defining, in polar coordinate terms, where to draw the element. Optional, but leaving this out will cause the element to be drawn in the middle of the screen.&lt;br /&gt;
======&amp;quot;Distance&amp;quot;======&lt;br /&gt;
Integer, the orbital radius in pixels.&lt;br /&gt;
======&amp;quot;Angle&amp;quot;======&lt;br /&gt;
Integer, the orbital angle in degrees. 0 degrees is the direction to the right side of the screen and goes clockwise.&lt;br /&gt;
======&amp;quot;Color&amp;quot;======&lt;br /&gt;
Array, 4 integers: red, green, blue, alpha. Color of the orbit path. Default is 192,192,192,255&lt;br /&gt;
======&amp;quot;Width&amp;quot;======&lt;br /&gt;
Integer, the width of the orbit path. Default is 3.&lt;br /&gt;
=====&amp;quot;Offset&amp;quot;=====&lt;br /&gt;
Object. Fine tuning a bitmap&#039;s placement. Optional.&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, this will move this object to the right by X pixels (negative values will move it to the left). This is in addition to the orbital distance and angle. (You could have two elements sharing the same orbital distance and angle, but have different offsets to place them differently)&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as the X above, just for vertical placement.&lt;br /&gt;
=====&amp;quot;Icon&amp;quot;=====&lt;br /&gt;
Object. Draws a secondary bitmap over the element. Optional.&lt;br /&gt;
======&amp;quot;Bitmap&amp;quot;======&lt;br /&gt;
Filename, graphic file to be drawn&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, x coordinate of where the bitmap will be drawn relative to the top left of the element&#039;s bitmap. Two special values, &amp;quot;-&amp;quot; and &amp;quot;+&amp;quot; can be used instead to automatically move the icon to the left most or right most part of the element&#039;s bitmap.&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as X above, just for vertical placement.&lt;br /&gt;
&lt;br /&gt;
=Using In-Game=&lt;br /&gt;
&lt;br /&gt;
There are a few things the player needs to take care of before they can use this effectively. First, the player should have No Subspace Drive. Check mark it in the ship editor or as a sexp. While in gameplay mode, the System Viewer will not be enabled by default, you can enable the script by using:&lt;br /&gt;
&amp;lt;pre&amp;gt;script-eval&lt;br /&gt;
 &amp;quot;SystemViewer.Allowed = true&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Viewer should now be able to be called up by going Alt-J. The script behaves just like it does outside the mission, except now there is a &amp;quot;Jump To&amp;quot; button available if the &amp;quot;CanJump&amp;quot; property was set in the config file.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;Jump To&amp;quot; button is selected, the object name (not the name property!) will be written to a sexp variable, &amp;quot;navsys_destination&amp;quot;. (From the Vegalancer campaign, some examples would be &amp;quot;Norica&amp;quot; or &amp;quot;89thTF&amp;quot;) If the ForceJump property was set, the player will automatically jump out.&lt;br /&gt;
&lt;br /&gt;
Actually ensuring the player arrives at the next mission through the campaign file is now up to you. Since you can&#039;t use variables directly, you will need to use events that trigger to when a variable equals a certain string.&lt;br /&gt;
&lt;br /&gt;
If an element in the system config file is named &amp;quot;Player&amp;quot;, the script will automatically move it to the contents of &amp;quot;navsys_destination&amp;quot;. This is handy so the player can see where he should be without the FREDder needing to make a thousand almost similar maps.&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=44073</id>
		<title>Script - System Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=44073"/>
		<updated>2014-06-22T16:04:08Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Using In-Game */ Adding some fine notes for using In Game&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The System Viewer is a LUA script that allows a modder to create a map that can be used for reference purposes or for in-game navigational purposes. The configuration files are done in JSON and I would recommend using [http://www.jsoneditoronline.org/ this site] to edit them.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link=&lt;br /&gt;
&lt;br /&gt;
LINK&lt;br /&gt;
&lt;br /&gt;
=Required Files=&lt;br /&gt;
&lt;br /&gt;
All required files are included in the above download, including some sample files for demonstration and to inspire. The following files are the required files needed to make the script work if the modder wishes to remove the other files.&lt;br /&gt;
&lt;br /&gt;
*/config/&lt;br /&gt;
**imonitor.cfg (if imonitor-sct.tbm is to be used)&lt;br /&gt;
*/interface/&lt;br /&gt;
**axui_box1.png&lt;br /&gt;
**axui_cancel.png (+c and h variants)&lt;br /&gt;
**axui_exit.png&lt;br /&gt;
**axui_jumpto.png (+c and h variants)&lt;br /&gt;
**axui_return.png (+c and h variants)&lt;br /&gt;
**cb_sidetab.png (+c and h variants)&lt;br /&gt;
*/scripts/&lt;br /&gt;
**dkjson.lua [[http://dkolf.de/src/dkjson-lua.fsl/home]]&lt;br /&gt;
*/tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**sysviewer-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
&lt;br /&gt;
==Demonstration Files==&lt;br /&gt;
*/interface/&lt;br /&gt;
**nav_asteroids.png&lt;br /&gt;
**nav_node.png&lt;br /&gt;
**nav_node_big.png&lt;br /&gt;
**nav_orion.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_planet_g.png&lt;br /&gt;
**nav_planet_p.png&lt;br /&gt;
**nav_planet_r.png&lt;br /&gt;
**nav_planet_y.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_star_b.png&lt;br /&gt;
**nav_star_r.png&lt;br /&gt;
**nav_star_w.png&lt;br /&gt;
**nav_star_y.png&lt;br /&gt;
**nav_sys_vega.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
The system viewer requires 2 configuration files (3 if an out-of-mission interface is desired). These files must be placed in the /config/ directory.&lt;br /&gt;
&lt;br /&gt;
==Interface Monitor==&lt;br /&gt;
&lt;br /&gt;
imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in [[Script - Interface Monitor]].&lt;br /&gt;
&lt;br /&gt;
==Campaign Configuration File==&lt;br /&gt;
&lt;br /&gt;
Used to decide which system config that gets loaded during a campaign.&lt;br /&gt;
&lt;br /&gt;
==System Configuration File==&lt;br /&gt;
&lt;br /&gt;
Contains all the information to draw systems&lt;br /&gt;
&lt;br /&gt;
=Campaign Configuration File=&lt;br /&gt;
&lt;br /&gt;
A file with the format &amp;lt;pre&amp;gt;sysview_[CAMPAIGN_FILENAME]_config.cfg&amp;lt;/pre&amp;gt; placed in the /config/ folder will be loaded when the System Viewer starts. Eg: sysview_Freespace2_config.cfg. The file is a JSON file with 2 required fields.&lt;br /&gt;
==&amp;quot;File&amp;quot;:==&lt;br /&gt;
This will tell the script which system file to look at and load.&lt;br /&gt;
==&amp;quot;Default&amp;quot;:==&lt;br /&gt;
This will load the specified system that the script will load by default.&lt;br /&gt;
==&amp;quot;[missionfilename].fs2&amp;quot;:==&lt;br /&gt;
This will load the specified system when the mission&#039;s filename matches the one being played (or to be played next if the script was activated in the mainhall screen)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;sm01-01.fs2&amp;quot;: Vega1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=System Configuration File=&lt;br /&gt;
&lt;br /&gt;
This file contains the information the script uses to draw the system.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;[Internal Name]&amp;quot;==&lt;br /&gt;
Object. The name of the object that contains the system configuration is used internally to change to keep track of the different systems in the file&lt;br /&gt;
===&amp;quot;Name&amp;quot;===&lt;br /&gt;
String, the displayed name. Drawn in the upper left corner in large text&lt;br /&gt;
===&amp;quot;Description&amp;quot;===&lt;br /&gt;
String, a subtitle to the name. Drawn below name in slightly smaller text&lt;br /&gt;
===&amp;quot;Background&amp;quot;===&lt;br /&gt;
Filename, the background that will be used in the system viewer screen. The view will be bound to this image (so its a good idea to make this a large image).&lt;br /&gt;
====&amp;quot;Elements&amp;quot;====&lt;br /&gt;
Object, this contains all the visible elements the player can interact with.&lt;br /&gt;
=====&amp;quot;[Internal Name]&amp;quot;=====&lt;br /&gt;
Object, this contains all the information to draw this element. The object&#039;s name will be the internal name for this element. This will be the name that gets written to a SEXP variable, navsys_destination, if the modder is using this as a navigational system. If this element is named &amp;quot;Player&amp;quot; it will be moved to navsys_destination as well.&lt;br /&gt;
=====&amp;quot;Name&amp;quot;=====&lt;br /&gt;
String, the name that will be drawn below the bitmap.&lt;br /&gt;
=====&amp;quot;Visible&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw this element.&lt;br /&gt;
=====&amp;quot;Bitmap&amp;quot;=====&lt;br /&gt;
Filename, should be in a folder with other graphic files (effects or maps etc). This is the bitmap that will be drawn. The script will also attempt to use the filename plus _h and _c for highlighted and clicked graphics.&lt;br /&gt;
=====&amp;quot;LargeBitmap&amp;quot;=====&lt;br /&gt;
Filename, will be drawn in the middle of the screen if this element is clicked.&lt;br /&gt;
=====&amp;quot;ShipClass&amp;quot;=====&lt;br /&gt;
String, if LargeBitmap is absent and ShipClass has a valid ship class, a rotating tech room style model will be rendered when an element is clicked on.&lt;br /&gt;
=====&amp;quot;ModelOrientation&amp;quot;=====&lt;br /&gt;
Array, 3 integers: pitch, bank, heading. If ShipClass was specified, this will be the default orientation in degrees that the model will be rendered as. Default is 17,0,180&lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;RotationSpeed&amp;quot;=====&lt;br /&gt;
Integer, the rotation speed of a model being rendered. No effect on Bitmaps. The Y-Axis is used as the rotation axis. Value is in degrees/second. Default is ~30 degrees/second.&lt;br /&gt;
=====&amp;quot;ShowOrbit&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw the circular orbit for this element. This does not allow hyperbolic or elliptical orbits. Optional.&lt;br /&gt;
=====&amp;quot;Selectable&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click on the object which will bring up detailed information about this object. Optional.&lt;br /&gt;
=====&amp;quot;CanJump&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click a &amp;quot;Jump To&amp;quot; button if this was activated during gameplay. Upon clicking JumpTo, the internal name for the element will be written to the SEXP Variable, navsys_destination, if it exists. It will also close the viewer. Optional.&lt;br /&gt;
=====&amp;quot;ForceJump&amp;quot;=====&lt;br /&gt;
Boolean, if true and the player clicks the &amp;quot;Jump To&amp;quot; button, it will force the player to jump out, ending the mission. Optional.&lt;br /&gt;
=====&amp;quot;Orbits&amp;quot;=====&lt;br /&gt;
String, internal name of another element. This will cause this element to have its orbit centered on the specified parent&#039;s orbit.&lt;br /&gt;
=====&amp;quot;Orbit&amp;quot;=====&lt;br /&gt;
Object. Defining, in polar coordinate terms, where to draw the element. Optional, but leaving this out will cause the element to be drawn in the middle of the screen.&lt;br /&gt;
======&amp;quot;Distance&amp;quot;======&lt;br /&gt;
Integer, the orbital radius in pixels.&lt;br /&gt;
======&amp;quot;Angle&amp;quot;======&lt;br /&gt;
Integer, the orbital angle in degrees. 0 degrees is the direction to the right side of the screen and goes clockwise.&lt;br /&gt;
======&amp;quot;Color&amp;quot;======&lt;br /&gt;
Array, 4 integers: red, green, blue, alpha. Color of the orbit path. Default is 192,192,192,255&lt;br /&gt;
======&amp;quot;Width&amp;quot;======&lt;br /&gt;
Integer, the width of the orbit path. Default is 3.&lt;br /&gt;
=====&amp;quot;Offset&amp;quot;=====&lt;br /&gt;
Object. Fine tuning a bitmap&#039;s placement. Optional.&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, this will move this object to the right by X pixels (negative values will move it to the left). This is in addition to the orbital distance and angle. (You could have two elements sharing the same orbital distance and angle, but have different offsets to place them differently)&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as the X above, just for vertical placement.&lt;br /&gt;
=====&amp;quot;Icon&amp;quot;=====&lt;br /&gt;
Object. Draws a secondary bitmap over the element. Optional.&lt;br /&gt;
======&amp;quot;Bitmap&amp;quot;======&lt;br /&gt;
Filename, graphic file to be drawn&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, x coordinate of where the bitmap will be drawn relative to the top left of the element&#039;s bitmap. Two special values, &amp;quot;-&amp;quot; and &amp;quot;+&amp;quot; can be used instead to automatically move the icon to the left most or right most part of the element&#039;s bitmap.&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as X above, just for vertical placement.&lt;br /&gt;
&lt;br /&gt;
=Using In-Game=&lt;br /&gt;
&lt;br /&gt;
There are a few things the player needs to take care of before they can use this effectively. First, the player should have No Subspace Drive. Check mark it in the ship editor or as a sexp. While in gameplay mode, the System Viewer will not be enabled by default, you can enable the script by using:&lt;br /&gt;
&amp;lt;pre&amp;gt;script-eval&lt;br /&gt;
 &amp;quot;SystemViewer.Allowed = true&amp;quot;&amp;lt;\pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The System Viewer should now be able to be called up by going Alt-J. The script behaves just like it does outside the mission, except now there is a &amp;quot;Jump To&amp;quot; button available if the &amp;quot;CanJump&amp;quot; property was set in the config file.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;Jump To&amp;quot; button is selected, the object name (not the name property!) will be written to a sexp variable, &amp;quot;navsys_destination&amp;quot;. (From the Vegalancer campaign, some examples would be &amp;quot;Norica&amp;quot; or &amp;quot;89thTF&amp;quot;) If the ForceJump property was set, the player will automatically jump out.&lt;br /&gt;
&lt;br /&gt;
Actually ensuring the player arrives at the next mission through the campaign file is now up to you. Since you can&#039;t use variables directly, you will need to use events that trigger to when a variable equals a certain string.&lt;br /&gt;
&lt;br /&gt;
If an element in the system config file is named &amp;quot;Player&amp;quot;, the script will automatically move it to the contents of &amp;quot;navsys_destination&amp;quot;. This is handy so the player can see where he should be without the FREDder needing to make a thousand almost similar maps.&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=44072</id>
		<title>Script - Journal/Fluff Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=44072"/>
		<updated>2014-06-22T15:51:21Z</updated>

		<summary type="html">&lt;p&gt;Axem: Adding command briefing feature&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Journal/Fluff viewer is a LUA Script that allows the viewing of articles that have no plot-related content, but help with world building (aka Fluff). This is similar to the tech room, but this script has a better layout for text heavy entries.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link= &lt;br /&gt;
&lt;br /&gt;
LINK!&lt;br /&gt;
&lt;br /&gt;
=Required Files:=&lt;br /&gt;
*interface/&lt;br /&gt;
**2_Journal&lt;br /&gt;
**axui_close (+ c and h variants)&lt;br /&gt;
**axui_left (+ c and h variants)&lt;br /&gt;
**axui_right (+ c and h variants)&lt;br /&gt;
**axui_zoomin (+ c and h variants)&lt;br /&gt;
**cb_sidetab (+ c and h variants)&lt;br /&gt;
*tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**barracks-lcl.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
**journal-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
 &lt;br /&gt;
==Demonstration Files:==&lt;br /&gt;
*config/&lt;br /&gt;
**journal_diary.cfg&lt;br /&gt;
**journal_FreeSpace2_config.cfg&lt;br /&gt;
**journal_people.cfg&lt;br /&gt;
**journal_photo.cfg&lt;br /&gt;
*fiction/&lt;br /&gt;
**surrender.txt&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
All configuration files must be in /config/ &lt;br /&gt;
&lt;br /&gt;
==Interface Monitor==&lt;br /&gt;
&lt;br /&gt;
imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in [[Script - Interface Monitor]].&lt;br /&gt;
&lt;br /&gt;
==Journal Config File==&lt;br /&gt;
 &lt;br /&gt;
Must be named in the format: journal_YOURCAMPAIGNFILENAME_config.cfg&lt;br /&gt;
&amp;lt;pre&amp;gt;journal_FreeSpace2_config.cfg&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
If no valid config file is available for a campaign, the journal will be empty&lt;br /&gt;
 &lt;br /&gt;
===Index===&lt;br /&gt;
Number, start at 1 and go up, journal supports up to 3&lt;br /&gt;
===Name===&lt;br /&gt;
String, this is what the label by the tab will be&lt;br /&gt;
===Style===&lt;br /&gt;
String, valid options: FullText, ImageText, Thumbnails, descriptions below&lt;br /&gt;
===RevSort===&lt;br /&gt;
This will reverse sort the entries in the file. So files at top of the specified file will be at the bottom and vice-versa. Useful for when you want the new entries to be at the top.&lt;br /&gt;
===File===&lt;br /&gt;
The file name of the content you want to display. Should be a cfg file as well or else FreeSpace won&#039;t see them in a VP file!&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Content Files==&lt;br /&gt;
 &lt;br /&gt;
===FullText Type===&lt;br /&gt;
Good for lots of words. No Images.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Font====&lt;br /&gt;
&#039;&#039;Optional.&#039;&#039; Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified.&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
Your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===ImageText Type===&lt;br /&gt;
Good for showing an image + caption plus more words. Good for pilot profiles.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Font====&lt;br /&gt;
&#039;&#039;Optional.&#039;&#039; Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified.&lt;br /&gt;
====CaptionFont====&lt;br /&gt;
&#039;&#039;Optional.&#039;&#039; Same as font, only for the text under the image&lt;br /&gt;
====Text====&lt;br /&gt;
String, your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, image that will be displayed to the left of the text.&lt;br /&gt;
====FullImage====&lt;br /&gt;
&#039;&#039;Optional.&#039;&#039; Filename, if this is present, a zoom icon will appear on the Image&#039;s top right corner. Clicking it will display this image. Image can be closed by clicking the close button on the top right corner. Optional.&lt;br /&gt;
====Caption====&lt;br /&gt;
String, this is what will be displayed underneath the image&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===Thumbnails===&lt;br /&gt;
Good for a lot of images and little text. When the user clicks a thumbnailed image, the image grabs focus and can only be closed by clicking a close button in the top right corner. Can also navigate through the images with side arrow buttons.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Font====&lt;br /&gt;
&#039;&#039;Optional.&#039;&#039; Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified.&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed under the thumbnailed image&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, the image that will be thumbnailed and displayed when the user clicks the thumbnailed image.&lt;br /&gt;
&lt;br /&gt;
==Generated Files==&lt;br /&gt;
Just for reference, you don&#039;t need to make these.&lt;br /&gt;
 &lt;br /&gt;
===Save File===&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.JOURNALCONFIGINDEX.sav&lt;br /&gt;
&amp;lt;pre&amp;gt;Eg: FreeSpace2_Holley.1.sav&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
(blank)&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this visible?&lt;br /&gt;
====Read====&lt;br /&gt;
Boolean, was this read?&lt;br /&gt;
====Title====&lt;br /&gt;
Title of entry&lt;br /&gt;
&lt;br /&gt;
===Notification File===&lt;br /&gt;
Generated when a new entry is added&lt;br /&gt;
&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.n.sav&lt;br /&gt;
&lt;br /&gt;
=FRED Functions=&lt;br /&gt;
 &lt;br /&gt;
Use with the script-eval sexp&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set visible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsv(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Sets an invisible entry to be visible. Use single quotes! Tab name is the @Name in the config file. Entry title is the @Title in the referred file&lt;br /&gt;
 &lt;br /&gt;
eg: jsv(&#039;Contacts&#039;, &#039;Misuzu Stella&#039;)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set invisible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsi(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Makes a visible entry invisible (effectively hiding it).&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal reset progress==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Journal:ResetProgress()&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Deletes all the sav files, basically reverting everything back to defaults&lt;br /&gt;
&lt;br /&gt;
=Command Briefing Buttons=&lt;br /&gt;
&lt;br /&gt;
If imonitor-sct.tbm is present, a button will appear on the command briefing screen that allows you go to to the journal screen. A &amp;quot;New!&amp;quot; notification is also displayed if a new entry has been added.&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Scripted_Message_Gauge&amp;diff=44071</id>
		<title>Script - Scripted Message Gauge</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Scripted_Message_Gauge&amp;diff=44071"/>
		<updated>2014-06-20T03:53:55Z</updated>

		<summary type="html">&lt;p&gt;Axem: Adding some v1.2 features&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Scripted Message Gauge is a LUA script that enables messages to be displayed in a different fashion. Instead of the default way of a message line appearing right away with a backlog, the message will be drawn one character at a time with a background that enables messages to be seen more easily against a bright background.&lt;br /&gt;
&lt;br /&gt;
The script requires code added in rev 10756 or 3.7.2 RC3 or later.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link=&lt;br /&gt;
&lt;br /&gt;
[http://www.mediafire.com/download/d5nplmsz43d32ip/ScriptedMessagev1.2.rar Download Link]&lt;br /&gt;
&lt;br /&gt;
=Required File=&lt;br /&gt;
&lt;br /&gt;
All required files are included in the above download.&lt;br /&gt;
&lt;br /&gt;
*/config/&lt;br /&gt;
**axmessage.cfg&lt;br /&gt;
*/interface/&lt;br /&gt;
**messagebox.png&lt;br /&gt;
*/scripts/&lt;br /&gt;
**dkjson.lua [[http://dkolf.de/src/dkjson-lua.fsl/home]]&lt;br /&gt;
*/tables/&lt;br /&gt;
**axmsg-mod.tbm&lt;br /&gt;
**axmsg-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
axmessage.cfg is a JSON configuration file&lt;br /&gt;
&lt;br /&gt;
==Default==&lt;br /&gt;
===TitleFont===&lt;br /&gt;
Integer or String, Font index or name used for the displayed sender&#039;s name. Default is 3.&lt;br /&gt;
&lt;br /&gt;
===TextFont===&lt;br /&gt;
Integer or String, Font index or name used for the displayed message text. Default is 1.&lt;br /&gt;
&lt;br /&gt;
===Image===&lt;br /&gt;
Filename, Image to use as the background for the message text. Default is messagebox.&lt;br /&gt;
&lt;br /&gt;
===Speed===&lt;br /&gt;
Integer, The time it will take 1 character to draw in seconds. Default is 0.03.&lt;br /&gt;
&lt;br /&gt;
===Length===&lt;br /&gt;
Integer, The script uses length to guess how long a message should be displayed for. Normal behavior will have a message be displayed for (Length * Number of characters in message) seconds. Default is 0.07.&lt;br /&gt;
&lt;br /&gt;
===AfterVoice===&lt;br /&gt;
Integer, If a non-generic voice file is used in a message, this is the amount of extra time the message will be visible for after the voice file is over. Default is 1.5.&lt;br /&gt;
&lt;br /&gt;
===TitleColor===&lt;br /&gt;
RGBA, If monochrome is false, this is the RGBA color the sender&#039;s name will be.&lt;br /&gt;
&lt;br /&gt;
===TextColor===&lt;br /&gt;
RGBA, If monochrome is false, this is the RGBA color the message text will be.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Position==&lt;br /&gt;
===Origin===&lt;br /&gt;
Integer, integer, Percent based positioning similar to how the new hud positioning works.&lt;br /&gt;
===Offset===&lt;br /&gt;
Integer, integer, The offset in pixels from the origin, similar to how the new hud positioning works.&lt;br /&gt;
===HeadAni===&lt;br /&gt;
Integer, integer, The offset in pixels for the talking head message gauges. This does not work (yet).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Backlog==&lt;br /&gt;
===Enabled===&lt;br /&gt;
Boolean, activates the backlog feature. Previously received messages will have a similar behavior to the old message gauge.&lt;br /&gt;
===Origin===&lt;br /&gt;
Integer, integer, Percent based positioning similar to how the new hud positioning works.&lt;br /&gt;
===Offset===&lt;br /&gt;
Integer, integer, The offset in pixels from the origin, similar to how the new hud positioning works.&lt;br /&gt;
===Height===&lt;br /&gt;
Integer, How height of the area that the backlog will be confined to. The message backlog will start at the bottom and gradually work its way up.&lt;br /&gt;
&lt;br /&gt;
==Offsets==&lt;br /&gt;
===Sender===&lt;br /&gt;
X,Y offset where the Sender text will be drawn from the position&lt;br /&gt;
===Text===&lt;br /&gt;
X,Y offset where the message text will be drawn from the position&lt;br /&gt;
&lt;br /&gt;
==Monochrome==&lt;br /&gt;
Boolean, turns monochrome on or off. See behavior for a detailed explanation&lt;br /&gt;
&lt;br /&gt;
==GenericFiles==&lt;br /&gt;
Array, filenames, A list of files (minus the file extensions) that will cause the script to use generic guessing for the message length and not the actual voice file length. These are the message beeps and alarms when there&#039;s no voice acting.&lt;br /&gt;
&lt;br /&gt;
==MinVertRes==&lt;br /&gt;
Integer, optional, the vertical resolution must be at least this for the script to activate.&lt;br /&gt;
&lt;br /&gt;
=Behavior=&lt;br /&gt;
==Message Length==&lt;br /&gt;
There are a few ways the script calculates how long a message should be visible. If there is no voice file or the voice file is in the generic list, the message will be displayed for (Length * Number of Characters in Message). If a modifier makes the message longer, the length will be extended as well (but it will not be shortened).&lt;br /&gt;
&lt;br /&gt;
If there is a VoiceFile attached to the message, the message will be displayed for (VoiceFile Length + AfterVoice).&lt;br /&gt;
&lt;br /&gt;
==Changing the Text Draw Speed in FRED==&lt;br /&gt;
By putting !s and .s at the beginning of messages names in FRED, the text draw speed will be modified.&lt;br /&gt;
&lt;br /&gt;
*!!! = Draws instantly&lt;br /&gt;
*!! = Draws 66% faster&lt;br /&gt;
*! = Draws 33% faster&lt;br /&gt;
*. = Draws 33% slower&lt;br /&gt;
*.. = Draws 66% slower&lt;br /&gt;
*... = Draws 100% slower&lt;br /&gt;
&lt;br /&gt;
The characters must be at the start of the message. So &amp;lt;pre&amp;gt;!!!Holley says sup&amp;lt;/pre&amp;gt; would work. &amp;lt;pre&amp;gt;Holley says sup!!!&amp;lt;/pre&amp;gt; would not.&lt;br /&gt;
&lt;br /&gt;
==Monochrome Mode==&lt;br /&gt;
&lt;br /&gt;
If monochrome mode is false, the image is drawn as-is in full color without any game added-transparency. TitleColor and TextColor will be used to color the sender name and text.&lt;br /&gt;
&lt;br /&gt;
If monochrome mode is true:&lt;br /&gt;
*The image will be colored the same color as the talking head hud gauge. An additional dark gray copy of the image is drawn underneath to minimize washout.&lt;br /&gt;
*The text will be colored the same as the default message lines hud gauge. The alpha is increased to max for maximum readability.&lt;br /&gt;
*If the talking head hud gauge and message lines hud gauge are the same color (eg you selected Amber/Green/Blue in the HUD config) the text will be brightened so its slightly easier to read.&lt;br /&gt;
&lt;br /&gt;
=Limitations=&lt;br /&gt;
&lt;br /&gt;
The gauge does not brighten or dim with the Increase HUD Contrast command (L key).&lt;br /&gt;
&lt;br /&gt;
The text doesn&#039;t scale like the rest of the retail hud. So using &amp;lt;pre&amp;gt;$Scale Gauges: No&amp;lt;/pre&amp;gt; in a hud gauges table will do nothing. This may change in the future.&lt;br /&gt;
&lt;br /&gt;
=Using In-Game=&lt;br /&gt;
&lt;br /&gt;
The script needs no special activation. When the script initializes in a mission, it turns off the retail message lines gauge.&lt;br /&gt;
&lt;br /&gt;
In order for the scripted messages gauge to be visible during in-game cutscenes where the disable-hud-except-messages is used, you need to use the included -mod.tbm file. It puts the control of HUD visibility on manual FREDder control, so the HUD may be visible during cutscenes where a camera sexp is used without any disable-hud sexps. Just add disable-hud or disable-hud-except-messages.&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Scripted_Message_Gauge&amp;diff=44061</id>
		<title>Script - Scripted Message Gauge</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Scripted_Message_Gauge&amp;diff=44061"/>
		<updated>2014-06-12T01:02:56Z</updated>

		<summary type="html">&lt;p&gt;Axem: Scripted Message Gauge!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Scripted Message Gauge is a LUA script that enables messages to be displayed in a different fashion. Instead of the default way of a message line appearing right away with a backlog, the message will be drawn one character at a time with a background that enables messages to be seen more easily against a bright background.&lt;br /&gt;
&lt;br /&gt;
The script requires code added in rev 10756 or 3.7.2 RC3 or later.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link=&lt;br /&gt;
&lt;br /&gt;
[http://www.mediafire.com/download/r5rh922h92fwscd/ScriptedMessageV1.rar Download Link]&lt;br /&gt;
&lt;br /&gt;
=Required File=&lt;br /&gt;
&lt;br /&gt;
All required files are included in the above download.&lt;br /&gt;
&lt;br /&gt;
*/config/&lt;br /&gt;
**axmessage.cfg&lt;br /&gt;
*/interface/&lt;br /&gt;
**messagebox.png&lt;br /&gt;
*/scripts/&lt;br /&gt;
**dkjson.lua [[http://dkolf.de/src/dkjson-lua.fsl/home]]&lt;br /&gt;
*/tables/&lt;br /&gt;
**axmsg-mod.tbm&lt;br /&gt;
**axmsg-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
axmessage.cfg is a JSON configuration file&lt;br /&gt;
&lt;br /&gt;
==Default==&lt;br /&gt;
===TitleFont===&lt;br /&gt;
Integer or String, Font index or name used for the displayed sender&#039;s name. Default is 3.&lt;br /&gt;
&lt;br /&gt;
===TextFont===&lt;br /&gt;
Integer or String, Font index or name used for the displayed message text. Default is 1.&lt;br /&gt;
&lt;br /&gt;
===Image===&lt;br /&gt;
Filename, Image to use as the background for the message text. Default is messagebox.&lt;br /&gt;
&lt;br /&gt;
===Speed===&lt;br /&gt;
Integer, The time it will take 1 character to draw in seconds. Default is 0.03.&lt;br /&gt;
&lt;br /&gt;
===Length===&lt;br /&gt;
Integer, The script uses length to guess how long a message should be displayed for. Normal behavior will have a message be displayed for (Length * Number of characters in message) seconds. Default is 0.07.&lt;br /&gt;
&lt;br /&gt;
===AfterVoice===&lt;br /&gt;
Integer, If a non-generic voice file is used in a message, this is the amount of extra time the message will be visible for after the voice file is over. Default is 1.5.&lt;br /&gt;
&lt;br /&gt;
===TitleColor===&lt;br /&gt;
RGBA, If monochrome is false, this is the RGBA color the sender&#039;s name will be.&lt;br /&gt;
&lt;br /&gt;
===TextColor===&lt;br /&gt;
RGBA, If monochrome is false, this is the RGBA color the message text will be.&lt;br /&gt;
&lt;br /&gt;
==Position==&lt;br /&gt;
===Origin===&lt;br /&gt;
Percent based positioning similar to how the new hud positioning works.&lt;br /&gt;
===Offset===&lt;br /&gt;
The offset in pixels from the origin, similar to how the new hud positioning works.&lt;br /&gt;
&lt;br /&gt;
==Offsets==&lt;br /&gt;
===Sender===&lt;br /&gt;
X,Y offset where the Sender text will be drawn from the position&lt;br /&gt;
===Text===&lt;br /&gt;
X,Y offset where the message text will be drawn from the position&lt;br /&gt;
&lt;br /&gt;
==Monochrome==&lt;br /&gt;
Boolean, turns monochrome on or off. See behavior for a detailed explanation&lt;br /&gt;
&lt;br /&gt;
==GenericFiles==&lt;br /&gt;
Array, filenames, A list of files (minus the file extensions) that will cause the script to use generic guessing for the message length and not the actual voice file length. These are the message beeps and alarms when there&#039;s no voice acting.&lt;br /&gt;
&lt;br /&gt;
==MinVertRes==&lt;br /&gt;
Integer, optional, the vertical resolution must be at least this for the script to activate.&lt;br /&gt;
&lt;br /&gt;
=Behavior=&lt;br /&gt;
==Message Length==&lt;br /&gt;
There are a few ways the script calculates how long a message should be visible. If there is no voice file or the voice file is in the generic list, the message will be displayed for (Length * Number of Characters in Message). If a modifier makes the message longer, the length will be extended as well (but it will not be shortened).&lt;br /&gt;
&lt;br /&gt;
If there is a VoiceFile attached to the message, the message will be displayed for (VoiceFile Length + AfterVoice).&lt;br /&gt;
&lt;br /&gt;
==Changing the Text Draw Speed in FRED==&lt;br /&gt;
By putting !s and .s at the beginning of messages names in FRED, the text draw speed will be modified.&lt;br /&gt;
&lt;br /&gt;
*!!! = Draws instantly&lt;br /&gt;
*!! = Draws 66% faster&lt;br /&gt;
*! = Draws 33% faster&lt;br /&gt;
*. = Draws 33% slower&lt;br /&gt;
*.. = Draws 66% slower&lt;br /&gt;
*... = Draws 100% slower&lt;br /&gt;
&lt;br /&gt;
The characters must be at the start of the message. So &amp;lt;pre&amp;gt;!!!Holley says sup&amp;lt;/pre&amp;gt; would work. &amp;lt;pre&amp;gt;Holley says sup!!!&amp;lt;/pre&amp;gt; would not.&lt;br /&gt;
&lt;br /&gt;
==Monochrome Mode==&lt;br /&gt;
&lt;br /&gt;
If monochrome mode is false, the image is drawn as-is in full color without any game added-transparency. TitleColor and TextColor will be used to color the sender name and text.&lt;br /&gt;
&lt;br /&gt;
If monochrome mode is true:&lt;br /&gt;
*The image will be colored the same color as the talking head hud gauge. An additional dark gray copy of the image is drawn underneath to minimize washout.&lt;br /&gt;
*The text will be colored the same as the default message lines hud gauge. The alpha is increased to max for maximum readability.&lt;br /&gt;
*If the talking head hud gauge and message lines hud gauge are the same color (eg you selected Amber/Green/Blue in the HUD config) the text will be brightened so its slightly easier to read.&lt;br /&gt;
&lt;br /&gt;
=Limitations=&lt;br /&gt;
&lt;br /&gt;
The gauge does not brighten or dim with the Increase HUD Contrast command (L key).&lt;br /&gt;
&lt;br /&gt;
=Using In-Game=&lt;br /&gt;
&lt;br /&gt;
The script needs no special activation. When the script initializes in a mission, it turns off the retail message lines gauge.&lt;br /&gt;
&lt;br /&gt;
In order for the scripted messages gauge to be visible during in-game cutscenes where the disable-hud-except-messages is used, you need to use the included -mod.tbm file. It puts the control of HUD visibility on manual FREDder control, so the HUD may be visible during cutscenes where a camera sexp is used without any disable-hud sexps. Just add disable-hud or disable-hud-except-messages.&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44060</id>
		<title>User:Axem</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=44060"/>
		<updated>2014-06-12T00:18:59Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Script Reference */ Added scripted message gauge&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About Axem!==&lt;br /&gt;
Hello! I am Axem, friendly administrator on the HLP forums. I can FRED (make missions), model, UVMap, texture, script and make rough effects. Just don&#039;t ask me to do any of it for you, I&#039;ve got enough to do! But I can help guide you to the right path. Below you&#039;ll find some of the stuff I&#039;ve done here over the years.&lt;br /&gt;
&lt;br /&gt;
==My Campaigns==&lt;br /&gt;
*[[Shadows of Kraken]]&lt;br /&gt;
*[[Just Another Day]]&lt;br /&gt;
*[[Just Another Day 2: Electric Boogaloo]]&lt;br /&gt;
*[[Just Another Day 3: Shivans on a Plane]]&lt;br /&gt;
*[[Vassago&#039;s Dirge]]&lt;br /&gt;
*[[Just Another Day 2.21: You Are (Not) Alpha 1]]&lt;br /&gt;
&lt;br /&gt;
==Projects I Help With==&lt;br /&gt;
*[[Diaspora]]&lt;br /&gt;
*[[Blue Planet]]&lt;br /&gt;
*[[Wings of Dawn]]&lt;br /&gt;
&lt;br /&gt;
==My Ships==&lt;br /&gt;
&lt;br /&gt;
*[[GTC Cretheus]]&lt;br /&gt;
*[[SC Lamia]]&lt;br /&gt;
*[[SGs Asura]] (textured by Nighteyes)&lt;br /&gt;
*[[UES Aranyaka]]&lt;br /&gt;
&lt;br /&gt;
Other WIPS can be seen on my [http://p3d.in/u/Axem p3d page]&lt;br /&gt;
&lt;br /&gt;
==Helpful Pages I&#039;ve Done==&lt;br /&gt;
===Tutorials===&lt;br /&gt;
*[[Tutorial - Conditional Arguments]]&lt;br /&gt;
*[[Tutorial - Directive-is-variable SEXP]]&lt;br /&gt;
*[[Tutorial - Mission Infrastructure]]&lt;br /&gt;
*[[Tutorial - PCS2 Kitbashing]]&lt;br /&gt;
*[[Tutorial - Custom HUD Gauges]]&lt;br /&gt;
===SEXP Reference===&lt;br /&gt;
*[[Advanced Cutscene SEXP Reference]]&lt;br /&gt;
===Script Reference===&lt;br /&gt;
*[[Script - Journal/Fluff Viewer]]&lt;br /&gt;
*[[Script - System Viewer]]&lt;br /&gt;
*[[Script - Interface Monitor]]&lt;br /&gt;
*[[Script - Scripted Message Gauge]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=44030</id>
		<title>Script - Journal/Fluff Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=44030"/>
		<updated>2014-05-24T19:21:55Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Content Files */ Adding font fields&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Journal/Fluff viewer is a LUA Script that allows the viewing of articles that have no plot-related content, but help with world building (aka Fluff). This is similar to the tech room, but this script has a better layout for text heavy entries.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link= &lt;br /&gt;
&lt;br /&gt;
LINK!&lt;br /&gt;
&lt;br /&gt;
=Required Files:=&lt;br /&gt;
*interface/&lt;br /&gt;
**2_Journal&lt;br /&gt;
**axui_close (+ c and h variants)&lt;br /&gt;
**axui_left (+ c and h variants)&lt;br /&gt;
**axui_right (+ c and h variants)&lt;br /&gt;
**axui_zoomin (+ c and h variants)&lt;br /&gt;
**cb_sidetab (+ c and h variants)&lt;br /&gt;
*tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**barracks-lcl.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
**journal-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
 &lt;br /&gt;
==Demonstration Files:==&lt;br /&gt;
*config/&lt;br /&gt;
**journal_diary.cfg&lt;br /&gt;
**journal_FreeSpace2_config.cfg&lt;br /&gt;
**journal_people.cfg&lt;br /&gt;
**journal_photo.cfg&lt;br /&gt;
*fiction/&lt;br /&gt;
**surrender.txt&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
All configuration files must be in /config/ &lt;br /&gt;
&lt;br /&gt;
==Interface Monitor==&lt;br /&gt;
&lt;br /&gt;
imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in [[Script - Interface Monitor]].&lt;br /&gt;
&lt;br /&gt;
==Journal Config File==&lt;br /&gt;
 &lt;br /&gt;
Must be named in the format: journal_YOURCAMPAIGNFILENAME_config.cfg&lt;br /&gt;
&amp;lt;pre&amp;gt;journal_FreeSpace2_config.cfg&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
If no valid config file is available for a campaign, the journal will be empty&lt;br /&gt;
 &lt;br /&gt;
===Index===&lt;br /&gt;
Number, start at 1 and go up, journal supports up to 3&lt;br /&gt;
===Name===&lt;br /&gt;
String, this is what the label by the tab will be&lt;br /&gt;
===Style===&lt;br /&gt;
String, valid options: FullText, ImageText, Thumbnails, descriptions below&lt;br /&gt;
===RevSort===&lt;br /&gt;
This will reverse sort the entries in the file. So files at top of the specified file will be at the bottom and vice-versa. Useful for when you want the new entries to be at the top.&lt;br /&gt;
===File===&lt;br /&gt;
The file name of the content you want to display. Should be a cfg file as well or else FreeSpace won&#039;t see them in a VP file!&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Content Files==&lt;br /&gt;
 &lt;br /&gt;
===FullText Type===&lt;br /&gt;
Good for lots of words. No Images.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Font====&lt;br /&gt;
&#039;&#039;Optional.&#039;&#039; Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified.&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
Your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===ImageText Type===&lt;br /&gt;
Good for showing an image + caption plus more words. Good for pilot profiles.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Font====&lt;br /&gt;
&#039;&#039;Optional.&#039;&#039; Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified.&lt;br /&gt;
====CaptionFont====&lt;br /&gt;
&#039;&#039;Optional.&#039;&#039; Same as font, only for the text under the image&lt;br /&gt;
====Text====&lt;br /&gt;
String, your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, image that will be displayed to the left of the text.&lt;br /&gt;
====FullImage====&lt;br /&gt;
&#039;&#039;Optional.&#039;&#039; Filename, if this is present, a zoom icon will appear on the Image&#039;s top right corner. Clicking it will display this image. Image can be closed by clicking the close button on the top right corner. Optional.&lt;br /&gt;
====Caption====&lt;br /&gt;
String, this is what will be displayed underneath the image&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===Thumbnails===&lt;br /&gt;
Good for a lot of images and little text. When the user clicks a thumbnailed image, the image grabs focus and can only be closed by clicking a close button in the top right corner. Can also navigate through the images with side arrow buttons.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Font====&lt;br /&gt;
&#039;&#039;Optional.&#039;&#039; Reference to a font in the font.tbl or -fnt.tbm file. If this is absent, the game will use a smaller font (font01.vf) on lower res screens, and a slightly larger one (font03.vf) for higher res screens. No scaling will be done if a font is specified.&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed under the thumbnailed image&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, the image that will be thumbnailed and displayed when the user clicks the thumbnailed image.&lt;br /&gt;
&lt;br /&gt;
==Generated Files==&lt;br /&gt;
Just for reference, you don&#039;t need to make these.&lt;br /&gt;
 &lt;br /&gt;
===Save File===&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.JOURNALCONFIGINDEX.sav&lt;br /&gt;
&amp;lt;pre&amp;gt;Eg: FreeSpace2_Holley.1.sav&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
(blank)&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this visible?&lt;br /&gt;
====Read====&lt;br /&gt;
Boolean, was this read?&lt;br /&gt;
====Title====&lt;br /&gt;
Title of entry&lt;br /&gt;
&lt;br /&gt;
===Notification File===&lt;br /&gt;
Generated when a new entry is added&lt;br /&gt;
&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.n.sav&lt;br /&gt;
&lt;br /&gt;
=FRED Functions=&lt;br /&gt;
 &lt;br /&gt;
Use with the script-eval sexp&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set visible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsv(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Sets an invisible entry to be visible. Use single quotes! Tab name is the @Name in the config file. Entry title is the @Title in the referred file&lt;br /&gt;
 &lt;br /&gt;
eg: jsv(&#039;Contacts&#039;, &#039;Misuzu Stella&#039;)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set invisible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsi(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Makes a visible entry invisible (effectively hiding it).&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal reset progress==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Journal:ResetProgress()&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Deletes all the sav files, basically reverting everything back to defaults&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=43882</id>
		<title>Script - System Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=43882"/>
		<updated>2014-05-09T02:52:24Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* &amp;quot;ModelOrientation&amp;quot; */ Being consistent&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The System Viewer is a LUA script that allows a modder to create a map that can be used for reference purposes or for in-game navigational purposes. The configuration files are done in JSON and I would recommend using [http://www.jsoneditoronline.org/ this site] to edit them.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link=&lt;br /&gt;
&lt;br /&gt;
LINK&lt;br /&gt;
&lt;br /&gt;
=Required Files=&lt;br /&gt;
&lt;br /&gt;
All required files are included in the above download, including some sample files for demonstration and to inspire. The following files are the required files needed to make the script work if the modder wishes to remove the other files.&lt;br /&gt;
&lt;br /&gt;
*/config/&lt;br /&gt;
**imonitor.cfg (if imonitor-sct.tbm is to be used)&lt;br /&gt;
*/interface/&lt;br /&gt;
**axui_box1.png&lt;br /&gt;
**axui_cancel.png (+c and h variants)&lt;br /&gt;
**axui_exit.png&lt;br /&gt;
**axui_jumpto.png (+c and h variants)&lt;br /&gt;
**axui_return.png (+c and h variants)&lt;br /&gt;
**cb_sidetab.png (+c and h variants)&lt;br /&gt;
*/scripts/&lt;br /&gt;
**dkjson.lua [[http://dkolf.de/src/dkjson-lua.fsl/home]]&lt;br /&gt;
*/tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**sysviewer-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
&lt;br /&gt;
==Demonstration Files==&lt;br /&gt;
*/interface/&lt;br /&gt;
**nav_asteroids.png&lt;br /&gt;
**nav_node.png&lt;br /&gt;
**nav_node_big.png&lt;br /&gt;
**nav_orion.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_planet_g.png&lt;br /&gt;
**nav_planet_p.png&lt;br /&gt;
**nav_planet_r.png&lt;br /&gt;
**nav_planet_y.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_star_b.png&lt;br /&gt;
**nav_star_r.png&lt;br /&gt;
**nav_star_w.png&lt;br /&gt;
**nav_star_y.png&lt;br /&gt;
**nav_sys_vega.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
The system viewer requires 2 configuration files (3 if an out-of-mission interface is desired). These files must be placed in the /config/ directory.&lt;br /&gt;
&lt;br /&gt;
==Interface Monitor==&lt;br /&gt;
&lt;br /&gt;
imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in [[Script - Interface Monitor]].&lt;br /&gt;
&lt;br /&gt;
==Campaign Configuration File==&lt;br /&gt;
&lt;br /&gt;
Used to decide which system config that gets loaded during a campaign.&lt;br /&gt;
&lt;br /&gt;
==System Configuration File==&lt;br /&gt;
&lt;br /&gt;
Contains all the information to draw systems&lt;br /&gt;
&lt;br /&gt;
=Campaign Configuration File=&lt;br /&gt;
&lt;br /&gt;
A file with the format &amp;lt;pre&amp;gt;sysview_[CAMPAIGN_FILENAME]_config.cfg&amp;lt;/pre&amp;gt; placed in the /config/ folder will be loaded when the System Viewer starts. Eg: sysview_Freespace2_config.cfg. The file is a JSON file with 2 required fields.&lt;br /&gt;
==&amp;quot;File&amp;quot;:==&lt;br /&gt;
This will tell the script which system file to look at and load.&lt;br /&gt;
==&amp;quot;Default&amp;quot;:==&lt;br /&gt;
This will load the specified system that the script will load by default.&lt;br /&gt;
==&amp;quot;[missionfilename].fs2&amp;quot;:==&lt;br /&gt;
This will load the specified system when the mission&#039;s filename matches the one being played (or to be played next if the script was activated in the mainhall screen)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;sm01-01.fs2&amp;quot;: Vega1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=System Configuration File=&lt;br /&gt;
&lt;br /&gt;
This file contains the information the script uses to draw the system.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;[Internal Name]&amp;quot;==&lt;br /&gt;
Object. The name of the object that contains the system configuration is used internally to change to keep track of the different systems in the file&lt;br /&gt;
===&amp;quot;Name&amp;quot;===&lt;br /&gt;
String, the displayed name. Drawn in the upper left corner in large text&lt;br /&gt;
===&amp;quot;Description&amp;quot;===&lt;br /&gt;
String, a subtitle to the name. Drawn below name in slightly smaller text&lt;br /&gt;
===&amp;quot;Background&amp;quot;===&lt;br /&gt;
Filename, the background that will be used in the system viewer screen. The view will be bound to this image (so its a good idea to make this a large image).&lt;br /&gt;
====&amp;quot;Elements&amp;quot;====&lt;br /&gt;
Object, this contains all the visible elements the player can interact with.&lt;br /&gt;
=====&amp;quot;[Internal Name]&amp;quot;=====&lt;br /&gt;
Object, this contains all the information to draw this element. The object&#039;s name will be the internal name for this element. This will be the name that gets written to a SEXP variable, navsys_destination, if the modder is using this as a navigational system. If this element is named &amp;quot;Player&amp;quot; it will be moved to navsys_destination as well.&lt;br /&gt;
=====&amp;quot;Name&amp;quot;=====&lt;br /&gt;
String, the name that will be drawn below the bitmap.&lt;br /&gt;
=====&amp;quot;Visible&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw this element.&lt;br /&gt;
=====&amp;quot;Bitmap&amp;quot;=====&lt;br /&gt;
Filename, should be in a folder with other graphic files (effects or maps etc). This is the bitmap that will be drawn. The script will also attempt to use the filename plus _h and _c for highlighted and clicked graphics.&lt;br /&gt;
=====&amp;quot;LargeBitmap&amp;quot;=====&lt;br /&gt;
Filename, will be drawn in the middle of the screen if this element is clicked.&lt;br /&gt;
=====&amp;quot;ShipClass&amp;quot;=====&lt;br /&gt;
String, if LargeBitmap is absent and ShipClass has a valid ship class, a rotating tech room style model will be rendered when an element is clicked on.&lt;br /&gt;
=====&amp;quot;ModelOrientation&amp;quot;=====&lt;br /&gt;
Array, 3 integers: pitch, bank, heading. If ShipClass was specified, this will be the default orientation in degrees that the model will be rendered as. Default is 17,0,180&lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;RotationSpeed&amp;quot;=====&lt;br /&gt;
Integer, the rotation speed of a model being rendered. No effect on Bitmaps. The Y-Axis is used as the rotation axis. Value is in degrees/second. Default is ~30 degrees/second.&lt;br /&gt;
=====&amp;quot;ShowOrbit&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw the circular orbit for this element. This does not allow hyperbolic or elliptical orbits. Optional.&lt;br /&gt;
=====&amp;quot;Selectable&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click on the object which will bring up detailed information about this object. Optional.&lt;br /&gt;
=====&amp;quot;CanJump&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click a &amp;quot;Jump To&amp;quot; button if this was activated during gameplay. Upon clicking JumpTo, the internal name for the element will be written to the SEXP Variable, navsys_destination, if it exists. It will also close the viewer. Optional.&lt;br /&gt;
=====&amp;quot;ForceJump&amp;quot;=====&lt;br /&gt;
Boolean, if true and the player clicks the &amp;quot;Jump To&amp;quot; button, it will force the player to jump out, ending the mission. Optional.&lt;br /&gt;
=====&amp;quot;Orbits&amp;quot;=====&lt;br /&gt;
String, internal name of another element. This will cause this element to have its orbit centered on the specified parent&#039;s orbit.&lt;br /&gt;
=====&amp;quot;Orbit&amp;quot;=====&lt;br /&gt;
Object. Defining, in polar coordinate terms, where to draw the element. Optional, but leaving this out will cause the element to be drawn in the middle of the screen.&lt;br /&gt;
======&amp;quot;Distance&amp;quot;======&lt;br /&gt;
Integer, the orbital radius in pixels.&lt;br /&gt;
======&amp;quot;Angle&amp;quot;======&lt;br /&gt;
Integer, the orbital angle in degrees. 0 degrees is the direction to the right side of the screen and goes clockwise.&lt;br /&gt;
======&amp;quot;Color&amp;quot;======&lt;br /&gt;
Array, 4 integers: red, green, blue, alpha. Color of the orbit path. Default is 192,192,192,255&lt;br /&gt;
======&amp;quot;Width&amp;quot;======&lt;br /&gt;
Integer, the width of the orbit path. Default is 3.&lt;br /&gt;
=====&amp;quot;Offset&amp;quot;=====&lt;br /&gt;
Object. Fine tuning a bitmap&#039;s placement. Optional.&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, this will move this object to the right by X pixels (negative values will move it to the left). This is in addition to the orbital distance and angle. (You could have two elements sharing the same orbital distance and angle, but have different offsets to place them differently)&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as the X above, just for vertical placement.&lt;br /&gt;
=====&amp;quot;Icon&amp;quot;=====&lt;br /&gt;
Object. Draws a secondary bitmap over the element. Optional.&lt;br /&gt;
======&amp;quot;Bitmap&amp;quot;======&lt;br /&gt;
Filename, graphic file to be drawn&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, x coordinate of where the bitmap will be drawn relative to the top left of the element&#039;s bitmap. Two special values, &amp;quot;-&amp;quot; and &amp;quot;+&amp;quot; can be used instead to automatically move the icon to the left most or right most part of the element&#039;s bitmap.&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as X above, just for vertical placement.&lt;br /&gt;
&lt;br /&gt;
=Using In-Game=&lt;br /&gt;
&lt;br /&gt;
TO-DO...&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=43881</id>
		<title>Script - System Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=43881"/>
		<updated>2014-05-09T02:50:51Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* System Configuration File */ Updating some new fields&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The System Viewer is a LUA script that allows a modder to create a map that can be used for reference purposes or for in-game navigational purposes. The configuration files are done in JSON and I would recommend using [http://www.jsoneditoronline.org/ this site] to edit them.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link=&lt;br /&gt;
&lt;br /&gt;
LINK&lt;br /&gt;
&lt;br /&gt;
=Required Files=&lt;br /&gt;
&lt;br /&gt;
All required files are included in the above download, including some sample files for demonstration and to inspire. The following files are the required files needed to make the script work if the modder wishes to remove the other files.&lt;br /&gt;
&lt;br /&gt;
*/config/&lt;br /&gt;
**imonitor.cfg (if imonitor-sct.tbm is to be used)&lt;br /&gt;
*/interface/&lt;br /&gt;
**axui_box1.png&lt;br /&gt;
**axui_cancel.png (+c and h variants)&lt;br /&gt;
**axui_exit.png&lt;br /&gt;
**axui_jumpto.png (+c and h variants)&lt;br /&gt;
**axui_return.png (+c and h variants)&lt;br /&gt;
**cb_sidetab.png (+c and h variants)&lt;br /&gt;
*/scripts/&lt;br /&gt;
**dkjson.lua [[http://dkolf.de/src/dkjson-lua.fsl/home]]&lt;br /&gt;
*/tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**sysviewer-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
&lt;br /&gt;
==Demonstration Files==&lt;br /&gt;
*/interface/&lt;br /&gt;
**nav_asteroids.png&lt;br /&gt;
**nav_node.png&lt;br /&gt;
**nav_node_big.png&lt;br /&gt;
**nav_orion.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_planet_g.png&lt;br /&gt;
**nav_planet_p.png&lt;br /&gt;
**nav_planet_r.png&lt;br /&gt;
**nav_planet_y.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_star_b.png&lt;br /&gt;
**nav_star_r.png&lt;br /&gt;
**nav_star_w.png&lt;br /&gt;
**nav_star_y.png&lt;br /&gt;
**nav_sys_vega.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
The system viewer requires 2 configuration files (3 if an out-of-mission interface is desired). These files must be placed in the /config/ directory.&lt;br /&gt;
&lt;br /&gt;
==Interface Monitor==&lt;br /&gt;
&lt;br /&gt;
imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in [[Script - Interface Monitor]].&lt;br /&gt;
&lt;br /&gt;
==Campaign Configuration File==&lt;br /&gt;
&lt;br /&gt;
Used to decide which system config that gets loaded during a campaign.&lt;br /&gt;
&lt;br /&gt;
==System Configuration File==&lt;br /&gt;
&lt;br /&gt;
Contains all the information to draw systems&lt;br /&gt;
&lt;br /&gt;
=Campaign Configuration File=&lt;br /&gt;
&lt;br /&gt;
A file with the format &amp;lt;pre&amp;gt;sysview_[CAMPAIGN_FILENAME]_config.cfg&amp;lt;/pre&amp;gt; placed in the /config/ folder will be loaded when the System Viewer starts. Eg: sysview_Freespace2_config.cfg. The file is a JSON file with 2 required fields.&lt;br /&gt;
==&amp;quot;File&amp;quot;:==&lt;br /&gt;
This will tell the script which system file to look at and load.&lt;br /&gt;
==&amp;quot;Default&amp;quot;:==&lt;br /&gt;
This will load the specified system that the script will load by default.&lt;br /&gt;
==&amp;quot;[missionfilename].fs2&amp;quot;:==&lt;br /&gt;
This will load the specified system when the mission&#039;s filename matches the one being played (or to be played next if the script was activated in the mainhall screen)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;sm01-01.fs2&amp;quot;: Vega1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=System Configuration File=&lt;br /&gt;
&lt;br /&gt;
This file contains the information the script uses to draw the system.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;[Internal Name]&amp;quot;==&lt;br /&gt;
Object. The name of the object that contains the system configuration is used internally to change to keep track of the different systems in the file&lt;br /&gt;
===&amp;quot;Name&amp;quot;===&lt;br /&gt;
String, the displayed name. Drawn in the upper left corner in large text&lt;br /&gt;
===&amp;quot;Description&amp;quot;===&lt;br /&gt;
String, a subtitle to the name. Drawn below name in slightly smaller text&lt;br /&gt;
===&amp;quot;Background&amp;quot;===&lt;br /&gt;
Filename, the background that will be used in the system viewer screen. The view will be bound to this image (so its a good idea to make this a large image).&lt;br /&gt;
====&amp;quot;Elements&amp;quot;====&lt;br /&gt;
Object, this contains all the visible elements the player can interact with.&lt;br /&gt;
=====&amp;quot;[Internal Name]&amp;quot;=====&lt;br /&gt;
Object, this contains all the information to draw this element. The object&#039;s name will be the internal name for this element. This will be the name that gets written to a SEXP variable, navsys_destination, if the modder is using this as a navigational system. If this element is named &amp;quot;Player&amp;quot; it will be moved to navsys_destination as well.&lt;br /&gt;
=====&amp;quot;Name&amp;quot;=====&lt;br /&gt;
String, the name that will be drawn below the bitmap.&lt;br /&gt;
=====&amp;quot;Visible&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw this element.&lt;br /&gt;
=====&amp;quot;Bitmap&amp;quot;=====&lt;br /&gt;
Filename, should be in a folder with other graphic files (effects or maps etc). This is the bitmap that will be drawn. The script will also attempt to use the filename plus _h and _c for highlighted and clicked graphics.&lt;br /&gt;
=====&amp;quot;LargeBitmap&amp;quot;=====&lt;br /&gt;
Filename, will be drawn in the middle of the screen if this element is clicked.&lt;br /&gt;
=====&amp;quot;ShipClass&amp;quot;=====&lt;br /&gt;
String, if LargeBitmap is absent and ShipClass has a valid ship class, a rotating tech room style model will be rendered when an element is clicked on.&lt;br /&gt;
=====&amp;quot;ModelOrientation&amp;quot;=====&lt;br /&gt;
Array, 3 integers, pitch, bank, heading. If ShipClass was specified, this will be the default orientation in degrees that the model will be rendered as. Default is 17,0,180&lt;br /&gt;
=====&amp;quot;RotationSpeed&amp;quot;=====&lt;br /&gt;
Integer, the rotation speed of a model being rendered. No effect on Bitmaps. The Y-Axis is used as the rotation axis. Value is in degrees/second. Default is ~30 degrees/second.&lt;br /&gt;
=====&amp;quot;ShowOrbit&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw the circular orbit for this element. This does not allow hyperbolic or elliptical orbits. Optional.&lt;br /&gt;
=====&amp;quot;Selectable&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click on the object which will bring up detailed information about this object. Optional.&lt;br /&gt;
=====&amp;quot;CanJump&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click a &amp;quot;Jump To&amp;quot; button if this was activated during gameplay. Upon clicking JumpTo, the internal name for the element will be written to the SEXP Variable, navsys_destination, if it exists. It will also close the viewer. Optional.&lt;br /&gt;
=====&amp;quot;ForceJump&amp;quot;=====&lt;br /&gt;
Boolean, if true and the player clicks the &amp;quot;Jump To&amp;quot; button, it will force the player to jump out, ending the mission. Optional.&lt;br /&gt;
=====&amp;quot;Orbits&amp;quot;=====&lt;br /&gt;
String, internal name of another element. This will cause this element to have its orbit centered on the specified parent&#039;s orbit.&lt;br /&gt;
=====&amp;quot;Orbit&amp;quot;=====&lt;br /&gt;
Object. Defining, in polar coordinate terms, where to draw the element. Optional, but leaving this out will cause the element to be drawn in the middle of the screen.&lt;br /&gt;
======&amp;quot;Distance&amp;quot;======&lt;br /&gt;
Integer, the orbital radius in pixels.&lt;br /&gt;
======&amp;quot;Angle&amp;quot;======&lt;br /&gt;
Integer, the orbital angle in degrees. 0 degrees is the direction to the right side of the screen and goes clockwise.&lt;br /&gt;
======&amp;quot;Color&amp;quot;======&lt;br /&gt;
Array, 4 integers: red, green, blue, alpha. Color of the orbit path. Default is 192,192,192,255&lt;br /&gt;
======&amp;quot;Width&amp;quot;======&lt;br /&gt;
Integer, the width of the orbit path. Default is 3.&lt;br /&gt;
=====&amp;quot;Offset&amp;quot;=====&lt;br /&gt;
Object. Fine tuning a bitmap&#039;s placement. Optional.&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, this will move this object to the right by X pixels (negative values will move it to the left). This is in addition to the orbital distance and angle. (You could have two elements sharing the same orbital distance and angle, but have different offsets to place them differently)&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as the X above, just for vertical placement.&lt;br /&gt;
=====&amp;quot;Icon&amp;quot;=====&lt;br /&gt;
Object. Draws a secondary bitmap over the element. Optional.&lt;br /&gt;
======&amp;quot;Bitmap&amp;quot;======&lt;br /&gt;
Filename, graphic file to be drawn&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, x coordinate of where the bitmap will be drawn relative to the top left of the element&#039;s bitmap. Two special values, &amp;quot;-&amp;quot; and &amp;quot;+&amp;quot; can be used instead to automatically move the icon to the left most or right most part of the element&#039;s bitmap.&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as X above, just for vertical placement.&lt;br /&gt;
&lt;br /&gt;
=Using In-Game=&lt;br /&gt;
&lt;br /&gt;
TO-DO...&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=43879</id>
		<title>Script - System Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=43879"/>
		<updated>2014-05-08T02:08:04Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* &amp;quot;Show Orbit&amp;quot; */ No space here&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The System Viewer is a LUA script that allows a modder to create a map that can be used for reference purposes or for in-game navigational purposes. The configuration files are done in JSON and I would recommend using [http://www.jsoneditoronline.org/ this site] to edit them.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link=&lt;br /&gt;
&lt;br /&gt;
LINK&lt;br /&gt;
&lt;br /&gt;
=Required Files=&lt;br /&gt;
&lt;br /&gt;
All required files are included in the above download, including some sample files for demonstration and to inspire. The following files are the required files needed to make the script work if the modder wishes to remove the other files.&lt;br /&gt;
&lt;br /&gt;
*/config/&lt;br /&gt;
**imonitor.cfg (if imonitor-sct.tbm is to be used)&lt;br /&gt;
*/interface/&lt;br /&gt;
**axui_box1.png&lt;br /&gt;
**axui_cancel.png (+c and h variants)&lt;br /&gt;
**axui_exit.png&lt;br /&gt;
**axui_jumpto.png (+c and h variants)&lt;br /&gt;
**axui_return.png (+c and h variants)&lt;br /&gt;
**cb_sidetab.png (+c and h variants)&lt;br /&gt;
*/scripts/&lt;br /&gt;
**dkjson.lua [[http://dkolf.de/src/dkjson-lua.fsl/home]]&lt;br /&gt;
*/tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**sysviewer-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
&lt;br /&gt;
==Demonstration Files==&lt;br /&gt;
*/interface/&lt;br /&gt;
**nav_asteroids.png&lt;br /&gt;
**nav_node.png&lt;br /&gt;
**nav_node_big.png&lt;br /&gt;
**nav_orion.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_planet_g.png&lt;br /&gt;
**nav_planet_p.png&lt;br /&gt;
**nav_planet_r.png&lt;br /&gt;
**nav_planet_y.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_star_b.png&lt;br /&gt;
**nav_star_r.png&lt;br /&gt;
**nav_star_w.png&lt;br /&gt;
**nav_star_y.png&lt;br /&gt;
**nav_sys_vega.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
The system viewer requires 2 configuration files (3 if an out-of-mission interface is desired). These files must be placed in the /config/ directory.&lt;br /&gt;
&lt;br /&gt;
==Interface Monitor==&lt;br /&gt;
&lt;br /&gt;
imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in [[Script - Interface Monitor]].&lt;br /&gt;
&lt;br /&gt;
==Campaign Configuration File==&lt;br /&gt;
&lt;br /&gt;
Used to decide which system config that gets loaded during a campaign.&lt;br /&gt;
&lt;br /&gt;
==System Configuration File==&lt;br /&gt;
&lt;br /&gt;
Contains all the information to draw systems&lt;br /&gt;
&lt;br /&gt;
=Campaign Configuration File=&lt;br /&gt;
&lt;br /&gt;
A file with the format &amp;lt;pre&amp;gt;sysview_[CAMPAIGN_FILENAME]_config.cfg&amp;lt;/pre&amp;gt; placed in the /config/ folder will be loaded when the System Viewer starts. Eg: sysview_Freespace2_config.cfg. The file is a JSON file with 2 required fields.&lt;br /&gt;
==&amp;quot;File&amp;quot;:==&lt;br /&gt;
This will tell the script which system file to look at and load.&lt;br /&gt;
==&amp;quot;Default&amp;quot;:==&lt;br /&gt;
This will load the specified system that the script will load by default.&lt;br /&gt;
==&amp;quot;[missionfilename].fs2&amp;quot;:==&lt;br /&gt;
This will load the specified system when the mission&#039;s filename matches the one being played (or to be played next if the script was activated in the mainhall screen)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;sm01-01.fs2&amp;quot;: Vega1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=System Configuration File=&lt;br /&gt;
&lt;br /&gt;
This file contains the information the script uses to draw the system.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;[Internal Name]&amp;quot;==&lt;br /&gt;
Object. The name of the object that contains the system configuration is used internally to change to keep track of the different systems in the file&lt;br /&gt;
===&amp;quot;Name&amp;quot;===&lt;br /&gt;
String, the displayed name. Drawn in the upper left corner in large text&lt;br /&gt;
===&amp;quot;Description&amp;quot;===&lt;br /&gt;
String, a subtitle to the name. Drawn below name in slightly smaller text&lt;br /&gt;
===&amp;quot;Background&amp;quot;===&lt;br /&gt;
Filename, the background that will be used in the system viewer screen. The view will be bound to this image (so its a good idea to make this a large image).&lt;br /&gt;
====&amp;quot;Elements&amp;quot;====&lt;br /&gt;
Object, this contains all the visible elements the player can interact with.&lt;br /&gt;
=====&amp;quot;[Internal Name]&amp;quot;=====&lt;br /&gt;
Object, this contains all the information to draw this element. The object&#039;s name will be the internal name for this element. This will be the name that gets written to a SEXP variable, navsys_destination, if the modder is using this as a navigational system. If this element is named &amp;quot;Player&amp;quot; it will be moved to navsys_destination as well.&lt;br /&gt;
=====&amp;quot;Name&amp;quot;=====&lt;br /&gt;
String, the name that will be drawn below the bitmap.&lt;br /&gt;
=====&amp;quot;Visible&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw this element.&lt;br /&gt;
=====&amp;quot;Bitmap&amp;quot;=====&lt;br /&gt;
Filename, should be in a folder with other graphic files (effects or maps etc). This is the bitmap that will be drawn. The script will also attempt to use the filename plus _h and _c for highlighted and clicked graphics.&lt;br /&gt;
=====&amp;quot;LargeBitmap&amp;quot;=====&lt;br /&gt;
Filename, will be drawn in the middle of the screen if this element is clicked.&lt;br /&gt;
=====&amp;quot;ShipClass&amp;quot;=====&lt;br /&gt;
String, if LargeBitmap is absent and ShipClass has a valid ship class, a rotating tech room style model will be rendered when an element is clicked on.&lt;br /&gt;
=====&amp;quot;ShowOrbit&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw the circular orbit for this element. (Sorry, no elliptical or hyperbolic orbits!) Optional.&lt;br /&gt;
&lt;br /&gt;
=====&amp;quot;Selectable&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click on the object which will bring up detailed information about this object. Optional.&lt;br /&gt;
=====&amp;quot;CanJump&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click a &amp;quot;Jump To&amp;quot; button if this was activated during gameplay. Upon clicking JumpTo, the internal name for the element will be written to the SEXP Variable, navsys_destination, if it exists. It will also close the viewer. Optional.&lt;br /&gt;
=====&amp;quot;ForceJump&amp;quot;=====&lt;br /&gt;
Boolean, if true and the player clicks the &amp;quot;Jump To&amp;quot; button, it will force the player to jump out, ending the mission. Optional.&lt;br /&gt;
=====&amp;quot;Orbits&amp;quot;=====&lt;br /&gt;
String, internal name of another element. This will cause this element to have its orbit centered on the specified parent&#039;s orbit.&lt;br /&gt;
=====&amp;quot;Orbit&amp;quot;=====&lt;br /&gt;
Object. Defining, in polar coordinate terms, where to draw the element. Optional, but leaving this out will cause the element to be drawn in the middle of the screen.&lt;br /&gt;
======&amp;quot;Distance&amp;quot;======&lt;br /&gt;
Integer, the orbital radius in pixels.&lt;br /&gt;
======&amp;quot;Angle&amp;quot;======&lt;br /&gt;
Integer, the orbital angle in degrees. 0 degrees is the direction to the right side of the screen and goes clockwise.&lt;br /&gt;
=====&amp;quot;Offset&amp;quot;=====&lt;br /&gt;
Object. Fine tuning a bitmap&#039;s placement. Optional.&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, this will move this object to the right by X pixels (negative values will move it to the left). This is in addition to the orbital distance and angle. (You could have two elements sharing the same orbital distance and angle, but have different offsets to place them differently)&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as the X above, just for vertical placement.&lt;br /&gt;
=====&amp;quot;Icon&amp;quot;=====&lt;br /&gt;
Object. Draws a secondary bitmap over the element. Optional.&lt;br /&gt;
======&amp;quot;Bitmap&amp;quot;======&lt;br /&gt;
Filename, graphic file to be drawn&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, x coordinate of where the bitmap will be drawn relative to the top left of the element&#039;s bitmap. Two special values, &amp;quot;-&amp;quot; and &amp;quot;+&amp;quot; can be used instead to automatically move the icon to the left most or right most part of the element&#039;s bitmap.&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as X above, just for vertical placement.&lt;br /&gt;
&lt;br /&gt;
=Using In-Game=&lt;br /&gt;
&lt;br /&gt;
TO-DO...&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=43878</id>
		<title>Script - System Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=43878"/>
		<updated>2014-05-08T02:07:42Z</updated>

		<summary type="html">&lt;p&gt;Axem: Added Orbits field and some additional demonstration files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The System Viewer is a LUA script that allows a modder to create a map that can be used for reference purposes or for in-game navigational purposes. The configuration files are done in JSON and I would recommend using [http://www.jsoneditoronline.org/ this site] to edit them.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link=&lt;br /&gt;
&lt;br /&gt;
LINK&lt;br /&gt;
&lt;br /&gt;
=Required Files=&lt;br /&gt;
&lt;br /&gt;
All required files are included in the above download, including some sample files for demonstration and to inspire. The following files are the required files needed to make the script work if the modder wishes to remove the other files.&lt;br /&gt;
&lt;br /&gt;
*/config/&lt;br /&gt;
**imonitor.cfg (if imonitor-sct.tbm is to be used)&lt;br /&gt;
*/interface/&lt;br /&gt;
**axui_box1.png&lt;br /&gt;
**axui_cancel.png (+c and h variants)&lt;br /&gt;
**axui_exit.png&lt;br /&gt;
**axui_jumpto.png (+c and h variants)&lt;br /&gt;
**axui_return.png (+c and h variants)&lt;br /&gt;
**cb_sidetab.png (+c and h variants)&lt;br /&gt;
*/scripts/&lt;br /&gt;
**dkjson.lua [[http://dkolf.de/src/dkjson-lua.fsl/home]]&lt;br /&gt;
*/tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**sysviewer-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
&lt;br /&gt;
==Demonstration Files==&lt;br /&gt;
*/interface/&lt;br /&gt;
**nav_asteroids.png&lt;br /&gt;
**nav_node.png&lt;br /&gt;
**nav_node_big.png&lt;br /&gt;
**nav_orion.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_planet_g.png&lt;br /&gt;
**nav_planet_p.png&lt;br /&gt;
**nav_planet_r.png&lt;br /&gt;
**nav_planet_y.png&lt;br /&gt;
**nav_planet_b.png&lt;br /&gt;
**nav_star_b.png&lt;br /&gt;
**nav_star_r.png&lt;br /&gt;
**nav_star_w.png&lt;br /&gt;
**nav_star_y.png&lt;br /&gt;
**nav_sys_vega.png&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
The system viewer requires 2 configuration files (3 if an out-of-mission interface is desired). These files must be placed in the /config/ directory.&lt;br /&gt;
&lt;br /&gt;
==Interface Monitor==&lt;br /&gt;
&lt;br /&gt;
imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in [[Script - Interface Monitor]].&lt;br /&gt;
&lt;br /&gt;
==Campaign Configuration File==&lt;br /&gt;
&lt;br /&gt;
Used to decide which system config that gets loaded during a campaign.&lt;br /&gt;
&lt;br /&gt;
==System Configuration File==&lt;br /&gt;
&lt;br /&gt;
Contains all the information to draw systems&lt;br /&gt;
&lt;br /&gt;
=Campaign Configuration File=&lt;br /&gt;
&lt;br /&gt;
A file with the format &amp;lt;pre&amp;gt;sysview_[CAMPAIGN_FILENAME]_config.cfg&amp;lt;/pre&amp;gt; placed in the /config/ folder will be loaded when the System Viewer starts. Eg: sysview_Freespace2_config.cfg. The file is a JSON file with 2 required fields.&lt;br /&gt;
==&amp;quot;File&amp;quot;:==&lt;br /&gt;
This will tell the script which system file to look at and load.&lt;br /&gt;
==&amp;quot;Default&amp;quot;:==&lt;br /&gt;
This will load the specified system that the script will load by default.&lt;br /&gt;
==&amp;quot;[missionfilename].fs2&amp;quot;:==&lt;br /&gt;
This will load the specified system when the mission&#039;s filename matches the one being played (or to be played next if the script was activated in the mainhall screen)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;sm01-01.fs2&amp;quot;: Vega1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=System Configuration File=&lt;br /&gt;
&lt;br /&gt;
This file contains the information the script uses to draw the system.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;[Internal Name]&amp;quot;==&lt;br /&gt;
Object. The name of the object that contains the system configuration is used internally to change to keep track of the different systems in the file&lt;br /&gt;
===&amp;quot;Name&amp;quot;===&lt;br /&gt;
String, the displayed name. Drawn in the upper left corner in large text&lt;br /&gt;
===&amp;quot;Description&amp;quot;===&lt;br /&gt;
String, a subtitle to the name. Drawn below name in slightly smaller text&lt;br /&gt;
===&amp;quot;Background&amp;quot;===&lt;br /&gt;
Filename, the background that will be used in the system viewer screen. The view will be bound to this image (so its a good idea to make this a large image).&lt;br /&gt;
====&amp;quot;Elements&amp;quot;====&lt;br /&gt;
Object, this contains all the visible elements the player can interact with.&lt;br /&gt;
=====&amp;quot;[Internal Name]&amp;quot;=====&lt;br /&gt;
Object, this contains all the information to draw this element. The object&#039;s name will be the internal name for this element. This will be the name that gets written to a SEXP variable, navsys_destination, if the modder is using this as a navigational system. If this element is named &amp;quot;Player&amp;quot; it will be moved to navsys_destination as well.&lt;br /&gt;
=====&amp;quot;Name&amp;quot;=====&lt;br /&gt;
String, the name that will be drawn below the bitmap.&lt;br /&gt;
=====&amp;quot;Visible&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw this element.&lt;br /&gt;
=====&amp;quot;Bitmap&amp;quot;=====&lt;br /&gt;
Filename, should be in a folder with other graphic files (effects or maps etc). This is the bitmap that will be drawn. The script will also attempt to use the filename plus _h and _c for highlighted and clicked graphics.&lt;br /&gt;
=====&amp;quot;LargeBitmap&amp;quot;=====&lt;br /&gt;
Filename, will be drawn in the middle of the screen if this element is clicked.&lt;br /&gt;
=====&amp;quot;ShipClass&amp;quot;=====&lt;br /&gt;
String, if LargeBitmap is absent and ShipClass has a valid ship class, a rotating tech room style model will be rendered when an element is clicked on.&lt;br /&gt;
=====&amp;quot;Show Orbit&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw the circular orbit for this element. (Sorry, no elliptical or hyperbolic orbits!) Optional.&lt;br /&gt;
=====&amp;quot;Selectable&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click on the object which will bring up detailed information about this object. Optional.&lt;br /&gt;
=====&amp;quot;CanJump&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click a &amp;quot;Jump To&amp;quot; button if this was activated during gameplay. Upon clicking JumpTo, the internal name for the element will be written to the SEXP Variable, navsys_destination, if it exists. It will also close the viewer. Optional.&lt;br /&gt;
=====&amp;quot;ForceJump&amp;quot;=====&lt;br /&gt;
Boolean, if true and the player clicks the &amp;quot;Jump To&amp;quot; button, it will force the player to jump out, ending the mission. Optional.&lt;br /&gt;
=====&amp;quot;Orbits&amp;quot;=====&lt;br /&gt;
String, internal name of another element. This will cause this element to have its orbit centered on the specified parent&#039;s orbit.&lt;br /&gt;
=====&amp;quot;Orbit&amp;quot;=====&lt;br /&gt;
Object. Defining, in polar coordinate terms, where to draw the element. Optional, but leaving this out will cause the element to be drawn in the middle of the screen.&lt;br /&gt;
======&amp;quot;Distance&amp;quot;======&lt;br /&gt;
Integer, the orbital radius in pixels.&lt;br /&gt;
======&amp;quot;Angle&amp;quot;======&lt;br /&gt;
Integer, the orbital angle in degrees. 0 degrees is the direction to the right side of the screen and goes clockwise.&lt;br /&gt;
=====&amp;quot;Offset&amp;quot;=====&lt;br /&gt;
Object. Fine tuning a bitmap&#039;s placement. Optional.&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, this will move this object to the right by X pixels (negative values will move it to the left). This is in addition to the orbital distance and angle. (You could have two elements sharing the same orbital distance and angle, but have different offsets to place them differently)&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as the X above, just for vertical placement.&lt;br /&gt;
=====&amp;quot;Icon&amp;quot;=====&lt;br /&gt;
Object. Draws a secondary bitmap over the element. Optional.&lt;br /&gt;
======&amp;quot;Bitmap&amp;quot;======&lt;br /&gt;
Filename, graphic file to be drawn&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, x coordinate of where the bitmap will be drawn relative to the top left of the element&#039;s bitmap. Two special values, &amp;quot;-&amp;quot; and &amp;quot;+&amp;quot; can be used instead to automatically move the icon to the left most or right most part of the element&#039;s bitmap.&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as X above, just for vertical placement.&lt;br /&gt;
&lt;br /&gt;
=Using In-Game=&lt;br /&gt;
&lt;br /&gt;
TO-DO...&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=43877</id>
		<title>Script - Journal/Fluff Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=43877"/>
		<updated>2014-05-08T02:02:02Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Configuration Files */ Adding imonitor-cfg.tbm&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Journal/Fluff viewer is a LUA Script that allows the viewing of articles that have no plot-related content, but help with world building (aka Fluff). This is similar to the tech room, but this script has a better layout for text heavy entries.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link= &lt;br /&gt;
&lt;br /&gt;
LINK!&lt;br /&gt;
&lt;br /&gt;
=Required Files:=&lt;br /&gt;
*interface/&lt;br /&gt;
**2_Journal&lt;br /&gt;
**axui_close (+ c and h variants)&lt;br /&gt;
**axui_left (+ c and h variants)&lt;br /&gt;
**axui_right (+ c and h variants)&lt;br /&gt;
**axui_zoomin (+ c and h variants)&lt;br /&gt;
**cb_sidetab (+ c and h variants)&lt;br /&gt;
*tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**barracks-lcl.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
**journal-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
 &lt;br /&gt;
==Demonstration Files:==&lt;br /&gt;
*config/&lt;br /&gt;
**journal_diary.cfg&lt;br /&gt;
**journal_FreeSpace2_config.cfg&lt;br /&gt;
**journal_people.cfg&lt;br /&gt;
**journal_photo.cfg&lt;br /&gt;
*fiction/&lt;br /&gt;
**surrender.txt&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
All configuration files must be in /config/ &lt;br /&gt;
&lt;br /&gt;
==Interface Monitor==&lt;br /&gt;
&lt;br /&gt;
imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in [[Script - Interface Monitor]].&lt;br /&gt;
&lt;br /&gt;
==Journal Config File==&lt;br /&gt;
 &lt;br /&gt;
Must be named in the format: journal_YOURCAMPAIGNFILENAME_config.cfg&lt;br /&gt;
&amp;lt;pre&amp;gt;journal_FreeSpace2_config.cfg&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
If no valid config file is available for a campaign, the journal will be empty&lt;br /&gt;
 &lt;br /&gt;
===Index===&lt;br /&gt;
Number, start at 1 and go up, journal supports up to 3&lt;br /&gt;
===Name===&lt;br /&gt;
String, this is what the label by the tab will be&lt;br /&gt;
===Style===&lt;br /&gt;
String, valid options: FullText, ImageText, Thumbnails, descriptions below&lt;br /&gt;
===RevSort===&lt;br /&gt;
This will reverse sort the entries in the file. So files at top of the specified file will be at the bottom and vice-versa. Useful for when you want the new entries to be at the top.&lt;br /&gt;
===File===&lt;br /&gt;
The file name of the content you want to display. Should be a cfg file as well or else FreeSpace won&#039;t see them in a VP file!&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Content Files==&lt;br /&gt;
 &lt;br /&gt;
===FullText Type===&lt;br /&gt;
Good for lots of words. No Images.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
Your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===ImageText Type===&lt;br /&gt;
Good for showing an image + caption plus more words. Good for pilot profiles.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
String, your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, image that will be displayed to the left of the text.&lt;br /&gt;
====FullImage====&lt;br /&gt;
Filename, if this is present, a zoom icon will appear on the Image&#039;s top right corner. Clicking it will display this image. Image can be closed by clicking the close button on the top right corner. Optional.&lt;br /&gt;
====Caption====&lt;br /&gt;
String, this is what will be displayed underneath the image&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===Thumbnails===&lt;br /&gt;
Good for a lot of images and little text. When the user clicks a thumbnailed image, the image grabs focus and can only be closed by clicking a close button in the top right corner. Can also navigate through the images with side arrow buttons.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed under the thumbnailed image&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, the image that will be thumbnailed and displayed when the user clicks the thumbnailed image.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Generated Files==&lt;br /&gt;
Just for reference, you don&#039;t need to make these.&lt;br /&gt;
 &lt;br /&gt;
===Save File===&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.JOURNALCONFIGINDEX.sav&lt;br /&gt;
&amp;lt;pre&amp;gt;Eg: FreeSpace2_Holley.1.sav&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
(blank)&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this visible?&lt;br /&gt;
====Read====&lt;br /&gt;
Boolean, was this read?&lt;br /&gt;
====Title====&lt;br /&gt;
Title of entry&lt;br /&gt;
&lt;br /&gt;
===Notification File===&lt;br /&gt;
Generated when a new entry is added&lt;br /&gt;
&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.n.sav&lt;br /&gt;
&lt;br /&gt;
=FRED Functions=&lt;br /&gt;
 &lt;br /&gt;
Use with the script-eval sexp&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set visible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsv(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Sets an invisible entry to be visible. Use single quotes! Tab name is the @Name in the config file. Entry title is the @Title in the referred file&lt;br /&gt;
 &lt;br /&gt;
eg: jsv(&#039;Contacts&#039;, &#039;Misuzu Stella&#039;)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set invisible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsi(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Makes a visible entry invisible (effectively hiding it).&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal reset progress==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Journal:ResetProgress()&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Deletes all the sav files, basically reverting everything back to defaults&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=43876</id>
		<title>Script - Journal/Fluff Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=43876"/>
		<updated>2014-05-08T02:00:50Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Required Files: */  Added a misc script to required&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Journal/Fluff viewer is a LUA Script that allows the viewing of articles that have no plot-related content, but help with world building (aka Fluff). This is similar to the tech room, but this script has a better layout for text heavy entries.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link= &lt;br /&gt;
&lt;br /&gt;
LINK!&lt;br /&gt;
&lt;br /&gt;
=Required Files:=&lt;br /&gt;
*interface/&lt;br /&gt;
**2_Journal&lt;br /&gt;
**axui_close (+ c and h variants)&lt;br /&gt;
**axui_left (+ c and h variants)&lt;br /&gt;
**axui_right (+ c and h variants)&lt;br /&gt;
**axui_zoomin (+ c and h variants)&lt;br /&gt;
**cb_sidetab (+ c and h variants)&lt;br /&gt;
*tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**barracks-lcl.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
**journal-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
 &lt;br /&gt;
==Demonstration Files:==&lt;br /&gt;
*config/&lt;br /&gt;
**journal_diary.cfg&lt;br /&gt;
**journal_FreeSpace2_config.cfg&lt;br /&gt;
**journal_people.cfg&lt;br /&gt;
**journal_photo.cfg&lt;br /&gt;
*fiction/&lt;br /&gt;
**surrender.txt&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
All configuration files must be in /config/ &lt;br /&gt;
&lt;br /&gt;
==Journal Config File==&lt;br /&gt;
 &lt;br /&gt;
Must be named in the format: journal_YOURCAMPAIGNFILENAME_config.cfg&lt;br /&gt;
&amp;lt;pre&amp;gt;journal_FreeSpace2_config.cfg&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
If no valid config file is available for a campaign, the journal will be empty&lt;br /&gt;
 &lt;br /&gt;
===Index===&lt;br /&gt;
Number, start at 1 and go up, journal supports up to 3&lt;br /&gt;
===Name===&lt;br /&gt;
String, this is what the label by the tab will be&lt;br /&gt;
===Style===&lt;br /&gt;
String, valid options: FullText, ImageText, Thumbnails, descriptions below&lt;br /&gt;
===RevSort===&lt;br /&gt;
This will reverse sort the entries in the file. So files at top of the specified file will be at the bottom and vice-versa. Useful for when you want the new entries to be at the top.&lt;br /&gt;
===File===&lt;br /&gt;
The file name of the content you want to display. Should be a cfg file as well or else FreeSpace won&#039;t see them in a VP file!&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Content Files==&lt;br /&gt;
 &lt;br /&gt;
===FullText Type===&lt;br /&gt;
Good for lots of words. No Images.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
Your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===ImageText Type===&lt;br /&gt;
Good for showing an image + caption plus more words. Good for pilot profiles.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
String, your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, image that will be displayed to the left of the text.&lt;br /&gt;
====FullImage====&lt;br /&gt;
Filename, if this is present, a zoom icon will appear on the Image&#039;s top right corner. Clicking it will display this image. Image can be closed by clicking the close button on the top right corner. Optional.&lt;br /&gt;
====Caption====&lt;br /&gt;
String, this is what will be displayed underneath the image&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===Thumbnails===&lt;br /&gt;
Good for a lot of images and little text. When the user clicks a thumbnailed image, the image grabs focus and can only be closed by clicking a close button in the top right corner. Can also navigate through the images with side arrow buttons.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed under the thumbnailed image&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, the image that will be thumbnailed and displayed when the user clicks the thumbnailed image.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Generated Files==&lt;br /&gt;
Just for reference, you don&#039;t need to make these.&lt;br /&gt;
 &lt;br /&gt;
===Save File===&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.JOURNALCONFIGINDEX.sav&lt;br /&gt;
&amp;lt;pre&amp;gt;Eg: FreeSpace2_Holley.1.sav&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
(blank)&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this visible?&lt;br /&gt;
====Read====&lt;br /&gt;
Boolean, was this read?&lt;br /&gt;
====Title====&lt;br /&gt;
Title of entry&lt;br /&gt;
&lt;br /&gt;
===Notification File===&lt;br /&gt;
Generated when a new entry is added&lt;br /&gt;
&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.n.sav&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=FRED Functions=&lt;br /&gt;
 &lt;br /&gt;
Use with the script-eval sexp&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set visible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsv(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Sets an invisible entry to be visible. Use single quotes! Tab name is the @Name in the config file. Entry title is the @Title in the referred file&lt;br /&gt;
 &lt;br /&gt;
eg: jsv(&#039;Contacts&#039;, &#039;Misuzu Stella&#039;)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set invisible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsi(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Makes a visible entry invisible (effectively hiding it).&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal reset progress==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Journal:ResetProgress()&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Deletes all the sav files, basically reverting everything back to defaults&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=43875</id>
		<title>Script - Journal/Fluff Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=43875"/>
		<updated>2014-05-08T01:59:25Z</updated>

		<summary type="html">&lt;p&gt;Axem: Removed some demonstration files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Journal/Fluff viewer is a LUA Script that allows the viewing of articles that have no plot-related content, but help with world building (aka Fluff). This is similar to the tech room, but this script has a better layout for text heavy entries.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link= &lt;br /&gt;
&lt;br /&gt;
LINK!&lt;br /&gt;
&lt;br /&gt;
=Required Files:=&lt;br /&gt;
*interface/&lt;br /&gt;
**2_Journal&lt;br /&gt;
**axui_close (+ c and h variants)&lt;br /&gt;
**axui_left (+ c and h variants)&lt;br /&gt;
**axui_right (+ c and h variants)&lt;br /&gt;
**axui_zoomin (+ c and h variants)&lt;br /&gt;
**cb_sidetab (+ c and h variants)&lt;br /&gt;
*tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**barracks-lcl.tbm&lt;br /&gt;
**journal-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
 &lt;br /&gt;
==Demonstration Files:==&lt;br /&gt;
*config/&lt;br /&gt;
**journal_diary.cfg&lt;br /&gt;
**journal_FreeSpace2_config.cfg&lt;br /&gt;
**journal_people.cfg&lt;br /&gt;
**journal_photo.cfg&lt;br /&gt;
*fiction/&lt;br /&gt;
**surrender.txt&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
All configuration files must be in /config/ &lt;br /&gt;
&lt;br /&gt;
==Journal Config File==&lt;br /&gt;
 &lt;br /&gt;
Must be named in the format: journal_YOURCAMPAIGNFILENAME_config.cfg&lt;br /&gt;
&amp;lt;pre&amp;gt;journal_FreeSpace2_config.cfg&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
If no valid config file is available for a campaign, the journal will be empty&lt;br /&gt;
 &lt;br /&gt;
===Index===&lt;br /&gt;
Number, start at 1 and go up, journal supports up to 3&lt;br /&gt;
===Name===&lt;br /&gt;
String, this is what the label by the tab will be&lt;br /&gt;
===Style===&lt;br /&gt;
String, valid options: FullText, ImageText, Thumbnails, descriptions below&lt;br /&gt;
===RevSort===&lt;br /&gt;
This will reverse sort the entries in the file. So files at top of the specified file will be at the bottom and vice-versa. Useful for when you want the new entries to be at the top.&lt;br /&gt;
===File===&lt;br /&gt;
The file name of the content you want to display. Should be a cfg file as well or else FreeSpace won&#039;t see them in a VP file!&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Content Files==&lt;br /&gt;
 &lt;br /&gt;
===FullText Type===&lt;br /&gt;
Good for lots of words. No Images.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
Your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===ImageText Type===&lt;br /&gt;
Good for showing an image + caption plus more words. Good for pilot profiles.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
String, your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, image that will be displayed to the left of the text.&lt;br /&gt;
====FullImage====&lt;br /&gt;
Filename, if this is present, a zoom icon will appear on the Image&#039;s top right corner. Clicking it will display this image. Image can be closed by clicking the close button on the top right corner. Optional.&lt;br /&gt;
====Caption====&lt;br /&gt;
String, this is what will be displayed underneath the image&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===Thumbnails===&lt;br /&gt;
Good for a lot of images and little text. When the user clicks a thumbnailed image, the image grabs focus and can only be closed by clicking a close button in the top right corner. Can also navigate through the images with side arrow buttons.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed under the thumbnailed image&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, the image that will be thumbnailed and displayed when the user clicks the thumbnailed image.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Generated Files==&lt;br /&gt;
Just for reference, you don&#039;t need to make these.&lt;br /&gt;
 &lt;br /&gt;
===Save File===&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.JOURNALCONFIGINDEX.sav&lt;br /&gt;
&amp;lt;pre&amp;gt;Eg: FreeSpace2_Holley.1.sav&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
(blank)&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this visible?&lt;br /&gt;
====Read====&lt;br /&gt;
Boolean, was this read?&lt;br /&gt;
====Title====&lt;br /&gt;
Title of entry&lt;br /&gt;
&lt;br /&gt;
===Notification File===&lt;br /&gt;
Generated when a new entry is added&lt;br /&gt;
&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.n.sav&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=FRED Functions=&lt;br /&gt;
 &lt;br /&gt;
Use with the script-eval sexp&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set visible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsv(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Sets an invisible entry to be visible. Use single quotes! Tab name is the @Name in the config file. Entry title is the @Title in the referred file&lt;br /&gt;
 &lt;br /&gt;
eg: jsv(&#039;Contacts&#039;, &#039;Misuzu Stella&#039;)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set invisible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsi(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Makes a visible entry invisible (effectively hiding it).&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal reset progress==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Journal:ResetProgress()&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Deletes all the sav files, basically reverting everything back to defaults&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=43868</id>
		<title>Script - Journal/Fluff Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=43868"/>
		<updated>2014-05-03T21:19:08Z</updated>

		<summary type="html">&lt;p&gt;Axem: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Journal/Fluff viewer is a LUA Script that allows the viewing of articles that have no plot-related content, but help with world building (aka Fluff). This is similar to the tech room, but this script has a better layout for text heavy entries.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link= &lt;br /&gt;
&lt;br /&gt;
LINK!&lt;br /&gt;
&lt;br /&gt;
=Required Files:=&lt;br /&gt;
*interface/&lt;br /&gt;
**2_Journal&lt;br /&gt;
**axui_close (+ c and h variants)&lt;br /&gt;
**axui_left (+ c and h variants)&lt;br /&gt;
**axui_right (+ c and h variants)&lt;br /&gt;
**axui_zoomin (+ c and h variants)&lt;br /&gt;
**cb_sidetab (+ c and h variants)&lt;br /&gt;
*tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**journal-lcl.tbm&lt;br /&gt;
**journal-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
 &lt;br /&gt;
==Demonstration Files:==&lt;br /&gt;
*config/&lt;br /&gt;
**journal_diary.cfg&lt;br /&gt;
**journal_FreeSpace2_config.cfg&lt;br /&gt;
**journal_people.cfg&lt;br /&gt;
**journal_photo.cfg&lt;br /&gt;
*fiction/&lt;br /&gt;
**surrender.txt&lt;br /&gt;
*interface/&lt;br /&gt;
**cats.jpg&lt;br /&gt;
**crystalpissed.png&lt;br /&gt;
**dawnohho.png&lt;br /&gt;
**dmc.jpg&lt;br /&gt;
**gummybears.jpg&lt;br /&gt;
**Isa.png&lt;br /&gt;
**justicea.png&lt;br /&gt;
**lunahelmetsmile.png&lt;br /&gt;
**M8.jpg&lt;br /&gt;
**M11.png&lt;br /&gt;
**miochan.jpg&lt;br /&gt;
**misuzugrin.png&lt;br /&gt;
**mm6w.png&lt;br /&gt;
**racistyang.jpg&lt;br /&gt;
**tempest.png&lt;br /&gt;
**thumbsup.jpg&lt;br /&gt;
**yesssss.png&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
All configuration files must be in /config/ &lt;br /&gt;
&lt;br /&gt;
==Journal Config File==&lt;br /&gt;
 &lt;br /&gt;
Must be named in the format: journal_YOURCAMPAIGNFILENAME_config.cfg&lt;br /&gt;
&amp;lt;pre&amp;gt;journal_FreeSpace2_config.cfg&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
If no valid config file is available for a campaign, the journal will be empty&lt;br /&gt;
 &lt;br /&gt;
===Index===&lt;br /&gt;
Number, start at 1 and go up, journal supports up to 3&lt;br /&gt;
===Name===&lt;br /&gt;
String, this is what the label by the tab will be&lt;br /&gt;
===Style===&lt;br /&gt;
String, valid options: FullText, ImageText, Thumbnails, descriptions below&lt;br /&gt;
===RevSort===&lt;br /&gt;
This will reverse sort the entries in the file. So files at top of the specified file will be at the bottom and vice-versa. Useful for when you want the new entries to be at the top.&lt;br /&gt;
===File===&lt;br /&gt;
The file name of the content you want to display. Should be a cfg file as well or else FreeSpace won&#039;t see them in a VP file!&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Content Files==&lt;br /&gt;
 &lt;br /&gt;
===FullText Type===&lt;br /&gt;
Good for lots of words. No Images.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
Your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===ImageText Type===&lt;br /&gt;
Good for showing an image + caption plus more words. Good for pilot profiles.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
String, your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, image that will be displayed to the left of the text.&lt;br /&gt;
====FullImage====&lt;br /&gt;
Filename, if this is present, a zoom icon will appear on the Image&#039;s top right corner. Clicking it will display this image. Image can be closed by clicking the close button on the top right corner. Optional.&lt;br /&gt;
====Caption====&lt;br /&gt;
String, this is what will be displayed underneath the image&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===Thumbnails===&lt;br /&gt;
Good for a lot of images and little text. When the user clicks a thumbnailed image, the image grabs focus and can only be closed by clicking a close button in the top right corner. Can also navigate through the images with side arrow buttons.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed under the thumbnailed image&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, the image that will be thumbnailed and displayed when the user clicks the thumbnailed image.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Generated Files==&lt;br /&gt;
Just for reference, you don&#039;t need to make these.&lt;br /&gt;
 &lt;br /&gt;
===Save File===&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.JOURNALCONFIGINDEX.sav&lt;br /&gt;
&amp;lt;pre&amp;gt;Eg: FreeSpace2_Holley.1.sav&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
(blank)&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this visible?&lt;br /&gt;
====Read====&lt;br /&gt;
Boolean, was this read?&lt;br /&gt;
====Title====&lt;br /&gt;
Title of entry&lt;br /&gt;
&lt;br /&gt;
===Notification File===&lt;br /&gt;
Generated when a new entry is added&lt;br /&gt;
&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.n.sav&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=FRED Functions=&lt;br /&gt;
 &lt;br /&gt;
Use with the script-eval sexp&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set visible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsv(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Sets an invisible entry to be visible. Use single quotes! Tab name is the @Name in the config file. Entry title is the @Title in the referred file&lt;br /&gt;
 &lt;br /&gt;
eg: jsv(&#039;Contacts&#039;, &#039;Misuzu Stella&#039;)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set invisible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsi(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Makes a visible entry invisible (effectively hiding it).&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal reset progress==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Journal:ResetProgress()&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Deletes all the sav files, basically reverting everything back to defaults&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=43867</id>
		<title>Script - Journal/Fluff Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_Journal/Fluff_Viewer&amp;diff=43867"/>
		<updated>2014-05-03T21:17:55Z</updated>

		<summary type="html">&lt;p&gt;Axem: First bit of documentation for this too...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Journal/Fluff viewer is a LUA Script that allows the viewing of articles that have no plot-related content, but help with world building (aka Fluff). This is similar to the tech room, but this script has a better layout for text heavy entries.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link= &lt;br /&gt;
&lt;br /&gt;
LINK!&lt;br /&gt;
&lt;br /&gt;
=Required Files:=&lt;br /&gt;
*interface/&lt;br /&gt;
**2_Journal&lt;br /&gt;
**axui_close (+ c and h variants)&lt;br /&gt;
**axui_left (+ c and h variants)&lt;br /&gt;
**axui_right (+ c and h variants)&lt;br /&gt;
**axui_zoomin (+ c and h variants)&lt;br /&gt;
**cb_sidetab (+ c and h variants)&lt;br /&gt;
*tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**journal-lcl.tbm&lt;br /&gt;
**journal-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
 &lt;br /&gt;
==Demonstration Files:==&lt;br /&gt;
*config/&lt;br /&gt;
**journal_diary.cfg&lt;br /&gt;
**journal_FreeSpace2_config.cfg&lt;br /&gt;
**journal_people.cfg&lt;br /&gt;
**journal_photo.cfg&lt;br /&gt;
*fiction/&lt;br /&gt;
**surrender.txt&lt;br /&gt;
*interface/&lt;br /&gt;
**cats.jpg&lt;br /&gt;
**crystalpissed.png&lt;br /&gt;
**dawnohho.png&lt;br /&gt;
**dmc.jpg&lt;br /&gt;
**gummybears.jpg&lt;br /&gt;
**Isa.png&lt;br /&gt;
**justicea.png&lt;br /&gt;
**lunahelmetsmile.png&lt;br /&gt;
**M8.jpg&lt;br /&gt;
**M11.png&lt;br /&gt;
**miochan.jpg&lt;br /&gt;
**misuzugrin.png&lt;br /&gt;
**mm6w.png&lt;br /&gt;
**racistyang.jpg&lt;br /&gt;
**tempest.png&lt;br /&gt;
**thumbsup.jpg&lt;br /&gt;
**yesssss.png&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
All configuration files must be in /config/ &lt;br /&gt;
&lt;br /&gt;
==Journal Config File==&lt;br /&gt;
 &lt;br /&gt;
Must be named in the format: journal_YOURCAMPAIGNFILENAME_config.cfg&lt;br /&gt;
&amp;lt;pre&amp;gt;journal_FreeSpace2_config.cfg&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
If no valid config file is available for a campaign, the journal will be empty&lt;br /&gt;
 &lt;br /&gt;
===Index===&lt;br /&gt;
Number, start at 1 and go up, journal supports up to 3&lt;br /&gt;
===Name===&lt;br /&gt;
String, this is what the label by the tab will be&lt;br /&gt;
===Style===&lt;br /&gt;
String, valid options: FullText, ImageText, Thumbnails, descriptions below&lt;br /&gt;
===RevSort===&lt;br /&gt;
This will reverse sort the entries in the file. So files at top of the specified file will be at the bottom and vice-versa. Useful for when you want the new entries to be at the top.&lt;br /&gt;
===File===&lt;br /&gt;
The file name of the content you want to display. Should be a cfg file as well or else FreeSpace won&#039;t see them in a VP file!&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Content Files==&lt;br /&gt;
 &lt;br /&gt;
===FullText Type===&lt;br /&gt;
Good for lots of words. No Images.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
Your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===ImageText Type===&lt;br /&gt;
Good for showing an image + caption plus more words. Good for pilot profiles.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed on the selection list box near the bottom&lt;br /&gt;
====Text====&lt;br /&gt;
String, your wall of text. Note that normal line breaks won&#039;t work here. If you need a line break, use the escape sequence \n&lt;br /&gt;
====File====&lt;br /&gt;
A .txt file in the /fiction/ folder, this will be displayed instead of what is entered for @Text. There&#039;s no need for \n escape sequences in the txt file.&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, image that will be displayed to the left of the text.&lt;br /&gt;
====FullImage====&lt;br /&gt;
Filename, if this is present, a zoom icon will appear on the Image&#039;s top right corner. Clicking it will display this image. Image can be closed by clicking the close button on the top right corner. Optional.&lt;br /&gt;
====Caption====&lt;br /&gt;
String, this is what will be displayed underneath the image&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
===Thumbnails===&lt;br /&gt;
Good for a lot of images and little text. When the user clicks a thumbnailed image, the image grabs focus and can only be closed by clicking a close button in the top right corner. Can also navigate through the images with side arrow buttons.&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
Enter a number or leave it blank, the script isn&#039;t picky here. It just needs to know to start here.&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this entry visible by default?&lt;br /&gt;
====Title====&lt;br /&gt;
String, this is what will be displayed under the thumbnailed image&lt;br /&gt;
====Image====&lt;br /&gt;
Filename, the image that will be thumbnailed and displayed when the user clicks the thumbnailed image.&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==Generated Files==&lt;br /&gt;
Just for reference, you don&#039;t need to make these.&lt;br /&gt;
 &lt;br /&gt;
===Save File===&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.JOURNALCONFIGINDEX.sav&lt;br /&gt;
&amp;lt;pre&amp;gt;Eg: FreeSpace2_Holley.1.sav&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
====Index====&lt;br /&gt;
(blank)&lt;br /&gt;
====Visible====&lt;br /&gt;
Boolean, is this visible?&lt;br /&gt;
====Read====&lt;br /&gt;
Boolean, was this read?&lt;br /&gt;
====Title====&lt;br /&gt;
Title of entry&lt;br /&gt;
&lt;br /&gt;
===Notification File===&lt;br /&gt;
Generated a new entry was added&lt;br /&gt;
Will be named CAMPAIGNFILENAME_PILOTNAME.n.sav&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
=FRED Functions=&lt;br /&gt;
 &lt;br /&gt;
Use with the script-eval sexp&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set visible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsv(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Sets an invisible entry to be visible. Use single quotes! Tab name is the @Name in the config file. Entry title is the @Title in the referred file&lt;br /&gt;
 &lt;br /&gt;
eg: jsv(&#039;Contacts&#039;, &#039;Misuzu Stella&#039;)&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal set invisible==&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;jsi(&#039;tab name&#039;, &#039;entry title&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Makes a visible entry invisible (effectively hiding it).&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
==journal reset progress==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Journal:ResetProgress()&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Deletes all the sav files, basically reverting everything back to defaults&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=43866</id>
		<title>Script - System Viewer</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Script_-_System_Viewer&amp;diff=43866"/>
		<updated>2014-05-03T19:14:46Z</updated>

		<summary type="html">&lt;p&gt;Axem: First bit of documentation for the System Viewer...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The System Viewer is a LUA script that allows a modder to create a map that can be used for reference purposes or for in-game navigational purposes. The configuration files are done in JSON and I would recommend using [http://www.jsoneditoronline.org/ this site] to edit them.&lt;br /&gt;
&lt;br /&gt;
This page will assist modders to install it, configure it, and use it.&lt;br /&gt;
&lt;br /&gt;
=Download Link=&lt;br /&gt;
&lt;br /&gt;
LINK&lt;br /&gt;
&lt;br /&gt;
=Required Files=&lt;br /&gt;
&lt;br /&gt;
All required files are included in the above download, including some sample files for demonstration and to inspire. The following files are the required files needed to make the script work if the modder wishes to remove the other files.&lt;br /&gt;
&lt;br /&gt;
*/config/&lt;br /&gt;
**imonitor.cfg (if imonitor-sct.tbm is to be used)&lt;br /&gt;
*/interface/&lt;br /&gt;
**axui_box1.png&lt;br /&gt;
**axui_cancel.png (+c and h variants)&lt;br /&gt;
**axui_exit.png&lt;br /&gt;
**axui_jumpto.png (+c and h variants)&lt;br /&gt;
**axui_return.png (+c and h variants)&lt;br /&gt;
*/scripts/&lt;br /&gt;
**dkjson.lua [[http://dkolf.de/src/dkjson-lua.fsl/home]]&lt;br /&gt;
*/tables/&lt;br /&gt;
**axui-sct.tbm&lt;br /&gt;
**imonitor-sct.tbm&lt;br /&gt;
**parsecfg-sct.tbm&lt;br /&gt;
**sysviewer-sct.tbm&lt;br /&gt;
**zLoadFirst-sct.tbm (written by Nuke)&lt;br /&gt;
&lt;br /&gt;
=Configuration Files=&lt;br /&gt;
&lt;br /&gt;
The system viewer requires 2 configuration files (3 if an out-of-mission interface is desired). These files must be placed in the /config/ directory.&lt;br /&gt;
&lt;br /&gt;
==Interface Monitor==&lt;br /&gt;
&lt;br /&gt;
imonitor.cfg is a JSON configuration file for imonitor-sct.tbm which allows the player to access different custom interface screens. Full documentation can be found in [[Script - Interface Monitor]].&lt;br /&gt;
&lt;br /&gt;
==Campaign Configuration File==&lt;br /&gt;
&lt;br /&gt;
Used to decide which system config that gets loaded during a campaign.&lt;br /&gt;
&lt;br /&gt;
==System Configuration File==&lt;br /&gt;
&lt;br /&gt;
Contains all the information to draw systems&lt;br /&gt;
&lt;br /&gt;
=Campaign Configuration File=&lt;br /&gt;
&lt;br /&gt;
A file with the format &amp;lt;pre&amp;gt;sysview_[CAMPAIGN_FILENAME]_config.cfg&amp;lt;/pre&amp;gt; placed in the /config/ folder will be loaded when the System Viewer starts. Eg: sysview_Freespace2_config.cfg. The file is a JSON file with 2 required fields.&lt;br /&gt;
==&amp;quot;File&amp;quot;:==&lt;br /&gt;
This will tell the script which system file to look at and load.&lt;br /&gt;
==&amp;quot;Default&amp;quot;:==&lt;br /&gt;
This will load the specified system that the script will load by default.&lt;br /&gt;
==&amp;quot;[missionfilename].fs2&amp;quot;:==&lt;br /&gt;
This will load the specified system when the mission&#039;s filename matches the one being played (or to be played next if the script was activated in the mainhall screen)&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;quot;sm01-01.fs2&amp;quot;: Vega1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=System Configuration File=&lt;br /&gt;
&lt;br /&gt;
This file contains the information the script uses to draw the system.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;[Internal Name]&amp;quot;==&lt;br /&gt;
Object. The name of the object that contains the system configuration is used internally to change to keep track of the different systems in the file&lt;br /&gt;
===&amp;quot;Name&amp;quot;===&lt;br /&gt;
String, the displayed name. Drawn in the upper left corner in large text&lt;br /&gt;
===&amp;quot;Description&amp;quot;===&lt;br /&gt;
String, a subtitle to the name. Drawn below name in slightly smaller text&lt;br /&gt;
===&amp;quot;Background&amp;quot;===&lt;br /&gt;
Filename, the background that will be used in the system viewer screen. The view will be bound to this image (so its a good idea to make this a large image).&lt;br /&gt;
====&amp;quot;Elements&amp;quot;====&lt;br /&gt;
Object, this contains all the visible elements the player can interact with.&lt;br /&gt;
=====&amp;quot;[Internal Name]&amp;quot;=====&lt;br /&gt;
Object, this contains all the information to draw this element. The object&#039;s name will be the internal name for this element. This will be the name that gets written to a SEXP variable, navsys_destination, if the modder is using this as a navigational system. If this element is named &amp;quot;Player&amp;quot; it will be moved to navsys_destination as well.&lt;br /&gt;
=====&amp;quot;Name&amp;quot;=====&lt;br /&gt;
String, the name that will be drawn below the bitmap.&lt;br /&gt;
=====&amp;quot;Visible&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw this element.&lt;br /&gt;
=====&amp;quot;Bitmap&amp;quot;=====&lt;br /&gt;
Filename, should be in a folder with other graphic files (effects or maps etc). This is the bitmap that will be drawn. The script will also attempt to use the filename plus _h and _c for highlighted and clicked graphics.&lt;br /&gt;
=====&amp;quot;LargeBitmap&amp;quot;=====&lt;br /&gt;
Filename, will be drawn in the middle of the screen if this element is clicked.&lt;br /&gt;
=====&amp;quot;ShipClass&amp;quot;=====&lt;br /&gt;
String, if LargeBitmap is absent and ShipClass has a valid ship class, a rotating tech room style model will be rendered when an element is clicked on.&lt;br /&gt;
=====&amp;quot;Show Orbit&amp;quot;=====&lt;br /&gt;
Boolean, if true it will draw the circular orbit for this element. (Sorry, no elliptical or hyperbolic orbits!) Optional.&lt;br /&gt;
=====&amp;quot;Selectable&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click on the object which will bring up detailed information about this object. Optional.&lt;br /&gt;
=====&amp;quot;CanJump&amp;quot;=====&lt;br /&gt;
Boolean, if true the player can click a &amp;quot;Jump To&amp;quot; button if this was activated during gameplay. Upon clicking JumpTo, the internal name for the element will be written to the SEXP Variable, navsys_destination, if it exists. It will also close the viewer. Optional.&lt;br /&gt;
=====&amp;quot;ForceJump&amp;quot;=====&lt;br /&gt;
Boolean, if true and the player clicks the &amp;quot;Jump To&amp;quot; button, it will force the player to jump out, ending the mission. Optional.&lt;br /&gt;
=====&amp;quot;Orbit&amp;quot;=====&lt;br /&gt;
Object. Defining, in polar coordinate terms, where to draw the element. Optional, but leaving this out will cause the element to be drawn in the middle of the screen.&lt;br /&gt;
======&amp;quot;Distance&amp;quot;======&lt;br /&gt;
Integer, the orbital radius in pixels.&lt;br /&gt;
======&amp;quot;Angle&amp;quot;======&lt;br /&gt;
Integer, the orbital angle in degrees. 0 degrees is the direction to the right side of the screen and goes clockwise.&lt;br /&gt;
=====&amp;quot;Offset&amp;quot;=====&lt;br /&gt;
Object. Fine tuning a bitmap&#039;s placement. Optional.&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, this will move this object to the right by X pixels (negative values will move it to the left). This is in addition to the orbital distance and angle. (You could have two elements sharing the same orbital distance and angle, but have different offsets to place them differently)&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as the X above, just for vertical placement.&lt;br /&gt;
=====&amp;quot;Icon&amp;quot;=====&lt;br /&gt;
Object. Draws a secondary bitmap over the element. Optional.&lt;br /&gt;
======&amp;quot;Bitmap&amp;quot;======&lt;br /&gt;
Filename, graphic file to be drawn&lt;br /&gt;
======&amp;quot;X&amp;quot;======&lt;br /&gt;
Integer, x coordinate of where the bitmap will be drawn relative to the top left of the element&#039;s bitmap. Two special values, &amp;quot;-&amp;quot; and &amp;quot;+&amp;quot; can be used instead to automatically move the icon to the left most or right most part of the element&#039;s bitmap.&lt;br /&gt;
======&amp;quot;Y&amp;quot;======&lt;br /&gt;
Integer, same as X above, just for vertical placement.&lt;br /&gt;
&lt;br /&gt;
=Using In-Game=&lt;br /&gt;
&lt;br /&gt;
TO-DO...&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=43865</id>
		<title>User:Axem</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=User:Axem&amp;diff=43865"/>
		<updated>2014-05-03T17:59:54Z</updated>

		<summary type="html">&lt;p&gt;Axem: /* Helpful Pages I&amp;#039;ve Done */ Preparing for future documentation!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About Axem!==&lt;br /&gt;
Hello! I am Axem, friendly administrator on the HLP forums. I can FRED (make missions), model, UVMap, texture, script and make rough effects. Just don&#039;t ask me to do any of it for you, I&#039;ve got enough to do! But I can help guide you to the right path. Below you&#039;ll find some of the stuff I&#039;ve done here over the years.&lt;br /&gt;
&lt;br /&gt;
==My Campaigns==&lt;br /&gt;
*[[Shadows of Kraken]]&lt;br /&gt;
*[[Just Another Day]]&lt;br /&gt;
*[[Just Another Day 2: Electric Boogaloo]]&lt;br /&gt;
*[[Just Another Day 3: Shivans on a Plane]]&lt;br /&gt;
*[[Vassago&#039;s Dirge]]&lt;br /&gt;
*[[Just Another Day 2.21: You Are (Not) Alpha 1]]&lt;br /&gt;
&lt;br /&gt;
==Projects I Help With==&lt;br /&gt;
*[[Diaspora]]&lt;br /&gt;
*[[Blue Planet]]&lt;br /&gt;
*[[Wings of Dawn]]&lt;br /&gt;
&lt;br /&gt;
==My Ships==&lt;br /&gt;
&lt;br /&gt;
*[[GTC Cretheus]]&lt;br /&gt;
*[[SC Lamia]]&lt;br /&gt;
*[[SGs Asura]] (textured by Nighteyes)&lt;br /&gt;
*[[UES Aranyaka]]&lt;br /&gt;
&lt;br /&gt;
Other WIPS can be seen on my [http://p3d.in/u/Axem p3d page]&lt;br /&gt;
&lt;br /&gt;
==Helpful Pages I&#039;ve Done==&lt;br /&gt;
===Tutorials===&lt;br /&gt;
*[[Tutorial - Conditional Arguments]]&lt;br /&gt;
*[[Tutorial - Directive-is-variable SEXP]]&lt;br /&gt;
*[[Tutorial - Mission Infrastructure]]&lt;br /&gt;
*[[Tutorial - PCS2 Kitbashing]]&lt;br /&gt;
*[[Tutorial - Custom HUD Gauges]]&lt;br /&gt;
===SEXP Reference===&lt;br /&gt;
*[[Advanced Cutscene SEXP Reference]]&lt;br /&gt;
===Script Reference===&lt;br /&gt;
*[[Script - Journal/Fluff Viewer]]&lt;br /&gt;
*[[Script - System Viewer]]&lt;br /&gt;
*[[Script - Interface Monitor]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Tutorial_-_Custom_HUD_Gauges&amp;diff=43824</id>
		<title>Tutorial - Custom HUD Gauges</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Tutorial_-_Custom_HUD_Gauges&amp;diff=43824"/>
		<updated>2014-05-01T22:27:21Z</updated>

		<summary type="html">&lt;p&gt;Axem: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes in a mission you need to show the player some additional information they need to monitor. Maybe it’s a timer, maybe it&#039;s added instructions or a prompt to press some keys. It&#039;s all up to you how you want to use them. Either for good, or for awesome. Let&#039;s make a simple hud gauge and then have fun with it and sexps.&lt;br /&gt;
&lt;br /&gt;
==The HUD Gauge Table==&lt;br /&gt;
&lt;br /&gt;
[[Hud_gauges.tbl | This is a really useful wiki page]] when modifying the hud gauge table. There&#039;s some neat general hud configuration stuff, but we&#039;re not interested in that right now. Just the gauge config.&lt;br /&gt;
&lt;br /&gt;
Actually, before we go any farther, we should sort of design our hud gauge first. We&#039;re going to need to know where to place it on the screen.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll just use the retail FS2 hud gauges for this tutorial. Go take your favorite VP viewer and open up sparky_fs2.vp, it contains all the graphical files for the game. Let us look in the hud folder for some files we can use.&lt;br /&gt;
&lt;br /&gt;
Oh, look at escort1, 2 and 3. These will do nicely. Let&#039;s make a note of the dimensions of the files.&lt;br /&gt;
&lt;br /&gt;
*Escort1.ani: 149x13&lt;br /&gt;
*Escort2.ani: 149x11&lt;br /&gt;
*Escort3.ani: 149x13&lt;br /&gt;
&lt;br /&gt;
Horizontally we&#039;ll throw this on the right side of the screen, and vertically we&#039;ll throw it in the middle.&lt;br /&gt;
&lt;br /&gt;
With that in mind, let&#039;s begin.&lt;br /&gt;
&lt;br /&gt;
So our blank (modular) hud gauge will start off like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#Gauge Config&lt;br /&gt;
	$Base: 	 (1024,768)&lt;br /&gt;
	$Gauges:&lt;br /&gt;
	&lt;br /&gt;
	$End Gauges&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gauge Config starts us off, and $Base tells the game that all of our coordinates are based on a 1024x786 screen resolution. The game will take that into account when scaling things up or down. And $Gauges is all like &amp;quot;Hey, I got your hud gauges. Fresh gauges here.&amp;quot; which gets closed off by $End Gauges and then #End closes the table for good.&lt;br /&gt;
&lt;br /&gt;
So because our gauge is a custom gauge, on a new line right after $Gauges: we&#039;ll put in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;+Custom:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This lets the game know this is a custom gauge (surprise surprise)&lt;br /&gt;
&lt;br /&gt;
===Position===&lt;br /&gt;
&lt;br /&gt;
Next, setting the position. There&#039;s two ways to do this.&lt;br /&gt;
Position: (x, y)&lt;br /&gt;
And&lt;br /&gt;
Origin: (percent x, percent y)&lt;br /&gt;
Offset: (x, y)&lt;br /&gt;
&lt;br /&gt;
Position sets the position to a point based on the base resolution specified. Putting position as (512, 384), or the middle of the screen, will make the gauge start there. As I said before, this will scale up with the resolution so it would always start in the middle of the screen. (Assuming $Scale Gauges is true)&lt;br /&gt;
&lt;br /&gt;
Origin + Offset is a newer feature, only found in 3.7.1 and beyond. Instead of specifying a position, we specify where we want the gauge as a percentage of the screen. So if we want it to start in the middle of the screen we would go Origin: (0.5, 0.5). And then any more fine tuning would be done with Offset.&lt;br /&gt;
&lt;br /&gt;
Which should you use? Origin and Offset is probably the better one if you&#039;ve got builds that can support it. The issues with fullscreen + widescreen aren&#039;t as bad as with position and it’s a little easier to work with. I&#039;ll mostly cover Origin + Offset.&lt;br /&gt;
&lt;br /&gt;
Position:&lt;br /&gt;
Time for a bit of math. The position is the point where the top left corner of the bitmap is. So if we want to put this on the right hand side, we would take our base&#039;s horizontal resolution and subtract the bitmap&#039;s width from it.&lt;br /&gt;
&lt;br /&gt;
1024 - 149 = 875&lt;br /&gt;
&lt;br /&gt;
And then to make it start at the halfway point vertically, we just divide the base vertical resolution by 2.&lt;br /&gt;
&lt;br /&gt;
768 / 2 = 384&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Position: (875, 384)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Origin+Offset:&lt;br /&gt;
This is a bit easier. Since origin works off of percentages of the screen&#039;s resolution, we specify 100% horizontal, 50% vertical.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Origin: (1.0, 0.5)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But wait, that would make the bitmap&#039;s top left corner be off screen now. That&#039;s where Offset comes in. Our bitmap is 149 px wide, so we just make the x offset the negative of the width.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Offset: (-149, 0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
REMEMBER! ONLY USE EITHER POSITION OR ORIGIN+OFFSET!&lt;br /&gt;
&lt;br /&gt;
===Name===&lt;br /&gt;
Next we need a name so we know what we&#039;re turning on or off. We&#039;ll just call this CustomGaugeA.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Name: CustomGaugeA&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text===&lt;br /&gt;
This is what the gauge will display by default. We&#039;ll put in &amp;quot;MFD Online&amp;quot;. That&#039;s generic enough for now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Text: MFD Online&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===X/Y Offset===&lt;br /&gt;
These are optional, they modify where the text starts drawing. We&#039;ll put these in and make them both 0 for now. We&#039;ll modify them later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;X Offset: 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Y Offset: 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Gauge Type===&lt;br /&gt;
FreeSpace needs all the gauges to be part of a retail gauge type. This affects the hud gauge coloring and what flashes when the flash-hud-gauge sexp is used. It has to be one of these [[Gauge_types | gauge types.]] I&#039;m going to use CENTER_RETICLE since the reticle won&#039;t actually flash if we use that sexp, but it will flash our custom gauge.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Gauge Type: CENTER_RETICLE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slew===&lt;br /&gt;
If this is on, the gauge will shake when the camera shudders from afterburners or a weapon like the maxim (which uses the shudder flag). Its best when the central hud elements have slew on, and the edged ones have it off. We&#039;ll turn this to NO.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Slew: NO&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Active by default===&lt;br /&gt;
If this is on, then the gauge will appear on at mission start. You probably want to keep the gauge off until you really need it so the hud isn&#039;t always cluttered, but we&#039;ll turn it on so we can see our results with no sexps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Active by default: YES&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Filename===&lt;br /&gt;
At last we come to the actual bitmap file name. Just fill in the bitmap&#039;s name, no extension required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Filename: escort1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now the table should look like…&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#Gauge Config&lt;br /&gt;
	$Base: 	(1024,768)&lt;br /&gt;
	$Gauges:&lt;br /&gt;
		+Custom:&lt;br /&gt;
			;Position:          	(875, 384)&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-149, 0)&lt;br /&gt;
			Name:			CustomGaugeA&lt;br /&gt;
			Text:			MFD Online&lt;br /&gt;
			X Offset:		0&lt;br /&gt;
			Y Offset:		0&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	YES&lt;br /&gt;
			Filename: 		escort1&lt;br /&gt;
	$End Gauges&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I added the Position but I commented it out with a ;. You can uncomment position and then comment out origin + offset to see the difference between the two.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s go in game and see how it works.&lt;br /&gt;
&lt;br /&gt;
[[file:hud1.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
I&#039;m using the 2014 mediavps here and you&#039;ll see how our new gauge a larger and a bit more blurry. We can fix that by adding Scale Gauge: NO just above Origin. While we&#039;re at it, we should adjust the three offsets so it looks better.&lt;br /&gt;
&lt;br /&gt;
So now I&#039;ve got this…&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#Gauge Config&lt;br /&gt;
	$Base: 				      (1024,768)&lt;br /&gt;
	$Gauges:&lt;br /&gt;
		+Custom:&lt;br /&gt;
			;Position:		(875, 384)&lt;br /&gt;
			Scale Gauge: 		NO&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-159, 0)&lt;br /&gt;
			Name:			CustomGaugeA&lt;br /&gt;
			Text:			MFD Online&lt;br /&gt;
			X Offset:		2&lt;br /&gt;
			Y Offset:		2&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	YES&lt;br /&gt;
			Filename: 		escort1&lt;br /&gt;
	$End Gauges&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And it looks like this&lt;br /&gt;
&lt;br /&gt;
[[file:hud2.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Much better!&lt;br /&gt;
&lt;br /&gt;
Well we&#039;ve got the top, so now we can take care of the middle and bottom. We can copy paste the entry a few times, changing a few parts. &lt;br /&gt;
&lt;br /&gt;
The y component of the offset will increase by the height of the bitmap that is above it. So CustomGaugeB (which will used escort2) will have an offset of (-159, 13) and then C will have an offset of (-159, 24) and so on.&lt;br /&gt;
&lt;br /&gt;
For text I wrote the Line number, and tweaked the X and Y offsets so they look nice in game. (X Offset: 1, Y Offset: 4&lt;br /&gt;
&lt;br /&gt;
In game we&#039;ve got something that now looks like…&lt;br /&gt;
&lt;br /&gt;
[[file:hud3.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Purdy.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s change all the active by defaults to NO now and make a mission that will use our new hud gauge.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the table that I&#039;m using.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#Gauge Config&lt;br /&gt;
	$Base: 				      (1024,768)&lt;br /&gt;
	$Gauges:&lt;br /&gt;
		+Custom:&lt;br /&gt;
			Scale Gauge: 		NO&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-159, 0)&lt;br /&gt;
			Name:			CustomGaugeA&lt;br /&gt;
			Text:			MFD Online&lt;br /&gt;
			X Offset:		2&lt;br /&gt;
			Y Offset:		2&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	NO&lt;br /&gt;
			Filename: 		escort1&lt;br /&gt;
		+Custom:&lt;br /&gt;
			Scale Gauge: 		NO&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-159, 13)&lt;br /&gt;
			Name:			CustomGaugeB&lt;br /&gt;
			Text:			Line 1&lt;br /&gt;
			X Offset:		4&lt;br /&gt;
			Y Offset:		1&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	NO&lt;br /&gt;
			Filename: 		escort2&lt;br /&gt;
		+Custom:&lt;br /&gt;
			Scale Gauge: 		NO&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-159, 24)&lt;br /&gt;
			Name:			CustomGaugeC&lt;br /&gt;
			Text:			Line 2&lt;br /&gt;
			X Offset:		4&lt;br /&gt;
			Y Offset:		1&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	NO&lt;br /&gt;
			Filename: 		escort2&lt;br /&gt;
		+Custom:&lt;br /&gt;
			Scale Gauge: 		NO&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-159, 35)&lt;br /&gt;
			Name:			CustomGaugeD&lt;br /&gt;
			Text:			Line 3&lt;br /&gt;
			X Offset:		4&lt;br /&gt;
			Y Offset:		1&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	NO&lt;br /&gt;
			Filename: 		escort3&lt;br /&gt;
	$End Gauges&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Playing with HUD gauges==&lt;br /&gt;
&lt;br /&gt;
There won&#039;t be any real structure to this mission. This will just be a playground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First lets have our hud gauge turn on 5 seconds after the mission starts and then flash to draw attention to it. The SEXP of choice here is either hud-set-active-gauge (which is deprecated in newer builds) or hud-set-custom-gauge-active (which is easier to use). I&#039;ll use hud-set-custom-gauge for the tutorial. Both work identically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If we put a true argument in, the gauge will turn on, and if we put false in, it will turn off. And we just refer to the gauge by the name we put in the table. So simple!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now what should we use the gauge for? Let&#039;s keep it simple and just use it to track our score and some other silly info. I&#039;ve populated the mission with a bunch of Amazon Drones and an Amazon Advanced. Their score has been set to 10 points each, except for the big one, which will be worth 500.&lt;br /&gt;
&lt;br /&gt;
[[File:Hudgaugesexp2.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
So in the initial hud activation sexp, we will set up what each line is supposed to say.&lt;br /&gt;
&lt;br /&gt;
[[File:Hudgaugesexp1.png|600px]]&lt;br /&gt;
&lt;br /&gt;
There are four sexps we can use to change the hud gauge text.&lt;br /&gt;
&lt;br /&gt;
===Hud-set-text===&lt;br /&gt;
This is the simplest. Just type in your text here and it will change the hud gauge you&#039;ve referred too. Note you&#039;re only limited to 31 characters here.&lt;br /&gt;
&lt;br /&gt;
===Hud-set-text-num===&lt;br /&gt;
This is quite similar, but only lets you choose a number. You can plug in status sexps that return values with this one.&lt;br /&gt;
&lt;br /&gt;
===Hud-set-message===&lt;br /&gt;
This one will let you choose a message to the gauge. This lets you get around the 31 character limitation with hud-set-text, but it can be easy to make these messages too long! Still these can be easier to edit since you just look for the message in the editor. Also you can use sexp variables just like you can in normal messages with $variablename.&lt;br /&gt;
&lt;br /&gt;
===Hud-set-directive===&lt;br /&gt;
This is kind of a goofy name, but still pretty awesome. The sexp is basically hud-set-text but it gets put through the same directive keypress function so the game will change $keypress$ text to the correctly bound key. So if you put &amp;quot;Press $t$&amp;quot; and someone rebound &amp;quot;select target&amp;quot; to q, then the text would show up as &amp;quot;Press q&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So I will use hud-set-text to make CustomGaugeA say &amp;quot;Current Score&amp;quot;. Then use for CustomGaugeB, I will use hud-set-text-num to relay the player&#039;s ship_score. CustomGaugeC will let us know how long it has been since we last killed a target with &amp;quot;Last kill: $seconds ago&amp;quot;. And CustomGaugeD will let us know which button we use to target ships.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now if we&#039;re feeding changing information into the hud gauges, we should keep in mind that they won&#039;t update by themselves, but they will retain their information between updates. So we can either check to see when we should update or just make them update once a second. We&#039;ll just do the simple thing here and update every second with repeating events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since only CustomGaugeB and C ever change, we only need to tell the event to change them. The only other thing I do is update the seconds variable which tells us how much time passed since our last kill. And there&#039;s another repeating event that updates the lastkill variable when we kill something.&lt;br /&gt;
&lt;br /&gt;
[[File:Hudgaugesexp3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
So how did we do?&lt;br /&gt;
&lt;br /&gt;
[[file:hud4.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Hey, where&#039;s my 500 points?! I guess this is what I get for not playing on INSANE.&lt;br /&gt;
&lt;br /&gt;
[[http://lazymodders.fsmods.net/files/HudTutorial.rar Here&#039;s a link]] to the mod with the custom hud gauge and mission file.&lt;br /&gt;
&lt;br /&gt;
There&#039;s still a lot I didn&#039;t cover, but after covering these basics, I&#039;m sure you have the ability to do just about anything you would need for your campaigns and missions. The only limit is your imagination!&lt;br /&gt;
&lt;br /&gt;
Happy FREDding!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FRED Examples]][[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=Tutorial_-_Custom_HUD_Gauges&amp;diff=43823</id>
		<title>Tutorial - Custom HUD Gauges</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=Tutorial_-_Custom_HUD_Gauges&amp;diff=43823"/>
		<updated>2014-05-01T22:27:01Z</updated>

		<summary type="html">&lt;p&gt;Axem: Tutorial for hud gauge magic!&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Mission Infrastructure and Checkpoints=&lt;br /&gt;
&lt;br /&gt;
Sometimes in a mission you need to show the player some additional information they need to monitor. Maybe it’s a timer, maybe it&#039;s added instructions or a prompt to press some keys. It&#039;s all up to you how you want to use them. Either for good, or for awesome. Let&#039;s make a simple hud gauge and then have fun with it and sexps.&lt;br /&gt;
&lt;br /&gt;
==The HUD Gauge Table==&lt;br /&gt;
&lt;br /&gt;
[[Hud_gauges.tbl | This is a really useful wiki page]] when modifying the hud gauge table. There&#039;s some neat general hud configuration stuff, but we&#039;re not interested in that right now. Just the gauge config.&lt;br /&gt;
&lt;br /&gt;
Actually, before we go any farther, we should sort of design our hud gauge first. We&#039;re going to need to know where to place it on the screen.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll just use the retail FS2 hud gauges for this tutorial. Go take your favorite VP viewer and open up sparky_fs2.vp, it contains all the graphical files for the game. Let us look in the hud folder for some files we can use.&lt;br /&gt;
&lt;br /&gt;
Oh, look at escort1, 2 and 3. These will do nicely. Let&#039;s make a note of the dimensions of the files.&lt;br /&gt;
&lt;br /&gt;
*Escort1.ani: 149x13&lt;br /&gt;
*Escort2.ani: 149x11&lt;br /&gt;
*Escort3.ani: 149x13&lt;br /&gt;
&lt;br /&gt;
Horizontally we&#039;ll throw this on the right side of the screen, and vertically we&#039;ll throw it in the middle.&lt;br /&gt;
&lt;br /&gt;
With that in mind, let&#039;s begin.&lt;br /&gt;
&lt;br /&gt;
So our blank (modular) hud gauge will start off like this&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#Gauge Config&lt;br /&gt;
	$Base: 	 (1024,768)&lt;br /&gt;
	$Gauges:&lt;br /&gt;
	&lt;br /&gt;
	$End Gauges&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gauge Config starts us off, and $Base tells the game that all of our coordinates are based on a 1024x786 screen resolution. The game will take that into account when scaling things up or down. And $Gauges is all like &amp;quot;Hey, I got your hud gauges. Fresh gauges here.&amp;quot; which gets closed off by $End Gauges and then #End closes the table for good.&lt;br /&gt;
&lt;br /&gt;
So because our gauge is a custom gauge, on a new line right after $Gauges: we&#039;ll put in&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;+Custom:&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This lets the game know this is a custom gauge (surprise surprise)&lt;br /&gt;
&lt;br /&gt;
===Position===&lt;br /&gt;
&lt;br /&gt;
Next, setting the position. There&#039;s two ways to do this.&lt;br /&gt;
Position: (x, y)&lt;br /&gt;
And&lt;br /&gt;
Origin: (percent x, percent y)&lt;br /&gt;
Offset: (x, y)&lt;br /&gt;
&lt;br /&gt;
Position sets the position to a point based on the base resolution specified. Putting position as (512, 384), or the middle of the screen, will make the gauge start there. As I said before, this will scale up with the resolution so it would always start in the middle of the screen. (Assuming $Scale Gauges is true)&lt;br /&gt;
&lt;br /&gt;
Origin + Offset is a newer feature, only found in 3.7.1 and beyond. Instead of specifying a position, we specify where we want the gauge as a percentage of the screen. So if we want it to start in the middle of the screen we would go Origin: (0.5, 0.5). And then any more fine tuning would be done with Offset.&lt;br /&gt;
&lt;br /&gt;
Which should you use? Origin and Offset is probably the better one if you&#039;ve got builds that can support it. The issues with fullscreen + widescreen aren&#039;t as bad as with position and it’s a little easier to work with. I&#039;ll mostly cover Origin + Offset.&lt;br /&gt;
&lt;br /&gt;
Position:&lt;br /&gt;
Time for a bit of math. The position is the point where the top left corner of the bitmap is. So if we want to put this on the right hand side, we would take our base&#039;s horizontal resolution and subtract the bitmap&#039;s width from it.&lt;br /&gt;
&lt;br /&gt;
1024 - 149 = 875&lt;br /&gt;
&lt;br /&gt;
And then to make it start at the halfway point vertically, we just divide the base vertical resolution by 2.&lt;br /&gt;
&lt;br /&gt;
768 / 2 = 384&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Position: (875, 384)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Origin+Offset:&lt;br /&gt;
This is a bit easier. Since origin works off of percentages of the screen&#039;s resolution, we specify 100% horizontal, 50% vertical.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Origin: (1.0, 0.5)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But wait, that would make the bitmap&#039;s top left corner be off screen now. That&#039;s where Offset comes in. Our bitmap is 149 px wide, so we just make the x offset the negative of the width.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Offset: (-149, 0)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
REMEMBER! ONLY USE EITHER POSITION OR ORIGIN+OFFSET!&lt;br /&gt;
&lt;br /&gt;
===Name===&lt;br /&gt;
Next we need a name so we know what we&#039;re turning on or off. We&#039;ll just call this CustomGaugeA.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Name: CustomGaugeA&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Text===&lt;br /&gt;
This is what the gauge will display by default. We&#039;ll put in &amp;quot;MFD Online&amp;quot;. That&#039;s generic enough for now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Text: MFD Online&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===X/Y Offset===&lt;br /&gt;
These are optional, they modify where the text starts drawing. We&#039;ll put these in and make them both 0 for now. We&#039;ll modify them later.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;X Offset: 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;Y Offset: 0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Gauge Type===&lt;br /&gt;
FreeSpace needs all the gauges to be part of a retail gauge type. This affects the hud gauge coloring and what flashes when the flash-hud-gauge sexp is used. It has to be one of these [[Gauge_types | gauge types.]] I&#039;m going to use CENTER_RETICLE since the reticle won&#039;t actually flash if we use that sexp, but it will flash our custom gauge.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Gauge Type: CENTER_RETICLE&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Slew===&lt;br /&gt;
If this is on, the gauge will shake when the camera shudders from afterburners or a weapon like the maxim (which uses the shudder flag). Its best when the central hud elements have slew on, and the edged ones have it off. We&#039;ll turn this to NO.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Slew: NO&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Active by default===&lt;br /&gt;
If this is on, then the gauge will appear on at mission start. You probably want to keep the gauge off until you really need it so the hud isn&#039;t always cluttered, but we&#039;ll turn it on so we can see our results with no sexps.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Active by default: YES&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Filename===&lt;br /&gt;
At last we come to the actual bitmap file name. Just fill in the bitmap&#039;s name, no extension required.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Filename: escort1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So now the table should look like…&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#Gauge Config&lt;br /&gt;
	$Base: 	(1024,768)&lt;br /&gt;
	$Gauges:&lt;br /&gt;
		+Custom:&lt;br /&gt;
			;Position:          	(875, 384)&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-149, 0)&lt;br /&gt;
			Name:			CustomGaugeA&lt;br /&gt;
			Text:			MFD Online&lt;br /&gt;
			X Offset:		0&lt;br /&gt;
			Y Offset:		0&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	YES&lt;br /&gt;
			Filename: 		escort1&lt;br /&gt;
	$End Gauges&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I added the Position but I commented it out with a ;. You can uncomment position and then comment out origin + offset to see the difference between the two.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s go in game and see how it works.&lt;br /&gt;
&lt;br /&gt;
[[file:hud1.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
I&#039;m using the 2014 mediavps here and you&#039;ll see how our new gauge a larger and a bit more blurry. We can fix that by adding Scale Gauge: NO just above Origin. While we&#039;re at it, we should adjust the three offsets so it looks better.&lt;br /&gt;
&lt;br /&gt;
So now I&#039;ve got this…&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#Gauge Config&lt;br /&gt;
	$Base: 				      (1024,768)&lt;br /&gt;
	$Gauges:&lt;br /&gt;
		+Custom:&lt;br /&gt;
			;Position:		(875, 384)&lt;br /&gt;
			Scale Gauge: 		NO&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-159, 0)&lt;br /&gt;
			Name:			CustomGaugeA&lt;br /&gt;
			Text:			MFD Online&lt;br /&gt;
			X Offset:		2&lt;br /&gt;
			Y Offset:		2&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	YES&lt;br /&gt;
			Filename: 		escort1&lt;br /&gt;
	$End Gauges&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And it looks like this&lt;br /&gt;
&lt;br /&gt;
[[file:hud2.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Much better!&lt;br /&gt;
&lt;br /&gt;
Well we&#039;ve got the top, so now we can take care of the middle and bottom. We can copy paste the entry a few times, changing a few parts. &lt;br /&gt;
&lt;br /&gt;
The y component of the offset will increase by the height of the bitmap that is above it. So CustomGaugeB (which will used escort2) will have an offset of (-159, 13) and then C will have an offset of (-159, 24) and so on.&lt;br /&gt;
&lt;br /&gt;
For text I wrote the Line number, and tweaked the X and Y offsets so they look nice in game. (X Offset: 1, Y Offset: 4&lt;br /&gt;
&lt;br /&gt;
In game we&#039;ve got something that now looks like…&lt;br /&gt;
&lt;br /&gt;
[[file:hud3.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Purdy.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s change all the active by defaults to NO now and make a mission that will use our new hud gauge.&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the table that I&#039;m using.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#Gauge Config&lt;br /&gt;
	$Base: 				      (1024,768)&lt;br /&gt;
	$Gauges:&lt;br /&gt;
		+Custom:&lt;br /&gt;
			Scale Gauge: 		NO&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-159, 0)&lt;br /&gt;
			Name:			CustomGaugeA&lt;br /&gt;
			Text:			MFD Online&lt;br /&gt;
			X Offset:		2&lt;br /&gt;
			Y Offset:		2&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	NO&lt;br /&gt;
			Filename: 		escort1&lt;br /&gt;
		+Custom:&lt;br /&gt;
			Scale Gauge: 		NO&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-159, 13)&lt;br /&gt;
			Name:			CustomGaugeB&lt;br /&gt;
			Text:			Line 1&lt;br /&gt;
			X Offset:		4&lt;br /&gt;
			Y Offset:		1&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	NO&lt;br /&gt;
			Filename: 		escort2&lt;br /&gt;
		+Custom:&lt;br /&gt;
			Scale Gauge: 		NO&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-159, 24)&lt;br /&gt;
			Name:			CustomGaugeC&lt;br /&gt;
			Text:			Line 2&lt;br /&gt;
			X Offset:		4&lt;br /&gt;
			Y Offset:		1&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	NO&lt;br /&gt;
			Filename: 		escort2&lt;br /&gt;
		+Custom:&lt;br /&gt;
			Scale Gauge: 		NO&lt;br /&gt;
			Origin:			(1, 0.5)&lt;br /&gt;
			Offset:			(-159, 35)&lt;br /&gt;
			Name:			CustomGaugeD&lt;br /&gt;
			Text:			Line 3&lt;br /&gt;
			X Offset:		4&lt;br /&gt;
			Y Offset:		1&lt;br /&gt;
			Gauge Type: 		CENTER_RETICLE&lt;br /&gt;
			Slew: 			NO&lt;br /&gt;
			Active by default: 	NO&lt;br /&gt;
			Filename: 		escort3&lt;br /&gt;
	$End Gauges&lt;br /&gt;
#End&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Playing with HUD gauges==&lt;br /&gt;
&lt;br /&gt;
There won&#039;t be any real structure to this mission. This will just be a playground.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
First lets have our hud gauge turn on 5 seconds after the mission starts and then flash to draw attention to it. The SEXP of choice here is either hud-set-active-gauge (which is deprecated in newer builds) or hud-set-custom-gauge-active (which is easier to use). I&#039;ll use hud-set-custom-gauge for the tutorial. Both work identically.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If we put a true argument in, the gauge will turn on, and if we put false in, it will turn off. And we just refer to the gauge by the name we put in the table. So simple!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now what should we use the gauge for? Let&#039;s keep it simple and just use it to track our score and some other silly info. I&#039;ve populated the mission with a bunch of Amazon Drones and an Amazon Advanced. Their score has been set to 10 points each, except for the big one, which will be worth 500.&lt;br /&gt;
&lt;br /&gt;
[[File:Hudgaugesexp2.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
So in the initial hud activation sexp, we will set up what each line is supposed to say.&lt;br /&gt;
&lt;br /&gt;
[[File:Hudgaugesexp1.png|600px]]&lt;br /&gt;
&lt;br /&gt;
There are four sexps we can use to change the hud gauge text.&lt;br /&gt;
&lt;br /&gt;
===Hud-set-text===&lt;br /&gt;
This is the simplest. Just type in your text here and it will change the hud gauge you&#039;ve referred too. Note you&#039;re only limited to 31 characters here.&lt;br /&gt;
&lt;br /&gt;
===Hud-set-text-num===&lt;br /&gt;
This is quite similar, but only lets you choose a number. You can plug in status sexps that return values with this one.&lt;br /&gt;
&lt;br /&gt;
===Hud-set-message===&lt;br /&gt;
This one will let you choose a message to the gauge. This lets you get around the 31 character limitation with hud-set-text, but it can be easy to make these messages too long! Still these can be easier to edit since you just look for the message in the editor. Also you can use sexp variables just like you can in normal messages with $variablename.&lt;br /&gt;
&lt;br /&gt;
===Hud-set-directive===&lt;br /&gt;
This is kind of a goofy name, but still pretty awesome. The sexp is basically hud-set-text but it gets put through the same directive keypress function so the game will change $keypress$ text to the correctly bound key. So if you put &amp;quot;Press $t$&amp;quot; and someone rebound &amp;quot;select target&amp;quot; to q, then the text would show up as &amp;quot;Press q&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So I will use hud-set-text to make CustomGaugeA say &amp;quot;Current Score&amp;quot;. Then use for CustomGaugeB, I will use hud-set-text-num to relay the player&#039;s ship_score. CustomGaugeC will let us know how long it has been since we last killed a target with &amp;quot;Last kill: $seconds ago&amp;quot;. And CustomGaugeD will let us know which button we use to target ships.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now if we&#039;re feeding changing information into the hud gauges, we should keep in mind that they won&#039;t update by themselves, but they will retain their information between updates. So we can either check to see when we should update or just make them update once a second. We&#039;ll just do the simple thing here and update every second with repeating events.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since only CustomGaugeB and C ever change, we only need to tell the event to change them. The only other thing I do is update the seconds variable which tells us how much time passed since our last kill. And there&#039;s another repeating event that updates the lastkill variable when we kill something.&lt;br /&gt;
&lt;br /&gt;
[[File:Hudgaugesexp3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
So how did we do?&lt;br /&gt;
&lt;br /&gt;
[[file:hud4.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Hey, where&#039;s my 500 points?! I guess this is what I get for not playing on INSANE.&lt;br /&gt;
&lt;br /&gt;
[[http://lazymodders.fsmods.net/files/HudTutorial.rar Here&#039;s a link]] to the mod with the custom hud gauge and mission file.&lt;br /&gt;
&lt;br /&gt;
There&#039;s still a lot I didn&#039;t cover, but after covering these basics, I&#039;m sure you have the ability to do just about anything you would need for your campaigns and missions. The only limit is your imagination!&lt;br /&gt;
&lt;br /&gt;
Happy FREDding!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FRED Examples]][[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
	<entry>
		<id>https://wiki.hard-light.org/index.php?title=File:Hudgaugesexp3.png&amp;diff=43809</id>
		<title>File:Hudgaugesexp3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.hard-light.org/index.php?title=File:Hudgaugesexp3.png&amp;diff=43809"/>
		<updated>2014-05-01T02:43:25Z</updated>

		<summary type="html">&lt;p&gt;Axem: For hud gauge tutorial&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For hud gauge tutorial&lt;/div&gt;</summary>
		<author><name>Axem</name></author>
	</entry>
</feed>