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

Grrr.

Status
Not open for further replies.
Level 4
Joined
Jul 9, 2008
Messages
88
Hey

Im doing this in GUI because I thought it would be simple, and because I tried it in jass, and because I suck at jass, failed.
In the RPG that I am making, I made it so if you pick up, the item, you get an attachment. (through the object editor).
Since it is totally unrealistic to have like 4 attachments, OR to have it say "you can only carry one sword at a time" or something like that, I wanted it to be so if you click the item, it enables/disables it, shows a BTN/DISBTN, the tooltip/"Click to enable this item". That was fairly simple. Then I wanted it to only let you have 1 enabled at a time, or if you click a disabled item, and another is enabled already, it switch for you without having to disable the other one first. (if i worded it right). That resulted in a long string of triggers that confused me and probly confuse you too. So heres the original and what I got so far, any simple way to do what I wrote this whole noobish paragraph about? :(
  • init vars
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set ItemTypes[1] = Spear
      • Set ItemTypes[2] = Spear
      • Set ItemTypes[3] = Long Sword
      • Set ItemTypes[4] = Long Sword
      • Set ItemTypes[5] = Short Sword
      • Set ItemTypes[6] = Short Sword
      • Set ItemTypes[7] = Morning Star
      • Set ItemTypes[8] = Morning Star
      • Set ItemTypes[9] = Spell Axe
      • Set ItemTypes[10] = Spell Axe
      • Set ItemTypes[11] = Quarter Staff
      • Set ItemTypes[12] = Quarter Staff
      • Set NumberOfItemTypes = 12
Note that the odd numbers in the previous triggers are enabled, the even numbers are the disabled ones. Important.
  • item
    • Events
      • Unit - A unit Uses an item
    • Conditions
    • Actions
      • For each (Integer A) from 1 to NumberOfItemTypes, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Equal to ItemTypes[(Integer A)]
            • Then - Actions
              • Set ItemTypeNumber[(Player number of (Triggering player))] = (Integer A)
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ItemTypeNumber[(Player number of (Triggering player))] Not equal to 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (ItemTypeNumber[(Player number of (Triggering player))] mod 2) Equal to 0
                • Then - Actions
                  • Item - Remove (Item being manipulated)
                  • Hero - Create ItemTypes[(ItemTypeNumber[(Player number of (Triggering player))] - 1)] and give it to (Triggering unit)
                • Else - Actions
                  • Item - Remove (Item being manipulated)
                  • Hero - Create ItemTypes[(ItemTypeNumber[(Player number of (Triggering player))] + 1)] and give it to (Triggering unit)
              • Set ItemTypeNumber[(Player number of (Triggering player))] = 0
            • Else - Actions
Yea, I know. Note that the event is when you click the item, using the dummy ability. Also note that when I do mod, I am finding out if the number is even or not, so I know if its enabled or disabled.
lol :( I hope u can help

EDIT: Another note: THIS DOES WORK. Im asking for help to make it do the extra features I wanted.
EDIT2: should I just post the Jass I made so far and have you help me with it?
 
Status
Not open for further replies.
Top