• 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.

Turning multiple items in to one...

Status
Not open for further replies.
Level 2
Joined
Apr 28, 2004
Messages
21
This has been bugging me a lot lately. I am already a fourth of the way done with my terrain for a survival based map, however I am not sure how to do some of the triggers yet...

Basically, as an example, you need to make a fire to keep you warm and cook your food. I want the ability to take a stick, some tinder, and flint, and press the "make" button, and you get a fire that you can place.

I've played around with the triggers, and so far I can't figure out how they did it in other maps, or even how I can give an item to a unit with an inventory at all.

Please help!

Thanks.
 
Level 4
Joined
Oct 23, 2006
Messages
65
Check to see if the unit has both items, and if they do then remove them and add whichever item you want.

The action triggers you are looking for are in the 'Hero' section.

'Hero - add item'
'Hero - remove item'
 
Level 4
Joined
Jan 23, 2005
Messages
65
comibine = item (powerup)
boolean[]

event: a unit sells an item
condition: buying unit is hero equal to true
actions:

for loop b from 1 to (max amount of items) set boolean to false

for loop a from 1 to 6
if item carried by buying unit in slot a equal to flint, set boolean[1] to true
if item carried by buying unit in slot a equal to stick, set boolean[2] to true
if item carried by buying unit in slot a equal to tinder, set boolean[3] to true

if bollean[1] = true && bollean[2] = true && bollean[3] = true then
for loop b from 1 to 6 - remove item carried by buying unit in slot b
create fire for buying unit

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

by the way, are u trying to copy "ice troll tribes"???^^
if ur using another event, just change the other stuff
use boolean[x] to refer to other items too

hf
 
Level 3
Joined
Nov 4, 2006
Messages
32
lol. now i am working with my map, that uses ice and jungle trolls thinhs. tinder, flint, stick... you must create this trigger:

event
unit casts ability
condition
ability being cast equal to "build button"
action
if all conditions are true do then actions
cond: type of item carrying by hero in slot 1 = tinder
cond: type of item carrying by hero in slot 1 = flint
cond: type of item carrying by hero in slot 1 = stick
then action: hero - remove item from hero from slot 1
then action: hero - remove item from hero from slot 2
then action: hero - remove item from hero from slot 3
then action: hero - create item fire camp and give to hero


lol, i am working on similar map :D how many buildings you map have? if you need to help with building sharing, tell me, i will help you!
 
Level 3
Joined
Nov 4, 2006
Messages
32
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 1]
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 2]
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 3]
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 4]
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 5]
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 6]
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 7]
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 8]
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 9]
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 10]
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 11]
(Item-type of (Item carried by (Picked unit) in slot 1)) Equal to Hammer [level 12]
(Item-type of (Item carried by (Picked unit) in slot 2)) Equal to Stone
(Item-type of (Item carried by (Picked unit) in slot 3)) Equal to Stone
(Item-type of (Item carried by (Picked unit) in slot 4)) Equal to Stone
(Item-type of (Item carried by (Picked unit) in slot 5)) Equal to Lumber
Then - Actions
Item - Remove (Item carried by (Picked unit) in slot 2)
Item - Remove (Item carried by (Picked unit) in slot 3)
Item - Remove (Item carried by (Picked unit) in slot 4)
Item - Remove (Item carried by (Picked unit) in slot 5)
Hero - Create Ready Light Armory and give it to (Picked unit)
Else - Actions


it is my code, i do not use button build. i using hammer item for building anything :p
 
Level 2
Joined
Apr 28, 2004
Messages
21
Thank you for all the replies!

There are many survival maps, Troll Tribes being one of them, however I am more interesting in a certain Wilderness Survival (that's the actual name, however it is shared by several other maps).

Basically instead of everything being in certain slots, in this map, if the unit is carrying them at all, it will remove them and replace it with something else.

How can I do that?

EDIT -Okay, I got it to work, kind of. I have it so no matter what slot it is in, it will disapear, however even if the right items are not in there, it will still give me the item I am trying to create...

Here is what I have...


I'm just using those items as a test. 8)

EDIT - That last action isn't supposed to be there, heh.
 
Level 2
Joined
Apr 28, 2004
Messages
21
Just in case, if anybody was thinking my problem is solved, it isn't.

After more playing around I still can't get it so I only get the item when I have all the right items in.
 
Level 8
Joined
Feb 10, 2006
Messages
466
I remember doing an alchemy system long time ago, here it is:

http://upload2.net/page/download/LyQHyq8Vsd0TyKe/Alchemy!.w3x.html

(can't upload here)

There are some limitations, like one crafer/alchemist/recipe_user per player, but they can be easily bypassed if you're willing to write some code.
Basically instead of having all items in inventory and using spell, user has to click on items in correct order. If i remember correctly there are comments in the map, so it should be fairly easy to figure out how to add your own items/recipes.
 
Status
Not open for further replies.
Top