Mission Object Set Up: Difference between revisions

From Off Grid Wiki
Jump to navigation Jump to search
No edit summary
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
== What's Required for a Hackable Object ==
[[File:HackableObject.PNG|200px|thumb|left|fig 0.1]]


Hackable Objects require either Lights, a Screen, or both. These need to be separate objects so the Materials can be switched around to show whether the Object has been Hacked or not.
==Choose a Mesh==


If a Hackable Object has a screen it needs to conform to either a 4x3 or 16x9 ratio. 4x3 is slightly more square and 16x9 is more rectangular.
Take a prop that is going to represent your hack-able object and place it in your scene.


<br /><br /><br /><br /><br />
It can be anything really, but to to make full use of the options available either:
* Choose from the Hackable Devices Collection scene in LevelKit.
[[File:HackableObject-Collection.png|400px|thumb|none|The scene to pick hackable objects from]]
* Piece your own together from pre-made models and parts of models in the LevelKit>Models>Props>Devices and it's sub-folder 'ModularTechParts'
* or follow this guide to [[Modeling your own Hackable Devices]]


[[File:4x3 Guide.png|200px|thumb|left|4x3 Guide]]
==Add the Hackable component==


[[File:16x9 Guide.png|200px|thumb|left|16x9 Guide]]
Decide how you want it too behave in it's different states, as explained on the [[Devices]] page.
<br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br />


== How to create a Screen for a Hackable Object ==
Eg.
Amok() sets of a sparks particle effect
RunOnce() spits out a sheet of paper


Blender is used for this tutorial. The Model for this Fuse Box is already finished, it requires a screen.
Create the corresponding effects, animations or behaviousts you want and connect them to the corresponding Unity Events in the Hackable component
<br />
[[File:HackerScreen_01.PNG|300px|thumb|left|Step 1]] <br />Create a Plane.
Change the Scale of the plane to 16x9 (this will seem very big)
<br /><br /><br /><br /><br /><br /><br /><br />


[[File:HackerScreen 02.png|300px|thumb|left|Step 2]] <br />Apply the Scale to the Plane.
==Add the MissionObject component==
<br /><br /><br /><br /><br /><br /><br /><br />


[[File:HackerScreen 03.png|300px|thumb|left|Step 3]] <br />In Edit Mode; UV Unwrap the Plane.
This is explained in more depth in the [[Mission Objects]] page, but essentially in this example we just need to add the MissionObject component and set it to 'Hackable'.
<br /><br /><br /><br /><br /><br /><br /><br />


[[File:HackerScreen_04.PNG|300px|thumb|left|Step 4]] <br />Apply a texture to the Plane to check the UV placement.
==Setup a Lua Device Script==
<br /><br /><br /><br /><br /><br /><br />
Follow this guide to [[Device Scripting]] to create a device script and set up the devices buttons to call the functions you setup in the 'Hackable' component.


[[File:HackerScreen 05.PNG|300px|thumb|left|Step 5]] <br /> Scale down the Plane and place it where you want the Screen to be.
Or even call anything else from the [[:Category:LuaAPI|Lua Apis]].
You might need to adjust your geometry for the Plane to fit. Don't change the shape of the Plane as this will distort the UVs.
<br /><br /><br /><br /><br /><br /><br />


[[File:HackerScreen 06.PNG|300px|thumb|left|Step 6]] <br />Make sure that the Screen has a unique Material name. Then this is ready to export.
==Add to your mission script and connect to networks==
<br /><br /><br /><br /><br /><br /><br /><br />
 
[[Category:Modding]]
* [[Mission Scripting#Devices|Setup the device]] and point is to your Device Script as explained above
* [[Mission Scripting#Adding in Hackable Devices|Add the device]]
* [[Mission Scripting#Connect Devices to the Network|Connect the device to a Network]]

Revision as of 16:17, 14 December 2018

Choose a Mesh

Take a prop that is going to represent your hack-able object and place it in your scene.

It can be anything really, but to to make full use of the options available either:

  • Choose from the Hackable Devices Collection scene in LevelKit.
The scene to pick hackable objects from
  • Piece your own together from pre-made models and parts of models in the LevelKit>Models>Props>Devices and it's sub-folder 'ModularTechParts'
  • or follow this guide to Modeling your own Hackable Devices

Add the Hackable component

Decide how you want it too behave in it's different states, as explained on the Devices page.

Eg. Amok() sets of a sparks particle effect RunOnce() spits out a sheet of paper

Create the corresponding effects, animations or behaviousts you want and connect them to the corresponding Unity Events in the Hackable component

Add the MissionObject component

This is explained in more depth in the Mission Objects page, but essentially in this example we just need to add the MissionObject component and set it to 'Hackable'.

Setup a Lua Device Script

Follow this guide to Device Scripting to create a device script and set up the devices buttons to call the functions you setup in the 'Hackable' component.

Or even call anything else from the Lua Apis.

Add to your mission script and connect to networks