• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Items combine into new item

Status
Not open for further replies.
Level 3
Joined
Mar 24, 2015
Messages
43
Let me start by saying, I'm new to the WC3 WE. Just started like 3 days ago. I've learned very fast with help from some great community members, but without an example or reference, it takes me forever to make a trigger, but I can usually get it working. I'm not quite sure how the triggers will work in relation to a custom spell or whatever I need for this:

1. (I'm making a survival/crafting game). Similar to “Wilderness Survival” game by Jay; I want a unit (with inventory) to be holding several items that combine into one. First, I need to know how to create my own Icon & tooltip (or spell? Idk) and name it “Craft.” Then, when i click on it, I want it to remove the recipe items from my inventory, and input the new item. How would I do this?

I ask a similar question a few days ago, and one person said "I suggest to get item system from spell section (preferable GUI)."

Can someone explain this, and/or give me a link to a tutorial?
I'm also not sure what type of triggers I will need, their setup, and how many I will need. Would I need a trigger for every single recipe?

Thank you.
 
Level 3
Joined
Mar 24, 2015
Messages
43
do you have any custom inventory... i mean a bigger inventory than that 6 size one of WC3?

I do not. Most of the recipes I'm thinking about using should not require any more than 4 slots. Maybe a select few might require 5 or 6 slots, probably no more than 1-5 items total.

However, I know from personal experience that having extra inventory in any game makes things easier. I'm trying my best not to use/copy any ideas from other similar games like "Wilderness Survival" by Jay, but b/c the game-type is basically the same, that's hard to do... Would you suggest creating a backpack with an extra 6 inventory slots for each player?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Actually there would be a problem with this one, before I continue I would like to ask how many different material items are you planning to have. Also count if you do like Recipie 1 (Iron ore + Iron ore = Iron ignot ), Recipie 2 ( Iron ignot + Iron ignot + Iron ignot = Bucket )
Meaning 2 materials at all (Iron ore, Iron ignot)

Ok, umm, the item systems around may be too complicated for your needs as most of them use either custom interface (It looks really cool though) or do other things in combination with crafting.

Here is what I would suggest, it is very primitive and brutal, but in the same time simple and if not messed will work just fine.
So to begin with: Introduce an ability which spawns a unit, "Crafting table". The table will have inventory and 1 ability, "Craft".
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Just make a spellbook and add a few spellbooks to it, then add spellbooks to the spellbooks in the spellbook. Then you can add a spellbook to that.
...
Lets start over.

You have a spellbook named "Craft".
When you open it, you have a few options: "Materials", "Weapons", "Consumables", etc.
Each of those are spellbooks as well.
The spellbook Materials will have a few abilities: "Copper Ignot", "Bronze Ignot", "Iron Ignot", "Steel Ignot", "Mithril Ignot", maybe some more.
"Wood Plank", "Wood Stick", etc

Those abilities check if you have certain items in your inventory and how many of those or how many stacks of them.
When you have those and you cast that ability, you will craft the new item.
 
Level 3
Joined
Mar 24, 2015
Messages
43
Actually there would be a problem with this one, before I continue I would like to ask how many different material items are you planning to have. Also count if you do like Recipie 1 (Iron ore + Iron ore = Iron ignot ), Recipie 2 ( Iron ignot + Iron ignot + Iron ignot = Bucket )
Meaning 2 materials at all (Iron ore, Iron ignot)

Ok, umm, the item systems around may be too complicated for your needs as most of them use either custom interface (It looks really cool though) or do other things in combination with crafting.

Here is what I would suggest, it is very primitive and brutal, but in the same time simple and if not messed will work just fine.
So to begin with: Introduce an ability which spawns a unit, "Crafting table". The table will have inventory and 1 ability, "Craft".

My friend and I both play a ton of crafting/survival games, which is why we are trying it out on here. I'm meeting him tomorrow some time to discuss the rest of the map design/units, and also the crafting system. So I don't know an exact number of items yet. We want this map to be noob friendly, but at the same time enjoyable for more experienced players. Until we get the designs and "crafting tree" done it's hard to say. Guessing, I'd say around 25 different raw materials with different combinations making about 40 new items. Then those new items might be used with more raw materials to "upgrade" them into better items. Let's say.. 75 items including all raw materials, intermediate items, and final items. It may sound like a lot, but it won't be once it's laid out. I'm going to make a crafting recipe guide for the game as well. Which just reminds me, I would like to do this with tooltips the way Jay does on "wilderness survival" or something similar. I'm definitely giving him credit for partial inspiration of this map haha.

If we have to, we can come up with some ways to get rid of certain crafting items to make it easier, but I still want the crafting element in the game for sure. For example, there will be enemy units throughout the map including a few "bosses" or "mini-bosses" which could have a % drop of special items that can't be crafted. etc...

Yes, I have thought about creating a building that works as a crafting building. (Think "crafting table" from Minecraft.)
 
Level 3
Joined
Mar 24, 2015
Messages
43
Yes, Wietlol. That sounds like a good option I will keep in mind. Thanks!
I'll just need to figure out how to make that work with custom icons (interface?) and triggers.

Edit: Yes, I already have a system for players to equip weapons, and I *think* armor as well. If not, I will find a way!
I think giving each player a backpack for extra inventory is good. I can't think of anything besides a backpack though. Maybe each player gets a pack mule that follows them around XD
If I go with the backpack idea, the way the story works is that the players have fled their village and are going to an extraction point. They have to craft better gear to survive and fight through to the end. They story plays out as if they had no time to prepare, before having to flee their village, but I thought another possible idea could be that each player gets a % rate of a starting item for crafting/survival that they could've already had in their packs. For example, maybe a 5% chance to get a knife/weapon, 5% chance to get a piece of clothing/armor, ?% chance to get food/bandages/etc... stuff like that. You get the idea.

Edit, again: If I did that idea, certain players would start with only 1 basic item (nothing game-breaking), and all players are on the same team anyway vs the enemies, and they have to work together to reach the end.
 
Last edited:
Level 12
Joined
Mar 17, 2007
Messages
412
Let me start by saying, I'm new to the WC3 WE. Just started like 3 days ago. I've learned very fast with help from some great community members, but without an example or reference, it takes me forever to make a trigger, but I can usually get it working. I'm not quite sure how the triggers will work in relation to a custom spell or whatever I need for this:

1. (I'm making a survival/crafting game). Similar to “Wilderness Survival” game by Jay; I want a unit (with inventory) to be holding several items that combine into one. First, I need to know how to create my own Icon & tooltip (or spell? Idk) and name it “Craft.” Then, when i click on it, I want it to remove the recipe items from my inventory, and input the new item. How would I do this?

I ask a similar question a few days ago, and one person said "I suggest to get item system from spell section (preferable GUI)."

Can someone explain this, and/or give me a link to a tutorial?
I'm also not sure what type of triggers I will need, their setup, and how many I will need. Would I need a trigger for every single recipe?

Thank you.

Hello,

I see that this is another "Wilderness Survival" thread of 'how does this work". It's great that the map has inspired you but you're asking much of the same "mechanics" there's a reason why you wont find the exact system you're looking for because I created them from scratch from the "editor" I didn't find them anywhere & if I shared them we would have several of these maps crawling around & just wouldn't be enjoyable anymore. Also the map took several years to make so I wouldn't expect a flick of the fingers for stuff to be provided for you, the map editor is time consuming you just gotta take the time to learn it.
 
Level 3
Joined
Mar 24, 2015
Messages
43
Hello,

I see that this is another "Wilderness Survival" thread of 'how does this work". It's great that the map has inspired you but you're asking much of the same "mechanics" there's a reason why you wont find the exact system you're looking for because I created them from scratch from the "editor" I didn't find them anywhere & if I shared them we would have several of these maps crawling around & just wouldn't be enjoyable anymore. Also the map took several years to make so I wouldn't expect a flick of the fingers for stuff to be provided for you, the map editor is time consuming you just gotta take the time to learn it.

Hey Jay!

As you know, I'm new to map making. Therefore, I have no idea what's available. I've searched and found certain things, and have had to ask for advice on others. I agree that a lot of time and effort go into these maps, and it's certainly a challenge having to learn it all.

Just so you know, this game isn't as much like a crafting/survival game as yours is(I've only recently found and played your game about 5 times and I enjoy it... I've even hosted it myself a few times :)). I'm not trying to make a map to compete with yours. My map will just have similar crafting mechanics to yours. To clarify with respect for you personally, my map is a team based game (no pvp). Players have to go from point A to point B. During that journey, they must work as a team to craft better gear and survive enemies. I planned to make it more vs nature, but my friend insisted on adding a zombie plague, so most of the enemies in my game will be zombies, bosses, and mini-bosses that the players will have to fight through to get to the end. My friend and I just love crafting games so much we wanted to incorporate some of these mechanics into this game. What I'm trying to say is that you shouldn't worry; our games will have tons of noticeable differences :)

Feel free to send me a pm anytime if you have questions/concerns.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
My friend and I both play a ton of crafting/survival games, which is why we are trying it out on here. I'm meeting him tomorrow some time to discuss the rest of the map design/units, and also the crafting system. So I don't know an exact number of items yet. We want this map to be noob friendly, but at the same time enjoyable for more experienced players. Until we get the designs and "crafting tree" done it's hard to say. Guessing, I'd say around 25 different raw materials with different combinations making about 40 new items. Then those new items might be used with more raw materials to "upgrade" them into better items. Let's say.. 75 items including all raw materials, intermediate items, and final items. It may sound like a lot, but it won't be once it's laid out. I'm going to make a crafting recipe guide for the game as well. Which just reminds me, I would like to do this with tooltips the way Jay does on "wilderness survival" or something similar. I'm definitely giving him credit for partial inspiration of this map haha.

If we have to, we can come up with some ways to get rid of certain crafting items to make it easier, but I still want the crafting element in the game for sure. For example, there will be enemy units throughout the map including a few "bosses" or "mini-bosses" which could have a % drop of special items that can't be crafted. etc...

Yes, I have thought about creating a building that works as a crafting building. (Think "crafting table" from Minecraft.)

Nnngh, yeeea, my initial idea was for a more-modest amount of materials, basically you give each material a value and make each recipie a sum of the materials values. This messes up if materials have close values, which limits you to about ~15-20 different materials if you calculate it properly.

So my second stupid plan was of making Ability for each recipie and stack them in spellbooks inside the Crafting Table. When you activate one of these spells a single trigger will check the Crafting Table's inventory for the needed materials. You will have to register all of the Abilities and Recipies and link them together.
I really wanted to avoid that as it may get pretty heavy when ran if you have a lot of recipies, or actualy not...
 
Level 3
Joined
Mar 24, 2015
Messages
43
Nnngh, yeeea, my initial idea was for a more-modest amount of materials, basically you give each material a value and make each recipie a sum of the materials values. This messes up if materials have close values, which limits you to about ~15-20 different materials if you calculate it properly.

So my second stupid plan was of making Ability for each recipie and stack them in spellbooks inside the Crafting Table. When you activate one of these spells a single trigger will check the Crafting Table's inventory for the needed materials. You will have to register all of the Abilities and Recipies and link them together.
I really wanted to avoid that as it may get pretty heavy when ran if you have a lot of recipies, or actualy not...

I think the spellbook idea is the best option I'm aware of right now. Similar to what Wietlol said a few posts above this. I've been awake for almost 40 hours now (yay insomnia) so I'm gonna try to get some sleep and I'll look for some spellbook tutorials tomorrow unless you already know of one.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Recipes are not that hard to make.
I would recommend you to first of all design your map.
Just write some stuff down in pictures and stuff and think about if it will be actually possible to do the things you want to do.

According to your numbers:
Guessing, I'd say around 25 different raw materials with different combinations making about 40 new items. Then those new items might be used with more raw materials to "upgrade" them into better items. Let's say.. 75 items including all raw materials, intermediate items, and final items.
I see that there will be a big problem if you have 6 inventory slots.
First of all you will have 25 possible raw materials.
Most of the materials will be pretty straight forward and you will almost always have at least one of them in your inventory.
Now you require 20 slots already.
When crafting those items that you want, you have to gather and gather and gather until you can craft it. In the meantime, you have collected a lot of other resources that you do not need. So my 20 slots are not that bull shit.

After that you will start crafting. Right now, you want to have a new item (lets say up to 10 items) that you will combine into a useable item (Iron Ignot + Wooden Stick = Iron Mace)
Now there is problem 2: Where the hell will you have your weapons etc if you already need 24 more slots than you actually have?
Now in fact you want to have 5-6 items as combat items and 3-4 consumables and 3-6 crafting materials and 20-25 raw materials.
So you have a slightly 600% too small inventory.

The question for you is not "How do I make recipes?" but "How can I store items?".

As I mentioned above: "Recipes are not hard to make.".
When you click "craft" or buy a recipe, you will check if you have all items required to craft the item. When you have those, you remove the stacks of those and maybe the whole item and you will create the new item.

However, the customized inventory is hard.
I have seen a lot of recipe systems accross the hive and making it is not taking that much time. Inventory systems is taking you a long time.
I have made one for myself which is still not working 100% (85% probably) and it took me a big hell of time to make.
 
Level 3
Joined
Mar 24, 2015
Messages
43
Thanks Wietlol, but let me explain a little more.
Of course those numbers were just my best guess. My friend and I are actually about to sit down in the next few minutes and discuss all of this stuff and get it figured out.

The resources in the game are going to be relatively easy to find. I'm going to design it so you shouldn't have to go far to find a certain resource for crafting. Because of their availability throughout the map, you shouldn't have to carry extra resources to craft future items, because you can find them in each new area. Some of these resources won't be available until you reach certain areas of the map because they'll be used to create mid-game and late-game items which will replace several early-game items. (for this, the player can just drop the old item, and craft the new one to take it's inventory slot). Therefore, I think having a regular inventory of 6 items, and a backpack with an extra 6 slots will be enough.
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
In that case I will tell you some stuff about recipes:
Recipes are simply combining multiple items (gold is also an item) into a new item.
You combine for example ItemA and ItemB into ItemC.
To craft ItemC, you require at least one ItemA and ItemB in your inventory or whereever you are allowed to take them from.

