Mimics

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
Karinas23
Posts: 58
Joined: Thu Jul 24, 2014 8:57 pm

Mimics

Post by Karinas23 »

is there a way to trigger a chest to transform into a mimic without opening the chest ? like i want the player to walk into a room and step on a floor trigger that causes 4 chests in the room to transform rather than when you open them.
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: Mimics

Post by Batty »

There's probably a better way but have the party trigger this script:

Code: Select all

function open()
   chest_1:destroy()
   spawn("mimic", 1, 15, 16, 0, 0, nil)
   chest_2:destroy()
   spawn("mimic", 1, 18, 16, 0, 0, nil)
   --etc..
end
and it will work. You have to set the spawn locations to match your chest locations and repeat it with chest_2, chest_3, etc.
User avatar
Karinas23
Posts: 58
Joined: Thu Jul 24, 2014 8:57 pm

Re: Mimics

Post by Karinas23 »

will that instantly just swap the models or actually show it changing shape ?
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: Mimics

Post by Prozail »

you could try something like

Code: Select all

function mimicMe()
       if chest_1 then
	local mimic = chest_1:spawn("mimic")
	chest_1:destroy()
	mimic.animation:play("open")
	playSound("mimic_open")
      end
end
that will start by playing the "open" animation and sound. He might clip, if his brain descides to move earlier than the animation ends, but don't know what to do about that.

Edit: Added error-checking and fixed typo also, keep in mind, it there are items in the chest, that has to be handled, otherwise they will simply be on the ground when the chest is destroyed.

If anyone knows how to trigger the click-event on something by a script please tell! It would simplify things.
Post Reply