Character Types and Prefabs: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
(initial upload)
 
m (small order adjustment)
Line 66: Line 66:
When creating guards you must add:
When creating guards you must add:


* Profile
* Spawn points
* Spawn points
* Patrol route
* Patrol route
* Profile
==== Spawn points ====
To create a spawn point:
* create empty game object
* Add the mission object script to the empty game object
* Select type "Spawn"
[[File:|frame|none|alt=|caption inspectorexample.png]]
==== Patrol route ====
To create a Patrol point:
* create empty game object
* Add the Patrol point script to the empty game object
* Within the Patrol point script component section you can define the maximum and minimum time a guard spends at the particular point.
* Repeat this process for as many points as you require.
[[File:|frame|none|alt=|caption inspectrexample.png]]


==== Profile ====
==== Profile ====
Line 145: Line 163:
     },
     },
</syntaxhighlight>
</syntaxhighlight>
==== Spawn points ====
To create a spawn point:
* create empty game object
* Add the mission object script to the empty game object
* Select type &quot;Spawn&quot;
[[File:|frame|none|alt=|caption inspectorexample.png]]
==== Patrol route ====
To create a Patrol point:
* create empty game object
* Add the Patrol point script to the empty game object
* Within the Patrol point script component section you can define the maximum and minimum time a guard spends at the particular point.
* Repeat this process for as many points as you require.
[[File:|frame|none|alt=|caption inspectrexample.png]]

Revision as of 10:54, 24 October 2017

Characters


Adding characters to your level is important as this will allow you to add other important systems such as conversations which is one way to introduce story elements to your level.

To add characters to your level you must open up the mission script and locate the character table. It should look something like this:

[[File:|frame|none|alt=|caption charactertable.png]]

To add a character in the table you must include the following:

  • name
  • displayName
  • internalName
  • characterType
  • prefab

This would look like the following in code:

-- Character definitions:
	characters = {
		joe = {
			displayName = "Joe Harman",
			internalName = "Joe",
			characterType = "player",
			prefab = "player",
			spawnpoint = "PlayerSpawn",
		},
	},

Note. When the characterType is virtual you do not need to add a prefab or spawn-point.

Character Types and Prefabs

character type prefab name description
enemy bigGuard,hugeGuard,drone All of the guards listed require the character type enemy. These will allow you to add guards to patrol your level.
virtual n/a virtual characters are characters that you won't see in the level but may communicate with the player using via CryptoChat
player player This will allow you to add a playable character to your game.There can only be one per level.
npc Secretary To add the Secretary character will require you add the character type npc

Virtual characters

Once you have created your virtual characters in order to use them within conversations you will have to add them to a network that is shared with the player. By default the mission script includes a mobile network called "Semaeopus4G" to connect other characters to this network you must use the ConnectToNetwork function. For example: Misson.ConnectToNetwork(mission.characters.terrance,mission.networks.Semaeopus4G.name,mission.networks.Semaeopus4G.userAccessKey)

Adding Guards

When creating guards you must add:

  • Spawn points
  • Patrol route
  • Profile

Spawn points

To create a spawn point:

  • create empty game object
  • Add the mission object script to the empty game object
  • Select type "Spawn"

[[File:|frame|none|alt=|caption inspectorexample.png]]

Patrol route

To create a Patrol point:

  • create empty game object
  • Add the Patrol point script to the empty game object
  • Within the Patrol point script component section you can define the maximum and minimum time a guard spends at the particular point.
  • Repeat this process for as many points as you require.

[[File:|frame|none|alt=|caption inspectrexample.png]]

Profile

When creating a guard you can give each one a personal profile, which will effect how each guard communicates and behaves.

This is a basic template and structure you should use:

Character ={

    Motivation = 0.6,
    Sociability = 0.5,
    FavouriteColor = { 1, 0.5586207, 0, 1 },
    Background = {

		FirstName = "THOMAS",

		LastName = "TEMPLATE",

		Nickname = {
			"Tommy",
		},

		DerogetoryName = {
			"Noggin",
		},

		FavouriteSwear = {
			"gosh-darn",
		},

		FavouriteFood = {
			"slice of Wensleydale cheese",
		},

		FavouriteSnack = {
			"Babybell",
		},

		FavouriteDrink = {
			"coffee",
		},

		BestFriend = {
			"Tristan",
		},

		RecipientPetName = {
			"Sweetums",
		},

		SenderPetName = {
			"Hubby",
		},

		FavouriteExclamation = {
			"Golly",
		},

		RandomHashtag = {
		  "#ROFL",
		},

		Mood = {
	    "happy",
		},

		PastEvent = {
		 "ate",
		},

		FutureEvent = {
			 "eat",
		 },
     },
    },