Ok, i have built a forest level the connects to a dungeon and then back to the forest. This is what i am trying to do.
Halfway through the dungeon, i want to trigger an event that deletes the current sky in the forest (cemetery_sky; no fog) and replaces it with a different one (forest_sky). Hopefully it will create the illusion of time passing (outside of the regular day/night cycle)
I have set up a pressure plate in the dungeon that is hidden and can only be activated by the party, and it is in a location that the party MUST pass through in order to progress.
The problem i am having is writing a script that deletes the current sky. A spawner should be able to create the new sky (also activated by the pad), but i can't really test that theory until i figure out how to delete the old sky.
Any help would be greatly appreciated
N.B. I did try and have a read through the Scripting Reference (work in progress) posted by petri, but it literally means nothing to me.
[Solved] A scripting question (from a less than noob)
[Solved] A scripting question (from a less than noob)
Last edited by TSotP on Sat Nov 01, 2014 11:14 pm, edited 1 time in total.
-
Ixnatifual
Re: A scripting question (from a less than noob)
Have you tried calling destroy() on the sky entity?
Re: A scripting question (from a less than noob)
Put a script entity on the map with the sky with the following, and make sure the id of the original sky is "cemetery_sky_1" (or you can change it in the script):
Connect the plate to that script (it can be from an other map)
Code: Select all
function switchSky()
if cemetery_sky_1 then
cemetery_sky_1:destroy()
spawn("forest_day_sky",self.go.level,0,0,0,0,"forest_sky_1")
end
end
Links to my YouTube playlist of "tutorials" and to my forum thread.
Re: A scripting question (from a less than noob)
That worked perfectly dude, thank you very muchProzail wrote:Put a script entity on the map with the sky with the following, and make sure the id of the original sky is "cemetery_sky_1" (or you can change it in the script):
Connect the plate to that script (it can be from an other map)Code: Select all
function switchSky() if cemetery_sky_1 then cemetery_sky_1:destroy() spawn("forest_day_sky",self.go.level,0,0,0,0,"forest_sky_1") end end