Build A Mission V2.2f
Created by aimless

Installation:
1st Script hook V
http://www.dev-c.com/gtav/scripthookv/
install Script hook v 
you will have dinput8.dll and ScriptHookV.dll in your gta v folder

2nd Script Hook V .NET
download
https://github.com/crosire/scripthookvdotnet/releases (v2.6.2)
install Script Hook V .NET 
you will have ScriptHookVDotNet.asi ,ScriptHookVDotNet.dll in your gta v folder
You need Microsoft .NET Framework 4.6 and Visual C++ Redistributable Packages for Visual Studio 2013 (x64)
Follow install instructions here.
https://www.gta5-mods.com/tools/scripthookv-net

3rd 
make a scripts folder in your gta v folder
if you already have one skip this step

4th
Place BAM.dll NativeUI.dll and bam folder into your scripts flolder.
You can get NativeUI.dll http://gtaforums.com/topic/809284-net-nativeui/

5th Make sure to run gtaV as admin
Right click your gtav folder and set to run as administator for all subfolders.

Usage; 
Note: Gamepad highly recommended. If using key and mouse mouse buttons are buggy
Keys
Key: H to open menu 
Key: Esc/back to close menu/go back to previous menu
Key: up to move up in menu
Key: down to move down in menu
Keys: left right to navigate lists in menu
Key: Enter to select
Keys: numpad 7 and 9 to rotate
Keys: numpad 4 and 6 to move placement marker left and right
Keys: numpad 2 and 8 to move placement marker closer and further 
Key: numpad 5 to reset marker psition
Key: U toggle placement view Walk on ground / free mode
Key: I Move up when in placement mode 2  (free mode)
Key: K Move down when in placement mode 2  (free mode)
W/A/S/D Move slow forward left backward right   (free mode)
Shift/MouseLeftButton Fast Move forward only when up in air (free mode)
Ctrl Fast Move backward only when up in air (free mode)

Note: There is a bug when placing items if you press the R Key the placement marker will disapear!
Note: The following keys can be changed in the Keys.txt
openmenu
rotateL
rotateR
placementmarkerleft
placementmarkerright
placementmarkerback
placementmarkeraway
resetmarker
placementtoggle
placementhight+
placementhight-

Controler:
buttons
button: B to close menu/go back to previous menu
button: dpad up to move up in menu
button: dpad down to move down in menu
button: dpad left right to navigate lists in menu
button: A to select
button: left right trigers to rotate
button: left right bumpers to move placement marker left and right
button: L3 and R3  to move placement marker closer and further 
mode 2 (free mode) right stick up/down adjust hight (When hight is low to ground movement is slowed down)


Playing missions:
1st Type the name of the mission into the Title button
2nd Select Test Mission
Notes: You can stop a mission by selecting clear mission/end test mission.
             You can select installed missions to Start a mission. 
             Newly made missions will only be avalible after the mod is reloaded by pressing insert. (make sure load all missions in unchecked when reloading scripts)


Building a Mission Basic:

The simplest mission you can make will have starpoint and one objective checkpoint. 
1st Enter a Title name. Bug Warning The title can not contain more the 30 characters or contain a period.(If it does the menu will not open until that mission is removed) 
Author and Description are optional. Bug Warning if not set last mission played or loaded Author/Description will be used. 
2nd place a startpoint. 
3rd place a checkpoint enter checkpoint 1. 
4th save. 
5th clear. 
6th test. 
7th startpoint appears walk into it. 
8th checkpoint appears walk into it. mission complete. 


Building a Mission Advanced:

1st Enter a Title name. Bug Warning The title can not contain more the 30 characters or contain a period.(If it does the menu will not open untill that mission is removed)
      Author and Description are optional. Bug Warning if not set last mission played or loaded will be used.

2nd Mission Details
Set cash reward amount for mission compete.
Set Maximum Wanted level.
Set Weather.
Note: time of day does not change when mission starts.

