| 07-20-2006, 09:50 AM | #1 |
Well, here I am again (for those of you that have seen me) Can't find a way to make this 2 special item triggers that I want. The first trigger should be something likes this: You write something in the chat and then the item pops up in your heros inventory. In my trigger it pops up underneath your hero which I don't want =/. My trigger looks like this: Trigger: Trigger: Then i need a trigger that replaces a item with another one. but the new item also pops up under the unit =/ |
| 07-20-2006, 09:58 AM | #2 |
ok, 1 question first, had you stored you hero in a variable with array? If yes, then use this: |
| 07-20-2006, 11:26 AM | #3 |
Well, since the event is for player 1 only, I assume that you don't need array, just a normal variable. Also, the Hero is the only unit the player controls, right? Use the "Hero - Create item and give it to hero" action and you'll be fine. |
| 07-20-2006, 11:29 AM | #4 |
Well, i prefer arrays, because they are more usefuel if you extend such a trigger, no need for more variables then. |
| 07-20-2006, 12:25 PM | #5 |
And take up more than 8,000 times as much memory as a non-array. |
| 07-20-2006, 12:56 PM | #6 |
Why do arrays use up 8000 times as much memory? |
| 07-20-2006, 01:13 PM | #7 |
Because arrays can go up to 8000 and a bit, so that much memory is put aside for the data, even though it isn't being 'used'. http://www.wc3campaigns.net/showthread.php?t=66619 |
| 07-20-2006, 02:42 PM | #8 |
Yes, any 1 array reserves 8192 variables. Even if they are not being used, they are reserved. |
| 07-20-2006, 03:04 PM | #9 |
That’s pretty crazy when there’s a size option in GUI (giving you the false-impression that it has a initial size value) |
| 07-20-2006, 03:56 PM | #10 |
The size in GUI just initializes values. Kind of pointless, huh? |
| 07-20-2006, 04:06 PM | #11 |
Not really, when it comes to things that must be initialised, like timers or dialogues. Besides, memory is cheap. Who cares about a few kBytes, really? |
| 07-20-2006, 04:16 PM | #12 |
And when i talk about a Unit Variable with Array, i mean to use the array for more than 1 Unit, well, but i think i'm the only mapper who stores over 100 Units in a Variable and i really don't want to make 100 Variables and endless if, else, then. |
| 07-20-2006, 04:55 PM | #13 |
Yes, for such things arrays are clearly handy, but this particular trigger (original post) does not need it. In fact, it seems it could go without any variables at all... |
| 07-20-2006, 05:05 PM | #14 |
| 07-21-2006, 03:01 PM | #15 |
=/ Just tried your last trigger Fireeye and I couldn't make it work =( And yes all players only got 1 hero. But I copied your trigger and it didn't work =/ |
