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. The Lich King demands your service! We've reached the 19th edition of the Icon Contest. Come along and make some chilling servants for the one true king.
    Dismiss Notice
  4. The 4th SFX Contest has started. Be sure to participate and have a fun factor in it.
    Dismiss Notice
  5. The poll for the 21st Terraining Contest is LIVE. Be sure to check out the entries and vote for one.
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  8. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  9. 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.

[Trigger] Slot changer

Discussion in 'Triggers & Scripts' started by ShadowBladeX, May 14, 2016.

  1. ShadowBladeX

    ShadowBladeX

    Joined:
    Apr 20, 2016
    Messages:
    206
    Resources:
    0
    Resources:
    0
    [​IMG]

    What is this?


    Well let me tell you.Some of you are making an rpg maps and want to have more than 6 items.

    How to make it?


    Well to start make a new item base it with tome of experience then remove its ability and change the exp part to 0 and you can customize the other parts and all you have to do is to follow this trigger
    triggers

    change slots 1

    • Slot change 1
      • Events
        • Unit - A unit uses an item
      • Conditions
        • Item being manipulated = change slot 1
      • Actions
        • Set Store_Unit1 = Hero manipulating item
        • Set Unit_Point 1 = Position of Hero manopulating item
        • Unit - Pause Store_Unit 1
        • Unit - Create 1 (Unit-type(Store_Unit 1)) for triggering unit at (Position of(Unit_Point1)) facing (Unit facing of(Store_Unit 1))
        • Unit - Move Store_Unit1 to hero locker region <gen> facing default builsing facing degrees
        • Item - Create 1 change slot 2 and give it to last created unit
        • Custom script: call RemoveLocation(udg_Unit_Point 1)

    change slot 2

    • Slot change 2
      • Events
        • Unit - A unit uses an item
      • Conditions
        • Item being manipulated = change slot 2
      • Actions
        • Set Store_Unit 2 = Hero manipulating item
        • Set Unit_Point 2 = (Position of(Hero manipulating item)
        • Unit - Move Store_Unit 1 to (Position of(Unit_Point 2)) facing of (Unit facing of(Unit_Store 2))
        • Unit - Pause Store_Unit 2
        • Unit - Move Store_Unit 2 to Hero locker region <gen> facing default building facing degrees
        • Custom script: call RemoveLocation(udg_Unit_Point 2)


    note1
    If you want to make more just change the second trigger to this
    • Events
      • Unit - A unit uses an item
      • Conditions
        • Item being manipulated = change slot 2
      • Actions
        • Set Store_Unit 2 = Hero manipulating item
        • Set Unit_Point 2 = (Position of(Hero manipulating item))
        • Unit - Create 1 (Unit-type(Unit manipulating item)) for triggering unit at position of Store_unit 2 facing (Unit facing of(Store_Unit 2))
        • Unit - Move Store_Unit 2 to Hero Locker <gen> facing default building facing degrees
        • Item - Create 1 change slot 3 and give it to last created unit
        • Custom script: call RemoveLocation(udg_Unit_Point 2)

    Then if you want to end your trigger just follow the same step as the second trigger and change the conditions then dont put "Item - create" at the end.

    A "+rep" is much appriciated to make me think more. Oh and i almost forgot when you make a hero locker region put it in an un accessable part of the map
     
    Last edited: Jun 12, 2016
  2. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    I don't understand why you love pause unit action so much. Anyway, the trigger you've made has so many flaws. You stored the caster in a variable but you didn't use the variable and also, you have location leaks. Lastly, you used Pause unit action.

    This isn't even a tutorial, you are just showing off your flawed triggers. You should've explained more what this is about and the steps on doing it. I doubt this even works as slot changer. If it does work, you should probably provide a test map.
     
  3. ShadowBladeX

    ShadowBladeX

    Joined:
    Apr 20, 2016
    Messages:
    206
    Resources:
    0
    Resources:
    0
    Then what should i use instead of pause
     
  4. blancfaye7

    blancfaye7

    Joined:
    May 21, 2014
    Messages:
    560
    Resources:
    1
    Maps:
    1
    Resources:
    1
  5. ShadowBladeX

    ShadowBladeX

    Joined:
    Apr 20, 2016
    Messages:
    206
    Resources:
    0
    Resources:
    0
    Dudes i know that you are pros and mastered every thing. But what about the noobs out there who cant handle to learn pro stuffs why cant we just start from the very beginning so then when they learn a thing or two they can manage to make their own triggers or tutorials instead of crediting them selves they could thank you for helping them understand. So please just understand the situation plus ive seen many post about how can you equip up to 11 slots and backpacks and many more so im trying my best to make this basic tutorial to let them learn and improve this by them selves. I have improved thou my first post im using waits but now i dont use them any more
     
  6. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    But you're still using pause unit even though it's unneeded and you leak locations. You could just start from the very beginning and learn more about triggers first. You can make a tutorial once you've fully understood what you want others to know. Because this way, it more looks like you're trying to be a teacher for someone but you don't understand the material yourself.

    As blancfaye7 said, you really should read the tutorials first. Take a look at other triggers that can be found here and make them as references. Find out what's right and what's wrong, what should and what shouldn't. You can also ask around if you have something that you don't understand or if you're not sure whether it's correct or not.
     
  7. ShadowBladeX

    ShadowBladeX

    Joined:
    Apr 20, 2016
    Messages:
    206
    Resources:
    0
    Resources:
    0
    What do you nean about location leaks? Its a region
     
  8. Emm-A-

    Emm-A-

    Joined:
    Jul 1, 2008
    Messages:
    1,312
    Resources:
    0
    Resources:
    0
    Aside from what has been posted already, you have to invest more time to make your tutorial understandable.
    I have a hard time to understand what you want to point out there, and I am not a beginner - so I guess, as this aims to help beginners, which is a good thing, you have to write in much more detail.



    Edit: it is pretty simple, just think of every time you use something like "Position of ..." or "Center of ...", and you did not store this point in a variable and destroy it later, you will havae a location leak.
     
  9. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    • Unit - Create 1 (Unit-type(Hero manipulating item)) for triggering unit at (Position of(triggering unit)) facing (Unit facing of(Store_Unit 1))
    • Unit - Move Store_Unit 1 to (Position of(Store_Unit 2))
    • Unit - Create 1 (Unit-type(Unit manipulating item)) for triggering unit at position of Store_unit 2 facing (Unit facing of(Store_Unit 2))
    Position of (...) is a location and it's leaking. You should store them into a variable and destroy it afterwards.

    More about Memory Leaks can be found here - http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/memory-leaks-263410/
     
  10. ShadowBladeX

    ShadowBladeX

    Joined:
    Apr 20, 2016
    Messages:
    206
    Resources:
    0
    Resources:
    0
    Oh is that it sorry cause im not fond of custom scripts so can you type the script code pls.

    --- merge ---

    Ill finish this on my laptop cause its so hard to edit on this phone
     
    Last edited by a moderator: May 15, 2016
  11. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    Neither am I.
    But here it is.
    • Custom script: call RemoveLocation(udg_YourVariable)
     
  12. Dr Super Good

    Dr Super Good

    Spell Reviewer

    Joined:
    Jan 18, 2005
    Messages:
    25,612
    Resources:
    3
    Maps:
    1
    Spells:
    2
    Resources:
    3
    I would not be Dr Super Good if I did not say that one could also move to StarCraft II where you can set up more than 6 (eg 12 or more) inventory slots per unit.

    I am not sure what your triggers are meant to be doing? How does the unit keep the item passive abilities when looking at the "backpack" slots?
     
  13. neo_sluf

    neo_sluf

    Joined:
    Feb 5, 2012
    Messages:
    1,432
    Resources:
    5
    Maps:
    5
    Resources:
    5
    Even if it has flaws still good job for making it. You should not be discourage by the problems and learn from the tutorials.

    This might be one day be helpful.
     
  14. blancfaye7

    blancfaye7

    Joined:
    May 21, 2014
    Messages:
    560
    Resources:
    1
    Maps:
    1
    Resources:
    1
    I'm not a pro. I admit that I am quite the amateur for now... but at least I know the basics.

    These basics that shouldn't really be questioned, because several tutorials are available. I'm not even sure if you opened the links I gave, because you still question the things in which was provided from the links.

    Your choice though.

    Important Last note Edit:
    >Or is it because, I find it easy, for I was a programmer to begin with. *facedesk* Well...! You should still ask, for unclear problems, but please be clear, and don't be repetitive about it. Search first, before asking. Then, if you still don't understand, then go ask.
     
    Last edited: May 14, 2016
  15. Rheiko

    Rheiko

    Joined:
    Aug 27, 2013
    Messages:
    2,936
    Resources:
    7
    Icons:
    2
    Spells:
    3
    Tutorials:
    2
    Resources:
    7
    Since neo_sluf mentioned something about flaws, I realized I was being offensive by saying your trigger has many flaws but it doesn't mean I intend to discourage you in any way. English isn't my mother tongue so sometimes I have problems picking the right word to use in a sentence. I apologize for being offensive.

    About triggering, it's very important to learn the basic in the beginning. You can learn them from many tutorials around here. Ask around if you have any question. Lastly, you'd better wait and not to rush things until you get back to your laptop. Take your time.
     
  16. ShadowBladeX

    ShadowBladeX

    Joined:
    Apr 20, 2016
    Messages:
    206
    Resources:
    0
    Resources:
    0
    This is what it does when you have a full inventory slot the hero will be moved to the unaccessable region so when you want to return back (close backpack for example) it will be on the same slot because you are moving a unit instead of items


    to all who gave me a rep+ thank you I promise to edit this soon and I will not use uneeded triggers
     
    Last edited: May 15, 2016
  17. ShadowBladeX

    ShadowBladeX

    Joined:
    Apr 20, 2016
    Messages:
    206
    Resources:
    0
    Resources:
    0
    Ummmm..... Guys quick question how can you make this trigger (Str+(Remaining Hp-(enemy Str+distance) i saw someone making this but idk how
     
  18. Nichilus

    Nichilus

    Joined:
    Sep 26, 2009
    Messages:
    1,968
    Resources:
    0
    Resources:
    0
    parenthesis "( )" mean an arithmetic function was used.
    So you pick the Arithmetic and in input you set for example Str or another arithmetic function.
    Your example has 3 arithmetic functions nested in each other.

    Arithmetic(Str + Arithmetic(Rem_Hp - Arithmetic(str + dist) ) )
     
  19. ShadowBladeX

    ShadowBladeX

    Joined:
    Apr 20, 2016
    Messages:
    206
    Resources:
    0
    Resources:
    0
    But the Str part i cant find
     
  20. Nichilus

    Nichilus

    Joined:
    Sep 26, 2009
    Messages:
    1,968
    Resources:
    0
    Resources:
    0
    Blizzard was quite systematic when creating GUI. Attributes are hero only and they're integer numbers (numbers without decimal point), so you need to check the list of actions for Integers and find Hero - Hero Attribute (or something like that).

    It may be that you're in list of actions for Reals (numbers with decimal point). In that case use the "Conversion - Convert Integer to Real" function first to access list of integer actions.

    E.g. using the earlier example "Arithmetic(Str + Arithmetic(Rem_Hp - Arithmetic(str + dist) ) )", I would consider Rem_HP and dist to be real numbers and that the result should be real number as well. In that case you need to just convert to str (which is integer) into real.

    The result should be something like this:
    Result = Arithmetic(Real(Str) + Arithmetic(Rem_Hp - Arithmetic(Real(str) + dist) ) )

    As it was getting quite complicated, I colored the parenthesis and the function the belong to.