• 🏆 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!

a system for itens and resouce generator

Status
Not open for further replies.
Level 2
Joined
Nov 6, 2019
Messages
7
Hi guys, I don't know if this is the right place for this sorry ... I am trying to make a way for an upgrade to generate an item within the building (having hero inventory) and a butom to make iron sword consuming iron ore and leather along with it generating a resorce and gold or wood per second.

and there would be a system that you could use items as a requirement to make a unit like:

recruit + sword + armor = footman (would work when you hit the button to do it would consume the items in the barracks inventory)
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
Sadly I don't fully understand what you mean when you say: "I am trying to make a way for an upgrade to generate an item within the building (having hero inventory) and a butom to make iron sword consuming iron ore and leather along with it generating a resorce and gold or wood per second."

But I think I understood your second request: "Items as requirements to train units" and I came up with a system for you and uploaded the map below.

How to use:
Edit the Setup Items trigger and add in your own Items. Follow the 5 steps listed under "How to add a new Item".
  • Setup Items
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- How to add a new Item: --------
      • -------- 1) Create a new Integer variable and a new Item in the Object Editor --------
      • -------- 2) Name the new variable something related to the Item's name like this: Item_Sword --------
      • -------- 3) Set the new variable to be equal to the next unused number. If this is your first new Item then it will be equal to 4, then 5, then 6, etc... --------
      • -------- 4) Set ItemType[] to the Item from the Object Editor and use the number from step 3 as it's Array --------
      • -------- 5) Set TotalItems to however many Items the system uses --------
      • -------- - --------
      • Set TotalItems = 3
      • -------- - --------
      • Set Item_Recruit = 1
      • Set ItemType[1] = Recruit
      • -------- - --------
      • Set Item_Shield = 2
      • Set ItemType[2] = Shield
      • -------- - --------
      • Set Item_Sword = 3
      • Set ItemType[3] = Sword
Then copy and paste one of my Example triggers. Here's an example for training a Footman. It requires 1 Recruit, 1 Sword and 1 Shield to train. Use the variables RequiredItem[] and RequiredItemCount[] to set which Items and how many of them you will need to train the Footman or whichever unit you want to train. You can have up to 6 RequiredItems (because there's 6 max inventory slots). Also, make sure to put the correct Unit Type in the Conditions. Once you've put in all of the requirements you can run the Convert Items trigger and the system will do the rest for you.
  • Train Footman
    • Events
      • Unit - A unit Begins training a unit
    • Conditions
      • (Trained unit-type) Equal to Footman
    • Actions
      • -------- Put your requirements here: --------
      • Set RequiredItem[1] = Item_Recruit
      • Set RequiredItemCount[1] = 1
      • Set RequiredItem[2] = Item_Sword
      • Set RequiredItemCount[2] = 1
      • Set RequiredItem[3] = Item_Shield
      • Set RequiredItemCount[3] = 1
      • -------- - --------
      • -------- Run this trigger: --------
      • Trigger - Run Convert Items <gen> (ignoring conditions)
 

Attachments

  • Items into Units.w3x
    21.2 KB · Views: 18
Last edited:
Level 2
Joined
Nov 6, 2019
Messages
7
thanks and in the other and so, I created a mine and one upgraded to produce iron but that it becomes an item and it will be generated in the mine's inventory finally another upgrade that made this mine generate gold per second.

And your map don't open on editor say's "level info data missing or invalid" :/
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
Are you using the latest patch? It must have to do with the folders/variable changes added in the newer patches, because the triggers themselves should be compatible with any version.

Also, I uploaded another version, maybe this one will work?
 

Attachments

  • Items into Units 2.w3x
    21 KB · Views: 23
Last edited:
Level 2
Joined
Nov 6, 2019
Messages
7
Are you using the latest patch? It must have to do with the folders/variable changes added in the newer patches, because the triggers themselves should be compatible with any version.

Also, I uploaded another version, maybe this one will work?

Yeah i'm not put the wc3 in the last patch lol, the map work fine thanks so much and for others things have any tips ?
 
Level 2
Joined
Nov 6, 2019
Messages
7
For the gold mine, do you plan on having multiple gold mine's per player or only 1 per player?

multiples but i see that we got unbalanced i put a limit. the ideia of my map is put a system like the knights and merchant, where buildings create the items to get things done
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,535
Do you want to add Gold like this?
  • Player - Add 100 to Player 1 (Red) Current gold
Or have an item called Gold, like the Iron.

Edit: I attached a map with an example of how you could do it. It's not perfect but I didn't have much to work with. If you can explain it in greater detail it makes it easier to know exactly what you want.
 

Attachments

  • Gold Mine.w3x
    18.7 KB · Views: 14
Last edited:
Level 2
Joined
Nov 6, 2019
Messages
7
Do you want to add Gold like this?
  • Player - Add 100 to Player 1 (Red) Current gold
Or have an item called Gold, like the Iron.

Edit: I attached a map with an example of how you could do it. It's not perfect but I didn't have much to work with. If you can explain it in greater detail it makes it easier to know exactly what you want.

not gold is the same used by the game, I moved to item the resources that the game does not have, such as iron, horses, wooden boards etc. the idea is that you do the research, mine and other builds create the item in her inventory to worker pick up. i'm leaving the map i'm working on might help in understanding xD

Ps: the system of gold mine is great, I was having trouble remembering things kk
 

Attachments

  • Dep RTS test.w3x
    2.1 MB · Views: 14
Status
Not open for further replies.
Top