Spawn more than one arrow in party slot

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Dinasty
Posts: 10
Joined: Tue Oct 02, 2012 6:59 pm

Spawn more than one arrow in party slot

Post 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 :P

Any help?
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Spawn more than one arrow in party slot

Post by Komag »

I'm interested in this too
Finished Dungeons - complete mods to play
User avatar
Blichew
Posts: 157
Joined: Thu Sep 27, 2012 12:39 am

Re: Spawn more than one arrow in party slot

Post 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.)
Dinasty
Posts: 10
Joined: Tue Oct 02, 2012 6:59 pm

Re: Spawn more than one arrow in party slot

Post 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 :D
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Spawn more than one arrow in party slot

Post by Komag »

nice, thank you!
Finished Dungeons - complete mods to play
Whalefish
Posts: 15
Joined: Fri Mar 30, 2012 5:51 pm

Re: Spawn more than one arrow in party slot

Post 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.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Spawn more than one arrow in party slot

Post 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"))
Finished Dungeons - complete mods to play
Post Reply