Completely redid this post since I have a better showing of whats going on:
Code:
function Create(self)
self.returner = CreateACDropShip("D82Yatagarasu Returner");
self.returner.Team = self.Team
self.returner.Pos = Vector(self.Pos.X, -90);
MovableMan:AddActor(self.returner);
end
function Update(self)
self.returner.Pos = Vector(self.Pos.X, -90);
if not(self:IsInventoryEmpty()) then
local item = self:SwapPrevInventory(nil);
self.returner:AddInventoryItem(item);
end
end
function Destroy(self)
self.returner.Pos = Vector(self.Pos.X, -110);
end
Basically, this is all of my script for a dropship. The idea is that when this one is created, it creates another invisible dropship somewhere. Then whenever anything gets loaded onto this dropship, it immediately gets transferred to the invisible dropship. Once this dropship is destroyed for any reason, the invisible dropship is moved up far enough to where it gets sent away for refunds.
Problem is, I get this error in regards to the self.returner:AddInventoryItem(item); line:
Code:
ERROR: no overload of 'ACDropShip:AddInventoryItem' matched the arguments (ACDropShip, MovableObject)
candidates are:
ACDropShip:AddInventoryItem(MovableObject*)
Seems like whatever SwapPrevInventory() gives you, AddInventoryItem() doesn't like.
Now, I've done some fiddling around in order to gather some possibly useful info, and I've discovered that if you create a new object (like with CreateAHuman() or something) and then immediately use it as an argument for AddInventoryItem(), it works. But if you use an Add function (like AddActor()) first and THEN pass it to AddInventoryItem(), you get the above error. So AddInventoryItem() doesn't work if the thing already exists in the Actor or Item lists? This seems like a logical conclusion, except for the fact that when something enters a craft, it gets pulled from its respective list. So I just don't know what to think.
I thought AddInventoryItem() and SwapPrev/NextInventory() could be used in conjunction to swap around existing items, but this doesn't seem to be the case. Now, is it supposed to be this way? Or is there something wrong here?