A Developer's Resource
&
Co..

ZeredaGames

Let's Play!

Blog

January 23 2019

Posted on 23 February, 2019 at 10:15

While learning about the GooglePlay setup featuers in Unity, i found that i need to build a test build to see if my functions are working correctly, well then i was thinking i need a way to utilize the pre written code for using the PlayStore. The got me thinking i need quests to activate the achievements and goals to reach for those achievements to be received. That way i can utilize the PlayStore Points system and leader board system and make people have competition. Wile figuring that out i decided to created the base work for all the dialogue and quest systems. This part of the pack will be clean and easy to use for developers. Next is editors to create quest lists of quests with goals, that can be loaded from resources at runtime, and minimal inspector editing is required.

 

How it works so far:

 

On the Awake Function a dialogue manager and a Quest manager, both populate the list's based on the quest managers List of folder names. This list you edit in the inspector by filling in each string in an array of the names of the folders found in "/Resources/Quests/QuestTypes/" + ({QuestsFolderNamesByQuestType}/ {QuestName}) and within those folders needs to be a folder called Quests, and one called Dialogue. The editor (When creating new quest) will add a new asset file to both folders for each quest. one for the Quest itself, and the other is the dialogue script for that quest.

 

Also in the awake it checks if that list of names has anything containing within it, and if it is empty do nothing at all, otherwise for each string in the list, fill a list to read from later of all the assets in that folder with that string name. Next it Takes those strings and uses them for a Toolbar style button system. Each string creates a category and each category creates a new button on the tab. now we can change what category of quest we want to view easily later. next with the files that were loaded from the folders it takes all the names of all the quests and adds those to a list to read from later. It then creates 4 lists starting out all as default, but by end of Awake function all 4 are different.

Reason is we need to make sure all data is there and remove what isn't needed after.

The 4 lists are ListAsset of Quest lists,

-1 for all quests (Default reference for resetting a quest),

-2 for creating a locked quest list (Completed and locked for w/e reason (Requirement Script), and

-3 a list that changes on runtime (Foe incomplete quests)

-4 a second list that changes on runtime (For Completed Quests))

List 1: Simply just populates all quests in resources,

List 2: Checks is quest is complete or locked based on the PlayerPreff's setting,

List 3: Checks is quests is completes and locked, and gets changed in update function, as quest's get completed. When a quest is completed it is removed from list. first at awake and any time during Update it updates the list of current quests. by A unlocking next quest and B moving completed quest to the 4th list Will do this on awake when checking also.

 

-4 is just a placeholder for the completed quests

if Completed in update and is a repeatable quests, 1st time, activate any Achievements on google play and prizes are given to the player, then remove the reward and add it to players item list, set a bool to true saying that achievement has been set, so next time we come into awake we can change that repeatable quests settings.

 

Quest has:(Gets changed on update and awake)

-A firstMoneyPrize (received when activating a, leave empty if not applicable),

-A Starting Item (quest Can be used to give a player an item to do quest, leave empty if not applicable),

-A RepeatablePrize (if player finished quest a second time), -A MainPrize (For when quest is complete First time) this contains its own prizeMoney variable and is removed and replaced by the RepeatablePrize on mission complete,

-And a Dialogue script for holding the conversations of that quest.

 

There are a number of OnOff bools for various things such as,

 

-is the quest locked,

-is the quest completed,

-is it enabled,

-is it repeatable,

-is it in the que

 

Quest also has:

 

-A QuestGiver script and a QuestComplete Script, these are used for activating and deactivating a quest,

-CatagoryName

-QuestName,

-IndexInListID

-UniqueID,

-Enum for quest type, Used to toggle bool

-Enum for repeatable, Used to toggle bool

-Enum for finished, Used to toggle bool

 

Dialogue is very similar in how it works in the awake and update, accept it grabs the dialoge scripts from the quest. in update the dialogue lists do what ever the quests lists states are instead of setting themselves.

 

It also controls all dialogue box animations and sentences in each dialogue script by first playing the 'OpenTextBox' animation, then start to display the text in the form of a type-writer style text (1 letter at a time based on the speed) once animation is complete. theres a public button function for Starting convo, skipping to next sentance in convo, and a function to end the convo. if Quest Complete remove dialoge script from list.

 

Google play can only be tested on build and i'm not ready to do that just yet, when i do i can test to see if quests are completing and activating Achievements to Google play.

 

still need to add Achievements script, create an achievements list for PlayStore to load, Match the data On the GooglePlay Developers Account to it, build the editor to build, edit, and save the assets, and then make a hand-full of the test quest's for seeing if this part of the pack works as expected. so still some work needs to be done.

 

That's the update for today,

Thamas Bell @ ZeredaGames

Categories: ZeredaGames Main Blogs

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

0 Comments