I am not sure if this was already covered, but I could not find another thread on this topic.
I am new to LoG and am working on my own dungeon. I would like to have multiple items (i.e. ammunition/thrown weapons/ingredients) stacked when placing them in a container. How would I go about this as I can only have 3 stacks of 1 instead of 1 stack of 3?
Also, how do I place items in a sack that is placed in an alcove? Or additional items on monsters spawned from spawners?
I am sure this is basic stuff, but thanks to anyone who takes time to help.
-MadMyke
Item Stacks in Containers
Re: Item Stacks in Containers
There are threads were many scripting questions been answered. Have a look here:
http://grimrock.net/forum/viewtopic.php?f=14&t=3240
viewtopic.php?f=14&t=3099
Concerning Items in an alcove look here:
http://www.grimrock.net/modding/how-to- ... an-alcove/
About your first question I am sorry: I don't understand, what you want...
http://grimrock.net/forum/viewtopic.php?f=14&t=3240
viewtopic.php?f=14&t=3099
Concerning Items in an alcove look here:
http://www.grimrock.net/modding/how-to- ... an-alcove/
About your first question I am sorry: I don't understand, what you want...
Re: Item Stacks in Containers
The first question is in reference to multiples of the same stackable item in a container or in the environment in general.
Right now, when I add a throwing knife for example, it adds a single throwing knife. I can place 3 single throwing knives, but I cannot place one stack of 3 throwing knives.
So I get:
1 Throwing Knife
1 Throwing Knife
1 Throwing Knife
instead of:
3 Throwing Knife
-MadMyke
p.s. Thanks for the link. It will help me a lot.
Right now, when I add a throwing knife for example, it adds a single throwing knife. I can place 3 single throwing knives, but I cannot place one stack of 3 throwing knives.
So I get:
1 Throwing Knife
1 Throwing Knife
1 Throwing Knife
instead of:
3 Throwing Knife
-MadMyke
p.s. Thanks for the link. It will help me a lot.
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: Item Stacks in Containers
You would have to spawn the items using code, but in a script you could spawn a stack of knives using the following;
I've guessed the object names - so this might not work through copy and paste. This creates a function you can use elsewhere to spawn a sack of knives. Could obviously be easily modified to spawn any stackable item in a sack, or even an alcove etc.
Code: Select all
function createSackOfKnives(level, x, y, facing)
local container = spawn("sack", level, x, y, facing);
local knives = spawn("throwing_knife");
knives:setStackSize(3);
container:addItem(item);
end
Last edited by JohnWordsworth on Wed Feb 26, 2014 10:41 am, edited 1 time in total.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
Re: Item Stacks in Containers
That's precisely what I needed.
I have just begun dabbling in Lua Script so I appreciate any insight I can find. Thank you.
I have just begun dabbling in Lua Script so I appreciate any insight I can find. Thank you.
Re: Item Stacks in Containers
With Dungeon Editor 2 you can set stack size in the inspector 
