Hi @novabyte,
Based on this Energy system in Unity I am experimenting with rewarded ads for doubling your last given reward.
For example; a player clicks on the classic “double reward” button after a finished level. The behaviour I currently have is to give the normal rewards that are given and then if an ad is completed then give the same amount.
I am using placements for it: Rewarded Video - Heroic Labs Documentation where for example I can grant specific currency into a certain action when the ad callback is done (we do this on the client) and that works well.
Something like this:
await _economySystem.PlacementStartAsync(placementId);
var attemptCount = 3;
var placementStatus = await _economySystem.PlacementStatusAsync(placementId, attemptCount: attemptCount);
return placementStatus.Success;
and then in my economy.json
"Energy": {
"min": 50,
"max": 50
}
This works well.
So then I am needing to do the same but with the last reward I found that I can write some custom hooks into the server using the transaction ledgers Storage - Heroic Labs Documentation
and then creating another placement like:
"double_currency_rewarded_ad": { reward {} }
And then using a custom reward system Rewards - Heroic Labs Documentation
I can hook that function into a reward and then passing strings as my double reward should execute my logic but that’s being impossible. Nakama says that it fallback to “placement fallback” and it gives nothing.
{"level":"warn","ts":"2024-09-18T08:25:49.558Z","caller":"server/economy.go:3188","msg":"placement fallback","runtime":"go","rpc_id":"rpc_id_economy_placement_status","rewardID":"","placementID":"double_currency_rewarded_ad","source":"github.com/heroiclabs/hiro-gdk/server/economy.go:3188"}
Is this possible or am I complicating it?
Thanks, Sam.