Page 1 of 1

[Solved]Filling inventory for testing purposes?

Posted: Sat Jan 26, 2013 5:21 am
by vidarfreyr
I made a little script to fill inventory of a character for testing purposes. But for some reason I can't get my simple script working.

Code: Select all

function itemPut1()
			for itemSlot = 11,31 do
						party:getChampion(1):insertItem(itemSlot,"baked_maggot"..itemSlot)
			end
end
I simply use a wall button to activate a script entity. I get error: "Item expected, got ???"

Re: Filling inventory for testing purposes?

Posted: Sat Jan 26, 2013 12:58 pm
by Komag
you have to spawn the item, and don't try to number in that way. Try one of these:

Code: Select all

function itemPut1()
  for itemSlot = 11,31 do
      party:getChampion(1):insertItem(itemSlot,spawn("baked_maggot"))
  end
end
or

Code: Select all

function itemPut1()
  for itemSlot = 11,31 do
      party:getChampion(1):insertItem(itemSlot,spawn("baked_maggot",nil,nil,nil,nil,"baked_maggot"..itemSlot))
  end
end

Re: Filling inventory for testing purposes?

Posted: Sat Jan 26, 2013 5:33 pm
by vidarfreyr
They both work!! :D Thanks!