Just to give you a basic idea of what "Triggerables" are, they are basically mapper setup triggers that can get objects like a door or something to move when a player activates them. For exsample the tunnel door on OGT is a trigger able.
So what I want to do here is to get this switch panel here:
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/1_tn.jpg)
(click to enlarge, like alot of the pics below)
To open these missile covers here:
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/2_tn.jpg)
Like so:
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/3_tn.jpg)
So the first thing you will want to do is setup your statics like I've done here, with even the object you want to have moving as a static for now, even thou we will be deleting it later.
Now I only have one moving object for this trigger, the hatches, even thou they may appear to be 4 objects they are in fact just 1 object which makes things easier for me, thou if they where separate objects I could give them very slightly diffrent delays which would make them look a little cooler, but no one will notice with them being all about 50m or more apart
![Razz :p](./images/smilies/imported_icon_razz.gif)
Now what you need to do is place your moving object where you want it to "start" as such at the begging of the game in its exact spot. Once you have it in that position, give it a lightmap (preferably a final lightmap as you probaly wont want to lightmap it again as you will have to set it up as a static etc, its possible but best to do it now). Anyways back on track, now that your lightmap is done you will want to clone your moving object into its "secondary" position where it ends up after moving. Best way is to select your "moving" object, hold the "shift" key then select the direction you want to move it in and drag it in that direction to where you want it to end up. This will clone your object as your doing it as we want to keep the start postion for refinance later on
![Smile :)](./images/smilies/icon_e_smile.gif)
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/4_tn.jpg)
now this may look abit odd but you will see later, its all for position ref and its how I work, thou you can do this in w/e way you want thou for now, best to stick to my way
![Smile :)](./images/smilies/icon_e_smile.gif)
Anyways once you have it setup like that, give your map a quick save, then go to your button.
Now you dont have to have your button/switch as a "static" but I always do as its easier to apply its lightmaps etc (you can give your triggerable button a geom).
So ye, to make your "Triggerable", right click on your map where abouts you want it, and click on "Create Triggerable".
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/5.jpg)
A window will popup asking for you to give it a name, with the default name of "Triggerable_" being there. Best to keep this begging bit, and then just add your name after it, so I'm going to call mine "Triggerable_MS_MissileCoversButton" with "MS" Standing for Missile Silo so I know what sort of area on the map it is when looking at the code, thou you can really name it bob and it will still work thou I wouldn't advise it
![Razz :p](./images/smilies/imported_icon_razz.gif)
This is how your Triggerable should now look like.
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/6_tn.jpg)
As you can see in the left, I have already setup a triggerable door before doing this triggerable on this map so just bare that in mind, ignore it for now I'm just pointing out with the arrow where you can find your triggerables on your map in your Resources bar.
Before I go on, just going to go though the triggerable "Tweaker" settings.
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/7.jpg)
AbsolutePosition = the location of the triggerable
Layer = what layer the triggerable is on
Radius = The radius where the trigger can be triggered
TriggerTypes = not 100% sure but take it that 3 (default) means triggerables, best not to touch this one unless you know what your doing
![Razz :p](./images/smilies/imported_icon_razz.gif)
TriggerId = the ID nubmer of your trigger
Geometry = the geom of your triggerable, best to not have one IMO so leave it blank.
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/8.jpg)
Radius = The radius where the trigger can be triggered (again)
TriggerId = the ID nubmer of your trigger (again)
Events = Events are how you want users to trigger this trigger, the events are 0=none, 1=use, 2=shoot, 3=move, 4=explosion, 5=cp changed.
Chance = the chance that the trigger will be trigged in %, 100 means a 100% chance that the trigger will be trigged when pressed, 0 means no chance, 50 means 50% chance etc, if its a button best to leave it at 100, if its something like shoot, move or explosion then you could lower it down.
AvrageTimeBetweenTests = not sure on this one, done no testing, default is 10 thou.
MinimumTimeBetweenTriggering = time needed untill second trigger to respond
TriggerForEachActivatingPlayer = not sure on this one too.
NotCycledIfOccupied = not sure on this one aswell.
Now back to my trigger, the purple circle represents the radius you can trigger this button in, really I want it to be alot smaller than this so I'm going to tweak down the radius too around 3(meters), apposed to the 5 it is now. Also I'm going to change its events to 1 (use) so players have to press "e" when in the radius to trigger the triggerable. Going to keep all the other settings the same and save up my objects and triggerables before I move on.
Now we have our "Triggerable" setup, we need to move onto making some "TriggerableTargets" which is basically the moving objects. To make one, right click on the map and click on "Crate TriggerableTarget"
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/9.jpg)
A window will popup asking for you to give it a name, with the default start being "TriggerableTarget_", I'm going to call mine "TriggerableTarget_MS_MissileCovers". This at first will just be a blank object with only a bunch of tweaker settings. First I'll go though its settings before I go on.
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/10.jpg)
Layer = what layer the TriggerableTarget is on
AbsolutePosition = the location of The triggerableTarget, and where the object "starts" in its "primary position"
AbsolutePositionSecondary = the Secondary location of the object, ie, where it moves too after it has been triggered (only need to fill this out if your object moves in a transitional form and not rotational)
Rotation = the rotation of the object (also if your object is going to rotate when it moves, this will be its primary/start rotation.
RotationSecondary = the Secondary rotation of the object (only need to fill this out if your object moves in a rotational form and not transitional)
MovementType = How your object moves, movementTypes are 0=transitional, 1=rotational.
MovementSpeed = how fast your object moves/rotates.
DelayBeforeStart = the delay after you trigger the Triggerable before this TriggerableTarget starts moving.
DelayBeforeCycle = If you have your Cycels set to more than 1, then this is the time between each of thous cycels.
DelayBeforeEnd = Aint tested this so not 100% sure on it tbh, best to do your own testing here
![Smile :)](./images/smilies/icon_e_smile.gif)
Cycles = How many times your object will move between the Primary and Secondary locations before coming to a stop at each push of the button.
Geometry = The Geom of the TriggerableTarget, ie, what object you want it to be.
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/11.jpg)
MovementSpeed = how fast your object moves/rotates (again)
MovementType = How your object moves, movementTypes are 0=transitional, 1=rotational (again)
Clockwise = if it moves in a rotational form, then this will tell the object to move clockwise or anticlockwise.
DelayBeforeStart = the delay after you trigger the Triggerable before this TriggerableTarget starts moving. (again)
DelayBeforeCycle = If you have your Cycels set to more than 1, then this is the time between each of thous cycels. (again)
DelayBeforeEnd = Aint tested this so not 100% sure on it tbh, best to do your own testing here (again)
Cycles = How many times your object will move between the Primary and Secondary locations before coming to a stop at each push of the button. (again)
StartingSplinePoint = ehhh for some reason this is the first time I have seen this hehe, ehhh, got to look into this
![Wink ;)](./images/smilies/icon_e_wink.gif)
Anyways back to our TriggerableTarget. Now first I want it to take the form of these Missile Silo Covers so first thing to do is fill out the geom box. The exact object name of this static is "missile_silo_covers" so all you need to do for your TriggerableTarget to have the same geom is to fill out its name (or the name of your object you want) into its Geometry tweaker box:
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/12.jpg)
Then hit enter and its geom will pop up.
Now to get this position of this thing sorted. Select the object in the Secondary position you want for your TriggerableTarget, then right click on it and click on "Copy Transformation"
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/13.jpg)
Then select your TriggerableTarget again, right click on it and click on "Paste Transformation"
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/14.jpg)
This will set your objects position to the exact same spot as the object you copied its transformation from.
With your TriggerableTarget still selected, right click on it and click on "Set Secondary POSITION"
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/15.jpg)
If you now unselect and reselect your object you will notice its "AbsolutePositionSecondary" tweaker box will now be updated.
Now select the object which is in your Primary location (for me, closed) and right click on it, and click on "Copy Transformation"
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/13.jpg)
Then select your TriggerableTarget again, right click on it and click on "Paste Transformation"
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/14.jpg)
Then save up what you have done (both objects and triggerabes) and then close the editor.
Now go to your map's folder in "\mods\*your mod*\levels\*your map*\" then find and open the "TriggerableTemplates.con" with your favorite text editor (like Notepad), I'm going to use the Crimson editor.
This .con contains most of the data on your triggerables, apart from the positions, rotations and stuff like that which is kept in the "Triggerables.con" but dont need to worrie about that now.
Anyways to get your Triggerable to trigger your TriggerableTarget you now need to link them. This I have found can only be done via hand editing this .con file thou there may be a way to do it in the editor, if there is I aint found it. Anyways what you need to do is first locate your Triggerable for a start, it shouldn't be too hard to find as there shouldn't be that much in this file. It should look something like this:
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/16.jpg)
And probaly a good idea to locate your TriggerableTarget at the same time, which should look something like this:
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/17.jpg)
Anyways back to your Triggerable, Just below the "ObjectTemplate.notCycledIfOccupied 0" line of your Triggerable, you will need to add this line of code "ObjectTemplate.addTriggerableTarget " Then after it give it the name of the of your TriggerableTarget, which mine is if you remember "TriggerableTarget_MS_MissileCovers" (you can find the name below where you located your triggerable target earlier just copy and paste it) then it should look something like this:
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/18.jpg)
Also bare in mind, you can have more than one TriggerableTarget attached to a Triggerable.
After you have done that and it looks more or less like it dose to my code above, then you can save it up and load the level editor and your map back up.
Once you have loaded your map back up, fly over to the location of your Triggerable, then delete your static missile covers (or w/e object you used) so you can just see your TriggerableTarget. You should also notice that your TriggerableTarget has some lightmaps applied too it from the lightmaps you generated from the static that was there before. Anyways your TriggerableTarget should be in its Primary (for me, closed) position, and you should always have it in its primary location when saving this file too otherwise you will feck things up. Should look something like this:
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/19_tn.jpg)
Now to test your Triggerable
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
To test it, first select your Triggerable in the resources tab then right click on it, and click on "Test Triggerable"
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/20.jpg)
Then you should see your triggerable work and mine just opened up, yay
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
![Image](http://www.rhinorage.co.uk/images/tut_triggerables/21.jpg)
If it dont then you have done something wrong, and exit your map without saving and go back over this tut.
Then just click on "Test Triggerable" to close it again, like i said befre, NEVER save your triggerables with it in its secondary position as it will feck things up.
Now that your Triggerable moves and is working, good idea to now tweak it so we can get it just right
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Select your TriggerableTarget and lets go though its settings. The speed of it at 1 is for these just right, thou think im going to add a 0.3sec delay before it starts with also adding a 20sec delay before Cycle and bumping up the Cycels to 2 so it opens, then waits 30secs before it closes itself
![Smile :)](./images/smilies/icon_e_smile.gif)
Then give it a quick test to see if its what you want, then keep on tweaking, trial and error mainly till you get it right
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Heres a quick video of it, with the Cycel delay turned down to 5secs so you dont have to wait ages watching blank video
![Razz :p](./images/smilies/imported_icon_razz.gif)
Now from here you can experiment what other things you can do to Triggerables, afew little notes thou:
- cant have "distructible trigger ables", so you cant have for exsample a door that can be destroyed, but also opened via a trigger able
- you can test triggerables in the editor also in player camera mode, by pressing the "e" key when inside the radius
- When a object can be triggered by more than one button, you need to add the line "ObjectTemplate.hasPartner 1" to the code somewhere, aint done much testing on this tbh.
![Smile :)](./images/smilies/icon_e_smile.gif)