1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. The 13th Music Contest Poll is up! Vote for the best tracks in this symphony of frost and flame.
    Dismiss Notice
  7. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  8. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Check if hero has 2 of the same item

Discussion in 'World Editor Help Zone' started by Qrom Bellascream, Oct 22, 2017.

  1. Qrom Bellascream

    Qrom Bellascream

    Joined:
    Apr 5, 2013
    Messages:
    150
    Resources:
    0
    Resources:
    0
    This is what i'm working with
    • pistol ability
      • Events
        • Unit - A unit Acquires an item
      • Conditions
        • (Item-type of (Item being manipulated)) Equal to 9mm
        • (Unit-type of (Hero manipulating item)) Equal to Player
      • Actions
        • Unit - Add Attack 9mm(Dummy) to (Hero manipulating item)
        • Item - Remove (Item carried by (Triggering unit) of type AK-47)
        • Item - Remove (Item carried by (Triggering unit) of type Butcher's Chopper)
        • Item - Remove (Item carried by (Triggering unit) of type M249 Light Machine Gun)
        • Item - Remove (Item carried by (Triggering unit) of type M4A1)
        • Item - Remove (Item carried by (Triggering unit) of type Prototype Shock Rifle)
        • Item - Remove (Item carried by (Triggering unit) of type Rusty Knife)

    This trigger takes into account picking up other weapons, but picking up the same weapon will cause it to be picked up, which it shouldn't. I tried messing around with "for loop a," but to no avail. Some insight into this would be appreciated
     
  2. RG00

    RG00

    Joined:
    Jun 4, 2017
    Messages:
    172
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Try with something like this:
    • Test
      • Eventi
        • Unità - A unit Raccoglie un oggetto
      • Condizioni
      • Azioni
        • Set Guns = 0
        • For each (Integer A) from 1 to 6, do (Actions)
          • Giro - Azioni
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • Se - Condizioni
                • (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Uguale a Gun
              • Allora - Azioni
                • Set Guns = (Guns + 1)
              • Altrimenti - Azioni
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • Se - Condizioni
            • Guns Maggiore di 1
          • Allora - Azioni
            • Eroe - Drop (Item being manipulated) from (Hero manipulating item)
          • Altrimenti - Azioni
     
  3. Wark

    Wark

    Joined:
    Oct 12, 2016
    Messages:
    744
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Did you try adding an if/then/else statement with a check to see if the hero has the item, then remove if they do?