3rd Place a startpoint
Select placement/objectives/add startpoint to place a startpoint.
Note: only last placed objectives can be deleted but not the startpoint.
Note2: if you want to change the startpoint position of an existing mission.
            make sure that the mission is cleared.
            place a new startpoint then load the mission and save.
            this will over write the old posiotion with the new one.

4th Place Objectives.

4a: Checkpoint
Select wanted level change.
Note:Will not overide max wanted level in mission settings. I.E. max wanted level must be over 0.
After placing a checkpoint a textbox will open.
Enter your objective text.

4b: Kill Actor
Select wanted level change.
Note:Will not overide max wanted level in mission settings. I.E. max wanted level must be over 0.
Select a Actor
Select a Wepon
Select a Task
(Optional) Kill All Enemys  (When selected any enemys spawned in the previouse objective will have to be killed to complete the objective)
(Optional) Has Pickup if selected Actor will drop a pickup opon death. You will need to recover it to pass the objective. Select a pickup model and enter pickup text.
After placing a Kill Actor a textbox will open.
Enter your objective text.

4c: Destroy Vehicles
Select wanted level change.
Note:Will not overide max wanted level in mission settings. I.E. max wanted level must be over 0.
Select Group Number.
All Vehicles "marked" with the same group number as the objective group number will have to be destroyed to complete the objective.
You must have at least one vehicle with the same group number as the objective group number and spawn on or before this objective.
You can use marked vehicles for more than one objective.
Enter your objective text.

4d: Get In Vehicles
Select wanted level change.
Note:Will not overide max wanted level in mission settings. I.E. max wanted level must be over 0.
Select Group Number.
Any Vehicles marked with the same group number as the objective group number can be entered to complete the objective.
You must have at least one vehicle with the same group number as the objective group number and spawn on or before this objective.
You can use marked vehicles for more than one objective.
Enter your objective text.

4e: Lose Wanted level
After placing a VehicleGet a textbox will open.
Enter your objective text.

5th Add your Props Actors Vehicles and Pickups
Each item set Actors Vehicles Props and Pickups have a seperate list for each objective.
1st Select the objective number you want the item to spawn on.
Note: The startpoint is objective 0
Note: If you have a Kill Actor objective for objective 1 and you want them to have other actors near them you will need to set them to objective 0.
if you set them to objective 1 they wont spawn until you kill objective actor 1.
For Actors
Select a Actor
Select a Wepon
Select Friend/Enemy/Bodyguards (Friends and Enemys will fight each other)(Bodyguards will fallow you)
For Bodyguards use task 0 seat position does not matter.
Select a Task
Select a Seat position if using task enter vehicle.
Bug Warning if you set more than one actor Friends or Enemys to the same seat position in the same vehicle it will crash.

6th continue to add objectives and items

7th Cutscenes
Cutscenes are played at the start of an objective.
To add a cutscene at the beginning of a mission select objective 0.
Set cutscene point duration.(sets time in seconds)
Select add cutscene point. A cam prop will be placed to represent a cam point. Enter text.
You can place up to 10 points for each cutscene.
Warning your character will be defenceless during cutscenes.

When your done.
save
clear mission
test

Editing:
Only last placed objectives can be deleted but not the startpoint.

To edit Actors 
1st Select edit actors
2nd Select objective number. If the objective has actors the count will be displayed on the bottom of the screen.
And all actors for that objective will have a red marker.  
Warning Select Actor To Edit/Delete number must not be greater than actor count -1 or the markers will not display.
3rd Select Actor To Edit/Delete 0- 30
The selected actor selected will display some attributes above them. Press enter to delete. Or select an attribute to change.

Edit Vehicles the same way as Actors.

Tips:
1: The editing funtions are very limited for props and pickups.
You can only delete the last placed item from the selected objective list.
Example if you want to delete prop 3 from objective 1 
and objective 1 has 10 props
you will have to delete 10,9,8,7,6,5,4,3 
then replace 4,5,6,7,8,9,10