When you craft ItemC, you will remove ItemA and ItemB first and add ItemC afterwards.
  • Craft
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Craft ItemC
    • Actions
      • -------- ItemC --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CraftingUnit has an item of type ItemA) Equal to True
          • (CraftingUnit has an item of type ItemB) Equal to True
        • Then - Actions
          • Item - Remove (Item carried by CraftingUnit of type ItemA)
          • Item - Remove (Item carried by CraftingUnit of type ItemB)
          • Hero - Create ItemC and give it to CraftingUnit
        • Else - Actions
          • Unit - Order (Triggering unit) to Stop
This one simply creates ItemC if ItemA and ItemB both have no stacks.
For stacks it gets more complicated and you also have to check if you have enough inventory space.
Also when using a custom inventory, you want to check if the hero has items outside his regular inventory (Regventory).

You mentioned a secondary inventory, a 6 slots backpack.
You probably have a different unit which has 6 items and you switch the items between your hero and the dummy when you click on some command button.
In that case, it is pretty simple to check if a unit has a certain item and how many stacks/charges it has left.
It also gets more complicated if you have multiple possibilities to craft one item but that is only implemented in very few games.

At least here is a very simple basic to use while making the method of how the players actually should be crafting.
 
Level 3
Joined
Mar 24, 2015
Messages
43
This one simply creates ItemC if ItemA and ItemB both have no stacks.
For stacks it gets more complicated and you also have to check if you have enough inventory space.
Also when using a custom inventory, you want to check if the hero has items outside his regular inventory (Regventory).

