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. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. 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.

Item class

Discussion in 'World Editor Help Zone' started by Lkal, Sep 3, 2015.

  1. Lkal

    Lkal

    Joined:
    Mar 30, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    Good afternoon, I have a question, how to make that unit could not pick up 2 items from one class.
     
  2. Melth

    Melth

    Joined:
    Jul 8, 2013
    Messages:
    201
    Resources:
    2
    Maps:
    2
    Resources:
    2
    Good afternoon, I have an answer!

    Use something like this:

    • Item Classes and Dropping
      • Events
        • Unit - A unit Acquires an item
      • Conditions
        • Or - Any (Conditions) are true
          • Conditions
            • And - All (Conditions) are true
              • Conditions
                • (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot 1))
                • (Item carried by (Triggering unit) in slot 1) Not equal to (Item being manipulated)
            • And - All (Conditions) are true
              • Conditions
                • (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot 2))
                • (Item carried by (Triggering unit) in slot 2) Not equal to (Item being manipulated)
            • And - All (Conditions) are true
              • Conditions
                • (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot 3))
                • (Item carried by (Triggering unit) in slot 3) Not equal to (Item being manipulated)
            • And - All (Conditions) are true
              • Conditions
                • (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot 4))
                • (Item carried by (Triggering unit) in slot 4) Not equal to (Item being manipulated)
            • And - All (Conditions) are true
              • Conditions
                • (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot 5))
                • (Item carried by (Triggering unit) in slot 5) Not equal to (Item being manipulated)
            • And - All (Conditions) are true
              • Conditions
                • (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot 6))
                • (Item carried by (Triggering unit) in slot 6) Not equal to (Item being manipulated)
      • Actions
        • Hero - Drop (Item being manipulated) from (Triggering unit)



    Basically, when the unit picks up an item, the item is immediately dropped if it is the same class as any OTHER item the unit already has.

    Thus a unit can never have two items of the same class.
     
  3. @Melth - This is a very bare-bones solution. it is also inefficient and can resolve multiple times. a loop would be better.

    Here is my take on this. Much more efficient and clean:

    • item block and drop
      • Events
        • Unit - A unit Acquires an item
      • Conditions
      • Actions
        • For each (Integer INT_TEMP) from 1 to 6, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Item being manipulated) Not equal to (Item carried by (Triggering unit) in slot INT_TEMP)
                • (Item-class of (Item being manipulated)) Equal to (Item-class of (Item carried by (Triggering unit) in slot INT_TEMP))
              • Then - Actions
                • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Custom script: exitwhen true
              • Else - Actions
        • Set INT_TEMP = 0
     
  4. Shadow Fury

    Shadow Fury

    Joined:
    Nov 4, 2013
    Messages:
    1,629
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Best solution is mine since I am using it in my map to prevent the picking of similar items (no matter what class/category). It is very flexible, easy to create and fully-functional. Create an event "Unit - A unit Acquires an item" then do the following actions:


    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Item being manipulated)) Equal to [Item 1]
        • ((Hero manipulating item) has an item of type [Item 1] Equal to True
      • Then - 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
            • ((Hero manipulating item) has an item of type [Item 1]) Equal to False
            • ((Hero manipulating item) has an item of type [Item 2]) Equal to False
          • Then - Actions
            • Hero - Give (Item being manipulated) to (Hero manipulating item)
          • Else - Actions
      • Else - Actions


    Where [Item 1] and [Item 2] cannot be picked together. You may other items of course in the set of conditions to prevent them from being picked together [Item 3, 4, 5 etc...). so that even if they are of different classes/categories, it will work anyway.
     
  5. Lkal

    Lkal

    Joined:
    Mar 30, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    I myself tried to do but failed (
     

    Attached Files:

    • 1.w3x
      File size:
      17.6 KB
      Views:
      79
  6. Shadow Fury

    Shadow Fury

    Joined:
    Nov 4, 2013
    Messages:
    1,629
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Here is the same test map with my solution.

    EDIT: Didn't think a few triggers would increase the filesize by so much.
     

    Attached Files:

    • 1.w3x
      File size:
      364.8 KB
      Views:
      53
  7. @Shadow Fury - how is your solution best?
    i don't even understand what your solution is frankly. why do you drop an item then have a condition to give it back?

    also I tested my solution, and works like a charm.
    no init variables of item classes or items needed before hand, which I guess is how your solution works.
     
  8. Lkal

    Lkal

    Joined:
    Mar 30, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    Thanks, but that's not what I need, it is necessary to take the unit could not carry items of a one class

    im rus. sorry for bad english)
     
    Last edited by a moderator: Sep 3, 2015
  9. Try my solution. I tested it, and it only works with one trigger.
    You don't need anything else.
     
  10. Lkal

    Lkal

    Joined:
    Mar 30, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    Can you upload your solution I do not understand how to do some of the conditions.
     
  11. Shadow Fury

    Shadow Fury

    Joined:
    Nov 4, 2013
    Messages:
    1,629
    Resources:
    4
    Maps:
    3
    Template:
    1
    Resources:
    4
    Mine also works with one trigger and has no variables. It is based on the fact that when you pick the item, you drop it, if you have one of the forbidden items, the item is not repicked. Otherwise it is repicked. That's how it works. Well, now it's up to you to decide which you prefer, I offered my solution.
     
  12. Yeah, but your solution relies on specified items, rather than an item class. That's why its not practical, unless you have
    an entire array of variables with all the items. In anycase you will still have to loop through them.

    Here you go.

    INT_TEMP is an integer used in the loop. the native integer A/B usually bug out when used

    exitwhen true is a custom script to exit the loop when an item of same class is found. The rest you should understand
     

    Attached Files:

  13. Lkal

    Lkal

    Joined:
    Mar 30, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    Thank you!!!! and how to configure the class of artifacts?
     
  14. Lkal

    Lkal

    Joined:
    Mar 30, 2011
    Messages:
    38
    Resources:
    0
    Resources:
    0
    Thank you all)
     
  15. What do you mean class of artifacts?
     
  16. Arad MNK

    Arad MNK

    Joined:
    Dec 11, 2014
    Messages:
    1,887
    Resources:
    3
    Maps:
    2
    Spells:
    1
    Resources:
    3
    Ardenian (again) posted the best way.

    @TO: Check IDS, and make it complex using the Base.
     
  17. Sure, though its not always that a system is the best solution.
    Its the user's choice.
     
  18. IDS is recommended for complex RPG systems and item class systems.
    If you only have two or three classes, then it might be not the best solution.