Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/old_trunk/scripts/ambush_at_uranus/secondprisoner.lua @ 4759

Last change on this file since 4759 was 4448, checked in by snellen, 18 years ago

reorganized scripts (put them in folders), implemented levelchange by script, put some npcs in spaceshiptower

File size: 660 bytes
Line 
1-- Create the trigger
2trigger = ScriptTrigger()
3trigger:setName("secondprisonertrigger")
4trigger:setScript("secondprisoner.lua")
5trigger:setFunction("tick")
6trigger:setActiveOnCreation(true)
7
8-- Get objects from orxonox
9thisscript:addObject("GenericNPC", "Secondprisoner")
10thisscript:addObject("FPSPlayer", "Player")
11
12-- Initialises the random number generator
13randinit = false
14function randInit()
15
16if not randinit then
17math.randomseed(os.clock())
18randinit = true
19end
20
21end
22
23
24function scream()
25
26end
27
28function tick(timestep)
29
30--io.write("Secondprisoner called \n")
31randInit()
32randNumber = 10 * math.random()
33
34if randNumber > 8 then
35scream()
36end
37
38return false
39end
Note: See TracBrowser for help on using the repository browser.