Generic Game Objects

Help, support and information for our Game Framework Unity Asset.
If posting about the assets in the extras bundle then please use the appropriate forum.
Post Reply
ez2ciamaprincess
Posts: 9
Joined: Sun Jul 07, 2019 1:05 am

Generic Game Objects

Post by ez2ciamaprincess » Sun Jul 07, 2019 1:16 am

Hi,
I'm just learning the framework and was trying to find a way to have an unlock for coins for items that are attached to my player. The way I have it set up is the player has hats rigged to the character as children and I turn them on and off with button click. I want to know how to charge coins for the hat and enable it. What would be the best way to do this. Any help would be great! I have tried level unlock as an item and generic game object and I can't seem to understand it. Is there some code snippet I can add to a button that checks if the player has enough coins and unlocks??

Also If it would be easier to just buy a panel with all my buttons on it?

Wonderful Framework!

Also... Localisation key L1.Name not found for language English (index 0).

I keep getting this error..

mahewitt
Site Admin
Posts: 273
Joined: Thu May 05, 2016 8:06 pm

Re: Generic Game Objects

Post by mahewitt » Wed Jul 10, 2019 7:58 am

Hi,

You can access the current players coins / score through GameManager.Instance.Player.Coins / GameManager.Instance.Player.Score. You could also look at the ConditionalAction component to automatically display different gameobjects based upon the players coins / score.

For the localisation error - the getting started tutorial should contain steps on what is needed.

http://www.flipwebapps.com/unity-assets ... tutorials/

Regards,
Mark

ez2ciamaprincess
Posts: 9
Joined: Sun Jul 07, 2019 1:05 am

Re: Generic Game Objects

Post by ez2ciamaprincess » Sat Jul 13, 2019 11:40 am

Thank You,

Is there any tutorials on Generic lock Setup? Or do they work the same as level locks?

mahewitt
Site Admin
Posts: 273
Joined: Thu May 05, 2016 8:06 pm

Re: Generic Game Objects

Post by mahewitt » Wed Jul 17, 2019 2:49 pm

Everything uses the same base 'GameItem' class, so the principles should the same whether using Levels, Worlds, Players, ....

ez2ciamaprincess
Posts: 9
Joined: Sun Jul 07, 2019 1:05 am

Re: Generic Game Objects

Post by ez2ciamaprincess » Sun Jul 21, 2019 8:28 am

I think I figured out most of it all except The conditional item part. How would I set up a condition that turns on an item from the character (Customizer Game) only if they have enough coins to enable it. Im confused. Is this a player or character? I dont know how to set this up properly.

mahewitt
Site Admin
Posts: 273
Joined: Thu May 05, 2016 8:06 pm

Re: Generic Game Objects

Post by mahewitt » Thu Jul 25, 2019 7:17 pm

Using the ConditionalAction you can do something like the following:
Capture.png
Capture.png (40.53 KiB) Viewed 2957 times
Although this would only affect the display and you will have more control accessing the API through code. The 'Player' is the one that collects coins score (think the one playing the game). Characters are items within the game e.g. Mario, Luigi, or types of cars.

ez2ciamaprincess
Posts: 9
Joined: Sun Jul 07, 2019 1:05 am

Re: Generic Game Objects

Post by ez2ciamaprincess » Mon Jul 29, 2019 2:45 pm

Thank You So much for taking the time and helping me!

Im just not sure this will work with how I have my game setup.

I did find a work around, But Im getting errors on scene change:

-----------------------------------------------------------------------------------------------------------
You are trying to remove a handler that isn't registered for UpdateMessage
Assertion failure. Value was False

Expected: True
-----------------------------------------------------------------------------------------------------------

I was trying to let the user buy a character button with the click to buy and unlock option.
Once the player has enough coins to unlock the character button it performs as it should,

I added a conditional action to destroy the character button (I tried disable too) after the player buys the button and removes the coin amount
the button destroys itself and then I have my button under the character button that alows the player to turn on "a hat" and change the colors etc.
everything works how I want it to, Untill I switch scenes (Main Menu).

Im pretty sure something is going on with the destroy button part and causing the error when I switch scenes.

I think there is no way around this unless you know what the issue might be? Otherwise I am out of ideas on how to make this work.

ez2ciamaprincess
Posts: 9
Joined: Sun Jul 07, 2019 1:05 am

Re: Generic Game Objects

Post by ez2ciamaprincess » Sun Aug 04, 2019 10:33 pm

I got it working! So Happy!!

mahewitt
Site Admin
Posts: 273
Joined: Thu May 05, 2016 8:06 pm

Re: Generic Game Objects

Post by mahewitt » Mon Aug 05, 2019 7:29 pm

glad to hear :D

Post Reply