2: While building a mission building it in steps may be your best option.
Example: Place a startpoint
Place objective 1
Place objective 1 items (spawn on 0).
Enter 1 for a title
Save

Then Place objective 2
Place objective 2 items (spawn on 1)
Enter 2 for a title
Save

This method will allow you to test each objective and if you make a mistake or it dosent work you can load the previous objective and only loose the last objective.

3: You can add colors to your objective text.
Navigate to your missions folder scripts/bam/missions and the title of your mission
open Objevtives.txt with notepad
and find the line with the objective text.
Example: Objectives[1]Text = Go to the Cemitary.
Change to  ~g~Go~w~ to the ~y~Cemitary.
Will display Go as green to the as white and Cemitary. as yellow

~r~ = Red
~b~ = Blue
~g~ = Green
~y~ = Yellow
~p~ = Purple
~o~ = Orange
~c~ = Grey
~m~ = Darker Grey
~u~ = Black
~n~ = New Line
~s~ = Default White
~w~ = White
~h~ = Bold Text

Known bugs:
Sometimes spawns more than one item.
You cant name a title whith a period at the end or contain more than 30 characters it will crash when saving and wont reload the munu until the mission is deleted from the mission folder!

Troubleshooting:
1st make shure you have the proper .net framework and c runtimes for Script hook and Script hook.net.
2nd Make shure you have administrator rights for your gta folder and all its sub folders.

2.2f
Added some missing weapons.
Added set Time of day.
Added stunt props.
Changed min max health and armor to 0-1000.
Updated to Script Hook V .NET v2.9.2

2.2e
Added more contact icons for txt notifications.

2.2d
Fixed bugs when loading and saving pickups.

2.2c
Fixed kill all actors not working on objectives 2-20.
Changed guard position task for actor objective not to stand and do nothig.

2.2b
Changed to not set weather in director mode.
Changed To use a, w, s ,d keys when in placement free mode.
This is the last update.

2.2a
Fixed a bug that would crash if using director mode.
Note: when using director mode you can not use the free mode.
Added option to enter objective text for the startpoint.
Updated to Script Hook V .NET v2.9.2

Changelog
2.2
Changed to clear most peds and vehicles, freeze time, and turn off all alarms when making a new or loading an existing mission to edit.
Added free mode.
Key: U toggle placement view Walk on ground / free mode
Key: I Move up when in placement mode 2  (free mode)
Key: K Move down when in placement mode 2  (free mode)
W/A/S/D Move slow forward left backward right   (free mode)
Shift/MouseLeftButton Fast Move forward only when up in air (free mode)
Ctrl Fast Move backward only when up in air (free mode)
Extended componant variation list to 138.
Changed telleport to not fall threw the ground.
Added blips when placing/loading most items.
Corrected actor objective tasks to display task seq 15-19 insead of 9-13.
Fixed some bugs if using a keyboard some things that were displayed would not go away when backing out of the menu.
Added mission demo10
Updated to Script Hook V .NET v2.8

2.1a
Changed trailers to automatically attach to vehicles.

2.1
Added Ambient Music
Added Text Messages
Added Load All Missions Option this will load a blip for each installed mission and they can be started by going to the marker.
Added check to see if a task sequence exists when set for an actor to stop it from crashing if no sequence exists.
Changed deliver vehicle to allow use of more than one vehicle in a group. Note the gps route was removed. Use get in vehicle then deliver vehicle if you want a gps route.
Simplifided the Objective check to a single funtion getting rid of of redundent code. This will speed things up when loading.
Updated to Script Hook V .NET v2.7

2.0
Added Play Random Mission
Added Task Sequences
Fixed a bug were objective actor could not be targeted.
Updated to Script Hook V .NET v2.6.2

1.9e
Changed check objectives to not hang and crash.

1.9d
Updated edit actors/vehicles.
Added waypoints.
Added tasks walk, jog, run, drive and fly heli to waypoint.
Added list of all objectives displayed when any objective menu is open.
Changed cutscene cam interp.
Some other bugfixes.