You mentioned a secondary inventory, a 6 slots backpack.
You probably have a different unit which has 6 items and you switch the items between your hero and the dummy when you click on some command button.

The only items I plan to have stacks of are food and arrows. They will be the "ItemC" in your explanation. They won't be used to combine into anything else. I do need to know how to actually create items that can stack.

I'm fine with only the player being able to craft with the items in their inventory. (Not with items in the backpack). I would actually prefer it that way, because it's like the player has the item readily accessible to craft with rather than the item being inside the backpack (not readily accessible). If a player wants to craft with an item in their backpack, they'll have to move it to their regular inventory. (As if a real person were removing an item from their backpack to craft with it, lol).

I'll have to figure out how to do the "dummy" character w/ inventory like you were saying.

Thanks for the trigger, I'll save it and try it out when I start adding the items. Currently, my physical map is like 99% done, excluding scenery/decorations.
I already have the player units/start locations in the game. I'm in the middle of adding all the enemy units/bosses right now.

Things I still have to do:
-Add animals/edit. (I know how)
-Add custom buildings/edit. (I know how)
-Design crafting system, items, recipes, and their triggers. (WIP)
-Add weapon/armor models for player units. (I think I know how)
-Add resources around map. (Haven't tried yet. If the items appear as the default item chests, I'll have to find/make models).
-Add items as drops for trees(wood) & killing specific enemy units. (I know how)
-Design & add custom abilities for appropriate units. (I think I know how)
-Balance all unit's stats. (I know how)
 

