• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Double Item Creation Problem

Status
Not open for further replies.
Level 6
Joined
Mar 12, 2007
Messages
225
I am currently making a survival style map. I have now finished the terrain and many of the objects and have started working on the triggering. The map is like Island Troll Tribes and, as you might know, when you get the required items to make something, you have to put it in the right order and then drop one and pick it back up to make it work. I don't really like this idea so I just made one where you get all the items, then use your "Create" ability and it makes, but I am having a few problems I can't seem to correct:
1. When you have to make something that requires two of the same item to make it, you can make it with two, but you can also make it with one! Example: You need two stones to make a sharpening stone, but when you only have one and you use create, it still makes it.
2. If you are trying to make a recipe, say a fire (flint + stone + tinder), and you use create, it creates the fire, but because of the bug above and the stone is not consumed, it also creates a sharpening stone!
If someone could help me out with this, that would be great.
Thanks to anyone who will.
 
Level 6
Joined
Mar 2, 2006
Messages
306
for problem 1, you're gonna need to count the stones in the troll's inventory; just say "set myvar = 0" and then go with simple loop "for each integer a from 1 to 6 (6 inventory slots) do -> if item-type of (item carried by triggering unit in slot a) == mystone then set myvar = myvar + 1"; then just make the check: "if myvar<2 then skip remaining actions (not enough stones)"

once the problem 1 is solved, problem 2 should disappear.
 
Level 6
Joined
Mar 12, 2007
Messages
225
Alright!! Thanks man. But I was wondering, you mentioned that it was in slot A, or whatever, does that mean it has to be in that slot? I want it to just happen even if its not in the right order.
 
Status
Not open for further replies.
Top