-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mission_script' of github.com:voxelinc/voxellancer into…
… final_presentation Conflicts: data/config.ini
- Loading branch information
Showing
111 changed files
with
2,139 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[general] | ||
directionalAcceleration=10.0,10.0,10.0,10.0 | ||
angularAcceleration=600.0,600.0,600.0 | ||
type=engine | ||
|
||
[trail] | ||
lifetime = 10 | ||
color=0xFFFF00 | ||
emissiveness=1.0 | ||
|
||
[visuals] | ||
color=0xFFFF00 | ||
emissiveness=0.7 | ||
|
||
[sound] | ||
name=null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
function main() | ||
showMessage("Welcome to another mission script") | ||
|
||
ships = {} | ||
count = 4 | ||
radius = 40 | ||
|
||
playerPos = position(playerShip()) | ||
|
||
for i = 1, count do | ||
local type | ||
if i > 3 then | ||
type = "eagle" | ||
else | ||
type = "mox" | ||
end | ||
|
||
local ship = createShip(type) | ||
local angle = (i/count) * (2 * math.pi) | ||
|
||
local position = vec3(playerPos.x - 10 + math.cos(angle) * radius, playerPos.y -10 + math.sin(angle) * radius, playerPos.z - 60) | ||
|
||
setPosition(ship, position) | ||
|
||
task = createFightTask(ship) | ||
addFightTaskTarget(task, playerShip()) | ||
|
||
spawn(ship) | ||
ships[i] = ship | ||
|
||
onWorldObjectDestroyed(ship, "destroyed") | ||
end | ||
|
||
missionMessage("...and go!") | ||
playVoice("data/sound/mission/woken_the_dragon.ogg") | ||
|
||
createSingleShotTimer("timeWarning", 10) | ||
end | ||
|
||
function missionTitle() | ||
return "They will kill you" | ||
end | ||
|
||
function missionCaption() | ||
return "Now you have woken the dragon" | ||
end | ||
|
||
function missionBriefing() | ||
return "Kill the ships, and yep, that's difficult" | ||
end | ||
|
||
function destroyed(ship) | ||
count = count - 1 | ||
if count == 0 then | ||
missionSucceed() | ||
end | ||
end | ||
|
||
function timeout() | ||
missionFail() | ||
end | ||
|
||
function timeWarning() | ||
missionMessage("You're not supposed to merely survive. Kill or be killed!") | ||
playVoice("data/sound/mission/not_supposed_to_survive.ogg") | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
function main() | ||
showMessage("Welcome to a mission script") | ||
|
||
ships = {} | ||
count = 6 | ||
radius = 40 | ||
|
||
playerPos = position(playerShip()) | ||
|
||
for i = 1, count do | ||
local ship = createShip("basicship") | ||
print("Created ship with key", ship) | ||
local angle = (i/count) * (2 * math.pi) | ||
|
||
local position = vec3(playerPos.x - 10 + math.cos(angle) * radius, playerPos.y -10 + math.sin(angle) * radius, playerPos.z - 60) | ||
|
||
setPosition(ship, position) | ||
|
||
flyAnywhere(ship) | ||
|
||
spawn(ship) | ||
ships[i] = ship | ||
|
||
onWorldObjectDestroyed(ship, "destroyed") | ||
end | ||
|
||
missionMessage("...and go!") | ||
|
||
playVoice("data/sound/mission/kill_the_ships.ogg") | ||
|
||
createSingleShotTimer("timeWarning1", 15) | ||
createSingleShotTimer("timeWarning2", 20) | ||
createSingleShotTimer("timeout", 40) | ||
end | ||
|
||
function missionTitle() | ||
return "Kill'em all" | ||
end | ||
|
||
function missionCaption() | ||
return "Killing is not nice but it works" | ||
end | ||
|
||
function missionBriefing() | ||
return "Kill the ships, that's really not that difficult" | ||
end | ||
|
||
function flyAnywhere(ship) | ||
local task = createFlyToTask(ship) | ||
local position = position(ship) | ||
|
||
onAiTaskFinished(task, "nextTask") | ||
|
||
setTargetPoint(task, vec3(position.x + math.random(-100, 100), position.y + math.random(-100, 100), position.z + math.random(-100, 100))) | ||
end | ||
|
||
function nextTask(task) | ||
ship = taskExecutor(task) | ||
flyAnywhere(ship) | ||
end | ||
|
||
function destroyed(ship) | ||
count = count - 1 | ||
if count == 0 then | ||
missionSucceed() | ||
end | ||
end | ||
|
||
function timeout() | ||
missionFail() | ||
end | ||
|
||
function timeWarning1() | ||
missionMessage("Time is ticking, dude.") | ||
playVoice("data/sound/mission/time_is_ticking.ogg") | ||
end | ||
|
||
function timeWarning2() | ||
missionMessage("Get your stuff done") | ||
playVoice("data/sound/mission/get_your_stuff_done.ogg") | ||
end | ||
|
||
function onFailure() | ||
missionFailureMessage("That really took too long. You failed!") | ||
playVoice("data/sound/mission/that_took_too_long.ogg") | ||
|
||
for k, v in pairs(ships) do | ||
if valid(v) then | ||
remove(v) | ||
end | ||
end | ||
end | ||
|
||
function onSuccess() | ||
missionSuccessMessage("Yeah, you're so awsome, dude!") | ||
playVoice("data/sound/mission/youre_awesome.ogg") | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
function main() | ||
reset(0) | ||
end | ||
|
||
function startMission(player) | ||
local mission = missionStart("killemall") | ||
remove(missionStartBanner) | ||
onMissionFailure(mission, "reset") | ||
onMissionSuccess(mission, "firstChallengeTaken") | ||
end | ||
|
||
function startFightingMission(player) | ||
local mission = missionStart("getkilledbyall") | ||
remove(dareyouBanner) | ||
onMissionFailure(mission, "reset") | ||
onMissionSuccess(mission, "firework") | ||
end | ||
|
||
function reset(dummy) | ||
missionStartBanner = createWorldObject("missionstart") | ||
setShowOnHud(missionStartBanner, true) | ||
setCanLockOn(missionStartBanner, false) | ||
|
||
setPosition(missionStartBanner, vec3(-40, 50, -100)) | ||
spawn(missionStartBanner) | ||
|
||
onAABBEntered(playerShip(), vec3(-60, 30, -120), vec3(-20, 70, -80), "startMission") | ||
end | ||
|
||
function firstChallengeTaken(dummy) | ||
createSingleShotTimer("startSecondChallenge", 3) | ||
end | ||
|
||
function startSecondChallenge() | ||
print("lol, mission over") | ||
|
||
dareyouBanner = createWorldObject("idareyou") | ||
setShowOnHud(dareyouBanner, true) | ||
setCanLockOn(dareyouBanner, false) | ||
|
||
setPosition(dareyouBanner, vec3(-100, 50, -360)) | ||
spawn(dareyouBanner) | ||
|
||
onAABBEntered(playerShip(), vec3(-120, 30, -380), vec3(-80, 70, -340), "startFightingMission") | ||
end | ||
|
||
function secondChallengeTaken(dummy) | ||
createSingleShotTimer("firework", 3) | ||
end | ||
|
||
function firework() | ||
showMessage("Unbelievable, you survived! I got something for you!") | ||
playVoice("data/sound/mission/got_something.ogg") | ||
|
||
cake = createWorldObject("cake") | ||
setPosition(cake, vec3(0,0,-1000)) | ||
setShowOnHud(cake, true) | ||
setCanLockOn(cake, false) | ||
spawn(cake) | ||
end |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.