question

duartedd avatar image
duartedd asked

unicorn battle quest and container items

Hi

I am just trying to find within unicorn battle source that after the battle where the popup with the quest info is shown - where the quest progress items are assigned to the user --- all i see is that when the backtohub button is called (bringing it back to the profile screen) is when the retrive (spelled wrong)questitems method is called

I dont see where the option of view items actually assigns the item to the current user. I have to be missing it somewhere as unlockcontaineritem which is being called would not work - if i understand it coorrectly it would throw an missing container item error because its not assigned to that user.

thanks!

daniel

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

duartedd avatar image duartedd commented ·

let me know if you need some more information to know what i am talking about

ive searched through a bunch of the scripts cant find a tie to it - i understand that it works once after you click the hub button due to it being retrieved and stored under the player so he she can then open the container but i cant see it working through the view items portion of the after game end popup portion....

item viewer controller,unlock slider controller, pf game data are a few of the reference scripts for the methods

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

Have a look at QuestOutroController.cs - that's where we take care of finalizing the player after the quest. Specifically, you're looking for where we execute the RetriveQuestItems Cloud Script handler. Though for a real game, it's highly recommended that you build some reasonable cheat detection into that, so that hacked clients don't just call it over and over to get free items.

6 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

duartedd avatar image duartedd commented ·

ya thats what i had mentioned above - i see that part

OnReturnToHubClick()

but it falls within this method which is called when the user clicks continue

before clicking that is where i am looking at the view items button which gives the user the chance to view and open the container in that menu - before it actually gets saved to the player.

i cant find anywhere else where that retivequestitems method is called (i would understand if it was put within thhe viewitems call (ShowItemsFound method)

but i dont see it in there.

0 Likes 0 ·
duartedd avatar image duartedd duartedd commented ·

thanks btw for your help! :D

0 Likes 0 ·
brendan avatar image brendan duartedd commented ·

Then maybe I'm misinterpreting your question. You said "I dont see where the option of view items actually assigns the item to the current user", which I took to mean that you wanted to know how the inventory items are granted to the player as a result of gameplay. Specifically, items are granted in a Cloud Script call - RetrieveQuestItems. I don't follow what you mean concerning opening containers at that stage, as that's unrelated. There's a different interface where we show the player their inventory and allow them to unlock containers.

0 Likes 0 ·
duartedd avatar image duartedd brendan commented ·

let me try to rephrase

so the player ends the match

the end match dialog comes up with the continue button or the view items button

he clicks the view items button

that launches the itemviewer interfaace like you are talking about

when the user slides to unlock the container

the unlockcontaineritem api is called

from what i understand that unlockcontaineritem api call needs to have the item assigned to the user - otherwise a missing container item error will be thrown.

i see nowhere EXCEPT once the player clicks continue where the retrivestoreitems is called and i cant see anywhere else where the items get assigned to that player.

thus due to the logic from what i can see the view items being before the continue is pressed should then yield a missing container item error when pressed

BUT i must be missing something somewhere assuming the source is the same as your launched game.

hope that helps

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.