1 | -- Create the trigger |
---|
2 | trigger = ScriptTrigger() |
---|
3 | trigger:setName("maintrigger") |
---|
4 | trigger:setScript("spaceship_tower.lua") |
---|
5 | trigger:setFunction("tick") |
---|
6 | trigger:setActiveOnCreation(true) |
---|
7 | |
---|
8 | -- Get objects from orxonox |
---|
9 | thisscript:addObject("FPSPlayer", "Player") |
---|
10 | thisscript:addObject("GenericNPC", "pedestrianOne") |
---|
11 | |
---|
12 | |
---|
13 | -- pedestrian |
---|
14 | pedestrian = { } |
---|
15 | --{ |
---|
16 | function pedestrian:tick(timestep) |
---|
17 | if pedestrianOne:finalGoalReached() then |
---|
18 | |
---|
19 | pedestrianOne:walkTo(516.458313, -352, -80.734474) |
---|
20 | pedestrianOne:walkTo(512.872253, -352, -116.005737) |
---|
21 | pedestrianOne:walkTo(499.799866, -352, -159.124832) |
---|
22 | pedestrianOne:walkTo(475.927399, -352, -210.216354) |
---|
23 | pedestrianOne:walkTo(448.311920, -352, -265.528564) |
---|
24 | pedestrianOne:walkTo(414.508118, -352, -323.333405) |
---|
25 | pedestrianOne:walkTo(370.584290, -352, -385.605530) |
---|
26 | pedestrianOne:walkTo(343.100464, -352, -415.069794) |
---|
27 | pedestrianOne:walkTo(264.569794, -352, -476.752869) |
---|
28 | pedestrianOne:walkTo(210.117767, -352, -506.892090) |
---|
29 | pedestrianOne:walkTo(164.443237, -352, -522.833435) |
---|
30 | pedestrianOne:walkTo(104.187263, -352, -532.872925) |
---|
31 | pedestrianOne:walkTo(2.165657, -352, -541.539734) |
---|
32 | pedestrianOne:walkTo(-83.860703, -352, -536.539429) |
---|
33 | pedestrianOne:walkTo(-190.057220, -352, -505.938080) |
---|
34 | pedestrianOne:walkTo(-304.299713, -352, -443.351471) |
---|
35 | pedestrianOne:walkTo(-386.765076, -352, -389.817383) |
---|
36 | pedestrianOne:walkTo(-450.359467, -352, -317.446564) |
---|
37 | pedestrianOne:walkTo(-496.030060, -352, -220.342926) |
---|
38 | pedestrianOne:walkTo(-519.588379, -352, -123.082298) |
---|
39 | pedestrianOne:walkTo(-532.314880, -352, -23.615164) |
---|
40 | pedestrianOne:walkTo(-532.617371, -352, 45.020267) |
---|
41 | pedestrianOne:walkTo(-523.393188, -352, 122.215889) |
---|
42 | pedestrianOne:walkTo(-514.028748, -352, 161.396454) |
---|
43 | pedestrianOne:walkTo(-494.465302, -352, 209.894760) |
---|
44 | pedestrianOne:walkTo(-442.015442, -352, 297.304840) |
---|
45 | pedestrianOne:walkTo(-390.615448, -352, 374.627777) |
---|
46 | pedestrianOne:walkTo(-319.119080, -352, 442.413940) |
---|
47 | pedestrianOne:walkTo(-217.457092, -352, 494.077393) |
---|
48 | pedestrianOne:walkTo(-151.378113, -352, 521.028198) |
---|
49 | pedestrianOne:walkTo(-65.499962, -352, 534.818909) |
---|
50 | pedestrianOne:walkTo(-12.994286, -352, 543.250610) |
---|
51 | pedestrianOne:walkTo(43.301056, -352, 545.434570) |
---|
52 | pedestrianOne:walkTo(111.077263, -352, 542.904480) |
---|
53 | pedestrianOne:walkTo(159.826782, -352, 531.741943) |
---|
54 | pedestrianOne:walkTo(218.487457, -352, 509.065948) |
---|
55 | pedestrianOne:walkTo(276.665436, -352, 477.931427) |
---|
56 | pedestrianOne:walkTo(332.371368, -352, 443.890839) |
---|
57 | pedestrianOne:walkTo(378.867981, -352, 401.978882) |
---|
58 | pedestrianOne:walkTo(415.942627, -352, 345.542542) |
---|
59 | pedestrianOne:walkTo(453.910004, -352, 273.056732) |
---|
60 | pedestrianOne:walkTo(488.833588, -352, 204.519592) |
---|
61 | pedestrianOne:walkTo(512.676575, -352, 145.735123) |
---|
62 | pedestrianOne:walkTo(525.567139, -352, 66.236511) |
---|
63 | |
---|
64 | end |
---|
65 | |
---|
66 | end |
---|
67 | |
---|
68 | --} |
---|
69 | |
---|
70 | |
---|
71 | |
---|
72 | |
---|
73 | |
---|
74 | -- THE tick function |
---|
75 | |
---|
76 | function tick(timestep) |
---|
77 | --io.write("Towerscript called \n") |
---|
78 | |
---|
79 | pedestrian:tick(timestep) |
---|
80 | |
---|
81 | return false |
---|
82 | end |
---|