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

[Trigger] One-Type Equip

Status
Not open for further replies.
Level 3
Joined
Sep 20, 2007
Messages
30
I want to make a RPG map.. How can i make a swordsman-type unit can only handling 1 sword and 1 shield?
and how can i make an item have maximum 99 stock(or charges) ?(while we can only get one when buying or Monster drops).
 
Level 22
Joined
Feb 4, 2005
Messages
3,971
I deleted my resource, I used to have this not to pick more than 1 bag let's say. And the game's not in front of me -

Event: A hero picks an item (don't remember the exact name)
C: Number of items carried by (hero manipulating item) of type (The window will choose exactly the item you mean -say Your Sword) not equal to (or greater than) 0. (This will allow you to be able to to pick one)
C: Number of items carried by (hero manip item) of type Sword2 not equal to (or greater than) 0.
- you have to make the condition for every single sword you have, if you have 20 swords, make a condition for each of it, so 20 conditions for each sword carried by you not to be greater than 0
AND Another 20 conditions or 1 condition with 19 OR (Boolean) item being manipulated equal to Sword1 or Sword 2 or Sword 3 or Sword 4... so that you don't drop an item say cheese and you have a sword :)
Just copy+paste each function and change the sword, the rest remains, so you can make these conditions fast

Action:
Drop (item being manipulated)

The idea is if you already have a sword of any type, you will drop another sword instantly if you try to pick it up.

Now make a separate trigger with the same event, conditions the same as with the sword but now you choose a condition for every shield you have.
Actions: the same as up
You can add an action like : Text- Display text message "You are already eqiupped", etc.

With inactivity and the game not in front of me I can't say names and triggers with accuracy but if you 've worked with triggers before, this may give you how to do it
 
Level 5
Joined
Aug 2, 2004
Messages
65
There is a much faster way to do this, by using item classes:

Lets just say you want 5 item types; weapon, shield, helmet, gloves, shoes. What we do is set these to be a particular item class simply by every item of <TYPE> be a specific class; Permanent, Artifact, Purchaseable, Campaign, Miscellaneous ect.

In your trigger you do this, in this case an item type is set as Permanent;
  • Item Class
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • Hero - Drop (Item being manipulated) from (Hero manipulating item)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-class of (Item carried by (Hero manipulating item) in slot 1)) Equal to (Item-class of (Item being manipulated))
              • (Item-class of (Item carried by (Hero manipulating item) in slot 2)) Equal to (Item-class of (Item being manipulated))
              • (Item-class of (Item carried by (Hero manipulating item) in slot 3)) Equal to (Item-class of (Item being manipulated))
              • (Item-class of (Item carried by (Hero manipulating item) in slot 4)) Equal to (Item-class of (Item being manipulated))
              • (Item-class of (Item carried by (Hero manipulating item) in slot 5)) Equal to (Item-class of (Item being manipulated))
              • (Item-class of (Item carried by (Hero manipulating item) in slot 6)) Equal to (Item-class of (Item being manipulated))
        • Then - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
          • Hero - Give (Last dropped item) to (Hero manipulating item)
          • Trigger - Turn on (This trigger)
Do this for your chosen item types and you will only be able to pick up one of a certain item. To do an error message such as "You already have an item of this type" just put the appropriate action in the "Then - Actions" section.

For Charges on items this trigger will make it so when picking up an item, it will add the charges to the same item of type in the inventory.
  • Charges
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
            • Then - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
              • Item - Set charges remaining in (Last dropped item) to ((Charges remaining in (Item being manipulated)) + (Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))))
              • Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))
              • Trigger - Turn off (This trigger)
              • Hero - Give (Last dropped item) to (Hero manipulating item)
              • Trigger - Turn on (This trigger)
            • Else - Actions
 
Last edited:
buddy, that doesnt work.. it will drop the item right when you pick it up.. i have a trigger in my map that you should be looking for.. here

O goodie, its only one trigger! :D you will have to organize all your items tho.. like "weapons in Permanent" "Helmets in Artifact" etc. do what my trigger does and you'll figure it out.
  • one Class
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • ((Hero manipulating item) has (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to True
                  • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
                  • (Item-class of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-class of (Item being manipulated))
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item-class of (Item being manipulated)) Equal to Permanent
                • Then - Actions
                  • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                  • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item-class of (Item being manipulated)) Equal to Artifact
                    • Then - Actions
                      • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                      • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Item-class of (Item being manipulated)) Equal to Purchasable
                        • Then - Actions
                          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Item-class of (Item being manipulated)) Equal to Campaign
                            • Then - Actions
                              • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: |cffff0000You alrea...
                              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
                            • Else - Actions
            • Else - Actions
 
Level 10
Joined
Sep 21, 2007
Messages
517
in my rpg systems pack i have all kinds of systems for rpgs, all made in gui and professional + leakless, its making the headlines, just got approved 2 days ago, just use it, i also made a chat system if you need one, i didnt post it yet in pending spells, but if you want it just send a private message, its simple but it has many features. (banning from chatlog,minimizing names based on what you put..etc)
it also has a guide on how to make your Chatlog (used to show your chat) more professional or exciting, with 3 complete paths that look really nice.
~~hope i helped.
 
Status
Not open for further replies.
Top