[Orxonox-commit 5255] r9918 - in code/branches/presentationHS13: . data/defaultConfig data/levels data/levels/templates src/modules/pong src/orxonox src/orxonox/gamestates src/orxonox/items src/orxonox/sound src/orxonox/weaponsystem src/orxonox/worldentities/pawns
smerkli at orxonox.net
smerkli at orxonox.net
Mon Dec 16 15:43:45 CET 2013
Author: smerkli
Date: 2013-12-16 15:43:45 +0100 (Mon, 16 Dec 2013)
New Revision: 9918
Modified:
code/branches/presentationHS13/
code/branches/presentationHS13/data/defaultConfig/keybindings.ini
code/branches/presentationHS13/data/levels/Spacerace2.oxw
code/branches/presentationHS13/data/levels/asteroidField.oxw
code/branches/presentationHS13/data/levels/asteroids.oxw
code/branches/presentationHS13/data/levels/dynamicMatch.oxw
code/branches/presentationHS13/data/levels/lastManStanding.oxw
code/branches/presentationHS13/data/levels/lastTeamStanding.oxw
code/branches/presentationHS13/data/levels/lastTeamStandingII.oxw
code/branches/presentationHS13/data/levels/maxim.oxw
code/branches/presentationHS13/data/levels/pirateAttack.oxw
code/branches/presentationHS13/data/levels/pong.oxw
code/branches/presentationHS13/data/levels/spaceRace.oxw
code/branches/presentationHS13/data/levels/surfaceRace.oxw
code/branches/presentationHS13/data/levels/teamBaseMatch.oxw
code/branches/presentationHS13/data/levels/teamDeathMatch.oxw
code/branches/presentationHS13/data/levels/templates/spaceshipAssff.oxt
code/branches/presentationHS13/data/levels/underAttack.oxw
code/branches/presentationHS13/src/modules/pong/Pong.cc
code/branches/presentationHS13/src/modules/pong/PongBall.cc
code/branches/presentationHS13/src/modules/pong/PongBall.h
code/branches/presentationHS13/src/modules/pong/PongScore.cc
code/branches/presentationHS13/src/modules/pong/PongScore.h
code/branches/presentationHS13/src/orxonox/MoodManager.h
code/branches/presentationHS13/src/orxonox/gamestates/GSMainMenu.cc
code/branches/presentationHS13/src/orxonox/items/MultiStateEngine.cc
code/branches/presentationHS13/src/orxonox/sound/AmbientSound.cc
code/branches/presentationHS13/src/orxonox/sound/AmbientSound.h
code/branches/presentationHS13/src/orxonox/sound/BaseSound.cc
code/branches/presentationHS13/src/orxonox/sound/SoundManager.cc
code/branches/presentationHS13/src/orxonox/sound/WorldAmbientSound.cc
code/branches/presentationHS13/src/orxonox/sound/WorldAmbientSound.h
code/branches/presentationHS13/src/orxonox/sound/WorldSound.cc
code/branches/presentationHS13/src/orxonox/weaponsystem/WeaponMode.cc
code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.cc
code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.h
Log:
Merged sfxThilo branch, things seem to be working fine
Property changes on: code/branches/presentationHS13
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/Racingbot:9388-9513
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/core6:9552-9666
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/formation:8885-8991
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hud:8883-8986
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/newlevel2012:9033-9244
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/pCuts:9023-9284
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationHS12:9481-9525
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/surfaceRace:9028-9199
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/turret:9380-9501
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
+ /code/branches/Racingbot:9388-9513
/code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/core6:9552-9666
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/formation:8885-8991
/code/branches/formationupdate:9580-9624
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hud:8883-8986
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/invaders:9694-9896
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/largeShip1:9384-9515
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/libs:9668-9674
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/newlevel2012:9033-9244
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/pCuts:9023-9284
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup2012:9029-9189
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation2011:8974-9015
/code/branches/presentation2012:9189-9268
/code/branches/presentation2012merge:9266-9347
/code/branches/presentation3:6913-7162
/code/branches/presentationHS12:9481-9525
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/radarDreiD:9690-9901
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/sfxThilo:9691-9917
/code/branches/shipSelection:9038-9206
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound2012:9205-9214
/code/branches/sound3:5941-6102
/code/branches/spaceNavigation:9381-9497
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/spaceraceTwo:8881-8996
/code/branches/spacestationentry:9699-9905
/code/branches/steering:5949-6091,8140-8595
/code/branches/surfaceRace:9028-9199
/code/branches/testing:9015-9549
/code/branches/tetris:8100-8563
/code/branches/turret:9380-9501
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
Modified: code/branches/presentationHS13/data/defaultConfig/keybindings.ini
===================================================================
--- code/branches/presentationHS13/data/defaultConfig/keybindings.ini 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/defaultConfig/keybindings.ini 2013-12-16 14:43:45 UTC (rev 9918)
@@ -57,7 +57,7 @@
KeyLeftShif
KeyLeftWindows=
KeyLessThan=
-KeyM=
+KeyM="WorldAmbientSound nextsong"
KeyMail=
KeyMediaSelect=
KeyMediaStop=
Modified: code/branches/presentationHS13/data/levels/Spacerace2.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/Spacerace2.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/Spacerace2.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -14,6 +14,7 @@
?>
+
<?lua
include("templates/spaceshipAssff2.oxt")
include("templates/spaceshipPirate.oxt")
@@ -106,8 +107,19 @@
</SpaceShip>
<SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+
+ <!-- SOUNDS & MUSIC -->
+ <WorldSound name="scoreSound" position="-200,0,0" source="sounds/ReadyGo.ogg" >
+ <events>
+ <play>
+ <EventListener event="start" />
+ </play>
+ </events>
+ </WorldSound>
+ <DistanceTrigger name="start" position="-200,0,0" target="Pawn" distance=100 stayActive="true" delay=0.5 />
+
+ <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />
-
<!-- ------------------Planet----------------- -->
<Planet position="0,0,0" scale=300 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="8,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
<StaticEntity position="0,0,0" collisionType=static>
Modified: code/branches/presentationHS13/data/levels/asteroidField.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/asteroidField.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/asteroidField.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -10,6 +10,7 @@
include("HUDTemplates3.oxo")
include("templates/lodInformation.oxt")
?>
+<WorldAmbientSound source="Asteroid_rocks.ogg" looping="true" playOnLoad="true" />
<?lua
include("templates/spaceshipAssff.oxt")
Modified: code/branches/presentationHS13/data/levels/asteroids.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/asteroids.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/asteroids.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -4,6 +4,7 @@
tags = "gametype"
screenshot = "asteroids.png"
/>
+<WorldAmbientSound source="Asteroid_rocks.ogg" looping="true" playOnLoad="true" />
<?lua
include("HUDTemplates3.oxo")
Modified: code/branches/presentationHS13/data/levels/dynamicMatch.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/dynamicMatch.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/dynamicMatch.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -4,6 +4,7 @@
tags = "gametype"
screenshot = "dynamicMatch.png"
/>
+<WorldAmbientSound source="Mars.ogg" looping="true" playOnLoad="true" />
<?lua
include("HUDTemplates3.oxo")
Modified: code/branches/presentationHS13/data/levels/lastManStanding.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/lastManStanding.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/lastManStanding.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -31,6 +31,8 @@
<?lua
include("includes/pickups.oxi")
?>
+
+ <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
<!----- Spawnpoints
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
Modified: code/branches/presentationHS13/data/levels/lastTeamStanding.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/lastTeamStanding.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/lastTeamStanding.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -32,6 +32,8 @@
<?lua
include("includes/pickups.oxi")
?>
+
+ <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
<Bot />
Modified: code/branches/presentationHS13/data/levels/lastTeamStandingII.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/lastTeamStandingII.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/lastTeamStandingII.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -26,6 +26,8 @@
ambientlight = "0.8, 0.8, 0.8"
skybox = "Orxonox/skyBoxBasic"
>
+ <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
+
<!-- TODO:
1. make collisionshapes bulletproof: -> attach movable entity with dynamic collisionshape within a static collisionshape
2. add forcefields -> there should be several "streams" through the level
Modified: code/branches/presentationHS13/data/levels/maxim.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/maxim.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/maxim.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -24,6 +24,8 @@
<Template link=lodtemplate_default />
</templates>
<?lua include("includes/notifications.oxi") ?>
+
+ <WorldAmbientSound source="Nebula_metal.ogg" looping="true" playOnLoad="true" />
<NotificationQueueCEGUI
name="narrative"
Modified: code/branches/presentationHS13/data/levels/pirateAttack.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/pirateAttack.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/pirateAttack.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -24,6 +24,8 @@
<?lua
dofile("includes/CuboidSpaceStation.lua")
?>
+
+<WorldAmbientSound source="Mars.ogg" looping="true" playOnLoad="true" />
<Level
name="Dani's Testlevel"
Modified: code/branches/presentationHS13/data/levels/pong.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/pong.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/pong.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -33,7 +33,10 @@
</Template>
<Template name=pongball>
- <PongBall>
+ <PongBall
+ defScoreSound = "sounds/PlayerWinScore_cut.ogg"
+ defBatSound = "sounds/Button.ogg"
+ defBoundarySound = "sounds/Button.ogg">
<attached>
<Model mesh="sphere.mesh" scale=2 />
<!--Billboard scale=0.2 colour="1.0, 1.0, 0.5" material="Examples/Flare" /-->
Modified: code/branches/presentationHS13/data/levels/spaceRace.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/spaceRace.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/spaceRace.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -28,6 +28,19 @@
ambientlight = "0.8, 0.8, 0.8"
skybox = "Orxonox/skyBoxMoreNebula"
>
+
+ <!-- SOUNDS & MUSIC -->
+ <WorldSound name="scoreSound" position="0,-2100,0" source="sounds/ReadyGo.ogg" >
+ <events>
+ <play>
+ <EventListener event="start" />
+ </play>
+ </events>
+ </WorldSound>
+ <DistanceTrigger name="start" position="0,-2100,0" target="Pawn" distance=100 stayActive="true" delay=0.5 />
+
+ <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />
+
<?lua math.randomseed(98) ?>
@@ -462,6 +475,8 @@
</WaypointPatrolController>
</controller>
</SpaceShip>
+
+
</Scene>
</Level>
Modified: code/branches/presentationHS13/data/levels/surfaceRace.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/surfaceRace.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/surfaceRace.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -10,6 +10,7 @@
tags = "gametype"
/>
+
<?lua
include("stats.oxo")
include("HUDTemplates3.oxo")
@@ -444,6 +445,17 @@
end
?>
<?lua end ?>
+
+ <!-- SOUNDS & MUSIC -->
+ <WorldSound name="scoreSound" position="0,8050,0" source="sounds/ReadyGo.ogg" >
+ <events>
+ <play>
+ <EventListener event="start" />
+ </play>
+ </events>
+ </WorldSound>
+ <DistanceTrigger name="start" position="0,8050,0" target="Pawn" distance=100 stayActive="true" delay=0.5 />
+ <WorldAmbientSound source="Ganymede.ogg" looping="true" playOnLoad="true" />
</Scene>
</Level>
Modified: code/branches/presentationHS13/data/levels/teamBaseMatch.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/teamBaseMatch.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/teamBaseMatch.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -18,6 +18,8 @@
gametype = "TeamBaseMatch"
>
+<WorldAmbientSound source="Jupiter.ogg" looping="true" playOnLoad="true" />
+
<templates>
<Template link=lodtemplate_default />
</templates>
Modified: code/branches/presentationHS13/data/levels/teamDeathMatch.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/teamDeathMatch.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/teamDeathMatch.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -21,6 +21,8 @@
<Template link=lodtemplate_default />
</templates>
<?lua include("includes/notifications.oxi") ?>
+
+ <WorldAmbientSound source="Jupiter.ogg" looping="true" playOnLoad="true" />
<Scene
ambientlight = "0.7, 0.6, 0.6"
Modified: code/branches/presentationHS13/data/levels/templates/spaceshipAssff.oxt
===================================================================
--- code/branches/presentationHS13/data/levels/templates/spaceshipAssff.oxt 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/templates/spaceshipAssff.oxt 2013-12-16 14:43:45 UTC (rev 9918)
@@ -36,6 +36,8 @@
mass = 100
linearDamping = 0.7
angularDamping = 0.9999999
+
+ explosionSound = "sounds/Explosion2.ogg"
>
<engines>
<MultiStateEngine position=" 7.6, 0, 6" template=spaceshipassffengine />
@@ -81,7 +83,7 @@
defEngineSndNormal = "sounds/Engine_low.ogg"
defEngineSndBoost = "sounds/Engine_high.ogg"
-
+
accelerationfront = 500
accelerationbrake = 500
accelerationback = 125
Modified: code/branches/presentationHS13/data/levels/underAttack.oxw
===================================================================
--- code/branches/presentationHS13/data/levels/underAttack.oxw 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/data/levels/underAttack.oxw 2013-12-16 14:43:45 UTC (rev 9918)
@@ -19,6 +19,7 @@
<Template link=lodtemplate_default />
</templates>
<?lua include("includes/notifications.oxi") ?>
+ <WorldAmbientSound source="Jupiter.ogg" looping="true" playOnLoad="true" />
<Scene
ambientlight = "0.5, 0.5, 0.5"
Modified: code/branches/presentationHS13/src/modules/pong/Pong.cc
===================================================================
--- code/branches/presentationHS13/src/modules/pong/Pong.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/modules/pong/Pong.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -46,6 +46,7 @@
#include "PongBat.h"
#include "PongBot.h"
#include "PongAI.h"
+
namespace orxonox
{
// Events to allow to react to scoring of a player, in the level-file.
@@ -116,6 +117,7 @@
this->bat_[0] = 0;
}
}
+
}
/**
Modified: code/branches/presentationHS13/src/modules/pong/PongBall.cc
===================================================================
--- code/branches/presentationHS13/src/modules/pong/PongBall.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/modules/pong/PongBall.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -40,6 +40,9 @@
#include "PongBat.h"
+#include "sound/WorldSound.h"
+#include "core/XMLPort.h"
+
namespace orxonox
{
RegisterClass(PongBall);
@@ -65,6 +68,23 @@
this->relMercyOffset_ = 0.05f;
this->registerVariables();
+
+ //initialize sound
+ if (GameMode::isMaster())
+ {
+ this->defScoreSound_ = new WorldSound(this->getContext());
+ this->defScoreSound_->setVolume(1.0f);
+ this->defBatSound_ = new WorldSound(this->getContext());
+ this->defBatSound_->setVolume(0.4f);
+ this->defBoundarySound_ = new WorldSound(this->getContext());
+ this->defBoundarySound_->setVolume(0.5f);
+ }
+ else
+ {
+ this->defScoreSound_ = 0;
+ this->defBatSound_ = 0;
+ this->defBoundarySound_ = 0;
+ }
}
/**
@@ -82,6 +102,15 @@
}
}
+ //xml port for loading sounds
+ void PongBall::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(PongBall, XMLPort, xmlelement, mode);
+ XMLPortParam(PongBall, "defScoreSound", setDefScoreSound, getDefScoreSound, xmlelement, mode);
+ XMLPortParam(PongBall, "defBatSound", setDefBatSound, getDefBatSound, xmlelement, mode);
+ XMLPortParam(PongBall, "defBoundarySound", setDefBoundarySound, getDefBoundarySound, xmlelement, mode);
+ }
+
/**
@brief
Register variables to synchronize over the network.
@@ -116,7 +145,8 @@
// If the ball has gone over the top or bottom boundary of the playing field (i.e. the ball has hit the top or bottom delimiters).
if (position.z > this->fieldHeight_ / 2 || position.z < -this->fieldHeight_ / 2)
{
- // Its velocity in z-direction is inverted (i.e. it bounces off).
+ defBoundarySound_->play(); //play boundary sound
+ // Its velocity in z-direction is inverted (i.e. it bounces off).
velocity.z = -velocity.z;
// And its position is set as to not overstep the boundary it has just crossed.
if (position.z > this->fieldHeight_ / 2)
@@ -141,7 +171,8 @@
distance = (position.z - this->bat_[1]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
if (fabs(distance) <= 1) // If the bat is there to parry.
{
- // Set the ball to be exactly at the boundary.
+ defBatSound_->play(); //play bat sound
+ // Set the ball to be exactly at the boundary.
position.x = this->fieldWidth_ / 2;
// Invert its velocity in x-direction (i.e. it bounces off).
velocity.x = -velocity.x;
@@ -154,6 +185,7 @@
// If the left player scores.
else if (GameMode::isMaster() && position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
{
+ defScoreSound_->play();//play score sound
if (this->getGametype() && this->bat_[0])
{
this->getGametype()->playerScored(this->bat_[0]->getPlayer());
@@ -168,7 +200,8 @@
distance = (position.z - this->bat_[0]->getPosition().z) / (this->fieldHeight_ * (this->batlength_ * 1.10f) / 2);
if (fabs(distance) <= 1) // If the bat is there to parry.
{
- // Set the ball to be exactly at the boundary.
+ defBatSound_->play(); //play bat sound
+ // Set the ball to be exactly at the boundary.
position.x = -this->fieldWidth_ / 2;
// Invert its velocity in x-direction (i.e. it bounces off).
velocity.x = -velocity.x;
@@ -181,6 +214,7 @@
// If the right player scores.
else if (GameMode::isMaster() && position.x < -this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
{
+ defScoreSound_->play();//play score sound
if (this->getGametype() && this->bat_[1])
{
this->getGametype()->playerScored(this->bat_[1]->getPlayer());
@@ -261,4 +295,55 @@
if (this->batID_[1] != OBJECTID_UNKNOWN)
this->bat_[1] = orxonox_cast<PongBat*>(Synchronisable::getSynchronisable(this->batID_[1]));
}
+
+ void PongBall::setDefScoreSound(const std::string &pongSound)
+ {
+ if( defScoreSound_ )
+ defScoreSound_->setSource(pongSound);
+ else
+ assert(0); // This should never happen, because soundpointer is only available on master
+ }
+
+ const std::string& PongBall::getDefScoreSound()
+ {
+ if( defScoreSound_ )
+ return defScoreSound_->getSource();
+ else
+ assert(0);
+ return BLANKSTRING;
+ }
+
+ void PongBall::setDefBatSound(const std::string &pongSound)
+ {
+ if( defBatSound_ )
+ defBatSound_->setSource(pongSound);
+ else
+ assert(0); // This should never happen, because soundpointer is only available on master
+ }
+
+ const std::string& PongBall::getDefBatSound()
+ {
+ if( defBatSound_ )
+ return defBatSound_->getSource();
+ else
+ assert(0);
+ return BLANKSTRING;
+ }
+
+ void PongBall::setDefBoundarySound(const std::string &pongSound)
+ {
+ if( defBoundarySound_ )
+ defBoundarySound_->setSource(pongSound);
+ else
+ assert(0); // This should never happen, because soundpointer is only available on master
+ }
+
+ const std::string& PongBall::getDefBoundarySound()
+ {
+ if( defBoundarySound_ )
+ return defBoundarySound_->getSource();
+ else
+ assert(0);
+ return BLANKSTRING;
+ }
}
Modified: code/branches/presentationHS13/src/modules/pong/PongBall.h
===================================================================
--- code/branches/presentationHS13/src/modules/pong/PongBall.h 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/modules/pong/PongBall.h 2013-12-16 14:43:45 UTC (rev 9918)
@@ -41,6 +41,7 @@
#include "worldentities/MovableEntity.h"
+
namespace orxonox
{
@@ -63,6 +64,8 @@
virtual void tick(float dt);
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
/**
@brief Set the dimensions of the playing field.
@param width The width of the playing field.
@@ -122,6 +125,13 @@
static const float MAX_REL_Z_VELOCITY;
+ void setDefScoreSound(const std::string& engineSound);
+ const std::string& getDefScoreSound();
+ void setDefBatSound(const std::string& engineSound);
+ const std::string& getDefBatSound();
+ void setDefBoundarySound(const std::string& engineSound);
+ const std::string& getDefBoundarySound();
+
private:
void registerVariables();
@@ -134,6 +144,9 @@
bool bDeleteBats_; //!< Bool, to keep track, of whether this->bat_ exists or not.
unsigned int* batID_; //!< The object IDs of the bats, to be able to synchronize them over the network.
float relMercyOffset_; //!< Offset, that makes the player not loose, when, in all fairness, he would have.
+ WorldSound* defScoreSound_;
+ WorldSound* defBatSound_;
+ WorldSound* defBoundarySound_;
};
}
Modified: code/branches/presentationHS13/src/modules/pong/PongScore.cc
===================================================================
--- code/branches/presentationHS13/src/modules/pong/PongScore.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/modules/pong/PongScore.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -40,6 +40,7 @@
#include "infos/PlayerInfo.h"
#include "Pong.h"
+#include "sound/WorldSound.h" /////////////////////////////
namespace orxonox
{
Modified: code/branches/presentationHS13/src/modules/pong/PongScore.h
===================================================================
--- code/branches/presentationHS13/src/modules/pong/PongScore.h 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/modules/pong/PongScore.h 2013-12-16 14:43:45 UTC (rev 9918)
@@ -123,6 +123,8 @@
bool bShowRightPlayer_; //!< Whether the right player is shown.
WeakPtr<PlayerInfo> player1_; //!< Store information about left player permanently.
WeakPtr<PlayerInfo> player2_; //!< Same for the right player. To end the game properly.
+ WorldSound* scoreSound_;
+
};
}
#endif /* _PongScore_H__ */
Modified: code/branches/presentationHS13/src/orxonox/MoodManager.h
===================================================================
--- code/branches/presentationHS13/src/orxonox/MoodManager.h 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/MoodManager.h 2013-12-16 14:43:45 UTC (rev 9918)
@@ -50,7 +50,7 @@
virtual ~MoodListener() {}
private:
- virtual void moodChanged(const std::string& mood) = 0;
+ virtual bool moodChanged(const std::string& mood) = 0;
static void changedMood(const std::string& mood);
};
Modified: code/branches/presentationHS13/src/orxonox/gamestates/GSMainMenu.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/gamestates/GSMainMenu.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/gamestates/GSMainMenu.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -84,7 +84,7 @@
GSMainMenu::~GSMainMenu()
{
if (GameMode::playsSound())
- this->ambient_->destroy();
+ this->ambient_->destroy(); //CHECK Thilo destroy ?preDestroy()? !!!!!!!
InputManager::getInstance().destroyState("MainMenuHackery");
Modified: code/branches/presentationHS13/src/orxonox/items/MultiStateEngine.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/items/MultiStateEngine.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/items/MultiStateEngine.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -60,6 +60,8 @@
this->defEngineSndBoost_ = new WorldSound(this->getContext());
this->defEngineSndNormal_->setLooping(true);
this->defEngineSndBoost_->setLooping(true);
+ this->defEngineSndNormal_->setVolume(0.8f);
+ this->defEngineSndBoost_->setVolume(0.5f);
this->lua_ = new LuaState();
}
else
Modified: code/branches/presentationHS13/src/orxonox/sound/AmbientSound.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/sound/AmbientSound.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/sound/AmbientSound.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -78,13 +78,13 @@
return SoundManager::getInstance().getRealVolume(SoundType::Music);
}
- void AmbientSound::setAmbientSource(const std::string& source)
+ bool AmbientSound::setAmbientSource(const std::string& source)
{
this->ambientSource_ = source;
- this->moodChanged(MoodManager::getInstance().getMood());
+ return(this->moodChanged(MoodManager::getInstance().getMood()));
}
- void AmbientSound::moodChanged(const std::string& mood)
+ bool AmbientSound::moodChanged(const std::string& mood)
{
if (GameMode::playsSound())
{
@@ -94,12 +94,19 @@
{
orxout(user_info) << "Loading ambient sound " << path << "..." << endl; // TODO: make this output internal if we implement sound streaming
this->setSource(path);
+
+ // all went fine
+ return true;
}
else
{
orxout(internal_warning, context::sound) << this->ambientSource_ << ": Not a valid name! Ambient sound will not change." << endl;
+
+ // everything went southways
+ return false;
}
}
+ return false;
}
void AmbientSound::setPlayOnLoad(bool val)
Modified: code/branches/presentationHS13/src/orxonox/sound/AmbientSound.h
===================================================================
--- code/branches/presentationHS13/src/orxonox/sound/AmbientSound.h 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/sound/AmbientSound.h 2013-12-16 14:43:45 UTC (rev 9918)
@@ -53,7 +53,7 @@
bool stop();
void pause();
- void setAmbientSource(const std::string& source);
+ bool setAmbientSource(const std::string& source);
inline const std::string& getAmbientSource() const
{ return this->ambientSource_; }
@@ -67,7 +67,7 @@
private:
void preDestroy();
float getRealVolume();
- void moodChanged(const std::string& mood);
+ bool moodChanged(const std::string& mood);
inline void ambientSourceChanged()
{ this->setAmbientSource(this->ambientSource_); }
inline void playOnLoadChanged()
Modified: code/branches/presentationHS13/src/orxonox/sound/BaseSound.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/sound/BaseSound.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/sound/BaseSound.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -46,7 +46,7 @@
BaseSound::BaseSound()
: bPooling_(false)
- , volume_(1.0)
+ , volume_(0.7)
, bLooping_(false)
, state_(Stopped)
, pitch_ (1.0)
Modified: code/branches/presentationHS13/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/sound/SoundManager.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/sound/SoundManager.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -217,7 +217,7 @@
SetConfigValueAlias(volume_[SoundType::All], "soundVolume_", 1.0f)
.description("Defines the overall volume.")
.callback(this, &SoundManager::checkSoundVolumeValidity);
- SetConfigValueAlias(volume_[SoundType::Music], "ambientVolume_", 1.0f)
+ SetConfigValueAlias(volume_[SoundType::Music], "ambientVolume_", 0.7f)
.description("Defines the ambient volume.")
.callback(this, &SoundManager::checkAmbientVolumeValidity);
SetConfigValueAlias(volume_[SoundType::Effects], "effectsVolume_", 1.0f)
Modified: code/branches/presentationHS13/src/orxonox/sound/WorldAmbientSound.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/sound/WorldAmbientSound.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/sound/WorldAmbientSound.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -32,9 +32,14 @@
#include "core/EventIncludes.h"
#include "core/XMLPort.h"
#include "AmbientSound.h"
+#include "core/command/ConsoleCommand.h"
+#include <exception>
+
namespace orxonox
{
+ SetConsoleCommand("WorldAmbientSound", "nextsong", &WorldAmbientSound::nextSong);
+
RegisterClass(WorldAmbientSound);
WorldAmbientSound::WorldAmbientSound(Context* context) : BaseObject(context), Synchronisable(context)
@@ -43,13 +48,23 @@
this->ambientSound_ = new AmbientSound();
this->registerVariables();
+ soundList_.push_back("Earth.ogg");
+ soundList_.push_back("Jupiter.ogg");
+ soundList_.push_back("Mars.ogg");
+ soundList_.push_back("allgorythm-lift_up.ogg");
+ soundList_.push_back("allgorythm-resonance_blaster.ogg");
+ soundList_.push_back("AlphaCentauri.ogg");
+ soundList_.push_back("Asteroid_rocks.ogg");
+ soundList_.push_back("Ganymede.ogg");
+ soundList_.push_back("luke_grey_-_hypermode.ogg");
+
}
-
WorldAmbientSound::~WorldAmbientSound()
{
if (this->isInitialized())
{
this->ambientSound_->destroy();
+ WorldAmbientSound::soundList_.clear();
}
}
@@ -93,4 +108,18 @@
else
this->ambientSound_->stop();
}
+
+ void WorldAmbientSound::nextSong()
+ {
+
+ //HACK: Assuption - there is only one WorldAmbientSound in a level and only one level is used.
+ for (ObjectList<WorldAmbientSound>::iterator it = ObjectList<WorldAmbientSound>::begin();
+ it != ObjectList<WorldAmbientSound>::end(); ++it)
+ {
+ while(it->ambientSound_->setAmbientSource(WorldAmbientSound::soundList_[WorldAmbientSound::soundNumber_]) == false){
+ WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size();
+ }
+ WorldAmbientSound::soundNumber_ = (WorldAmbientSound::soundNumber_ + 1) % WorldAmbientSound::soundList_.size();
+ }
+ }
}
Modified: code/branches/presentationHS13/src/orxonox/sound/WorldAmbientSound.h
===================================================================
--- code/branches/presentationHS13/src/orxonox/sound/WorldAmbientSound.h 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/sound/WorldAmbientSound.h 2013-12-16 14:43:45 UTC (rev 9918)
@@ -33,7 +33,10 @@
#include "core/BaseObject.h"
#include "network/synchronisable/Synchronisable.h"
+#include <string>
+#include <vector>
+
namespace orxonox
{
/**
@@ -53,11 +56,31 @@
void play();
+ //This function changes the current ambient song.
+ //You can call nextSong() active in the level
+ //by pressing the key 'M'.
+ static void nextSong();
+
private:
void registerVariables();
+ //Vector with the diffrent available level sounds.
+ //The sound names are pushed in the WorldAmbientSound-constructor.
+ static std::vector<std::string> soundList_;
+
+ // This value will be initialized below, don't make this into
+ // a const, since we want to change it in nextSong().
+ static int soundNumber_;
+
+
AmbientSound* ambientSound_;
};
+
+ // This is an initialization for the soundnumber variable. Since it is
+ // static, we have to initialize it this way.
+ int WorldAmbientSound::soundNumber_ = 0;
+ std::vector<std::string> WorldAmbientSound::soundList_;
+
}
#endif /* _WorldAmbientSound_H__ */
Modified: code/branches/presentationHS13/src/orxonox/sound/WorldSound.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/sound/WorldSound.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/sound/WorldSound.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -80,7 +80,7 @@
float refDist = this->getScene()->getSoundReferenceDistance();
alSourcef(this->audioSource_, AL_REFERENCE_DISTANCE, refDist);
// TODO: 500 is very magical here. Derive something better
- alSourcef(this->audioSource_, AL_MAX_DISTANCE, refDist * 500);
+ alSourcef(this->audioSource_, AL_MAX_DISTANCE, refDist * 20);
}
this->tick(0); // update position, orientation and velocity
}
Modified: code/branches/presentationHS13/src/orxonox/weaponsystem/WeaponMode.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/weaponsystem/WeaponMode.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/weaponsystem/WeaponMode.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -78,6 +78,7 @@
{
this->defSndWpnFire_ = new WorldSound(this->getContext());
this->defSndWpnFire_->setLooping(false);
+ this->defSndWpnFire_->setVolume(0.8f);
this->bSoundAttached_ = false;
}
else
Modified: code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.cc 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.cc 2013-12-16 14:43:45 UTC (rev 9918)
@@ -45,6 +45,7 @@
#include "weaponsystem/WeaponSlot.h"
#include "weaponsystem/WeaponPack.h"
#include "weaponsystem/WeaponSet.h"
+#include "sound/WorldSound.h"
#include "controllers/FormationController.h"
@@ -99,6 +100,16 @@
this->isHumanShip_ = this->hasLocalController();
this->setSyncMode(ObjectDirection::Bidirectional); // needed to synchronise e.g. aimposition
+
+ if (GameMode::isMaster())
+ {
+ this->explosionSound_ = new WorldSound(this->getContext());
+ this->explosionSound_->setVolume(1.0f);
+ }
+ else
+ {
+ this->explosionSound_ = 0;
+ }
}
Pawn::~Pawn()
@@ -108,6 +119,7 @@
if (this->weaponSystem_)
this->weaponSystem_->destroy();
}
+
}
void Pawn::XMLPort(Element& xmlelement, XMLPort::Mode mode)
@@ -134,9 +146,12 @@
XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0);
XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f);
+ XMLPortParam(Pawn, "explosionSound", setExplosionSound, getExplosionSound, xmlelement, mode);
+
XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
}
+
void Pawn::registerVariables()
{
registerVariable(this->bAlive_, VariableDirection::ToClient);
@@ -289,7 +304,7 @@
void Pawn::kill()
{
- this->damage(this->health_);
+ this->damage(this->health_);
this->death();
}
@@ -313,7 +328,8 @@
this->setHealth(1);
if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_))
{
- // Set bAlive_ to false and wait for PawnManager to do the destruction
+ explosionSound_->play();
+ // Set bAlive_ to false and wait for PawnManager to do the destruction
this->bAlive_ = false;
this->setDestroyWhenPlayerLeft(false);
@@ -531,5 +547,22 @@
}
+ void Pawn::setExplosionSound(const std::string &explosionSound)
+ {
+ if(explosionSound_ )
+ explosionSound_->setSource(explosionSound);
+ else
+ assert(0); // This should never happen, because soundpointer is only available on master
+ }
+ const std::string& Pawn::getExplosionSound()
+ {
+ if( explosionSound_ )
+ return explosionSound_->getSource();
+ else
+ assert(0);
+ return BLANKSTRING;
+ }
+
+
}
Modified: code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.h 2013-12-16 14:35:48 UTC (rev 9917)
+++ code/branches/presentationHS13/src/orxonox/worldentities/pawns/Pawn.h 2013-12-16 14:43:45 UTC (rev 9918)
@@ -36,6 +36,7 @@
#include "interfaces/RadarViewable.h"
#include "worldentities/ControllableEntity.h"
+
namespace orxonox // tolua_export
{ // tolua_export
class _OrxonoxExport Pawn // tolua_export
@@ -177,6 +178,9 @@
virtual void changedVisibility();
+ void setExplosionSound(const std::string& engineSound);
+ const std::string& getExplosionSound();
+
protected:
virtual void preDestroy();
@@ -230,6 +234,9 @@
{ this->weaponSystem_ = weaponsystem; }
Vector3 aimPosition_;
+
+ WorldSound* explosionSound_;
+
}; // tolua_export
} // tolua_export
More information about the Orxonox-commit
mailing list