The Driver Syndicate/Scripting/Mission Scripting: Difference between revisions

From Equilibrium Engine Wiki
Jump to navigation Jump to search
Line 12: Line 12:
You can check "GameData\scripts\missions\minigame" for reference
You can check "GameData\scripts\missions\minigame" for reference


* [[The Driver Syndicate/Scripting/Mission Scripting/Checkpoint|Checkpoint]]
* [[The Driver Syndicate/Scripting/Mission Scripting/Minigames/Checkpoint|Checkpoint]]
* [[The Driver Syndicate/Scripting/Mission Scripting/Gates|Gates]]
* [[The Driver Syndicate/Scripting/Mission Scripting/Minigames/Gates|Gates]]
* [[The Driver Syndicate/Scripting/Mission Scripting/Getaway|Getaway]]
* [[The Driver Syndicate/Scripting/Mission Scripting/Minigames/Getaway|Getaway]]
* [[The Driver Syndicate/Scripting/Mission Scripting/Pursuit|Pursuit]]
* [[The Driver Syndicate/Scripting/Mission Scripting/Pursuit|Pursuit]]
* [[The Driver Syndicate/Scripting/Mission Scripting/Survival|Survival]]
* [[The Driver Syndicate/Scripting/Mission Scripting/Minigames/Survival|Survival]]
* [[The Driver Syndicate/Scripting/Mission Scripting/Trailblazer|Trailblazer]]
* [[The Driver Syndicate/Scripting/Mission Scripting/Minigames/Trailblazer|Trailblazer]]


=== Checkpoint ===
=== Checkpoint ===

Revision as of 13:41, 25 January 2025

Overview

There are almost endless possibilities to create missions. As an example you can look at the default missions (located in: GameData\scripts\missions\story_demo)

For creating and testing missions and minigames usa always Release.exe!

Missions

This will be a big chapter. That's why there's a separate page for it.

See here: Creating Missions

Minigames

You can check "GameData\scripts\missions\minigame" for reference

Checkpoint

ToDo:

--//////////////////////////////////////////////////////////////////////////////////
--// Copyright � Inspiration Byte
--// 2009-2017
--//////////////////////////////////////////////////////////////////////////////////

--------------------------------------------------------------------------------
-- Mission script for checkpoints
--------------------------------------------------------------------------------
-- By Shurumov Ilya
-- 11 Mar 2015
--------------------------------------------------------------------------------

world:SetLevelName("default") -- set levelname here
world:SetEnvironmentName("dusk_clear") -- set weather here

MISSION.MusicScript = "rio_night" -- set music here
MISSION.Hud = CheckpointGame.Hud

----------------------------------------------------------------------------------------------
-- Mission initialization
----------------------------------------------------------------------------------------------

function MISSION.Init()
	local playerCar = gameses:CreateCar("mustang", CAR_TYPE_NORMAL) -- set car here

	playerCar:SetOrigin( Vector3D.new(58.50, 0.53, -126.01) ) -- set starting coordinates here
	playerCar:SetAngles( Vector3D.new(-0.17, 0.60, -0.00) ) -- set starting direction here
	playerCar:Spawn()
	playerCar:SetColorScheme( 3 )
	
	gameses:SetPlayerCar( playerCar )
	
	-- init game mode
	-- set checkpoints below
	local checkpoints = {
		{Vector3D.new(-64, 0.54, 33.28), 10 },
		{Vector3D.new(95.68, 3.14, 340.6), 15 },
		{Vector3D.new(95.12,4.63,551.8), 10 },
		{Vector3D.new(340.25, 15.13, 499.15), 10 },
		{Vector3D.new(598.41, 0.64, 400.8), 15 },
		{Vector3D.new(390.01,4.64,437.59), 0 },
	}
	
	CheckpointGame.Init( checkpoints, false )
end

Gates

These ara simple to create:

  1. Start Freeride mode on the level you want to create the minigame.
  2. Drive to your desired starting point. Open the console with the key below escape key.
  3. Then type "trailbrazer_gates_record" and press enter and drive your route. when the counter reaches 100 the script is saved in "GameData/trailblazer_generated.txt".
  4. Now you can rename the file as you desire and move it into "scripts\trailblazer\gates" of your mod/Addon. (remember the filename for next step)
  5. In "scripts\missions\minigame\gates" you need a .lua file with following content:
