Coinslots and Coins
-
- Posts: 14
- Joined: Sun Feb 24, 2013 5:49 pm
Coinslots and Coins
Hi
I'm trying out the coinslots and coins from http://grimrock.nexusmods.com/mods/128
The coins stack in your inventory but if you drop a stack of coins on a coinslot it takes the whole stack. Is there a way to know how many coins were entered and/or a way to prevent more than a set number from entering or require only a certain amount?
I'm trying out the coinslots and coins from http://grimrock.nexusmods.com/mods/128
The coins stack in your inventory but if you drop a stack of coins on a coinslot it takes the whole stack. Is there a way to know how many coins were entered and/or a way to prevent more than a set number from entering or require only a certain amount?
Re: Coinslots and Coins
It could be done I think, you could get the stack count of the mouse item and only do it for one or if there is more than one then only take one or something, might get a bit complicated but should be possible
Finished Dungeons - complete mods to play
Re: Coinslots and Coins
AFAIK if you use shift+click at the coin stack u get one coin at mouse.
The simple way^^
The simple way^^
Dungeon Master Resource Pack worker and passionated Beer drinker
-
- Posts: 14
- Joined: Sun Feb 24, 2013 5:49 pm
Re: Coinslots and Coins
I know that... but my players may notgermanny wrote:AFAIK if you use shift+click at the coin stack u get one coin at mouse.
The simple way^^
I want to be able to allow my players to find coins but the when they put them in a slot, if they pick up the whole stack, for the slot to only take one at a time.Komag wrote:It could be done I think, you could get the stack count of the mouse item and only do it for one or if there is more than one then only take one or something, might get a bit complicated but should be possible
Then, if I want to have it "cost" a certain number of coins I can just attach it to a counter.
A better alternative would be to set the number of coins required on a coinslot and then whether they are entered one by one or in bunches shouldn't matter... it will only take that many coins.
Any examples of how I could achieve any of this? I'm pretty new to lua.
Re: Coinslots and Coins
Best way to do this is to have a little readme tutorial about it. Where you tell them coins must be inserted one by one. Shift click to separate from stack.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
- Message me to join in!
Re: Coinslots and Coins
Yeah but he wants the machine not to steal too many coins at once! Relying on the player to do it right is not user friendly enough.
You would need to use hooks and scripts to check the stack amount on the mouse, then you might have to do destroying and spawning tricks to make things work right. I don't have time to work on it, but I think it should be doable with some effort.
You would need to use hooks and scripts to check the stack amount on the mouse, then you might have to do destroying and spawning tricks to make things work right. I don't have time to work on it, but I think it should be doable with some effort.
Finished Dungeons - complete mods to play
-
- Posts: 14
- Joined: Sun Feb 24, 2013 5:49 pm
Re: Coinslots and Coins
Exactly... Relying on players to do it right could potentially lead to players not being able to progress because they "wasted" all their coins.Komag wrote:Yeah but he wants the machine not to steal too many coins at once! Relying on the player to do it right is not user friendly enough.
You would need to use hooks and scripts to check the stack amount on the mouse, then you might have to do destroying and spawning tricks to make things work right. I don't have time to work on it, but I think it should be doable with some effort.
Would a simply solution be this?
When a player inserts coin(s) the hook that catches this counts how many were inserted and calls activate that many times? Then if you wanted to refund the player the excess you could.
I may be totally off base as I'm not totally familiar with the hooks yet... Would that work?
Re: Coinslots and Coins
I think so, sounds like a good approach
Finished Dungeons - complete mods to play
-
- Posts: 14
- Joined: Sun Feb 24, 2013 5:49 pm
Re: Coinslots and Coins
Ok ... I'm going box-eyed with this.
I can clone the object and set a function for when it's activated... but I can't figure out how to get a count of the items in the stack that activated it. Am I missing something really obvious?
I can clone the object and set a function for when it's activated... but I can't figure out how to get a count of the items in the stack that activated it. Am I missing something really obvious?
Re: Coinslots and Coins
Well, it will depend on how you are setting up the slot. If it is an alcove, you can use the onInsertItem hook to run a script that will getMouseItem and getStackCount, then go from there
Finished Dungeons - complete mods to play