One Item Type per Hero

Status
Not open for further replies.
Level 3
Joined
Oct 3, 2008
Messages
41
Hello Everyone,

I was wondering how to make it so that heros could only carry one weapon, one shield, one piece of body armour and so on. In my map, I have openable and closable gates, purchasable abilities, almost complete ai and so on. My weapons show up on my character so I dont want them to overlap. Can someone help please?
 
1 weapon only

There are several different item classifications like permanent,

031008152554_Bild1.JPG


You put all items of one type for example weapons in one class.

Then you create a trigger which looks similar to this one

031008152912_Bild2.JPG


That should work.

You can pm me if you have problems...

Azazel
 
No offence but you didn't explain it very good DarkAngelAzazel.
There is a tutorial how to do this here.

You can also use the triggers below.
I based them of the tutorial, and in my opinion should be better because you wont have to make a trigger for each player, however I never tested it. xD

Read the tutorial and then you'll most likely know what my triggers say aswell, if u however don't understand it you can always ask me to explain it better.


  • Only1Weapon
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • 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
          • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Equal to False
        • Then - Actions
          • Set Only1Weapon[(Player number of (Owner of (Triggering unit)))] = True
        • 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
              • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Equal to True
            • Then - Actions
              • Set DropPointItem[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
              • Item - Move (Item being manipulated) to DropPointItem[(Player number of (Owner of (Triggering unit)))]
              • Floating Text - Create floating text that reads You are already wea... at DropPointItem[(Player number of (Owner of (Triggering unit)))] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
              • Floating Text - Change (Last created floating text): Disable permanence
              • Floating Text - Change the lifespan of (Last created floating text) to 5.00 seconds
              • Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
              • Floating Text - Set the velocity of (Last created floating text) to 15.00 towards 90.00 degrees
              • Custom script: call RemoveLocation(udg_DropPointItem[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
              • Set Only1Weapon[(Player number of (Owner of (Triggering unit)))] = True
            • 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
                  • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Equal to False
                • Then - Actions
                  • Set Only1Weapon[(Player number of (Owner of (Triggering unit)))] = True
                • Else - Actions
                  • Do nothing
  • Able2PickUpWeapon
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • 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
          • Only1Weapon[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Set Only1Weapon[(Player number of (Owner of (Triggering unit)))] = False
        • Else - Actions
          • Set Only1Weapon[(Player number of (Owner of (Triggering unit)))] = False
Why use these? Since they should apply to all heroes instaid of making a trigger for each hero.
 
No offence but you didn't explain it very good DarkAngelAzazel.

I wish the people would stop calling me "DarkAngelAzazel" :( I just put DarkAngel before that because only Azazel wasn't accepted.... :(
Plz just call me Azazel..

You can also use the triggers below.
I based them of the tutorial, and in my opinion should be better because you wont have to make a trigger for each player, however I never tested it. xD

^^ sure your right.. but i never understood how to use the trigger BB code...
Do i need to put the trigger in jass in the [TRIGGER.] [/TRIGGER.] thing?

Why use these? Since they should apply to all heroes instaid of making a trigger for each hero.

Oo but my trigger is not for one hero...
It says "a unit aquires an item" thats general isn't it? :confused:
 
I wish the people would stop calling me "DarkAngelAzazel" :( I just put DarkAngel before that because only Azazel wasn't accepted.... :(
Plz just call me Azazel..



^^ sure your right.. but i never understood how to use the trigger BB code...
Do i need to put the trigger in jass in the [TRIGGER.] [/TRIGGER.] thing?



Oo but my trigger is not for one hero...
It says "a unit aquires an item" thats general isn't it? :confused:
No. You put JASS inside [code=jass][/code] tags.

A unit acquires is indeed general.
 
Status
Not open for further replies.
Back
Top