Sorry if this is in the wrong forum topic, I didn't see one that perfectly fit my query.
In a scenario where the player can exchange collected resources for an item, how do I do the math to determine how many of the item to give the player?
Specifically, the player can exchange 10 'shrubs' for a healing 'Balm' (potion).
Currently, the player needs to interact with the herbalist for each Balm, meaning if you have 44 shrubs, you'll need to click through the herbalist dialog 4 times. Instead, I'd like the event to do the math based on the number of shrubs and give the player 4 Balms in one shot. In psuedo-code:
> Create variable based on number of shrubs (this is easy, we'll call it Num_Shrubs)
> Divide Num_Shrubs by 10, creating a new variable with the result (call it Num_Balms)
> Give player a number of Balms equal to Num_Balms, and take all but the remainder of shrubs from player.
The event works fine as it is, but you often have more than 1 Balm's worth of shrubs, and I'd like to make those interactions less annoyingly clicky for the player.
I've played around with the various Control Variables options, but nothings working quite as I expect, so I thought I'd ask the experts how to accomplish this functionally.
Thanks!
In a scenario where the player can exchange collected resources for an item, how do I do the math to determine how many of the item to give the player?
Specifically, the player can exchange 10 'shrubs' for a healing 'Balm' (potion).
Currently, the player needs to interact with the herbalist for each Balm, meaning if you have 44 shrubs, you'll need to click through the herbalist dialog 4 times. Instead, I'd like the event to do the math based on the number of shrubs and give the player 4 Balms in one shot. In psuedo-code:
> Create variable based on number of shrubs (this is easy, we'll call it Num_Shrubs)
> Divide Num_Shrubs by 10, creating a new variable with the result (call it Num_Balms)
> Give player a number of Balms equal to Num_Balms, and take all but the remainder of shrubs from player.
The event works fine as it is, but you often have more than 1 Balm's worth of shrubs, and I'd like to make those interactions less annoyingly clicky for the player.
I've played around with the various Control Variables options, but nothings working quite as I expect, so I thought I'd ask the experts how to accomplish this functionally.
Thanks!