HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Persistent Summon Inventory - D'oh!

01-09-2007, 05:15 PM#1
Baron Crinkle
Bringing this into its own thread because I have several variations of it I'm looking to implement, but the flagship trigger is as follows:

Trigger:
Catalogue The Gore Bus
Collapse Events
Unit - A unit Acquires an item
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to The Gore Bus (Level 1) (Gorvus)
(Unit-type of (Triggering unit)) Equal to The Gore Bus (Level 2) (Gorvus)
(Unit-type of (Triggering unit)) Equal to The Gore Bus (Level 3) (Gorvus)
Collapse Actions
If ((Item carried by (Triggering unit) in slot 1) Equal to No item) then do (Set GoreBusItems[1] = No item) else do (Do nothing)
Set GoreBusItems[1] = (Item carried by (Triggering unit) in slot 1)
If ((Item carried by (Triggering unit) in slot 2) Equal to No item) then do (Set GoreBusItems[2] = No item) else do (Do nothing)
Set GoreBusItems[2] = (Item carried by (Triggering unit) in slot 2)
If ((Item carried by (Triggering unit) in slot 3) Equal to No item) then do (Set GoreBusItems[3] = No item) else do (Do nothing)
Set GoreBusItems[3] = (Item carried by (Triggering unit) in slot 3)
If ((Item carried by (Triggering unit) in slot 4) Equal to No item) then do (Set GoreBusItems[4] = No item) else do (Do nothing)
Set GoreBusItems[4] = (Item carried by (Triggering unit) in slot 4)
If ((Item carried by (Triggering unit) in slot 5) Equal to No item) then do (Set GoreBusItems[5] = No item) else do (Do nothing)
Set GoreBusItems[5] = (Item carried by (Triggering unit) in slot 5)
If ((Item carried by (Triggering unit) in slot 6) Equal to No item) then do (Set GoreBusItems[6] = No item) else do (Do nothing)
Set GoreBusItems[6] = (Item carried by (Triggering unit) in slot 6)

Using this to take note of items when the summon is given them. Then I have this:

Trigger:
Gore Bus Dies
Collapse Events
Unit - A unit Dies
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Unit-type of (Triggering unit)) Equal to The Gore Bus (Level 1) (Gorvus)
(Unit-type of (Triggering unit)) Equal to The Gore Bus (Level 2) (Gorvus)
(Unit-type of (Triggering unit)) Equal to The Gore Bus (Level 3) (Gorvus)
Collapse Actions
Item - Remove (Item carried by (Triggering unit) in slot 1)
Item - Remove (Item carried by (Triggering unit) in slot 2)
Item - Remove (Item carried by (Triggering unit) in slot 3)
Item - Remove (Item carried by (Triggering unit) in slot 4)
Item - Remove (Item carried by (Triggering unit) in slot 5)
Item - Remove (Item carried by (Triggering unit) in slot 6)

To keep the items from just dumping on the ground. Problem is, I can't seem to give the items back to the thing when it is resummoned, etc. Here's the last part of the equation:

Trigger:
Outfit The Gore Bus
Collapse Events
Unit - A unit Spawns a summoned unit
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Unit-type of (Summoned unit)) Equal to The Gore Bus (Level 1) (Gorvus)
(Unit-type of (Summoned unit)) Equal to The Gore Bus (Level 2) (Gorvus)
(Unit-type of (Summoned unit)) Equal to The Gore Bus (Level 3) (Gorvus)
Collapse Actions
Hero - Give GoreBusItems[1] to (Summoned unit)
Hero - Give GoreBusItems[2] to (Summoned unit)
Hero - Give GoreBusItems[3] to (Summoned unit)
Hero - Give GoreBusItems[4] to (Summoned unit)
Hero - Give GoreBusItems[5] to (Summoned unit)
Hero - Give GoreBusItems[6] to (Summoned unit)


01-09-2007, 05:48 PM#2
Naakaloh
An item must exist to be given to a hero. If you remove the item, you'll have to create another of the same type for it be given to the hero.
01-09-2007, 06:41 PM#3
Baron Crinkle
Quote:
Originally Posted by Naakaloh
An item must exist to be given to a hero. If you remove the item, you'll have to create another of the same type for it be given to the hero.


Ahhh, that makes sense. So this is the right way to do it?

Trigger:
Hero - Create (Item-type of GoreBusItems[1]) and give it to (Summoned unit)


Edit: Damn. Still doesn't work.
01-09-2007, 06:46 PM#4
Thunder_Eye
Trigger:
Set GoreBusItems[2] = (Item carried by (Triggering unit) in slot 2)
should be and Item-Type comparsion, not an Item comparions.
EDIT:
I dont think that will work if GoreBusItems[1] is "No Item" (after youve removed it)
01-09-2007, 06:49 PM#5
Baron Crinkle
Quote:
Originally Posted by Thunder_Eye
Trigger:
Set GoreBusItems[2] = (Item carried by (Triggering unit) in slot 2)
should be and Item-Type comparsion, not an Item comparions.
EDIT:
I dont think that will work if GoreBusItems[1] is "No Item" (after youve removed it)


Set GoreBusItems[1] = (Item carried by (Triggering unit) of type (Item-type of (Item being manipulated)))


?

How would I better go about making sure someone doesn't trick the array into free items?
01-10-2007, 02:46 AM#6
Naakaloh
Can you use an itemtype variable instead of item? I don't know if you can it's been a while since I've used the World Editor. Assuming that will work, just set the value to null or "No Itemtype" or whatever it needs to be after you give it to the resummoned thing.
01-10-2007, 02:47 PM#7
Baron Crinkle
Quote:
Originally Posted by Naakaloh
Can you use an itemtype variable instead of item? I don't know if you can it's been a while since I've used the World Editor. Assuming that will work, just set the value to null or "No Itemtype" or whatever it needs to be after you give it to the resummoned thing.


Did that, but for whatever reason it only keeps track of inventory slot 1.