1.9c
Finnished Component Variations.

1.9b
Targeted the wrong version of .net in 1.9a

1.9a
Added LoadAllObjectives to Keys.txt 
Set to 0 to load objectives 1-20 at start and set to 1 to load 1-10.
Use 1 if you get a [ERROR] Script 'buildamission' is not responding! Aborting ... followed by
at buildamission.LoadObjective18() or another number
If 1 is used you will notice pause after objective 10 while loading 11-20.
Fixed crashing when using a model other than main characters after dead.
Added buttons for Component Variations Note: components do not save to be finnished later.

1.9
Changed maximum objectives per mission from 10 to 20.
Add vehicle objectives collect and deliver Trailer, with Tow Truck, with Cargobob.
Added collect and deliver Container with Cargobob.
Added Cargobob Props for use with collect and deliver Container with Cargobob.
Fixed some bugs that would crash while saving and loading.
Changed vehicle heath meter to time bar style from NativeUI.
Edit actors and vehicles only works for objectives 0-9 to be finnished later.

1.8h
Added Objective Pickup

1.8g
Added Scenarios List
Added Task 13:START SCENARIO IN PLACE
Added Can Exit Vehicle To Actors
Updated to NaiveUI 1.6.1
Still Using scripthookvdotnet-2.4

1.8f
Fixed a bugs with AI.

1.8e
Fixed a bug with AI.

1.8d
Fixed a bug with AI.

1.8c
Added Range To GoTo Actor and Deliver Actor.
Fixed a bug when setting wanted level to 3.
Changed gaurd position debug sphere to 1/2 size.

1.8b
Added Change To Respect And Set To Wander To Deliver Actor Objective.
Fixed a bug that actors would not fly heli.
Fixed a bug when rotating items with keys.
Added change and set max wanted level for objectives.
Some small bugfixes.

1.8a
Added the following Actor Settings: 
Relationship Respect: Actors set to respect wont fight against your player, friends, bodyguards, or enemies.
Group Numbers to assign actors for objectives.
Guard/Wander range to be used with GuardCurrentPosition and WanderAround.
Can Leave Guard Range to be used with GuardCurrentPosition.
Vehicle Fallow Distance to be used with Vehicle Fallow. You can set multiple  actors at different distances to create a convoy behind your player.
Added Seeing Range and Hearing range.
Added GoTo Actor Objective you can only use one actor per objective.(Use actors set to respect for rescue missions. And select change to bodyguard to use diliver actor next objective.)
Added Deliver Actor Objective you can only use one actor per objective.(Use with bodyguards so they will fallow.)
Added Enable Director Mode checkbox to main menu. (Must enable before using director mode.)

1.8
Added DeliverVehicle
Added Cutscenes
Cutscenes are played at the start of an objective.
To add a cutscene at the beginning of a mission select objective 0.
Set cutscene point duration.(sets time in seconds)
Select add cutscene point. A cam prop will be placed to represent a cam point. Enter text.
You can place up to 10 points for each cutscene.
Warning your character will be defenceless during cutscenes.

1.7c
Added Health Armour Invincible to actors
Bugfixes

1.7b
Added loadblipnames to keys.txt. 

1.7a
Fixed a bug with lose wanted level looping to the last objective.

1.7
Removed mission flag so you can save your game after a mission. And you can see non mission enemy blips.
Because the mission flag was removed you will need to set your phone profile setings to sleep before running a mission.
Or else you will loose gps blip routes and frieds/bodygurds may turn on you.
Added IgnoredByEveryone and IgnoredByPolice set to false at start of mission and end to combat a bug where mission and non mission enemeys 
would stop fighting against your character.
Added wanted level change to all objectives.(Will not overide max wanted level set in mission settings. Max wanted level must be over 0 to take efect.)
Added Lose wanted level objective.

1.6b
Fixed a bug with enemys not shooting in some situations.
Fixed a bug with the wanted level.

