Page 1 of 1
how to made a turning statue
Posted: Tue Jan 01, 2013 3:34 pm
by hyteria
hello everyone and happy new year
well i want to made a turning statue like this video (0:46) to made some puzzle like to statue facing open a door etc... any idea?
http://www.youtube.com/watch?v=Kms9ASr81ZE
thx
Re: how to made a turning statue
Posted: Tue Jan 01, 2013 3:52 pm
by Neikun
For this you would have to destroy the statue and spawn a new one in a new facing, I think.
Perhaps that wouldn't work though because then if you kept turning it, it would eventually crash the dungeon... hmm.
Re: how to made a turning statue
Posted: Tue Jan 01, 2013 5:21 pm
by Kuningas
Happy new years!
This is how I did a turning dragon statue recently, I hope it is of some use:
Code: Select all
function dragonturn()
if dragonfacing == nil then
dragon_pointwest:destroy()
spawn("dragon_statue", 3, 21, 16, 2, "dragon_pointnorth")
dragonfacing = "north"
else
if dragonfacing == "east" then
dragon_pointeast:destroy()
spawn("dragon_statue", 3, 21, 16, 0, "dragon_pointsouth")
dragonfacing = "south"
else
if dragonfacing == "south" then
dragon_pointsouth:destroy()
spawn("dragon_statue", 3, 21, 16, 1, "dragon_pointwest")
dragonfacing = "west"
else
if dragonfacing == "west" then
dragon_pointwest:destroy()
spawn("dragon_statue", 3, 21, 16, 2, "dragon_pointnorth")
dragonfacing = "north"
else
if dragonfacing == "north" then
dragon_pointnorth:destroy()
spawn("dragon_statue", 3, 21, 16, 3, "dragon_pointeast")
dragonfacing = "east"
end
end
end
end
end
end
It is a bit crude, but it works. I had three of these for three different statues, each linked to the same counter so it will decrement the counter when and only when it points in the correct direction, so that when all the statues pointed in the correct direction, the door would open. I removed the counter parts and sound effects to make it shorter.
Basically it is the same piece of coding five times, four for all the directions and the fifth for the initial direction it faces. This way you'll not need to set the direction variable beforehand (the initial direction of my statue was west). The coordinates also correspond to the map I was using, so you'll have to use your own, naturally.
It is also worth noting that this method probably won't look that good if the player sees the action, so it is recommendable to put the activator (button, lever, whatever you are using) so that the player will only hear the sound of the statue turning to preserve the illusion.
Again, I hope this is what you meant and is of some help!
Re: how to made a turning statue
Posted: Tue Jan 01, 2013 9:25 pm
by hyteria
thx for reply , well in fact you need to use a pressure plate or something to use the function , well its possible to use something like onhit() that affect statue (like a destroyable wall) when someone who hit it , with a big evasion to make it not destroyable , something who say onhit then face, +1 , well i did know nothing on code but i try to found some logic hehe
Re: how to made a turning statue
Posted: Tue Jan 01, 2013 10:13 pm
by Komag
or you could use the 1000 sockets method to simulate real-time rotation!
Re: how to made a turning statue
Posted: Tue Jan 01, 2013 10:21 pm
by hyteria
i dont understand :s
Re: how to made a turning statue
Posted: Tue Jan 01, 2013 10:26 pm
by Komag
it's a crazy trick to spawn a zillion alcoves at map launch and then have a fast timer destroy and spawn the statue into all of them one at a time, each of which is at a slightly different angle
Re: how to made a turning statue
Posted: Wed Jan 02, 2013 12:22 am
by Kuningas
You're right -- it sounds crazy. : D
I also reckon once we get some insight on animation, rotating statues shouldn't be too much of a problem. But that, as I oft say, is a thing for the future.
Also: Yes, you need to use an activator for the script I presented. I used buttons in small, one-square recesses so the player couldn't see the statue turning but only hear (I used a custom sound effect). Basically, just having the buttons or pressure plates so the player can't look at the statue at that moment should also work fine.