0 votes
by (220 points)
edited by

I have an object containing the values of "weight", size" and "quantity". 

<<set $ammo to {
weight: 2,
size: 1,
qty: 10

In addition to that, there are variables set in StoryInit for an current and maximum inventory and weight:

<<set $curInventory to 0>>
<<set $maxInventory to 5>>
<<set $curWeight to 0>>
<<set $maxWeight to 7>>

I'm trying to figure out how to pick up the ammo so the curInv never exceeds the maxInv. Same for the weight. The ammo should be able to be picked up one piece at a time (therefore the qty) and/or all at once. 

Any idea how to achieve this? 

Thanks in advance!


1 Answer

0 votes
by (220 points)
Nevermind, I somehow managed to do it on my own with tempVariables and a ton of if/elseif.