sentrywiz

S

sentrywiz

Let me start by saying, I'm new to the WC3 WE. Just started like 3 days ago. I've learned very fast with help from some great community members, but without an example or reference, it takes me forever to make a trigger, but I can usually get it working. I'm not quite sure how the triggers will work in relation to a custom spell or whatever I need for this:

1. (I'm making a survival/crafting game). Similar to “Wilderness Survival” game by Jay; I want a unit (with inventory) to be holding several items that combine into one. First, I need to know how to create my own Icon & tooltip (or spell? Idk) and name it “Craft.” Then, when i click on it, I want it to remove the recipe items from my inventory, and input the new item. How would I do this?

I ask a similar question a few days ago, and one person said "I suggest to get item system from spell section (preferable GUI)."

Can someone explain this, and/or give me a link to a tutorial?
I'm also not sure what type of triggers I will need, their setup, and how many I will need. Would I need a trigger for every single recipe?

Thank you.

Those spells which don't do anything and are simply used for triggers are referred to as "Dummy / Channel " spells. Dummy because they don't do anything or have their effects removed and Channel because Channel is a spell specifically made for triggered effects.

Here is a tutorial for channel:

Link

Next, what you want is simply a recipe trigger. Usually recipe triggers work automatically when a unit acquires all needed items, but it can be made with a spell no bother.

Here is a dummy trigger from one of my maps with recipes:

  • Item Recipe
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • ((Hero manipulating item) has an item of type Item1) Equal to True
      • ((Hero manipulating item) has an item of type Item2) Equal to True
    • Actions
      • Special Effect - Create a special effect attached to the origin of (Hero manipulating item) using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Item - Remove (Item carried by (Hero manipulating item) of type Item1)
      • Item - Remove (Item carried by (Hero manipulating item) of type Item2)
      • Hero - Create Item3 and give it to (Hero manipulating item)
If you want the trigger to fire when a spell is cast, you can modify it in this manner:

  • Item Recipe
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Craft
      • ((Triggering Unit) has an item of type Item1) Equal to True
      • ((Triggering Unit) has an item of type Item2) Equal to True
    • Actions
      • Special Effect - Create a special effect attached to the origin of (Triggering Unit) using Abilities\Spells\Demon\DarkPortal\DarkPortalTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Item - Remove (Item carried by (Triggering Unit) of type Item1)
      • Item - Remove (Item carried by (Triggering Unit) of type Item2)
      • Hero - Create Item3 and give it to (Triggering Unit)
We use triggering unit here because the event has changed.

And I believe that's all you wanted?
 
Level 3
Joined
Mar 24, 2015
Messages
43
HAHAHA dont make me laugh :D

That is even a problem in AAA games.

I know it will take time to balance stats, but I do know how.

I'm 22 years old, and I've passed calc 3 in college... My friend Levi who is helping with the design of the game does Physics, and he just made his own original algorithm for a payload that will be on a rocket being sent 75 miles up into the atmosphere for data testing this summer. His algorithm was better than the computer generated one.

We got this ;)
 
Level 3
Joined
Mar 24, 2015
Messages
43
We use triggering unit here because the event has changed.
And I believe that's all you wanted?

I think the second trigger you listed is the one I'll be using, thank you.

What are the special effects in the action part of that trigger?

Edit: thanks for the tutorial link. That's exactly what I need to use. I was also going to experiement and find a way so that not just any ability used will trigger the craft effect, and I found the trigger condition I need at the bottom of that tutorial that will solve this problem :D
 
Last edited:
Level 3
Joined
May 12, 2012
Messages
41
to answer the question simply,
you need collectable items that dissappear out of your inventory when clicked but have no effect,
then you need a trigger for "item used",
with multiple OR conditions -> one for every item out of that one combination,
and then the reaction to remove all of those items out of the inventory and put another one (specified) item into the inventory of the triggering unit.
 
Status
Not open for further replies.
Top