Hi. I've been working on a system that when an item is placed in a certain units inventory becomes permantly fixed to that unit. I've got that part of the code working, but it will only work if the unit in question picks up the item, and is NOT given it.
For example, my hero makes an item and then gives it to the unit (in this case a guard tower). I want the item to swap immediately in place of the given item. Heres the code if it helps
The guard tower has been given a modified version of the Inventory(Hero) ability to give it 2 slots instead of 6, and each of the items with (A) after them are the permantly equiped versions of the items.
Thanks.
For example, my hero makes an item and then gives it to the unit (in this case a guard tower). I want the item to swap immediately in place of the given item. Heres the code if it helps
Code:
Item Equip
Events
Unit - A unit Acquires an item
Conditions
(Triggering unit) Equal to (Random unit from (Units of type Guard Tower))
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by (Triggering unit) of type Spider Ring)) Equal to Spider Ring
Then - Actions
Item - Remove (Item carried by (Triggering unit) of type Spider Ring)
Item - Create Spider Ring(A) at (Position of (Item carried by (Triggering unit) of type Spider Ring))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by (Triggering unit) of type Goblin Night Scope)) Equal to Goblin Night Scope
Then - Actions
Item - Remove (Item carried by (Triggering unit) of type Goblin Night Scope)
Item - Create Goblin Night Scope(A) at (Position of (Item carried by (Triggering unit) of type Goblin Night Scope))
Else - Actions
The guard tower has been given a modified version of the Inventory(Hero) ability to give it 2 slots instead of 6, and each of the items with (A) after them are the permantly equiped versions of the items.
Thanks.