• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Slot changer

Status
Not open for further replies.
Level 6
Joined
Apr 20, 2016
Messages
215
full

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


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

  • 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:
Level 22
Joined
Aug 27, 2013
Messages
3,973
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.
 
Level 6
Joined
Apr 20, 2016
Messages
215
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
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
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.
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
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.
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
  • 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/
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
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?
 
Level 9
Joined
May 21, 2014
Messages
580
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

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:
Level 22
Joined
Aug 27, 2013
Messages
3,973
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.
 
Level 6
Joined
Apr 20, 2016
Messages
215
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?

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:
Level 25
Joined
Sep 26, 2009
Messages
2,378
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) ) )
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
But the Str part i cant find

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.
 
Status
Not open for further replies.
Top