I am trying to implement Rupees as a currency for my Legend of Zelda Map.
I have the green, blue and red rupees (wip) but I was wondering whether it is possible to use a rupee bag item (given to the player on map start) to automatically store the number of rupees (currency) collected as an integer, which could later be used with item vendors etc.
In theory the player would pick up the item from the ground, and either when they pick it up, or when it is placed in the inventory (whichever is more feasible), the item would disappear and the number stored in the "rupee bag" item would increment based on the number picked up.
I have no idea whether this is possible, so if anyone has any ideas or pointers as to how I can implement it, I would really appreciate it.
Thanks.
Money Bags?
-
- Posts: 168
- Joined: Thu Oct 30, 2014 1:56 am
Re: Money Bags?
Maybe you could add a counter component to your money bag.
Re: Money Bags?
I could do, but that's the easy part.
The part I need help with is which triggers to use to identify when the rupee is picked up, and how to code that into the object definition.
Thanks.

Thanks.
Re: Money Bags?
You can toy around with something like this.
There is an onPickUpItem hook that you could use to see if rupee_red, rupee_green, or rupee_blue and the item would vanish from their cursor and increase the money_bag counter.
Untested, but should be a close enough starting point for you.
There is an onPickUpItem hook that you could use to see if rupee_red, rupee_green, or rupee_blue and the item would vanish from their cursor and increase the money_bag counter.
Code: Select all
defineObject{
name = "party",
baseObject = "party",
components = {
{
class = "Party",
onPickUpItem =
function(party, item)
if string.find(item.go.name, "rupee_") then
setMouseItem(nil)
money_bag.counter:increment()
return true
end
return true
end
}
},
}
Last edited by cameronC on Thu Nov 20, 2014 11:55 pm, edited 1 time in total.
Writer and sometimes artist of the very slightly acclaimed comic series Scrambled Circuits. A comic series about a robot written by a human.
Grimrock 2 socketSystem: viewtopic.php?f=22&t=8546 / Github
Grimrock 2 socketSystem: viewtopic.php?f=22&t=8546 / Github
Re: Money Bags?
Fantastic, that's exactly the sort of thing I was looking for, thanks 
I'll see if I can get that to work.

I'll see if I can get that to work.