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

Help with extra resoures

Status
Not open for further replies.
Level 1
Joined
Sep 21, 2005
Messages
5
I am making a map that needs more than just gold, lumber and food. There are two other resources called ore and precious materials, which are collected by a hero as items and can be clumped together in blocks of 5s (5 slots of 1)or 10s (2 slots of 5). I have been trying to figure out how to use 2 blocks of 10 ore and 2 blocks of 10 precious materials to enable the player to research 'cloud castle resources' which in turn enables the player to buy the cloud castle for 2000 gold and 4000 lumber. Please could somone give me a hand with this? I am stuck on converting items to research - i thought this would be it but it doesnt work.

Cloud castle enable
Events
Map initialization
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Number of items carried by Castle Builders Guild 0030 <gen>) Greater than or equal to 4
And - All (Conditions) are true
Conditions
(Item-type of (Item carried by Castle Builders Guild 0030 <gen> in slot 1)) Equal to Lump of 10 Ore
(Item-type of (Item carried by Castle Builders Guild 0030 <gen> in slot 2)) Equal to Lump of 10 Ore
(Item-type of (Item carried by Castle Builders Guild 0030 <gen> in slot 3)) Equal to 10 Precious Materials
(Item-type of (Item carried by Castle Builders Guild 0030 <gen> in slot 4)) Equal to 10 Precious Materials
Then - Actions
Unit - Order Castle Builders Guild 0030 <gen> to research Cloud Castle Resources
Hero - Drop (Item carried by Castle Builders Guild 0030 <gen> of type Lump of 10 Ore) from Castle Builders Guild 0030 <gen>
Item - Remove (Last dropped item)
Hero - Drop (Item carried by Castle Builders Guild 0030 <gen> of type Lump of 10 Ore) from Castle Builders Guild 0030 <gen>
Item - Remove (Last dropped item)
Hero - Drop (Item carried by Castle Builders Guild 0030 <gen> of type 10 Precious Materials) from Castle Builders Guild 0030 <gen>
Item - Remove (Last dropped item)
Hero - Drop (Item carried by Castle Builders Guild 0030 <gen> of type 10 Precious Materials) from Castle Builders Guild 0030 <gen>
Item - Remove (Last dropped item)
Else - Actions

To me that says that if the castle builders guild (which has inventory hero) is given the block of resources i mentioned earlier and they are in the correct slots, the upgrade should be done automatically and the resources will be used up. Whats wrong? Sorry if I havent explained very well :?
 
Level 13
Joined
May 5, 2004
Messages
1,330
The event is wrong. Map Init fires right at the beginning of the map. For your trigger, you should use a periodic event like "Time - Every 1 seconds of game time". For this "resources have to be in the right slot"-thing: I'll see if there's a better way, so people don't have to put the items into the correct slots.
 
Level 1
Joined
Sep 21, 2005
Messages
5
Thanks for your reply. I changed the time to every 5 seconds and it works, however it will only research the cloud castle resources when the player has enough gold and lumber. If i make it so that you need 99999 gold and lumber it doesnt work. Putting the numbers to attainable amounts kind of makes the trigger pointless because the player will just be able to research it without paying the 20 ore and precious materials. Is there some other way to go about this? Thanks in advance.
 
Level 13
Joined
May 5, 2004
Messages
1,330
Ok, I'm just working on a trigger for another guy, when I'm finished I'll start working on one for you.

I guess that research is an upgrade, right? So you just have to make it unavailable at map start and a trigger that makes it available if you have enough ore/materials (and unavailable if you spend the stuff somewhere else). I'll give it a try asap.
 
Level 1
Joined
Sep 21, 2005
Messages
5
Ive sorted it. Thanks for your help - if anyone wants the code pm me - it enables items to be used for research - ie. more resources. All i did was make it so that if you click the upgrade button yourself, the building gets destroyed, but that trigger is turned off when you put the correct item combos in the building. pm me if you want the code anyone!
 
Status
Not open for further replies.
Top