Difference between revisions of "Single Player CCG Kit Manual"

From gamevanilla wiki
Jump to: navigation, search
(How to add a player character)
(How to add a player character)
Line 21: Line 21:
 
We start by creating an empty game object in our scene to hold our player character.
 
We start by creating an empty game object in our scene to hold our player character.
  
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step1.png|200px
+
https://wiki.gamevanilla.com/images/single-player-ccg-kit/manuals/create-player/step1.png
  
 
We name the object for our player, in this example the name is ''FallenHero''. Inside this empty game object we drag our rigged sprite.
 
We name the object for our player, in this example the name is ''FallenHero''. Inside this empty game object we drag our rigged sprite.

Revision as of 01:46, 11 February 2020

How Addressables work in a nutshell

Single-Player CCG Kit uses the Addressable Asset System for dynamically loading its resources. We recommend going over the package documentation to understand the reasoning and benefits of using this system, as opposed to classic Unity systems like the Resources folder.

The kit currently provides two Addressable assets:

  • Wizard (for the player character).
  • Demon (for the enemy character).

As more card effects are developed in future updates, we will provide additional characters with different abilities/AI patterns.

These assets are located in the GameData folder and the Players and Enemies subfolders, respectively.

In order to mark an asset as Addressable, you just need to toggle the Addressable option in the asset's Inspector and provide a name for it. Addressable assets will automatically be added to the Addressable's Default Local Group, so they can be easily accessible by default. Addressable initialization happens in the GameBootstrap script and is done by reference (with the referenced addressable assets being specified in the GameBootstrap's Inspector).

How to add a player character

We start by creating an empty game object in our scene to hold our player character.

step1.png

We name the object for our player, in this example the name is FallenHero. Inside this empty game object we drag our rigged sprite.

step2.png

We click the Edit Collider button on the Box Collider 2D component to adjust the collider to surround our image correctly.

step3.png

step4.png

With our player looking correct, we need to add the appropriate scripts for our player to function. We need to add Convert to Entity, Entity Cache and Player Authoring. For the Convert to Entity component, make sure it is set to Convert And Inject Game Object.

step5.png

Now that we have the player set up, we can make a prefab by simply dragging it into SinglePlayerCCGKit/Prefabs/Characters.

step6.png

Next we need to create a collection of cards for our player. We want to create the Card Library in “SinglePlayerCCGKit>GameData>Collections”. We do this by right clicking in the folder and choosing Create> Single-Player CCG Kit> Card Library. We label it after our player.

step7.png

step8.png

Now we need to fill the deck with some base cards. For this example we’re just adding the existing cards.

step9.png

Now that we have our Prefab, and a deck, we need to create the Character Template. We want to create the Character Template in “SinglePlayerCCGKit>GameData>Players”. We do this by right clicking in the folder and choosing Create> Single-Player CCG Kit>Player. We again label it after our player.

step10.png

step11.png

Now we can use the editor to fill in our Character Template. Choose the FallenHero Player Data as the asset. Choose our FallenHero Prefab for the prefab. Choose our FallenHeroDeck for the deck. And lastly add Actions as you wish.

step12.png

At this point you have a complete player that you can now enter into the Character Template field of the Game Bootstrap. It will now be active in the game!

step13.png

step14.png