hold more than one of the same object
gamemaker
23 Jun 2005, 21:12how do you do that and please tell me where you put the code
MaDbRiT
23 Jun 2005, 22:14Short answer is 'you can't', long answer is 'you cannot do the impossible - think about it!'
Seriously, your question makes no sense. How can you hold more than one of the same object? there is by definition only ONE instance of the "same object".
Take a $10 bill as an example. It's an object. You can't ever be holding the same ten dollar bill "twice" there is only one of it, but you can hold two essentially similar $10 bills at the same time but they are not the same object twice, they are two unique objects.
Of course in a game you might want to have the player pick up cash and add to his funds, you'd do that with a dummy object which when picked up adds and when dropped reduces the value held in the players funds. You would be highly unlikely to use multiple objects to simulate cash, much more likely you'd use a status variable to hold a total of cash held.
Explain in more detail what you are trying to achieve and I'm sure someone will help you.
Al (MaDbRiT)

Seriously, your question makes no sense. How can you hold more than one of the same object? there is by definition only ONE instance of the "same object".
Take a $10 bill as an example. It's an object. You can't ever be holding the same ten dollar bill "twice" there is only one of it, but you can hold two essentially similar $10 bills at the same time but they are not the same object twice, they are two unique objects.
Of course in a game you might want to have the player pick up cash and add to his funds, you'd do that with a dummy object which when picked up adds and when dropped reduces the value held in the players funds. You would be highly unlikely to use multiple objects to simulate cash, much more likely you'd use a status variable to hold a total of cash held.
Explain in more detail what you are trying to achieve and I'm sure someone will help you.
Al (MaDbRiT)
francisstokes
23 Jun 2005, 23:28MaDbRiT's right, it is imposible to have more than 1 of the same thing, but why would you need more than 1 of the same object anyway?You could have 3 lets say, tee-shirts in your inventory.
But if it is currency you want, then a variable is the way to go.
But if it is currency you want, then a variable is the way to go.
gamemaker
23 Jun 2005, 23:28like you have 2 coal ore
MaDbRiT
23 Jun 2005, 23:55like you have 2 coal ore
2 meaning what? 2 pieces of ore, 2 tonnes, 2 kilotonnes?
If you want pieces that show up in the inventory as seperate entries you need to make each piece an individual object in the game - that's only sensible.
If you in fact want a VALUE or COUNT of 'coal ore', (tonnes / kilotonnes - whatever) that shows in the status area you don't actually need to have ANY 'coal ore' objects at all, though most people would use a single dummy object, introducing it into various locations where 'coal ore' should be collectable for aesthetic reasons.
I repeat... Explain in more detail EXACTLY what you are trying to achieve and I'm sure someone will help you.
Al (MaDbRiT)
gamemaker
24 Jun 2005, 00:00ok more detail the game when i cut a tree a get wood it will only let me hold one wood at a time i want like 12 wood at a time but only taking one spot in inventory
steve the gaming guy
24 Jun 2005, 03:59Ok, I get it. I don't know how to code it enough to give advice but I think it was recently covered in another thread.
Basically, you're wanting your inventory to show:
wood [1]
or when you pick up 5 more, it shows:
wood [6]
Am I right?
Basically, you're wanting your inventory to show:
wood [1]
or when you pick up 5 more, it shows:
wood [6]
Am I right?
MaDbRiT
24 Jun 2005, 07:14OK.
Here's a quick example of the sort of thing I think you are trying to achieve. You can cut n'paste the 'code' below into a text editor, save it as (say) 'coal.asl' then either run it in Quest or load it into QDK to see how it works.
Al (MaDbRiT)
Here's a quick example of the sort of thing I think you are trying to achieve. You can cut n'paste the 'code' below into a text editor, save it as (say) 'coal.asl' then either run it in Quest or load it into QDK to see how it works.
' "test"
' Created with QDK Pro 3.53
define game <test>
asl-version <350>
gametype singleplayer
start <start>
game author <MaDbRiT>
game version <.001>
game copyright <© Al Bampton (MaDbRiT)>
game info <Created with QDK Pro 3.53>
command <drop coal> if ( %coal% > 0 ) then {
dec <coal>
msg <You drop a piece of coal, it immediately shatters into fine black dust which is carried away by the breeze.>
}
else msg <You don't have any coal to drop!>
define variable <coal>
type numeric
value <0>
display nozero <[!] piece*s* of coal>
end define
end define
define synonyms
end define
define room <start>
look <a very good place to start...>
south <another room>
define object <coal>
look <black, dusty, very coal-like (what did you expect?)>
take {
msg <You pick up a piece of coal (there must be several tonnes here).>
inc <coal>
}
prefix <a large pile of>
end define
end define
define room <another room>
north <start>
end define
define text <intro>
end define
define text <win>
end define
define text <lose>
end define
Al (MaDbRiT)
Elexxorine
24 Jun 2005, 12:35this method is very good, but quest kinda gets confused if you have loads of variables. i assume you're making a rpg, and will have lots of objects in variable, madbrit suggested arrays to me, i don't fully understand them. ask him or read the 'grid system' forum. 

francisstokes
24 Jun 2005, 15:29No offenece meant, but Quest shouldn't get confused by the variables, its more likely that when you have alot of string and numeric (most of the time for rpgs they ARE numeric) variables, you get confused and forget those all important % signs.
paul_one
24 Jun 2005, 17:42Hmmm, I want some quantum portals and exacti-replica machines that mean the same object CAN occupy the same time-frame, but different spaces.... Even then they'd be seperate objects - but they would be the exact same things that you could hold at the exact same time.
Just saying that it's not really 'impossible' but rather more 99.9% impobbable that time machines will be created.
Just saying that it's not really 'impossible' but rather more 99.9% impobbable that time machines will be created.