SCRIPTING 101

Now for a little bit of scripting; let’s have the markers be disabled initially and then have them enabled by an event.

Scripting in UnrealEd is pretty easy because it’s mostly just logic based; unlike other games where you have to learn an actual language with the proper syntax, etc, with UnrealEd you just have to focus on the logic of the script.

First we’re going to need a “Trigger” which will create an event, and a “ScriptedTrigger” which we’ll place all the lines of script in.

 

Next let’s setup the Trigger. Open it’s properties, find the heading “Collision”, and subheading “CollisionRadius” and up it to about 128. When whatever object the trigger is set to respond to (default is the player - see the "Trigger" heading in the screen below) enters this radius it was cause the trigger to activate.

Next find “Events” and under the subheading “Event” create a name for the event that will be created. We're going to use "enableMarkers". Names should be clear, easy to write (very important to avoid typos and frustration!) and easy to remember as well as unique to avoid problems.

 

Now setup the ScriptedTrigger. Under the heading “AIScript” is where all the actions will be placed. Click the “Actions” subheading, then “add” to add a new event. Then scroll through the list to find what you want. We're looking for “WaitForEvent” and the event is the event we created in the trigger, which is “enableMarkers”.

Then we’re going to “TriggerEvent” “snipeMarker” and "TriggerEvent" “grenMarker” which are the name we're going to give the squad markers in just a minute!

 

So with that out of the way double click the sniper marker and under the “Events” heading find “Tag” and here is where we name the marker to “snipeMarker” then under the “Object” heading set the “InitialState” to “Disabled

Now do the same for the grenade marker.

 

Finally open up the “Player Start” properties and under “Events” and the “Event” subheading give it an event to create when the level loads called “levelstart”. This can be used to initialize all other events in the map since the player start has to be used when the player enters the map.

We’re not using this specifically right now, but we will later, and you COULD use it to set the markers to disabled instead of changing their object properties. Basically if you’re doing any scripting it’s best to set it up so you have it to use.

 

That’s it!