1.6a
Fixed a bug that actors would not enter and flee in a plane.
Added edit Default/Random Variation for Actors.
Added Group numbers to "mark" Vehicles.
Vehicles marked with a number other then 0 can be used for objectives and spawn on any objective on or before that objective.
Added Destroy Vehicles and Get In Vehicles Objectives. These will replace Get Vehicle and Destroy Vehicle.

1.6
Added edit actors and edit vehicles

1.5
Added Default/Random Componant_Variation for Actors
Added Pickups option for Actor objective.
Added Kill All Enemies to Actor objective. (When selected any enemies spawned in the previous objective will have to be killed to complete the objective)
Changed Enemy Blips to show on minimap only after engaged in combat.

1.4a
Fixed a bug actors would not attack player.
Added separate lists for Main Characters, Cops/Gov., Gangs, Animals, and Random Actors.

1.4
Addes bodyguards to relationships
Added task 7 HELI PROTECT
some  buggfixes mostly to the tasks and relationships

Changelog
1.3 
Added a funtion to detect if your computer is using , or . as a decimal seperator and replaces them acordingly.(now you can use missions created whith ether , or .)
Note: For this funtion to work properly you should load and save any missions you have made to update them. (please backup your missions before doing this)
Added mission faild screen
Added destination option for get vehicle
Added health meter for get vehicle if the health of the vehicle drops to 0 before you get or deliver the mission will fail.
Added Installed Missions button to start missions whithout having to type the title.
Note: If you add or create more missions you will have to restart the mod before they will showup.
Added ped models to actor/actor objective lists this should be a complete list now
Fixed a problem where the placement marker would not hide if using a keyboard.
Changed continue button to jump x/tab.
Changed seat positions to Driver, Passenger, left back, right back, seat outside left, seat outside right, LeftRear, RightRear
Note: this will effect missions you already made.
Some other small changes.

1.2 
update for Script hook V Script Hook V .NET you may need to reinstall 
Visual C++ Redistributable Packages for Visual Studio 2013
added Keys.txt to set key bindings.
added Halloween & Lowrider vehicles.

1.1
fixed a problem with the vehicles selection.
some other minor fixes.

1.0 initial relese

Credits:
Alexander Blade/SCRIPT HOOK SDK Link http://dev-c.com/gtav/scripthookv/
Crosire/Contibuters ScriptHookVDotNet Link https://github.com/crosire/scripthookvdotnet/releases
Metiri/GTA V Scripting Video Tutorials Link https://www.youtube.com/channel/UCMdBeKmopZBdd3-1n5lOjhA
Guadmaz/NativeUI Library Link https://www.gta5-mods.com/users/Guadmaz
Guadmaz/Sourcecode from His mods: display text and rectangles to screen(Mission Passed Screen) display text at 3d cords(Start point) time bars (vehicle health)
GostRolly/Sourcecode from The Red House:Add Blips, Blip SPRITE, Blip ROUTE Link https://www.gta5-mods.com/users/Ghost_Rolly
ardaozkal/Sourcecode Menu: GetUserInput/Spawn Pickups Link https://www.gta5-mods.com/users/ardaozkal
jedijosh920/Helpfull Functions Input Text cam interpolation Links https://www.gta5-mods.com/users/jedijosh920   http://gtaforums.com/topic/820813-displaying-help-text/
ISOFX/NativeUI Tutorials Link http://gtaforums.com/topic/818081-nativeui-tutorials/
Konijima/SOUND_FRONTEND [Research]: Play Sounds Link http://gtaforums.com/topic/814173-sound-frontend-research/
bilago/Naming Blips Link http://gtaforums.com/topic/811169-net-how-to-rename-a-blip/
houri.s and MoMadenU/Controler Input 
GeorgeZhang Explanation of group/relationship groups http://gtaforums.com/topic/814647-calling-all-critters/?hl=relationshipgroup
Amey.Banaye Change Ped's clothes
Eddlm driving styles
Kryptus Notification with image (text messages)