--//////////////////////////////////////////////////////////////////////////////////
--// Copyright � Inspiration Byte
--// 2009-2017
--//////////////////////////////////////////////////////////////////////////////////

--------------------------------------------------------------------------------
-- Mission script for trail blazer/gates
--------------------------------------------------------------------------------
-- By Shurumov Ilya
-- 11 Sep 2018
--------------------------------------------------------------------------------

world:SetLevelName("default") --set levelname here
world:SetEnvironmentName("dawn_clear") --set weather here

MISSION.MusicScript = "nyc_day" -- set music here
MISSION.Hud = TrailblazerGame.GatesHud

----------------------------------------------------------------------------------------------
-- Mission initialization
----------------------------------------------------------------------------------------------

function MISSION.Init()
	local playerCar = gameses:CreateCar("mustang_f", CAR_TYPE_NORMAL) --set car here
	playerCar:Spawn()
	playerCar:SetColorScheme( 2 )
	gameses:SetPlayerCar( playerCar )

	-- init game mode
	TrailblazerGame.Init( "gates/gt01", true ) -- replace gt01 with your filename (point 5)
end

After this you only need to add the minigame in your ModInit file

(this needs to be described in more detail here)

Also see The Driver Syndicate/Addon System

Getaway

ToDo:

--//////////////////////////////////////////////////////////////////////////////////
--// Copyright � Inspiration Byte
--// 2009-2015
--//////////////////////////////////////////////////////////////////////////////////

--------------------------------------------------------------------------------
-- Cop test script
--------------------------------------------------------------------------------

world:SetLevelName("default") -- set levelname here
world:SetEnvironmentName("dusk_night_transition") -- set weather and daytime here

----------------------------------------------------------------------------------------------
-- Mission initialization
----------------------------------------------------------------------------------------------

MISSION.MusicScript = "vegas_day" -- set music here
	
MISSION.Init = function()
		
	local GameProps = {
		CopCarName = "cop_regis", -- set cop car here
		CopPosition = Vector3D.new(194.96,0.31,124.11), --set cop starting point here
		CopAngles = Vector3D.new(0, 90, 0), --set cop starting direction here
		Timeout = 98
	}
		
	-- car name		maxdamage	pos ang
	local playerCar = gameses:CreateCar("challenger", CAR_TYPE_NORMAL) -- set player car here

	playerCar:SetOrigin( Vector3D.new(134.96,0.31,124.11) ) --set player starting point here
	playerCar:SetAngles( Vector3D.new(0,90,0) ) --set player starting point here
	playerCar:Spawn()
	playerCar:SetColorScheme(2)
	
	gameses:SetPlayerCar( playerCar )
	
	GetawayGame.Init(GameProps)

end

Pursuit

ToDo:

Survival

ToDo:

--//////////////////////////////////////////////////////////////////////////////////
--// Copyright � Inspiration Byte
--// 2009-2015
--//////////////////////////////////////////////////////////////////////////////////

--------------------------------------------------------------------------------
-- Cop test script
--------------------------------------------------------------------------------

world:SetLevelName("default")
world:SetEnvironmentName("dusk_overcast")

----------------------------------------------------------------------------------------------
-- Mission initialization
----------------------------------------------------------------------------------------------

MISSION.MusicScript = "rio_day" --set music here

MISSION.Init = function()

	-- car name		maxdamage	pos ang
	local playerCar = gameses:CreateCar("mustang_f", CAR_TYPE_NORMAL) --set car here

	playerCar:SetOrigin( Vector3D.new(41.44, 0.48, 107.64) ) --set starting coordinates here
	playerCar:SetAngles( Vector3D.new(0, -90, 0) ) --set starting direction here
	playerCar:SetColorScheme(3)
	playerCar:Spawn()

	gameses:SetPlayerCar( playerCar )
	
	SurvivalGame.Init( 8 )
end

--------------------------------------------------------------------------------

Trailblazer

Similar to Gates...

ToDo: