HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Item trigger..

07-20-2006, 09:50 AM#1
Fallenzeca
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:
Blank rune
Collapse Events
Player - Player 1 (Red) types a chat message containing -Adori Blank as An exact match
Conditions
Collapse Actions
Item - Create Blank Rune at (Position of (Random unit from (Units owned by Player 1 (Red))))
This is the best i can come up with =/
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
Fireeye
ok, 1 question first, had you stored you hero in a variable with array? If yes, then use this:
Trigger:
Collapse Events
Player - Player 1 (Red) types a chat message containing -Adori Blank as An exact match
Conditions
Collapse Actions
Hero - Create Blank Rune and give it to Hero[(Player number of (Triggering player))]
07-20-2006, 11:26 AM#3
King Klear
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
Fireeye
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
Captain Griffen
And take up more than 8,000 times as much memory as a non-array.
07-20-2006, 12:56 PM#6
Whitehorn
Why do arrays use up 8000 times as much memory?
07-20-2006, 01:13 PM#7
Captain Griffen
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
The)TideHunter(
Yes, any 1 array reserves 8192 variables.
Even if they are not being used, they are reserved.
07-20-2006, 03:04 PM#9
Whitehorn
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
Alevice
The size in GUI just initializes values. Kind of pointless, huh?
07-20-2006, 04:06 PM#11
Anitarf
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
Fireeye
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
King Klear
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
Fireeye
Of course it could, but the condition is "Only 1 Hero", then you can use, else all heros would get the item.
Trigger:
Collapse Events
Player - Player 1 (Red) types a chat message containing -Adori Blank as An exact match
Conditions
Collapse Actions
Collapse Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 1 (Red)) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) is A Hero) Equal to True
Collapse Then - Actions
Hero - Create Blank Rune and give it to (Picked Unit)
Collapse Else - Actions
Do nothing
07-21-2006, 03:01 PM#15
Fallenzeca
=/ 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 =/