Page 1 of 1

A question on spawning assets.

Posted: Sat Oct 06, 2012 9:25 am
by Daght
Can I spawn an asset like the cave_in after having used/triggered a button or lever?

Re: A question on spawning assets.

Posted: Sat Oct 06, 2012 12:28 pm
by Komag
yes, no problem, you just have to do it in a script instead of the spawn item because it limits the type of items that can be spawned.

- add your button
- add a script item "lua" with code:

Code: Select all

function makeCavein()
  spawn("dungeon_cave_in", 1, 12, 13, 1)
end
- connect the button to the script
In this example, pressing the button will spawn the cave in on level one at x,y coordinates 12, 13, facing east (which you see from the west). So you would adjust all the numbers for your situation.