Page 1 of 1
Spawn more than one arrow in party slot
Posted: Thu Oct 04, 2012 3:45 pm
by Dinasty
This works but it add only one arrow in the champion's hand..
Code: Select all
party:getChampion(3):insertItem(8, spawn("arrow"))
if i copy multiples time the code it doesn't add more arrows... if i put a number near "arrow" doens't work too
Any help?
Re: Spawn more than one arrow in party slot
Posted: Thu Oct 04, 2012 3:50 pm
by Komag
I'm interested in this too
Re: Spawn more than one arrow in party slot
Posted: Thu Oct 04, 2012 3:57 pm
by Blichew
Have you tried spawning if normally then adding Item:setStackSize(stackSize) ?
So it will be:
Code: Select all
party:getChampion(3):insertItem(8, spawn("arrow",nil,nil,nil,nil,"spawnedArrow"))
spawnedArrow:setStackSize(5)
I don't know if it'll work but it's worth a try (I might used spawn with wrong parameters, just put nil in every coord param, and add an ID at the end.)
Re: Spawn more than one arrow in party slot
Posted: Thu Oct 04, 2012 4:31 pm
by Dinasty
It didn't works but thanks anyway! thanks of u i found the solution!
Code: Select all
local startArrow = spawn("arrow")
party:getChampion(3):insertItem(8, startArrow)
startArrow:setStackSize(5)
SOLVED

Re: Spawn more than one arrow in party slot
Posted: Thu Oct 04, 2012 4:55 pm
by Komag
nice, thank you!
Re: Spawn more than one arrow in party slot
Posted: Fri Oct 05, 2012 1:43 pm
by Whalefish
This is how I got the setstacksize working:
spawn("arrow"):setStackSize(4)
In your example:
party:getChampion(3):insertItem(8, spawn("arrow"):setStackSize(5))
should work, didn't test it right now.
Re: Spawn more than one arrow in party slot
Posted: Fri Oct 05, 2012 3:42 pm
by Komag
So here is an example of my starting gear (mostly just for testing things), in a script in the corner of the map:
Code: Select all
party:getChampion(1):insertItem(11,spawn("scroll"):setScrollText("Welcome to your DEATH!\n...dare you venture on?"))
party:getChampion(1):insertItem(12,spawn("iron_key"))
party:getChampion(1):insertItem(7,spawn("dagger"))
party:getChampion(2):insertItem(7,spawn("hand_axe"))
party:getChampion(2):insertItem(11,spawn("knife"))
party:getChampion(2):insertItem(4,spawn("leather_boots"))
party:getChampion(3):insertItem(5,spawn("tattered_cloak"))
party:getChampion(3):insertItem(7,spawn("short_bow"))
party:getChampion(3):insertItem(8, spawn("arrow"):setStackSize(6))
party:getChampion(4):insertItem(7,spawn("legionary_spear"))
party:getChampion(4):insertItem(5,spawn("tattered_cloak"))
party:getChampion(4):insertItem(8,spawn("whitewood_wand"))
party:getChampion(4):insertItem(11,spawn("mortar"))