Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 7, 2007, 5:29:27 PM (17 years ago)
Author:
vkaenemi
Message:

added subground level, intro script explosion, questfix, vis, levelswitch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • data/trunk/scripts/moonstation/intro.lua

    r4850 r4867  
    44thisscript:addObject("NPC", "IntroSpaceship")
    55thisscript:addObjectAsName("GameWorld", "Moon Station", "gameWorld") -- =gameTitle
     6
     7thisscript:registerClass("Explosion")
     8explosion = Explosion()
    69
    710-- Initialisation
     
    1821triggerMoonstation:setTarget("CameraIntro")
    1922triggerMoonstation:setRadius(150)
    20 triggerMoonstation:setDebugDraw(true)
     23--triggerMoonstation:setDebugDraw(true)
    2124
    22 -- Camera2MoonstationCenter
     25-- Camera2Spaceship
    2326triggerShowCrash = SpaceTrigger()
    2427triggerShowCrash:setScript("intro.lua")
     
    2730triggerShowCrash:setTarget("CameraIntro")
    2831triggerShowCrash:setRadius(200)
    29 triggerShowCrash:setDebugDraw(true)
     32--triggerShowCrash:setDebugDraw(true)
     33
     34-- Explode
     35triggerShowCrash = SpaceTrigger()
     36triggerShowCrash:setScript("intro.lua")
     37triggerShowCrash:setFunction("explodeSpaceship")
     38triggerShowCrash:setAbsCoor(840.948486, 175.905289, -175.412460)
     39triggerShowCrash:setTarget("IntroSpaceship")
     40triggerShowCrash:setRadius(250)
     41--triggerShowCrash:setDebugDraw(true)
    3042
    3143--hide crashing ship
     
    3648triggerShowCrash:setTarget("IntroSpaceship")
    3749triggerShowCrash:setRadius(60)
    38 triggerShowCrash:setDebugDraw(true)
     50--triggerShowCrash:setDebugDraw(true)
    3951
    4052-- End of Intro
     
    4557triggerEndIntro:setTarget("CameraIntro")
    4658triggerEndIntro:setRadius(110)
    47 triggerEndIntro:setDebugDraw(true)
     59--triggerEndIntro:setDebugDraw(true)
    4860
    4961
     
    5264introRunning = false
    5365spaceshipCrashDelay = 2
     66boomSize = 100
     67pauseBurn = 0
     68exploded = false
    5469
    5570-- init function
     
    7994        if spaceshipCrashDelay<0 then --BUG this is a little hack cause if the target is mooving the camera switch would be imediate
    8095                IntroSpaceship:pause(false)
    81                 return true
     96                if pauseBurn==0 then
     97                        pauseBurn = 5
     98                        explosion:setAbsCoor(IntroSpaceship:getAbsCoorX(),IntroSpaceship:getAbsCoorY(),IntroSpaceship:getAbsCoorZ())
     99                        explosion:explode(math.random()*50+50, math.random()*50+50, math.random()*50+50)
     100                        if exploded then
     101                                return true
     102                        end
     103                else
     104                        pauseBurn = pauseBurn - 1
     105                end
     106                return false
    82107        end
    83108        return false
    84109end
    85110
     111function explodeSpaceship(timestep)
     112        --gameWorld:showText("BOOOOOOOOOOOOOOOOM");
     113        explosion:setAbsCoor(1003, 226, -102)
     114        explosion:explode(boomSize,boomSize,boomSize)
     115        boomSize = boomSize + 10
     116        if boomSize == 600 then
     117                return true
     118        end
     119        exploded = true
     120        return false
     121end
     122
    86123function hideCrashingSpaceship(timestep)
    87         --IntroSpaceship:setVisibility(false) --BUG affects all npc
    88124        IntroSpaceship:pause(true)
     125        IntroSpaceship:setVisibility(false)
    89126        return true
    90127end
Note: See TracChangeset for help on using the changeset viewer.