Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: data/trunk/scripts/secondprisoner.lua @ 4270

Last change on this file since 4270 was 4202, checked in by bensch, 18 years ago

merged the data back from scripting

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.