How would one go about giving a item, from unit A, to unit B, via triggers. Also, is there a way to set an Item as a variable, preferablly by which inventory slot it is in.
An example of my goal, is Unit A has 14 inventory slots. It moves to Location M. Theres another unit, cleverly named Unit B. Unit B has 3 inventory slots. Trigger fires when Location M is reached, this trigger cycles through Unit A's inventory slots, start at 0,0, then 0,1 1,0 1,1 2,0 2,1 etc, giving the item in each slot to Unit B, until Unit B's inventory is full.
Kill unit A; collect all units in region with radius 0.1 centred on dead unit matching condition item; give item to unit B; create unit at location of unit A facing facing of unit A. Does that count? :)
No. I want neither Unit A or Unit B to die, and I want the items directly OUT of Unit A's inventory, and into Unit B's inventory. If they touch the ground, they can be stolen by someone else. I'm avoiding that like the plague. I'm currently working on 1 solution, but its a really sloppy work around.
To do this the way I want, I really need to be able to designate which inventory slot it is in. Because Unit B varies, Unit A does not. Unit B's inventory size varies. Unit A's does not.
So I want to be able to rearrange the items in Unit A's inventory, so that it will give the first xyz items to Unit B.
UntitledTrigger001EventsTimer-Every15.0secondsofGameTimeLocalVariablesvar1=0<Integer>var2=0<Integer>Items(Unit)=NoUnit<Unit[15]>
Conditions
Actions
Variable - Set var1 = 0
Unit Group - Pick each unit in (Any units in (Region((Position of Players:Captains:Unit[1]), 0.01)) owned by player Any Player matching Required: Item; Excluded: Dead, with at most Any Amount) and do (Actions)
Actions
Variable - Modify var1: + 1
Variable - Set Items(Unit)[var1] = (Picked unit)
General - For each integer var2 from 1 to var1 with increment 1, do (Actions)
Actions
UI - Display (Name of (Unit type of Items(Unit)[var2])) for (All players) to Subtitle area
Ok, so I was checking to see which order Pick Each Unit refered to, and I have to say, I am completely freaking confused.
It doesn't pick randomly, because if I left the same 3 items in the inventory for a few minutes, every time it displayed, it was the same order. However, if I drop an item, then pick it up, it seems to reset the order that it initially picked. To top it off, when I swap the order that things in the inventory are, it has like a 30% chance to change the order that is displayed.
Bump from page 2 before work.
As a side question, how many variables will I be able to have before it becomes a bad thing.
Considering you can have 4 dimensional arrays, I don't think I should be too worried, but it just feels weird to me making 2 arrays with a total size of 360 :/ Which I'm going to need to make a dialog to work around this problem.
Now that I think about it, its 362*2, since 0 is included. >.> I understand how that works, but to me, the only logical way to use an array is with Array[Variable], and as far as I have seen, 70% of the time, that variable is player number. =O Just wondering how others are using their 0.
I have ran into yet another snag.
How would one go about giving a item, from unit A, to unit B, via triggers. Also, is there a way to set an Item as a variable, preferablly by which inventory slot it is in.
An example of my goal, is Unit A has 14 inventory slots. It moves to Location M. Theres another unit, cleverly named Unit B. Unit B has 3 inventory slots. Trigger fires when Location M is reached, this trigger cycles through Unit A's inventory slots, start at 0,0, then 0,1 1,0 1,1 2,0 2,1 etc, giving the item in each slot to Unit B, until Unit B's inventory is full.
Is this possible?
Kill unit A; collect all units in region with radius 0.1 centred on dead unit matching condition item; give item to unit B; create unit at location of unit A facing facing of unit A. Does that count? :)
@BrotherLaz: Go
No. I want neither Unit A or Unit B to die, and I want the items directly OUT of Unit A's inventory, and into Unit B's inventory. If they touch the ground, they can be stolen by someone else. I'm avoiding that like the plague. I'm currently working on 1 solution, but its a really sloppy work around.
To do this the way I want, I really need to be able to designate which inventory slot it is in. Because Unit B varies, Unit A does not. Unit B's inventory size varies. Unit A's does not.
So I want to be able to rearrange the items in Unit A's inventory, so that it will give the first xyz items to Unit B.
Ok, so I was checking to see which order Pick Each Unit refered to, and I have to say, I am completely freaking confused.
It doesn't pick randomly, because if I left the same 3 items in the inventory for a few minutes, every time it displayed, it was the same order. However, if I drop an item, then pick it up, it seems to reset the order that it initially picked. To top it off, when I swap the order that things in the inventory are, it has like a 30% chance to change the order that is displayed.
I am thoroughly confused.
Can anybody explain this behavior?
Bump from page 2 before work.
As a side question, how many variables will I be able to have before it becomes a bad thing.
Considering you can have 4 dimensional arrays, I don't think I should be too worried, but it just feels weird to me making 2 arrays with a total size of 360 :/ Which I'm going to need to make a dialog to work around this problem.
Now that I think about it, its 362*2, since 0 is included. >.> I understand how that works, but to me, the only logical way to use an array is with Array[Variable], and as far as I have seen, 70% of the time, that variable is player number. =O Just wondering how others are using their 0.
Final bump of desperation from page 2.
It's AI stuff, using the related trigger action. It isn't related to unit orders.