[Orxonox-commit 4309] r8980 - in code/branches/presentation2011: . data/levels data/levels/includes data/levels/templates src/libraries/core src/modules/pong src/modules/weapons/projectiles src/modules/weapons/weaponmodes src/orxonox/controllers src/orxonox/gametypes src/orxonox/infos src/orxonox/worldentities src/orxonox/worldentities/pawns
jo at orxonox.net
jo at orxonox.net
Wed Dec 14 14:38:39 CET 2011
Author: jo
Date: 2011-12-14 14:38:37 +0100 (Wed, 14 Dec 2011)
New Revision: 8980
Added:
code/branches/presentation2011/src/orxonox/gametypes/Mission.cc
code/branches/presentation2011/src/orxonox/gametypes/Mission.h
code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc
code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.h
Modified:
code/branches/presentation2011/
code/branches/presentation2011/data/levels/dynamicMatch.oxw
code/branches/presentation2011/data/levels/fightInOurBack.oxw
code/branches/presentation2011/data/levels/includes/weaponSettingsSpacecruiser.oxi
code/branches/presentation2011/data/levels/lastManStanding.oxw
code/branches/presentation2011/data/levels/lastTeamStanding.oxw
code/branches/presentation2011/data/levels/lastTeamStandingII.oxw
code/branches/presentation2011/data/levels/missionOne.oxw
code/branches/presentation2011/data/levels/pirateAttack.oxw
code/branches/presentation2011/data/levels/templates/spaceshipSpacecruiser.oxt
code/branches/presentation2011/src/libraries/core/GUIManager.cc
code/branches/presentation2011/src/modules/pong/Pong.cc
code/branches/presentation2011/src/modules/pong/Pong.h
code/branches/presentation2011/src/modules/pong/PongAI.h
code/branches/presentation2011/src/modules/pong/PongScore.cc
code/branches/presentation2011/src/modules/pong/PongScore.h
code/branches/presentation2011/src/modules/weapons/projectiles/Rocket.cc
code/branches/presentation2011/src/modules/weapons/weaponmodes/LightningGun.cc
code/branches/presentation2011/src/orxonox/controllers/AIController.cc
code/branches/presentation2011/src/orxonox/controllers/AIController.h
code/branches/presentation2011/src/orxonox/controllers/ArtificialController.cc
code/branches/presentation2011/src/orxonox/controllers/ArtificialController.h
code/branches/presentation2011/src/orxonox/controllers/HumanController.cc
code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.cc
code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.h
code/branches/presentation2011/src/orxonox/gametypes/CMakeLists.txt
code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc
code/branches/presentation2011/src/orxonox/gametypes/Gametype.h
code/branches/presentation2011/src/orxonox/gametypes/TeamDeathmatch.h
code/branches/presentation2011/src/orxonox/infos/GametypeInfo.h
code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.cc
code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.h
code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc
code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.h
Log:
teamgametype merged into trunk
Property changes on: code/branches/presentation2011
___________________________________________________________________
Modified: svn:mergeinfo
- /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/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/fps:6591-7072
/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/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/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/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/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/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/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/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/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/steering:5949-6091,8140-8595
/code/branches/tetris:8100-8563
/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/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/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/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/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/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/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/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/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/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/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/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/steering:5949-6091,8140-8595
/code/branches/tetris:8100-8563
/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/presentation2011/data/levels/dynamicMatch.oxw
===================================================================
--- code/branches/presentation2011/data/levels/dynamicMatch.oxw 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/data/levels/dynamicMatch.oxw 2011-12-14 13:38:37 UTC (rev 8980)
@@ -37,6 +37,7 @@
</StaticEntity>
<!-- -----------12-Spawnpoints around the planet------------- -->
+<!-- inner Spawnpoints -->
<TeamSpawnPoint team=0 position="1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
<TeamSpawnPoint team=0 position="-1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
<TeamSpawnPoint team=0 position="0,1000,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/>
Modified: code/branches/presentation2011/data/levels/fightInOurBack.oxw
===================================================================
--- code/branches/presentation2011/data/levels/fightInOurBack.oxw 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/data/levels/fightInOurBack.oxw 2011-12-14 13:38:37 UTC (rev 8980)
@@ -109,7 +109,7 @@
<Level
name="Fight in our back"
description="Our fleet is far ahead of us. We need to get rid of all the enemies in its back, because we do not want our enemies to attack from everywhere. So let us clear this Sector!"
- gametype=TeamDeathmatch
+ gametype=Mission
>
<templates>
<Template link=lodtemplate_default />
@@ -213,7 +213,7 @@
<?lua for i=0,0,1 do
x=800
-health=2050
+health=1500
?>
<!--Transporter 1-->
<EventTrigger name="activateTeam1No1" acitvations=1 stayactive="true">
@@ -238,7 +238,7 @@
<?lua for j=0,1,1 do
-health=1600
+health=1300
x=800
z=j*300
?>
Modified: code/branches/presentation2011/data/levels/includes/weaponSettingsSpacecruiser.oxi
===================================================================
--- code/branches/presentation2011/data/levels/includes/weaponSettingsSpacecruiser.oxi 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/data/levels/includes/weaponSettingsSpacecruiser.oxi 2011-12-14 13:38:37 UTC (rev 8980)
@@ -1,12 +1,11 @@
<weaponslots>
- <WeaponSlot position="-20,-15,-108" />
- <WeaponSlot position=" 20,-15,-108" />
- <WeaponSlot position=" 0, -7,-110" />
- <WeaponSlot position="-14,-31,-184" />
- <WeaponSlot position=" 14,-31,-184" />
- <WeaponSlot position="-34,-30,-169" />
- <WeaponSlot position=" 34,-30,-169" />
-
+ <WeaponSlot position="-20,10,2" />
+ <WeaponSlot position=" 20,10,2" />
+ <WeaponSlot position=" 0,18,0" />
+ <WeaponSlot position="-14,-6,-74" />
+ <WeaponSlot position=" 14,-6,-74" />
+ <WeaponSlot position="-34,-5,-59" />
+ <WeaponSlot position=" 34,-5,-59" />
</weaponslots>
<weaponsets>
<WeaponSet firemode=0 />
Modified: code/branches/presentation2011/data/levels/lastManStanding.oxw
===================================================================
--- code/branches/presentation2011/data/levels/lastManStanding.oxw 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/data/levels/lastManStanding.oxw 2011-12-14 13:38:37 UTC (rev 8980)
@@ -49,7 +49,7 @@
<attached>
<Model position="0,0,0" scale=140 mesh="asteroid_UV.mesh" shadow=true />
<Model position="-160,40,28.4" scale=1 mesh="sphere.mesh" /><!--EasterEgg indicator-->
- <PickupSpawner position="-160,40,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="15"><!--EasterEgg-->
+ <PickupSpawner position="-160,40,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="15"><!--EasterEgg : invisible pickup is hidden inside the asteroid -->
<pickup>
<InvisiblePickup template=hugeinvisiblepickup />
</pickup>
Modified: code/branches/presentation2011/data/levels/lastTeamStanding.oxw
===================================================================
--- code/branches/presentation2011/data/levels/lastTeamStanding.oxw 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/data/levels/lastTeamStanding.oxw 2011-12-14 13:38:37 UTC (rev 8980)
@@ -15,7 +15,9 @@
?>
<Level
- gametype = "LastTeamStanding"
+ name = "Last Team Standing"
+ description = "testmap for gametype last team standing"
+ gametype = "TeamGametype"
>
<templates>
<Template link=lodtemplate_default />
Modified: code/branches/presentation2011/data/levels/lastTeamStandingII.oxw
===================================================================
--- code/branches/presentation2011/data/levels/lastTeamStandingII.oxw 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/data/levels/lastTeamStandingII.oxw 2011-12-14 13:38:37 UTC (rev 8980)
@@ -94,6 +94,7 @@
</collisionShapes>
</StaticEntity>
<!-- END of CUBE-->
+
<!-------------- Centered Thin Gate -------------->
<StaticEntity position="0,0,0" direction="0,0,0" collisionType=static mass=100000 >
@@ -411,7 +412,7 @@
<TeamSpawnPoint team=3 position="835,-300,845" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
<TeamSpawnPoint team=3 position="845,350,835" direction="0,0,-1" spawnclass=SpaceShip pawndesign=spaceshipassff />
<TeamSpawnPoint team=3 position="845,-300,835" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
-<Bot />
+<Bot /><!-- at least one bot is needed to stat the game properly. Else the game finishes. This could be avoided, if the menue allows a preselection of the number of players. -->
</Scene>
</Level>
Modified: code/branches/presentation2011/data/levels/missionOne.oxw
===================================================================
--- code/branches/presentation2011/data/levels/missionOne.oxw 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/data/levels/missionOne.oxw 2011-12-14 13:38:37 UTC (rev 8980)
@@ -21,6 +21,7 @@
<Level
name = "Mission One"
description = "How to steer a spaceship."
+ gametype = "Mission"
>
<templates>
<Template link=lodtemplate_default />
@@ -46,110 +47,329 @@
include("includes/pickups.oxi")
?>
- <WorldAmbientSound source="Mars.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.ogg-->
+ <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.ogg, Mars.ogg-->
<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"/>
- <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
+<!-- END OF INCLUDES & NECESSARITIES -->
+<!-- SPAWNPOINT & START OF QUESTS via spawntrigger -->
+ <EventMultiTrigger name=spawntrigger>
+ <events>
+ <trigger>
+ <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="attack" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </TeamSpawnPoint>
+ </trigger>
+ </events>
+ </EventMultiTrigger>
-<!-- END OF INCLUDES & NECESSARITIES -->
+ <QuestEffectBeacon times=1>
+ <effects>
+ <AddQuest questId="missionOne.basicFlying" />
+ <!--AddQuestHint hintId ="quest1hint3" /-->
+ </effects>
+ <events>
+ <execute>
+ <EventListener event=spawntrigger />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="missionOne.basicFlying" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="flying4" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="missionOne.navigation" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="navigationend" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+<!--helper trigger to end the weaponsystemI quest -->
+ <DistanceTrigger name="boxend" position="0,0,0" distance=950 target="SpaceShip" stayActive="false" delay=0.1>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="boxtrigger4" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </DistanceTrigger>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="missionOne.weaponsystemI" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="boxend" />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+<!--helper trigger to end the weaponsystemII quest -->
+ <DistanceTrigger name="piratesend" position="0,0,0" distance=2000 target="SpaceShip" stayActive="false" delay=0.1>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="movingpirates2" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </DistanceTrigger>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="missionOne.weaponsystemII" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event=piratesend />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+<!--helper trigger to end the DuBallStation quest -->
+ <DistanceTrigger name="duballend" position="-1000,-300,700" distance=2000 target="SpaceShip" stayActive="false" delay=0.1>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="duball3" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </DistanceTrigger>
+
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="missionOne.DuballStation" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event=duballend />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+ <QuestEffectBeacon times=1> <!-- alternative quest end -->
+ <effects>
+ <CompleteQuest questId="missionOne.DuballStation" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event=toHydroFarmer />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+<!--helper trigger to end the getHelp quest -->
+ <DistanceTrigger name="getHelpEnd" position="-47000,-1000,1300" distance=1400 target="SpaceShip" stayActive="false" delay=0.1>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="ondock" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </DistanceTrigger>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="missionOne.getHelp" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event=getHelpEnd />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+<!--helper trigger to end the getHome quest -->
+ <DistanceTrigger name="getHomeEnd" position="0,0,0" distance=4000 target="SpaceShip" stayActive="false" delay=0.1>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="attack" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </DistanceTrigger>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="missionOne.getHome" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event=getHomeEnd />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+<!--helper trigger to end the defence quest -->
+ <DistanceTrigger name="defenceEnd" position="0,0,0" distance=4000 target="SpaceShip" stayActive="false" delay=0.1>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </DistanceTrigger>
+
+ <QuestEffectBeacon times=1>
+ <effects>
+ <CompleteQuest questId="missionOne.defence" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event=defenceEnd />
+ </execute>
+ </events>
+ </QuestEffectBeacon>
+
+<!-- End the quest after own destruction of spacecruiser -->
+ <QuestEffectBeacon position="-100,0,0" times=1>
+ <effects>
+ <FailQuest questId="missionOne.getHelp" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="failQuest" />
+ </execute>
+ </events>
+ <attached>
+ <DistanceTrigger name="failQuest" position="-47000,-1000,1300" distance=2300 target="SpaceShip">
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="gameEnd" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </DistanceTrigger>
+ </attached>
+ </QuestEffectBeacon>
+
+
+
+
<LocalQuest id="missionOne.basicFlying">
- <QuestDescription title="Flying" description="INSERT STORY HERE. The first thing you have to learn is flying. Use 'W' to accelerate and steer with your mouse. In order to know where to fly there are two detection systems. The navigation markers highlite important objects directly in the level. If you can't directly see those objects, there are arrows which indicate how you have to steer. The second device is the radar. There you get an overview of all objects near you. In order to find an object that you spotted on radar, you have to steer in a way that the corresponding dot is in the center of the radar. Now you can find the corresponding object straight ahead. Your goal is to fly to the first waypoint. It's that orange dot on the radar." failmessage="" completeMessage="Well done." />
+ <QuestDescription title="Flying" description="Can you see the blinking light straight ahead? Your goal is to fly through it.
+Use (W) to accelerate and steer with your mouse.
+
+Further flying moves:
+break (S)
+roll (Q) and (E)
+boost (Space)
+
+Whenever a new quest is added you can view it by pressing (F3). Quit this menu via (Esc)." failmessage="" completeMessage="" />
<complete-effects>
- <AddQuest questId="missionOne.weaponsystem" />
+ <AddQuest questId="missionOne.navigation" />
</complete-effects>
</LocalQuest>
- <LocalQuest id="missionOne.weaponsystem">
- <QuestDescription title="Weaponsystem" description="INSERT STORY HERE." failmessage="" completeMessage="All right." />
- <subquests>
+ <LocalQuest id="missionOne.navigation">
+ <QuestDescription title="Navigation" description="The next goal is to find and move towards the test targets for your weaponsystem. The three arrows that just appeared down in the right corner of your screen indicate in which direction you have to turn your spacefighter to find your next targets.
+
+Alternative navigation: There's a green circle in the left corner - the radar. The red dots on the radar represent your targets. If you manage to move your spaceship in a way such that a dot is at the center of the radar, you will be able to see the concerning object straight ahead." failmessage="" completeMessage="" />
+ <complete-effects>
+ <AddQuest questId="missionOne.weaponsystemI" />
+ </complete-effects>
+ </LocalQuest>
+
<LocalQuest id ="missionOne.weaponsystemI">
- <QuestDescription title="Destroy Boxes" description="Test your four different weapons on the four boxes. The four weapons are laser (left click), plasma (right click), self targeting rockets (middle click) and manual rockets (press 'T'). Attention if you use manual rockets: Press 'T' only once to start the rocket. If you miss your target you can get out of the rocket, by clicking or pressing 'T' once more." failmessage="" completeMessage="" />
+ <QuestDescription title="Destroy the Boxes" description="Test your four different weapons on the four boxes:
+1. laser (left click)
+2. plasma (right click)
+3. target seeking rockets (middle click)
+4. manual rockets (T)
+
+Attention if you use manual rockets: Press (T) only once to start the rocket. If you miss your target you can get out of the rocket, by clicking or pressing (T) once more." failmessage="" completeMessage="" />
+ <hints>
+ <QuestHint id="missionOne.weaponsystem.laser">
+ <QuestDescription title="Laser" description="The laser is a standard weapon. It is fast and precise but does not deal much damage." />
+ </QuestHint>
+ <QuestHint id="missionOne.weaponsystem.lightningGun">
+ <QuestDescription title="Lightninggun" description="That was the lightning gun. Its plasma munition is quite slow, but a normal spaceship can't take more than three hits of such a strong weapon. That could be your favourite weapon for close range combat or if you want to hit a really slow enemy." />
+ </QuestHint>
+ <QuestHint id="missionOne.weaponsystem.targetSeekingRocket">
+ <QuestDescription title="Target Seeking Rocket" description="The target seeking rockets follow slow targets on their own." />
+ </QuestHint>
+ <QuestHint id="missionOne.weaponsystem.manualrocket">
+ <QuestDescription title="Manual Rocket" description="Manual rockets are your most powerful weapon. But since you have to steer it to your target yourself, you will leave your spaceship unprotected for a while. The total amount of both manual and target seeking rockets is limited to 10." />
+ </QuestHint>
+ </hints>
<complete-effects>
<AddQuest questId="missionOne.weaponsystemII" />
</complete-effects>
</LocalQuest>
+
<LocalQuest id="missionOne.weaponsystemII">
- <QuestDescription title="" description="" failmessage="" completeMessage="" />
+ <QuestDescription title="Kill the pirates" description="Get rid of the patrolling pirates.
+Find out which weapon is best to tackle moving targets. Get close enough." failmessage="" completeMessage="" />
<complete-effects>
<AddQuest questId="missionOne.DuballStation" />
</complete-effects>
</LocalQuest>
- </subquests>
- <hints>
- <QuestHint id="missionOne.weaponsystem.laser">
- <QuestDescription title="Laser" description="The laser is a standard weapon. It is fast and precise but does not deal much damage." />
- </QuestHint>
- <QuestHint id="missionOne.weaponsystem.lightningGun">
- <QuestDescription title="Lightninggun" description="That was the lightning gun. Its plasma munition is quite slow, but a normal spaceship can't take more than three hits of such a strong weapon. That could be your favourite weapon for close range combat or if you want to hit a really slow enemy." />
- </QuestHint>
- <QuestHint id="missionOne.weaponsystem.targetSeekingRocket">
- <QuestDescription title="Target Seeking Rocket" description="The target seeking rockets follow slow targets on their own." />
- </QuestHint>
- <QuestHint id="missionOne.weaponsystem.manualrocket">
- <QuestDescription title="Manual Rocket" description="Manual rockets are your most powerful weapon. But since you have to steer it to your target yourself, you will leave your spaceship unprotected for a while. The total amount of both manual and target seeking rockets is limited to 10." />
- </QuestHint>
- </hints>
- <complete-effects>
- </complete-effects>
- </LocalQuest>
<LocalQuest id="missionOne.DuballStation">
- <QuestDescription title="Duball Space Station" description="Fly towards the Duball Space Station. The grey radar marker will lead you to its position." failmessage="" completeMessage="Well done." />
+ <QuestDescription title="Duball Space Station" description="Fly towards the Duball Space Station. The grey radar marker will lead you to its position." failmessage="" completeMessage="" />
<complete-effects>
<AddQuest questId="missionOne.getHelp" />
</complete-effects>
</LocalQuest>
<LocalQuest id="missionOne.getHelp">
- <QuestDescription title="Get Help" description="There are enemies approaching. You can't handle it on your own. Fortunately there's a shortcut to the next friendly unit. Use the portal (grey dot) to get near the Hydrogen Farmer. There you might get help - as far as we know there should be a stronger spaceship docked to the Hydrogen Farmer. In order to be able to use that stronger spaceship you have to dock to the Hydrogen Farmer. Simply fly to the center of the Hydrogen Farmer, which is between its three legs." failmessage="" completeMessage="Well done." />
+ <QuestDescription title="Get Help" description="There are several enemies approaching. You can't handle it on your own. Fortunately there's a shortcut to the next friendly unit. Use the portal (grey dot) to get near the Hydrogen Farmer.
+The Hydrogen Farmer is a large spaceship with three legs.
+There you might get help - as far as we know there should be a strong spaceruiser docked to the Hydrogen Farmer. In order to be able to use that stronger spaceship, you have to dock to the Hydrogen Farmer.
+Simply fly to the center of the Hydrogen Farmer, which is between its three legs.
+
+How to dock: Accept the dialogue, take your hands off the keyboard and watch." failmessage="" completeMessage="" />
<complete-effects>
<AddQuest questId="missionOne.getHome" />
</complete-effects>
</LocalQuest>
<LocalQuest id="missionOne.getHome">
- <QuestDescription title="Return ASAP" description="" failmessage="" completeMessage="Well done." />
+ <QuestDescription title="Return ASAP" description="So you managed to get the spacecruiser. Use the portal to return to the DuBall Space Station.
+Hurry! Your help is desperately needed." failmessage="" completeMessage="" />
<complete-effects>
<AddQuest questId="missionOne.defence" />
</complete-effects>
</LocalQuest>
<LocalQuest id="missionOne.defence">
- <QuestDescription title="Defence" description="" failmessage="" completeMessage="Well done." />
+ <QuestDescription title="Defence" description="Seven enemies were detected that seem to launch a coordinated attack.
+Do not hesitate to fight or you will be the target.
+
+Always take care of the enemy that is the closest to you." failmessage="" completeMessage="Yeah! You did it." />
</LocalQuest>
+<!-- --------------------- END OF QUESTS -------------------------- -->
- <QuestEffectBeacon position="800,700,600" times="1">
- <effects>
- <AddQuest questId="missionOne.basicFlying" />
- </effects>
- <events>
- <execute>
- <EventListener event="questStart"/>
- </execute>
- </events>
- <attached>
- <DistanceTrigger name="questStart" position="0,0,0" distance="50" target="Pawn" beaconMode="identify" targetname="PlayerDistanceTrigger" delay="2" />
- </attached>
- </QuestEffectBeacon>
-
-
-<!-- TUTORIAL-TODO: -->
-<!-- 1. Flying & manoeuvring (basic flying, using pickups, forcefields, docks & portals) --> <!-- "W","S","SPACE"-->
-<!-- 2. Aiming & Weapons (static targets, moving targets, dangerous targets)--> <!-- 3 Mouse buttons + "T"-->
-<!-- 3. Game handling (quests, knowing when a game is over :-), pausing, chat, ... ) --> <!--"F3", "F2", "ESC" -->
-<!-- 4. Extras (other things to discover) --> <!-- "Q","E","A","D","C", "CTRL", "", ... -->
-
-<!--
-
-"Lets start flying. Use W to accelerate and S to brake. The goal is to reach the spacestation which is displayed on the radar. If you want to be faster you can temporarily boost by hitting additionally the space button. If you use too much boost your engine heats up and you won't be able to use boost for a while. By the way boost could be useful during combat .."
-
--->
-
- <DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true"/>
- <SimpleNotification message="Welcome to the Orxonox Tutorial.">
+ <DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=2/>
+ <SimpleNotification message="Press (F3) to see your mission briefing.">
<events>
<trigger>
<EventListener event="spawndelaytrigger0" />
@@ -157,7 +377,8 @@
</events>
</SimpleNotification>
-<BlinkingBillboard position="-900,640,600" frequency=0.4 amplitude=2 material="Flares/lensflare" colour="1,1,0">
+<!-- Blinking Billboard should be replaced with WAYPOINT -->
+<BlinkingBillboard position="-900,640,600" frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,1,0.05">
<events>
<visibility>
<EventTrigger invert=true>
@@ -183,8 +404,10 @@
</visibility>
</events>
</Billboard>
+
<!-------------------------------------- PART ZERO: How to fly --------------------------------------->
- <DistanceTrigger name="flying1" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=4/>
+
+ <DistanceTrigger name="flying1" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=6/>
<SimpleNotification message="Let's fly to the blinking light.">
<events>
<trigger>
@@ -193,8 +416,8 @@
</events>
</SimpleNotification>
- <DistanceTrigger name="flying2" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=8/>
- <SimpleNotification message="Use 'W' to accelerate and the mouse to steer.">
+ <DistanceTrigger name="flying2" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=10/>
+ <SimpleNotification message="Use (W) to accelerate and the mouse to steer.">
<events>
<trigger>
<EventListener event="flying2" />
@@ -202,17 +425,13 @@
</events>
</SimpleNotification>
- <!--DistanceTrigger name="flying3" position="800,700,600" target="Pawn" distance=20 stayActive="true" delay=12/>
- <SimpleNotification message="Point with the mouse to the blinking light.">
- <events>
- <trigger>
- <EventListener event="flying3" />
- </trigger>
- </events>
- </SimpleNotification-->
+<!-- QUEST-Trigger && Message Trigger: navigationend is activated after flying4 was triggered -->
+ <DistanceTrigger name="navigationend" position="0,0,0" distance=950 target="SpaceShip" stayActive="false" delay=1.1>
+ <DistanceTrigger name="flying4" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=1/>
+ </DistanceTrigger>
- <DistanceTrigger name="flying4" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=1/>
- <SimpleNotification message="Three red arrows just appeared.">
+
+ <SimpleNotification message="Three arrows just appeared.">
<events>
<trigger>
<EventListener event="flying4" />
@@ -221,7 +440,7 @@
</SimpleNotification>
<DistanceTrigger name="flying5" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=5/>
- <SimpleNotification message="Follow those red arrows.">
+ <SimpleNotification message="Follow those arrows.">
<events>
<trigger>
<EventListener event="flying5" />
@@ -229,11 +448,43 @@
</events>
</SimpleNotification>
+<!-------------------------------------- PART ONE : Destroy boxes --------------------------------------->
+<!-- @ triggers: spawndelaytriggerX: textoutput only if no box was destroyed -->
+ <Trigger name="spawndelaytrigger1" mode="and" stayActive="true">
+ <DistanceTrigger position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=9 />
+ <EventTrigger activations="1" invert="true">
+ <events>
+ <trigger>
+ <EventListener event="boxtrigger1" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ <Trigger name="spawndelaytrigger2" mode="and" stayActive="true">
+ <DistanceTrigger position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=13 />
+ <EventTrigger activations="1" invert="true">
+ <events>
+ <trigger>
+ <EventListener event="boxtrigger1" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
-<!-------------------------------------- PART ONE : Destroy boxes --------------------------------------->
- <DistanceTrigger name="spawndelaytrigger1" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=9 />
- <SimpleNotification message="Destroy the four boxes.">
+ <Trigger name="spawndelaytrigger3" mode="and" stayActive="true">
+ <DistanceTrigger position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=17 />
+ <EventTrigger activations="1" invert="true">
+ <events>
+ <trigger>
+ <EventListener event="boxtrigger1" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+
+<!-- @Text: How to shoot-->
+ <SimpleNotification message="Destroy the four boxes." broadcast="true">
<events>
<trigger>
<EventListener event="spawndelaytrigger1" />
@@ -241,8 +492,7 @@
</events>
</SimpleNotification>
- <DistanceTrigger name="spawndelaytrigger2" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=13 />
- <SimpleNotification message=" 1. Aim the a red cycle.">
+ <SimpleNotification message=" 1. Aim the a red cycle." broadcast="true">
<events>
<trigger>
<EventListener event="spawndelaytrigger2" />
@@ -250,8 +500,7 @@
</events>
</SimpleNotification>
- <DistanceTrigger name="spawndelaytrigger3" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=17 />
- <SimpleNotification message="2. Click! (hold the left mouse button)">
+ <SimpleNotification message="2. Click! (hold the left mouse button)" broadcast="true">
<events>
<trigger>
<EventListener event="spawndelaytrigger3" />
@@ -260,60 +509,62 @@
</SimpleNotification>
<!-- @Objects: 4 boxes (uncontrolled pawns) -->
- <Pawn health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box >
- <events>
- <visibility>
- <EventListener event="flying4" />
- </visibility>
- </events>
- <attached>
- <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
- </collisionShapes>
- </Pawn>
+ <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 1" >
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
- <Pawn health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box visible="true">
- <events>
- <visibility>
- <EventListener event="flying4" />
- </visibility>
- </events>
- <attached>
- <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
- </collisionShapes>
- </Pawn>
- <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box >
- <events>
- <visibility>
- <EventListener event="flying4" />
- </visibility>
- </events>
- <attached>
- <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
- </collisionShapes>
- </Pawn>
- <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box >
- <events>
- <visibility>
- <EventListener event="flying4" />
- </visibility>
- </events>
- <attached>
- <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
- </collisionShapes>
- </Pawn>
+ <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 2">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+ <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 3">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+
+ <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 4">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+
<!-- @Triggers: boxtrigger1 <-> one box destroyed
boxtrigger2 <-> two boxes destroyed
boxtrigger3 <-> three boxes destroyed
@@ -364,8 +615,7 @@
</events>
</SimpleNotification>
-
- <SimpleNotification message="Aim at the last target and press 'T'." broadcast="true">
+ <SimpleNotification message="Aim at the last target and press (T)." broadcast="true">
<events>
<trigger>
<EventListener event="boxtrigger3" />
@@ -385,7 +635,7 @@
<!--------------------------------------PART TWO: Moving targets --------------------------------------->
<!-- @Objects: 2 pirates moving in squares, nonlethal -->
- <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" >
+ <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" RVName="Pirate">
<events>
<visibility>
<EventListener event="boxtrigger4" />
@@ -395,7 +645,7 @@
<Template link=spaceshippirate />
</templates>
<controller>
- <WaypointController>
+ <WaypointController team=1>
<waypoints>
<Model mesh="cube.mesh" scale=8 position=" 0,1700,-200" />
<Model mesh="cube.mesh" scale=8 position=" 0,1700,-700" />
@@ -406,7 +656,7 @@
</controller>
</SpaceShip>
- <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget">
+ <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget" RVName="Pirate">
<events>
<visibility>
<EventListener event="boxtrigger4" />
@@ -416,7 +666,7 @@
<Template link=spaceshippirate />
</templates>
<controller>
- <WaypointController>
+ <WaypointController team=1>
<waypoints>
<Model mesh="cube.mesh" scale=8 position=" 0,2400,1000" />
<Model mesh="cube.mesh" scale=8 position=" 0,2400, 500" />
@@ -472,22 +722,41 @@
</events>
</DistanceTrigger>
- <EventTrigger name="duball2" activations="1" stayactive="true" delay=4 >
- <events>
- <trigger>
- <EventListener event="duball1" />
- </trigger>
- </events>
- </EventTrigger>
+ <Trigger name="duball2" mode="and" stayActive="true">
+ <EventTrigger activations="1" stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="duball1" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger activations="1" invert="true">
+ <events>
+ <trigger>
+ <EventListener event="toHydroFarmer" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
- <EventTrigger name="duball3" activations="1" stayactive="true" delay=4 >
- <events>
- <trigger>
- <EventListener event="duball2" />
- </trigger>
- </events>
- </EventTrigger>
+ <Trigger name="duball3" mode="and" stayActive="true">
+ <EventTrigger activations="1" stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="duball2" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger activations="1" invert="true">
+ <events>
+ <trigger>
+ <EventListener event="toHydroFarmer" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+
<SimpleNotification message="Welcome to the Duball Space Station!">
<events>
<trigger>
@@ -519,7 +788,7 @@
<Model scale=13 mesh="DuBall1.mesh" position = "-100,0,0"/>
<Model scale=13 mesh="DuBall2.mesh" position = "100,0,0"/>
<Billboard scale=7 material="Examples/Flare" colour="0.5,0.5,0.5" position = "-100,0,0"/>
- <Billboard scale=7 material="Examples/Flare" colour="0.5,0.5,0.5" position = "100,0,0"/>
+ <Billboard scale=7 material="Examples/Flare" colour="0.5,0.5,0.5" position = "100,0,0"/>
</attached>
<collisionShapes>
<SphereCollisionShape radius="80" position = "-100,0,0" />
@@ -656,7 +925,7 @@
<!-- PORTALS END-->
- <SimpleNotification message="Dock to the Hydrogen Farmer.">
+ <SimpleNotification message="Dock to the Hydrogen Farmer." broadcast="true">
<events>
<trigger>
<EventListener event=toHydroFarmer />
@@ -664,9 +933,31 @@
</events>
</SimpleNotification>
-<!-------------------------------------- PART FOUR : Get Help --------------------------------------->
- <DistanceTrigger name="famer1" position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=0 />
- <SimpleNotification message="We just received a message from DuBall.">
+<!-------------------------------------- PART FOUR : Get Help --------------------------------------->
+
+ <Trigger name="famer1" mode="and" stayActive="true">
+ <DistanceTrigger position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=0 />
+ <EventTrigger name="notGameEnd" activations="1" invert="true">
+ <events>
+ <trigger>
+ <EventListener event="gameEnd" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+
+ <Trigger name="famer2" mode="and" stayActive="true">
+ <DistanceTrigger position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=4 />
+ <EventTrigger activations="1" invert="true">
+ <events>
+ <trigger>
+ <EventListener event="gameEnd" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+
+ <SimpleNotification message="We just received a message from DuBall." broadcast="true">
<events>
<trigger>
<EventListener event=famer1 />
@@ -674,8 +965,8 @@
</events>
</SimpleNotification>
- <DistanceTrigger name="famer2" position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=4 />
- <SimpleNotification message="We will lend you our strongest ship.">
+
+ <SimpleNotification message="We will lend you our strongest ship." broadcast="true">
<events>
<trigger>
<EventListener event=famer2 />
@@ -685,7 +976,14 @@
<!-- @Objects: HYDROGEN FARMER & DOCKING -->
- <SpaceShip position="-48900,100,0" roll=90 yaw=0 pitch=20 mass=10000 health=100000 name="HydroFarmer">
+ <SpaceShip
+ team = 0
+ position = "-48900,100,0"
+ roll = 90 yaw=0 pitch=20
+ mass = 10000
+ health = 100000 initialhealth=100000 maxhealth="100000"
+ name = "HydroFarmer"
+ RVName = "Hydrogen Farmer" >
<attached>
<!-- Docking -->
<DistanceTriggerBeacon name="bcnDestroyer" />
@@ -729,7 +1027,6 @@
</collisionShapes>
</SpaceShip>
- <Billboard position="-48900,0,0" material="Examples/Flare" colour="0.6,0,0" scale=3/>
<Dock position="-48900,0,0" roll=90 yaw=180 >
<animations>
<MoveToDockingTarget target="destroyer" />
@@ -741,24 +1038,42 @@
<execute>
<EventListener event="dockMe" />
</execute>
+ <activity>
+ <EventListener event=notGameEnd />
+ </activity>
</events>
<attached>
<DistanceTrigger position="10,-202, -42" distance="800" target="Pawn"
beaconMode="exclude" targetname="bcnDestroyer" name="dockMe"
/>
</attached>
+
</Dock>
- <SpaceShip template="spaceshipspacecruiser" position="-48900,800,0" orientation="-0.14, 0.68, 0.68, 0.223" health="300" maxhealth="400" initialhealth="300" name="cruiser" >
+<!-- at Objects: SpaceCruiser as docking target -->
+ <SpaceShip
+ template = "spaceshipspacecruiser"
+ team = "0"
+ position = "-48900,800,0"
+ orientation = "-0.14, 0.68, 0.68, 0.223"
+ health = "400"
+ initialhealth = "400"
+ maxhealth = "500"
+ shieldhealth = "80"
+ initialshieldhealth = "80"
+ maxshieldhealth = "120"
+ shieldabsorption = "0.8"
+ reloadrate = "1"
+ reloadwaittime = "1"
+ name = "cruiser"
+ RVName = "Spacecruiser" >
<attached>
<DockingTarget name="spaceShip" />
</attached>
</SpaceShip>
-<!-- TESTBOX-->
-<!-- TESTBOX-->
-
+<!-- cruiserKilled: if cuiser is killed & player hasn't taken control of spacecrusier -->
<Trigger name="cruiserKilled" mode="and" stayActive="true">
<EventTrigger stayActive="true">
<events>
@@ -777,23 +1092,29 @@
</Trigger>
- <EventTrigger delay=4 name="earlyEnd">
- <events>
- <trigger>
- <EventListener event="cruiserKilled" />
- </trigger>
- </events>
- <events>
- <activity>
- <EventListener event="movingpirates2" />
- </activity>
- </events>
- </EventTrigger>
+<!-- triggers when either hydrofarmer or cruiser is killed -->
+ <Trigger mode=or name="gameEnd">
+ <EventTrigger activations="1">
+ <events>
+ <trigger>
+ <EventListener event="HydroFarmer" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger activations="1">
+ <events>
+ <trigger>
+ <EventListener event="cruiserKilled" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+<!-- triggers delayed when either hydrofarmer or cruiser is killed -->
<EventTrigger delay=4 name="earlyEnd">
<events>
<trigger>
- <EventListener event="HydroFarmer" />
+ <EventListener event="gameEnd" />
</trigger>
</events>
<events>
@@ -804,7 +1125,6 @@
</EventTrigger>
-
<SimpleNotification message="Oh no! You killed the Hydrogen Farmer!" broadcast="true">
<events>
<trigger>
@@ -821,7 +1141,7 @@
</events>
</SimpleNotification>
- <SimpleNotification message="Press 'Esc' and restart the mission." broadcast="true">
+ <SimpleNotification message="Press (Esc) and restart the mission." broadcast="true">
<events>
<trigger>
<EventListener event="earlyEnd" />
@@ -829,7 +1149,6 @@
</events>
</SimpleNotification>
-
<!-- hydrogen farmer & docking END -->
@@ -871,7 +1190,7 @@
enablecollisiondamage = "false"
>
<!--attached>
- <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-50" />
+ <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-50" />
</attached--> <!-- Forcefield kills HYDROGEN FARMER-->
<collisionShapes>
<SphereCollisionShape radius="2500" position="0,0,0" />
@@ -880,28 +1199,52 @@
<!-------------------------------------- The attack --------------------------------------->
-
<!-- TODO:
- update spaceshipTransporter
- - bots do friendly fire (is drone function reusable?)
+ - bots do friendly fire (is drone function reusable?)
-->
+<!-- Fallback Spawnpoint: on cruiserdeath caused by pirates. Unfortunately unstable behaviour concerning activity. -->
+ <TeamSpawnPoint team=0 position="2000,1500,-1500" direction="-1,-1,1" spawnclass=SpaceShip pawndesign=spaceshipspacecruiser>
+ <events>
+ <activity>
+ <EventListener event="attack" />
+ </activity>
+ </events>
+ </TeamSpawnPoint>
+
<!-- @Triggers: toHydroFamer <-> first portal usage
ondock <-> successfull docking
attack <-> second portal usage -->
- <DistanceTrigger name="attack" position="-1400,-500,800" target="Pawn" distance=100 stayActive="true" >
+ <DistanceTrigger name="attack" position="-1400,-500,800" target="Pawn" distance=100 stayActive="true" mode="and">
<EventTrigger name="ondock" activations="1" stayactive="true" delay=6>
<events>
<trigger>
<EventListener event="dockMe" />
</trigger>
</events>
- <DistanceTrigger name="toHydroFarmer" position="-47000,-1000,1300" target="Pawn" distance=100 stayActive="true" />
+ <Trigger mode=and>
+ <DistanceTrigger name="toHydroFarmer" position="-47000,-1000,1300" target="Pawn" distance=100 stayActive="true" />
+ <EventTrigger activations="1" invert="true">
+ <events>
+ <trigger>
+ <EventListener event="gameEnd" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
</EventTrigger>
+ <EventTrigger activations="1" invert="true">
+ <events>
+ <trigger>
+ <EventListener event="earlyEnd" />
+ </trigger>
+ </events>
+ </EventTrigger>
</DistanceTrigger>
- <SimpleNotification message="Return before it's too late. Boost with 'Space'." broadcast="true">
+ <SimpleNotification message="Return before it's too late. Boost with (Space)." broadcast="true">
<events>
<trigger>
<EventListener event=ondock />
@@ -918,8 +1261,8 @@
</SimpleNotification>
-
<!-- @Objects: 6 pirates, heading towards DuBall, attacking -->
+<!-- TODO: re-hide pirates on early end-->
<!-- 1 -->
<SpaceShip position="3000,-4000,4000" lookat="-1300,-600,900" name="attacker"visible="true">
<events>
@@ -1065,6 +1408,7 @@
</controller>
</SpaceShip>
+
<!-- @Triggers: attacktriggerX <-> X enemies destroyed , X is an element of [1,6] -->
<EventTrigger name="attacktrigger6" activations="1" stayactive="true">
<events>
@@ -1141,6 +1485,7 @@
</trigger>
</events>
</SimpleNotification>
+
<SimpleNotification message="One enemy left!" broadcast="true">
<events>
<trigger>
@@ -1148,6 +1493,7 @@
</trigger>
</events>
</SimpleNotification>
+
<SimpleNotification message="Well done. You finished this tutorial." broadcast="true">
<events>
<trigger>
@@ -1157,7 +1503,7 @@
</SimpleNotification>
<!-- @Triggers: postAttack <-> delayed attacktrigger6 -->
- <EventTrigger name="postAttack1" activations="1" stayactive="true" delay=3>
+ <EventTrigger name="postAttack1" activations="1" stayactive="true" delay=4.1>
<events>
<trigger>
<EventListener event="attacktrigger6" />
@@ -1165,7 +1511,7 @@
</events>
</EventTrigger>
- <EventTrigger name="postAttack2" activations="1" stayactive="true" delay=6>
+ <EventTrigger name="postAttack2" activations="1" stayactive="true" delay=8.2>
<events>
<trigger>
<EventListener event="attacktrigger6" />
@@ -1173,7 +1519,7 @@
</events>
</EventTrigger>
- <SimpleNotification message="Either quit by pressing 'Esc' or ..." broadcast="true">
+ <SimpleNotification message="Either quit by pressing (Esc) or ..." broadcast="true">
<events>
<trigger>
<EventListener event="postAttack1" />
@@ -1191,14 +1537,14 @@
<!-------------------------------------- |Bonus Part| --------------------------------------->
<!-- @Triggers: "bonusX" <-> delayed "attacktrigger6" -->
- <EventTrigger name="bonus1" activations="1" stayactive="true" delay=10>
+ <EventTrigger name="bonus1" activations="1" stayactive="true" delay=12.3>
<events>
<trigger>
<EventListener event="attacktrigger6" />
</trigger>
</events>
</EventTrigger>
- <EventTrigger name="bonus2" activations="1" stayactive="true" delay=16>
+ <EventTrigger name="bonus2" activations="1" stayactive="true" delay=16.4>
<events>
<trigger>
<EventListener event="attacktrigger6" />
@@ -1212,28 +1558,28 @@
</trigger>
</events>
</EventTrigger>
- <EventTrigger name="bonus4" activations="1" stayactive="true" delay=28>
+ <EventTrigger name="bonus4" activations="1" stayactive="true" delay=28.1>
<events>
<trigger>
<EventListener event="attacktrigger6" />
</trigger>
</events>
</EventTrigger>
- <EventTrigger name="bonus5" activations="1" stayactive="true" delay=32.1>
+ <EventTrigger name="bonus5" activations="1" stayactive="true" delay=32.3>
<events>
<trigger>
<EventListener event="attacktrigger6" />
</trigger>
</events>
</EventTrigger>
- <EventTrigger name="bonus6" activations="1" stayactive="true" delay=36.2>
+ <EventTrigger name="bonus6" activations="1" stayactive="true" delay=36.5>
<events>
<trigger>
<EventListener event="attacktrigger6" />
</trigger>
</events>
</EventTrigger>
- <EventTrigger name="bonus7" activations="1" stayactive="true" delay=4>
+ <EventTrigger name="bonus7" activations="1" stayactive="true" delay=4.1>
<events>
<trigger>
<EventListener event="bonus6" />
@@ -1243,7 +1589,7 @@
- <SimpleNotification message="Rotate your ship. Press 'Q' or 'E'. " broadcast="true">
+ <SimpleNotification message="Rotate your ship. Press (Q) or (E). " broadcast="true">
<events>
<trigger>
<EventListener event=bonus1 />
@@ -1251,7 +1597,7 @@
</events>
</SimpleNotification>
- <SimpleNotification message="Switch the camera's position. Press 'C'. " broadcast="true">
+ <SimpleNotification message="Switch the camera's position. Press (C). " broadcast="true">
<events>
<trigger>
<EventListener event=bonus2 />
@@ -1259,7 +1605,7 @@
</events>
</SimpleNotification>
- <SimpleNotification message="360° view: press 'Ctrl' + use the mouse " broadcast="true">
+ <SimpleNotification message="360° view: press (Ctrl) + use the mouse " broadcast="true">
<events>
<trigger>
<EventListener event=bonus3 />
@@ -1291,7 +1637,7 @@
</events>
</SimpleNotification>
- <SimpleNotification message="Press 'Esc' and return to the main menu." broadcast="true">
+ <SimpleNotification message="Press (Esc) and return to the main menu." broadcast="true">
<events>
<trigger>
<EventListener event=bonus7 />
@@ -1318,10 +1664,11 @@
<!-- Script code="artificialcontroller setbotlevel 0.1" /-->
</Scene>
</Level>
-<!-- TODO:
-! Quest Interface
-- Foolproof text messages (e.g. verspätete Nachrichten unterdrücken)
-- Radar visibility & Hud Markers (done)
+
+<!-- TODO:
+- Story & more precise Questmessages; more quest hints; fail-quest;
+- Colouring: Show who is friend or foe via the colour
+- Waypoints: show the player the way
+- Foolproof text messages (e.g. verspätete Nachrichten unterdrücken ~done )
- End Tutorial, if either the Hydrogen Farmer or the SpaceCruiser gets destroyed. (~done)
-
-->
Modified: code/branches/presentation2011/data/levels/pirateAttack.oxw
===================================================================
--- code/branches/presentation2011/data/levels/pirateAttack.oxw 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/data/levels/pirateAttack.oxw 2011-12-14 13:38:37 UTC (rev 8980)
@@ -26,7 +26,9 @@
?>
<Level
- gametype = "TeamDeathmatch"
+name="Dani's Testlevel"
+description="Erste Versuche mit den Quests"
+gametype=Mission
>
<templates>
@@ -250,7 +252,7 @@
</execute>
</events>
</QuestEffectBeacon>
- <!--Stick found-->
+ <!--Stick found-->zz
<QuestEffectBeacon position="4800,5785,-10725" times=1>
<attached>
<DistanceTrigger name=questbeacon7 position="0,0,0" distance=30 target="Pawn" beaconMode="identify" targetname=Me />
Modified: code/branches/presentation2011/data/levels/templates/spaceshipSpacecruiser.oxt
===================================================================
--- code/branches/presentation2011/data/levels/templates/spaceshipSpacecruiser.oxt 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/data/levels/templates/spaceshipSpacecruiser.oxt 2011-12-14 13:38:37 UTC (rev 8980)
@@ -10,10 +10,10 @@
maxhealth = 400
initialhealth = 300
- shieldhealth = 60
- initialshieldhealth = 60
- maxshieldhealth = 80
- shieldabsorption = 0.8
+ shieldhealth = 75
+ initialshieldhealth = 75
+ maxshieldhealth = 90
+ shieldabsorption = 0.9
reloadrate = 1
reloadwaittime = 1
@@ -44,7 +44,7 @@
<MultiStateEngine position="-7.6, 20, 0" template=spaceshipcruiserengine />
</engines>
<attached>
- <Model position="12,-30,-120" yaw=90 pitch=-90 roll=0 scale=6 mesh="spacecruiser.mesh" />
+ <Model position="12,-5,-10" yaw=90 pitch=-90 roll=0 scale=6 mesh="spacecruiser.mesh" />
<!--Model mesh="cube.mesh" mass=10 position="0,-30,-108" scale3D="38,6,62" />
<Model mesh="cube.mesh" mass=10 position="0,-20,-108" scale3D="20,6,40" />
<Model mesh="cube.mesh" mass=10 position="-16,-35,-112" scale3D="15,5,57" roll=-14 pitch=3.5/>
@@ -56,17 +56,17 @@
</attached>
<collisionShapes>
- <BoxCollisionShape position="0,-30,-108" halfExtents="38,6,62" />
- <BoxCollisionShape position="0,-20,-108" halfExtents="20,6,40" />
- <BoxCollisionShape position="-16,-35,-112" halfExtents="15,5,57" roll=-14 pitch=3.5/>
- <BoxCollisionShape position="16,-35,-112" halfExtents="15,5,57" roll=14 pitch=3.5/>
- <BoxCollisionShape position="19,-21.5,-108" halfExtents="18,5,52" roll=-21 />
- <BoxCollisionShape position="-19,-21.5,-108"halfExtents="18,5,52" roll=21 />
- <BoxCollisionShape position="0,-21,-169"halfExtents="18,1,16" pitch=-30x />
+ <BoxCollisionShape position="0,-5,2" halfExtents="38,6,62" />
+ <BoxCollisionShape position="0,5,2" halfExtents="20,6,40" />
+ <BoxCollisionShape position="-16,-10,-2" halfExtents="15,5,57" roll=-14 pitch=3.5/>
+ <BoxCollisionShape position="16,-10,-2" halfExtents="15,5,57" roll=14 pitch=3.5/>
+ <BoxCollisionShape position="19,3.5,2" halfExtents="18,5,52" roll=-21 />
+ <BoxCollisionShape position="-19,4.5,2" halfExtents="18,5,52" roll=21 />
+ <BoxCollisionShape position="0,4,-59" halfExtents="18,1,16" pitch=-30/>
</collisionShapes>
<?lua
- include("includes/weaponSettingsSpacecruiser.oxi")
+ include("../includes/weaponSettingsSpacecruiser.oxi")
?>
</SpaceShip>
</Template>
@@ -74,16 +74,9 @@
<Template name=spaceshipcruisercameras defaults=0>
<SpaceShip>
<camerapositions>
- <CameraPosition position="0,10, 40" drag=true mouselook=true />
- <CameraPosition position="0,20, 80" drag=true mouselook=true />
- <CameraPosition position="0,30, 120" drag=true mouselook=true />
- <CameraPosition position="0,20,-260" drag=true mouselook=true yaw=180/>
- <CameraPosition position="0,30,-350" drag=true mouselook=true yaw=180/>
- <!--CameraPosition position="0,150,-25" pitch=-90 drag=true />
- <CameraPosition position="0,0,-40" yaw=180 drag=true />
- <CameraPosition position="0,3,-14" yaw=0 />
- <CameraPosition position="-50,5,-8" yaw=-90 drag=true />
- <CameraPosition position="50,5,-8" yaw=90 drag=true /-->
+ <CameraPosition position="0,40, 170" drag=true mouselook=true />
+ <CameraPosition position="0,55, 230" drag=true mouselook=true />
+ <CameraPosition position="0,65, 460" drag=true mouselook=true />
</camerapositions>
</SpaceShip>
</Template>
@@ -92,10 +85,10 @@
<MultiStateEngine
boostfactor = 2
- speedfront = 150
- speedback = 50
- speedleftright = 50
- speedupdown = 50
+ speedfront = 200
+ speedback = 70
+ speedleftright = 70
+ speedupdown = 70
defEngineSndNormal = "sounds/Engine_low.ogg"
defEngineSndBoost = "sounds/Engine_high.ogg"
@@ -110,25 +103,25 @@
<WorldSound mainstate="activity" source="sounds/Engine_idle.ogg" looping=1 active=false/>
</EffectContainer>
<EffectContainer condition="not idle">
- <FadingBillboard mainstate=activity active=false scale=0.1 position="20, -25, -40" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
- <FadingBillboard mainstate=activity active=false scale=0.1 position="-20, -25, -40" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.1 position="20, 0, 70" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.1 position="-20, 0, 70" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
</EffectContainer>
<EffectContainer condition="normal or brake">
</EffectContainer>
<EffectContainer condition="normal or boost">
- <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 20, -25, -40" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1300 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
- <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-20, -25, -40" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1300 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 20, 0, 70" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1300 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-20, 0, 70" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1300 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" />
</EffectContainer>
<EffectContainer condition="boost">
- <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 20, -25, -40" colour="0.6, 0.75, 0.8, 0.7" width=40 length=800 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
- <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-20, -25, -40" colour="0.6, 0.75, 0.8, 0.7" width=40 length=800 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 20, 0, 70" colour="0.6, 0.75, 0.8, 0.7" width=40 length=800 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
+ <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-20, 0, 70" colour="0.6, 0.75, 0.8, 0.7" width=40 length=800 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" />
</EffectContainer>
<!-- <EffectContainer condition="brake">
- <FadingBillboard mainstate=activity active=false scale=0.3 position=" 20, -25, -40" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
- <FadingBillboard mainstate=activity active=false scale=0.3 position="-20, -25, -40" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
- <FadingBillboard mainstate=activity active=false scale=0.15 position="20, -25, -40" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
- <FadingBillboard mainstate=activity active=false scale=0.15 position="-20, -25, -40" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.3 position=" 20, 0, 70" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.3 position="-20, 0, 70" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.15 position="20, 0, 70" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
+ <FadingBillboard mainstate=activity active=false scale=0.15 position="-20, 0, 70" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 />
</EffectContainer>
-->
</MultiStateEngine>
Modified: code/branches/presentation2011/src/libraries/core/GUIManager.cc
===================================================================
--- code/branches/presentation2011/src/libraries/core/GUIManager.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/libraries/core/GUIManager.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -222,7 +222,7 @@
static CEGUI::MouseButton convertButton(MouseButtonCode::ByEnum button);
GUIManager* GUIManager::singletonPtr_s = 0;
- /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen";
+ /*static*/ const std::string GUIManager::defaultScheme_ = "Orxonox"; //TaharezGreen
SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false);
SetConsoleCommand("hideGUI", &GUIManager::hideGUI);
Modified: code/branches/presentation2011/src/modules/pong/Pong.cc
===================================================================
--- code/branches/presentation2011/src/modules/pong/Pong.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/modules/pong/Pong.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -36,15 +36,16 @@
#include "core/CoreIncludes.h"
#include "core/EventIncludes.h"
#include "core/command/Executor.h"
+#include "core/ConfigValueIncludes.h"
#include "gamestates/GSLevel.h"
+#include "chat/ChatManager.h"
#include "PongCenterpoint.h"
#include "PongBall.h"
#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.
@@ -74,6 +75,8 @@
// Set the type of Bots for this particular Gametype.
this->botclass_ = Class(PongBot);
+ this->scoreLimit_ = 10;
+ this->setConfigValues();
}
/**
@@ -279,8 +282,28 @@
this->bat_[1]->setPosition( this->center_->getFieldDimension().x / 2, 0, 0);
}
+ // If a palyer gets 21 points, he won the game -> end of game
+
+ PlayerInfo* player1 = this->getLeftPlayer();
+ PlayerInfo* player2 = this->getRightPlayer();
+ if(player1==NULL||player2==NULL) return; //safety
+ if(this->getScore(player1) >= scoreLimit_)
+ {
+ std::string name1=player1->getName();
+ std::string message(name1 + " has won!");
+ ChatManager::message(message);
+ this->end();
+ }
+ else if(this->getScore(player2) >= scoreLimit_)
+ {
+ std::string name2=player2->getName();
+ std::string message2(name2 + " has won!");
+ ChatManager::message(message2);
+ this->end();
+ }
// Restart the timer to start the ball.
this->starttimer_.startTimer();
+
}
/**
@@ -320,4 +343,13 @@
else
return 0;
}
+
+ /**
+ @brief
+ Make scoreLimit_ configurable e.g. in the menu.
+ */
+ void Pong::setConfigValues()
+ {
+ SetConfigValue(scoreLimit_, 10).description("The player first reaching those points wins.");
+ }
}
Modified: code/branches/presentation2011/src/modules/pong/Pong.h
===================================================================
--- code/branches/presentation2011/src/modules/pong/Pong.h 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/modules/pong/Pong.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -80,8 +80,9 @@
*/
void setCenterpoint(PongCenterpoint* center)
{ this->center_ = center; }
-
- PlayerInfo* getLeftPlayer() const; //!< Get the left player.
+ void setConfigValues(); //!< Makes scoreLimit configurable.
+
+ PlayerInfo* getLeftPlayer() const; //!< Get the left player.
PlayerInfo* getRightPlayer() const; //!< Get the right player.
protected:
@@ -93,7 +94,8 @@
WeakPtr<PongCenterpoint> center_; //!< The playing field.
WeakPtr<PongBall> ball_; //!< The Pong ball.
WeakPtr<PongBat> bat_[2]; //!< The two bats.
- Timer starttimer_; //!< A timer to delay the start of the game.
+ Timer starttimer_; //!< A timer to delay the start of the game.
+ int scoreLimit_; //!< If a player scored that much points, the game is ended.
};
}
Modified: code/branches/presentation2011/src/modules/pong/PongAI.h
===================================================================
--- code/branches/presentation2011/src/modules/pong/PongAI.h 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/modules/pong/PongAI.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -79,7 +79,7 @@
void move(char direction, bool bUseDelay); //!< Determine the movement the AI will undertake.
void delayedMove(); //!< Is called, when a delayed move takes effect.
- PongBall* ball_; //!< A pointer to the ball.
+ WeakPtr<PongBall> ball_; //!< A weak pointer to the ball.
Vector2 ballDirection_; //!< Vector to store the (x,z) direction in which the ball is flying.
float ballEndPosition_; //!< The calculated end position of the ball.
float randomOffset_; //!< A random offset to introduce random errors (weighted by the strength of the AI) into the AI's behavior.
Modified: code/branches/presentation2011/src/modules/pong/PongScore.cc
===================================================================
--- code/branches/presentation2011/src/modules/pong/PongScore.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/modules/pong/PongScore.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -59,6 +59,8 @@
this->bShowScore_ = false;
this->bShowLeftPlayer_ = false;
this->bShowRightPlayer_ = false;
+ this->player1_ = NULL;
+ this->player2_ = NULL;
}
/**
@@ -97,44 +99,51 @@
// If the owner is set. The owner being a Pong game.
if (this->owner_ != NULL)
{
- // Get the two players.
- PlayerInfo* player1 = this->owner_->getLeftPlayer();
- PlayerInfo* player2 = this->owner_->getRightPlayer();
-
- std::string name1;
- std::string name2;
-
- std::string score1("0");
- std::string score2("0");
-
- // Save the name and score of each player as a string.
- if (player1 != NULL)
+ if(!this->owner_->hasEnded())
{
- name1 = player1->getName();
- score1 = multi_cast<std::string>(this->owner_->getScore(player1));
+ //get the two players
+ player1_ = this->owner_->getLeftPlayer();
+ player2_ = this->owner_->getRightPlayer();
}
- if (player2 != NULL)
- {
- name2 = player2->getName();
- score2 = multi_cast<std::string>(this->owner_->getScore(player2));
- }
- // Assemble the strings, depending on what should all be displayed.
- std::string output1;
- if (this->bShowLeftPlayer_)
+ if(this->owner_->hasStarted())
{
- if (this->bShowName_ && this->bShowScore_ && player1 != NULL)
- output1 = name1 + " - " + score1;
- else if (this->bShowScore_)
- output1 = score1;
- else if (this->bShowName_)
- output1 = name1;
- }
+ // Get the two players.
- std::string output2;
- if (this->bShowRightPlayer_)
- {
- if (this->bShowName_ && this->bShowScore_ && player2 != NULL)
+ std::string name1;
+ std::string name2;
+
+ std::string score1("0");
+ std::string score2("0");
+
+ // Save the name and score of each player as a string.
+ if (player1_ != NULL)
+ {
+ name1 = player1_->getName();
+ score1 = multi_cast<std::string>(this->owner_->getScore(player1_));
+ }
+ if (player2_ != NULL)
+ {
+ name2 = player2_->getName();
+ score2 = multi_cast<std::string>(this->owner_->getScore(player2_));
+ }
+
+ // Assemble the strings, depending on what should all be displayed.
+ std::string output1;
+ if (this->bShowLeftPlayer_)
+ {
+ if (this->bShowName_ && this->bShowScore_ && player1_ != NULL)
+ output1 = name1 + " - " + score1;
+ else if (this->bShowScore_)
+ output1 = score1;
+ else if (this->bShowName_)
+ output1 = name1;
+ }
+
+ std::string output2;
+ if (this->bShowRightPlayer_)
+ {
+ if (this->bShowName_ && this->bShowScore_ && player2_ != NULL)
output2 = score2 + " - " + name2;
else if (this->bShowScore_)
output2 = score2;
@@ -142,16 +151,16 @@
output2 = name2;
}
- std::string output("PONG");
- if (this->bShowName_ || this->bShowScore_)
- {
- if (this->bShowLeftPlayer_ && this->bShowRightPlayer_)
- output = output1 + ':' + output2;
- else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_)
- output = output1 + output2;
+ std::string output("PONG");
+ if (this->bShowName_ || this->bShowScore_)
+ {
+ if (this->bShowLeftPlayer_ && this->bShowRightPlayer_)
+ output = output1 + ':' + output2;
+ else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_)
+ output = output1 + output2;
+ }
+ this->setCaption(output);
}
-
- this->setCaption(output);
}
}
Modified: code/branches/presentation2011/src/modules/pong/PongScore.h
===================================================================
--- code/branches/presentation2011/src/modules/pong/PongScore.h 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/modules/pong/PongScore.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -121,6 +121,8 @@
bool bShowScore_; //!< Whether the score of the players is shown.
bool bShowLeftPlayer_; //!< Whether the left player is shown.
bool bShowRightPlayer_; //!< Whether the right player is shown.
+ PlayerInfo* player1_; //!< Store information about left player permanently.
+ PlayerInfo* player2_; //!< Same for the right player. To end the game properly.
};
}
#endif /* _PongScore_H__ */
Modified: code/branches/presentation2011/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/branches/presentation2011/src/modules/weapons/projectiles/Rocket.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/modules/weapons/projectiles/Rocket.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -65,7 +65,6 @@
this->localAngularVelocity_ = 0;
this->lifetime_ = 100.0f;
- this->bIsRocket_= true;
if (GameMode::isMaster())
{
@@ -134,7 +133,6 @@
{
if(this->isInitialized())
{
- this->bIsRocket_= false;
if (GameMode::isMaster())
{
this->destructionEffect();
Modified: code/branches/presentation2011/src/modules/weapons/weaponmodes/LightningGun.cc
===================================================================
--- code/branches/presentation2011/src/modules/weapons/weaponmodes/LightningGun.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/modules/weapons/weaponmodes/LightningGun.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -51,7 +51,7 @@
this->reloadTime_ = 1.0f;
this->damage_ = 0.0f;
- this->speed_ = 250.0f;
+ this->speed_ = 700.0f;
this->setMunitionName("LaserMunition");
this->setDefaultSound("sounds/Weapon_LightningGun.ogg");
Modified: code/branches/presentation2011/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/AIController.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/controllers/AIController.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -73,59 +73,7 @@
this->searchNewMaster();
}
- // search enemy
- random = rnd(maxrand);
- if (random < (15 + botlevel_* 20) && (!this->target_))
- this->searchNewTarget();
-
- // forget enemy
- random = rnd(maxrand);
- if (random < ((1-botlevel_)*6) && (this->target_))
- this->forgetTarget();
-
- // next enemy
- random = rnd(maxrand);
- if (random < (botlevel_*20) && (this->target_))
- this->searchNewTarget();
-
- // fly somewhere
- random = rnd(maxrand);
- if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
- this->searchRandomTargetPosition();
-
- // stop flying
- random = rnd(maxrand);
- if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
- this->bHasTargetPosition_ = false;
-
- // fly somewhere else
- random = rnd(maxrand);
- if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
- this->searchRandomTargetPosition();
-
- // shoot
- random = rnd(maxrand);
- if (!(this->passive_) && random < (75 + botlevel_*25) && (this->target_ && !this->bShooting_))
- this->bShooting_ = true;
-
- // stop shooting
- random = rnd(maxrand);
- if (random < ((1 - botlevel_)*25) && (this->bShooting_))
- this->bShooting_ = false;
-
- // boost
- random = rnd(maxrand);
- if (random < botlevel_*100 )
- this->boostControl();
-
- // update Checkpoints
- /*random = rnd(maxrand);
- if (this->defaultWaypoint_ && random > (maxrand-10))
- this->manageWaypoints();
- else //if(random > maxrand-10) //CHECK USABILITY!!*/
- if (this->waypoints_.size() == 0 )
- this->manageWaypoints();
-
+ this->defaultBehaviour(maxrand);
}
if (this->state_ == SLAVE)
@@ -135,8 +83,6 @@
if (this->state_ == MASTER)
{
-
-
this->commandSlaves();
if (this->specificMasterAction_ != NONE)
@@ -169,60 +115,9 @@
if(this->slaves_.size() < 3 && random < 20)
this->searchNewMaster();
- // search enemy
- random = rnd(maxrand);
- if (random < (botlevel_)*25 && (!this->target_))
- this->searchNewTarget();
-
- // forget enemy
- random = rnd(maxrand);
- if (random < (1-botlevel_)*6 && (this->target_))
- this->forgetTarget();
-
- // next enemy
- random = rnd(maxrand);
- if (random < 10 && (this->target_))
- this->searchNewTarget();
-
- // fly somewhere
- random = rnd(maxrand);
- if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
- this->searchRandomTargetPosition();
-
-
- // fly somewhere else
- random = rnd(maxrand);
- if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
- this->searchRandomTargetPosition();
-
- // shoot
- random = rnd(maxrand);
- if (!(this->passive_) && random < 25*(botlevel_)+1 && (this->target_ && !this->bShooting_))
- {
- this->bShooting_ = true;
- this->forceFreeSlaves();
- }
-
- // stop shooting
- random = rnd(maxrand);
- if (random < ( (1- botlevel_)*25 ) && (this->bShooting_))
- this->bShooting_ = false;
-
- // boost
- random = rnd(maxrand);
- if (random < botlevel_*100 )
- this->boostControl();
-
- // update Checkpoints
- /*random = rnd(maxrand);
- if (this->defaultWaypoint_ && random > (maxrand-10))
- this->manageWaypoints();
- else //if(random > maxrand-10) //CHECK USABILITY!!*/
- if (this->waypoints_.size() == 0 )
- this->manageWaypoints();
+ this->defaultBehaviour(maxrand);
}
}
-
}
void AIController::tick(float dt)
@@ -320,8 +215,9 @@
else if (this->mode_ == ROCKET)//Rockets do not belong to a group of bots -> bot states are not relevant.
{ //Vector-implementation: mode_.back() == ROCKET;
if(controllable)
- {
- if(controllable->getRocket())//Check wether the bot is controlling the rocket and if the timeout is over.
+ {//Check wether the bot is controlling the rocket and if the timeout is over.
+ if(controllable->getIdentifier() == ClassByString("Rocket"))
+
{
this->follow();
this->timeout_ -= dt;
@@ -341,4 +237,72 @@
SUPER(AIController, tick, dt);
}
+ void AIController::defaultBehaviour(float maxrand)
+ { float random;
+ // search enemy
+ random = rnd(maxrand);
+ if (random < (botlevel_* 100) && (!this->target_))
+ this->searchNewTarget();
+
+ // forget enemy
+ random = rnd(maxrand);
+ if (random < ((1-botlevel_)*20) && (this->target_))
+ this->forgetTarget();
+
+ // next enemy
+ random = rnd(maxrand);
+ if (random < (botlevel_*30) && (this->target_))
+ this->searchNewTarget();
+
+ // fly somewhere
+ random = rnd(maxrand);
+ if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
+ this->searchRandomTargetPosition();
+
+ // stop flying
+ random = rnd(maxrand);
+ if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
+ this->bHasTargetPosition_ = false;
+
+ // fly somewhere else
+ random = rnd(maxrand);
+ if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
+ this->searchRandomTargetPosition();
+
+ if (this->state_ == MASTER) // master: shoot
+ {
+ random = rnd(maxrand);
+ if (!(this->passive_) && random < (100*botlevel_) && (this->target_ && !this->bShooting_))
+ {
+ this->bShooting_ = true;
+ this->forceFreeSlaves();
+ }
+ }
+ else
+ {
+ // shoot
+ random = rnd(maxrand);
+ if (!(this->passive_) && random < (botlevel_*100) && (this->target_ && !this->bShooting_))
+ this->bShooting_ = true;
+ }
+
+ // stop shooting
+ random = rnd(maxrand);
+ if (random < ((1 - botlevel_)*50) && (this->bShooting_))
+ this->bShooting_ = false;
+
+ // boost
+ random = rnd(maxrand);
+ if (random < botlevel_*50 )
+ this->boostControl();
+
+ // update Checkpoints
+ /*random = rnd(maxrand);
+ if (this->defaultWaypoint_ && random > (maxrand-10))
+ this->manageWaypoints();
+ else //if(random > maxrand-10) //CHECK USABILITY!!*/
+ if (this->waypoints_.size() == 0 )
+ this->manageWaypoints();
+ }
+
}
Modified: code/branches/presentation2011/src/orxonox/controllers/AIController.h
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/AIController.h 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/controllers/AIController.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -43,15 +43,16 @@
AIController(BaseObject* creator);
virtual ~AIController();
- virtual void tick(float dt);
+ virtual void tick(float dt); //<! Carrying out the targets set in action().
protected:
- virtual void action();
+ virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets.
+ void defaultBehaviour(float maxrand); //<! Helper function for code reusage. Some concrete commands for a bot.
private:
static const float ACTION_INTERVAL;
- Timer actionTimer_;
+ Timer actionTimer_; //<! Regularly calls action().
};
}
Modified: code/branches/presentation2011/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/ArtificialController.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/controllers/ArtificialController.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -41,6 +41,7 @@
#include "worldentities/pawns/SpaceShip.h"
#include "gametypes/TeamDeathmatch.h"
#include "gametypes/Dynamicmatch.h"
+#include "gametypes/Mission.h"
#include "controllers/WaypointPatrolController.h"
#include "controllers/NewHumanController.h"
#include "controllers/DroneController.h"
@@ -91,7 +92,7 @@
this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this));
this->bSetupWorked = false;
- this->botlevel_ = 0.2f;
+ this->botlevel_ = 0.5f;
this->mode_ = DEFAULT;////Vector-implementation: mode_.push_back(DEFAULT);
this->timeout_ = 0;
this->currentWaypoint_ = 0;
@@ -997,6 +998,16 @@
team2 = tdm->getTeam(entity2->getPlayer());
}
+ Mission* miss = orxonox_cast<Mission*>(gametype);
+ if (miss)
+ {
+ if (entity1->getPlayer())
+ team1 = miss->getTeam(entity1->getPlayer());
+
+ if (entity2->getPlayer())
+ team2 = miss->getTeam(entity2->getPlayer());
+ }
+
TeamBaseMatchBase* base = 0;
base = orxonox_cast<TeamBaseMatchBase*>(entity1);
if (base)
@@ -1109,7 +1120,7 @@
if(this->getControllableEntity())
{
Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
- if(pawn)
+ if(pawn && pawn->isA(Class(SpaceShip))) //fix for First Person Mode: check for SpaceShip
{
this->weaponModes_.clear(); // reset previous weapon information
WeaponSlot* wSlot = 0;
Modified: code/branches/presentation2011/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/ArtificialController.h 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/controllers/ArtificialController.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -50,7 +50,7 @@
void abandonTarget(Pawn* target);
- inline void setTeam(int team)
+ inline void setTeam(int team) //TODO: write through to controllable entity.
{ this->team_ = team; }
inline int getTeam() const
{ return this->team_; }
Modified: code/branches/presentation2011/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/HumanController.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/controllers/HumanController.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -194,8 +194,8 @@
{
this->boosting_ = true;
this->boostingTimeout_.startTimer();
-
- this->controllableEntity_->boost(this->boosting_);
+ if(this->controllableEntity_)
+ this->controllableEntity_->boost(this->boosting_);
// orxout() << "Start boosting" << endl;
}
}
@@ -208,8 +208,8 @@
{
this->boosting_ = false;
this->boostingTimeout_.stopTimer();
-
- this->controllableEntity_->boost(this->boosting_);
+ if(this->controllableEntity_)
+ this->controllableEntity_->boost(this->boosting_);
// orxout() << "Stop boosting" << endl;
}
Modified: code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -41,7 +41,6 @@
{
RegisterObject(WaypointPatrolController);
- //this->team_ = 0;
this->alertnessradius_ = 500;
this->patrolTimer_.setTimer(rnd(), true, createExecutor(createFunctor(&WaypointPatrolController::searchEnemy, this)));
@@ -52,7 +51,6 @@
SUPER(WaypointPatrolController, XMLPort, xmlelement, mode);
XMLPortParam(WaypointPatrolController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
-// XMLPortParam(WaypointPatrolController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(0);
}
void WaypointPatrolController::tick(float dt)
Modified: code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.h
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.h 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/controllers/WaypointPatrolController.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -45,11 +45,6 @@
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
virtual void tick(float dt);
- /* inline void setTeam(int team)
- { this->team_ = team; }
- inline int getTeam() const
- { return this->team_; } */
-
inline void setAlertnessRadius(float radius)
{ this->alertnessradius_ = radius; }
inline float getAlertnessRadius() const
@@ -58,7 +53,6 @@
protected:
void searchEnemy();
- //int team_;
float alertnessradius_;
Timer patrolTimer_;
};
Modified: code/branches/presentation2011/src/orxonox/gametypes/CMakeLists.txt
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/CMakeLists.txt 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/gametypes/CMakeLists.txt 2011-12-14 13:38:37 UTC (rev 8980)
@@ -8,4 +8,6 @@
Dynamicmatch.cc
LastManStanding.cc
LastTeamStanding.cc
+ TeamGametype.cc
+ Mission.cc
)
Modified: code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/gametypes/Gametype.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -84,6 +84,7 @@
this->dedicatedAddBots_ = createConsoleCommand( "dedicatedAddBots", createExecutor( createFunctor(&Gametype::addBots, this) ) );
this->dedicatedKillBots_ = createConsoleCommand( "dedicatedKillBots", createExecutor( createFunctor(&Gametype::killBots, this) ) );
/* HACK HACK HACK */
+ //this->numberOfPlayers_ = 0;
}
Gametype::~Gametype()
@@ -131,7 +132,7 @@
if(it->first->isHumanPlayer() && it->first->isReadyToSpawn())
this->gtinfo_->playerReadyToSpawn(it->first);
}
-
+
this->checkStart();
}
else if (!this->gtinfo_->hasEnded())
@@ -438,7 +439,7 @@
if(player->isHumanPlayer())
this->gtinfo_->playerSpawned(player);
-
+
this->playerPostSpawn(player);
}
else
Modified: code/branches/presentation2011/src/orxonox/gametypes/Gametype.h
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/Gametype.h 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/gametypes/Gametype.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -122,12 +122,9 @@
inline const std::string& getHUDTemplate() const
{ return this->gtinfo_->getHUDTemplate(); }
- void addBots(unsigned int amount);
+ virtual void addBots(unsigned int amount);
void killBots(unsigned int amount = 0);
- inline unsigned int getNumberOfPlayers() const
- { return this->players_.size(); }
-
virtual void addTime(float t);
virtual void removeTime(float t);
@@ -150,10 +147,12 @@
{ this->timeLimit_ = t; }
//inline bool getForceSpawn()
- // { return this->bForceSpawn_; }
+ // { return this->bForceSpawn_; }
virtual void resetTimer();
virtual void resetTimer(float t);
+ inline unsigned int getNumberOfPlayers()
+ { return this->gtinfo_->getNumberOfPlayers(); }
protected:
virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
@@ -191,6 +190,7 @@
ConsoleCommand* dedicatedAddBots_;
ConsoleCommand* dedicatedKillBots_;
/* HACK HACK HACK */
+
};
}
Copied: code/branches/presentation2011/src/orxonox/gametypes/Mission.cc (from rev 8968, code/branches/gamecontent/src/orxonox/gametypes/Mission.cc)
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/Mission.cc (rev 0)
+++ code/branches/presentation2011/src/orxonox/gametypes/Mission.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -0,0 +1,103 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Johannes Ritz
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "Mission.h"
+//#include "TeamGametype.h"
+#include "items/Engine.h"
+#include "controllers/ArtificialController.h"
+
+#include "core/CoreIncludes.h"
+#include "network/Host.h"
+#include "worldentities/pawns/Pawn.h"
+
+namespace orxonox
+{
+ CreateUnloadableFactory(Mission);
+
+ Mission::Mission(BaseObject* creator) : TeamGametype(creator)
+ {
+ RegisterObject(Mission);
+ this->missionAccomplished_ = false;
+ this->lives_ = 10; // should be 1 as default value
+ this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
+ }
+
+ void Mission::tick(float dt)
+ {
+ SUPER(Mission, tick, dt);
+
+ if (missionAccomplished_)
+ {
+ this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
+ this->end();
+ }
+ }
+
+ void Mission::pawnKilled(Pawn* victim, Pawn* killer)
+ {
+ if (victim && victim->getPlayer() && this->lives_ == 1)
+ {
+ this->missionAccomplished_ = false;
+ this->end();
+ }
+ }
+
+ void Mission::start()
+ {
+ Gametype::start();
+ this->setTeams();
+ /*for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it != ObjectList<Engine>::end(); ++it)
+ it->setActive(false); // works -> @sr :*/
+ this->gtinfo_->sendAnnounceMessage("Your mission has started!");
+ }
+
+ //void Mission::addBots(unsigned int amount)
+
+ void Mission::end()
+ {
+ Gametype::end();
+ /*if (this->missionAccomplished_)
+ this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
+ else
+ this->gtinfo_->sendAnnounceMessage("Mission failed!");
+ * */
+ }
+
+ void Mission::setTeams()
+ {//Set pawn-colours
+ for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
+ {
+ Pawn* pawn = static_cast<Pawn*>(*it);
+ if(!pawn) continue;
+ this->setDefaultObjectColour(pawn);
+ }
+ }
+
+
+
+}
Copied: code/branches/presentation2011/src/orxonox/gametypes/Mission.h (from rev 8968, code/branches/gamecontent/src/orxonox/gametypes/Mission.h)
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/Mission.h (rev 0)
+++ code/branches/presentation2011/src/orxonox/gametypes/Mission.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -0,0 +1,64 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Johannes Ritz
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _Mission_H__
+#define _Mission_H__
+
+#include "OrxonoxPrereqs.h"
+//#include "Gametype.h"
+#include "TeamGametype.h"
+
+namespace orxonox
+{
+ class _OrxonoxExport Mission : public TeamGametype
+ {
+ public:
+ Mission(BaseObject* creator);
+ virtual ~Mission() {}
+
+ virtual void tick(float dt);
+
+ virtual void start();
+ virtual void end();
+ virtual void setTeams();
+ virtual void addBots(unsigned int amount){} //<! overwrite function in order to bypass the addbots command
+ inline void setLives(unsigned int amount)
+ {this->lives_ = amount;}
+ inline unsigned int getLives()
+ {return this->lives_;}
+
+ protected:
+ virtual void pawnKilled(Pawn* victim, Pawn* killer = 0);
+ bool missionAccomplished_; //<! indicates if player successfully finsihed the mission;
+ int lives_; //<! amount of player's lives <-> nr. of retries
+
+ };
+}
+
+#endif /* _Mission_H__ */
+
Modified: code/branches/presentation2011/src/orxonox/gametypes/TeamDeathmatch.h
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/TeamDeathmatch.h 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/gametypes/TeamDeathmatch.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -55,7 +55,6 @@
virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
int getTeam(PlayerInfo* player);
-
inline const ColourValue& getTeamColour(int teamnr) const
{ return this->teamcolours_[teamnr]; }
Copied: code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc (from rev 8968, code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc)
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc (rev 0)
+++ code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -0,0 +1,327 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Johannes Ritz
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "TeamGametype.h"
+
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "infos/PlayerInfo.h"
+#include "interfaces/TeamColourable.h"
+#include "worldentities/TeamSpawnPoint.h"
+#include "worldentities/pawns/Pawn.h"
+#include "worldentities/ControllableEntity.h"
+#include "controllers/ArtificialController.h"
+
+namespace orxonox
+{
+ CreateUnloadableFactory(TeamGametype);
+
+ TeamGametype::TeamGametype(BaseObject* creator) : Gametype(creator)
+ {
+ RegisterObject(TeamGametype);
+
+ this->teams_ = 2; //most team gametypes use two different teams
+ this->allowFriendlyFire_ = false;
+ //this->playersPerTeam_ = 0;
+ this->maxPlayers_ = 2; //TEST
+ this->setConfigValues();
+ }
+
+ void TeamGametype::setConfigValues()
+ {
+ SetConfigValue(teams_, 2);
+
+ static ColourValue colours[] =
+ {
+ ColourValue(0.2f, 0.2f, 1.0f),
+ ColourValue(1.0f, 0.1f, 0.1f),
+ ColourValue(0.3f, 1.0f, 0.3f),
+ ColourValue(1.0f, 1.0f, 0.0f),
+ ColourValue(0.0f, 1.0f, 1.0f),
+ ColourValue(1.0f, 0.0f, 1.0f),
+ ColourValue(7.0f, 7.0f, 7.0f),
+ ColourValue(2.0f, 2.0f, 2.0f)
+ };
+ static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
+
+ SetConfigValue(teamcolours_, defaultcolours);
+ }
+
+ void TeamGametype::playerEntered(PlayerInfo* player)
+ {
+ Gametype::playerEntered(player);
+ if(player == NULL) return;
+ this->findAndSetTeam(player);
+ if( this->players_.size() <= maxPlayers_ || maxPlayers_ == 0)
+ {
+ this->allowedInGame_[player]= true;
+ }
+ else
+ {
+ this->allowedInGame_[player]= false;
+ orxout() << "not allowed in game: players = " << this->players_.size() << " > maximum: " << maxPlayers_ << endl;
+ }
+ }
+
+ void TeamGametype::findAndSetTeam(PlayerInfo* player)
+ {
+ std::vector<unsigned int> playersperteam(this->teams_, 0);
+
+ for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it)
+ if (it->second < static_cast<int>(this->teams_) && it->second >= 0)
+ playersperteam[it->second]++;
+
+ unsigned int minplayers = static_cast<unsigned int>(-1);
+ size_t minplayersteam = 0;
+ for (size_t i = 0; i < this->teams_; ++i)
+ {
+ if (playersperteam[i] < minplayers)
+ {
+ minplayers = playersperteam[i];
+ minplayersteam = i;
+ }
+ }
+
+ this->teamnumbers_[player] = minplayersteam;
+
+ }
+
+ bool TeamGametype::playerLeft(PlayerInfo* player)
+ {
+ bool valid_player = Gametype::playerLeft(player);
+ if( (this->players_.size() >= maxPlayers_) && (allowedInGame_[player] == true) ) // if there's a "waiting list"
+ {
+ for (std::map<PlayerInfo*, bool>::iterator it = this->allowedInGame_.begin(); it != this->allowedInGame_.end(); ++it)
+ {
+ if(it->second == false) // waiting player found
+ {it->second = true; break;} // allow player to enter
+ }
+ }
+
+ if (valid_player)
+ { // clean up the maps
+ this->teamnumbers_.erase(player);
+ this->allowedInGame_.erase(player);
+ }
+
+
+ return valid_player;
+ }
+
+ void TeamGametype::spawnDeadPlayersIfRequested()
+ {
+ for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); ++it)\
+ {
+ if(allowedInGame_[it->first] == false)//check if dead player is allowed to enter
+ {
+ continue;
+ }
+ if (it->second.state_ == PlayerState::Dead)
+ {
+ if ((it->first->isReadyToSpawn() || this->bForceSpawn_))
+ {
+ this->spawnPlayer(it->first);
+ }
+ }
+ }
+ }
+
+
+ bool TeamGametype::allowPawnHit(Pawn* victim, Pawn* originator)
+ {// hit allowed: if victim & originator are foes or if originator doesnot exist or if friendlyfire is allowed
+ return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
+ }
+
+ bool TeamGametype::allowPawnDamage(Pawn* victim, Pawn* originator)
+ {
+ return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
+ }
+
+ bool TeamGametype::allowPawnDeath(Pawn* victim, Pawn* originator)
+ {
+ return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
+ }
+
+ SpawnPoint* TeamGametype::getBestSpawnPoint(PlayerInfo* player) const
+ {
+ int desiredTeamNr = -1;
+ std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+ if (it_player != this->teamnumbers_.end())
+ desiredTeamNr = it_player->second;
+
+ // Only use spawnpoints of the own team (or non-team-spawnpoints)
+ std::set<SpawnPoint*> teamSpawnPoints = this->spawnpoints_;
+ for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
+ {
+ if ((*it)->isA(Class(TeamSpawnPoint)))
+ {
+ TeamSpawnPoint* tsp = orxonox_cast<TeamSpawnPoint*>(*it);
+ if (tsp && static_cast<int>(tsp->getTeamNumber()) != desiredTeamNr)
+ {
+ teamSpawnPoints.erase(it++);
+ continue;
+ }
+ }
+
+ ++it;
+ }
+
+ SpawnPoint* fallbackSpawnPoint = NULL;
+ if (teamSpawnPoints.size() > 0)
+ {
+ unsigned int randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
+ unsigned int index = 0;
+ // Get random fallback spawnpoint in case there is no active SpawnPoint.
+ for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
+ {
+ if (index == randomspawn)
+ {
+ fallbackSpawnPoint = (*it);
+ break;
+ }
+
+ ++index;
+ }
+
+ // Remove all inactive SpawnPoints from the list.
+ for (std::set<SpawnPoint*>::iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); )
+ {
+ if(!(*it)->isActive())
+ {
+ teamSpawnPoints.erase(it++);
+ continue;
+ }
+
+ ++it;
+ }
+
+ randomspawn = static_cast<unsigned int>(rnd(static_cast<float>(teamSpawnPoints.size())));
+ index = 0;
+ for (std::set<SpawnPoint*>::const_iterator it = teamSpawnPoints.begin(); it != teamSpawnPoints.end(); ++it)
+ {
+ if (index == randomspawn)
+ return (*it);
+
+ ++index;
+ }
+
+ return fallbackSpawnPoint;
+ }
+
+ return 0;
+ }
+
+ void TeamGametype::playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn)
+ {
+ if (!player)
+ return;
+
+ this->setTeamColour(player,pawn);
+ }
+
+ bool TeamGametype::pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2)
+ {
+ if (pawn1 && pawn2)
+ {
+ std::map<PlayerInfo*, int>::const_iterator it1 = this->teamnumbers_.find(pawn1->getPlayer());
+ std::map<PlayerInfo*, int>::const_iterator it2 = this->teamnumbers_.find(pawn2->getPlayer());
+
+ if (it1 != this->teamnumbers_.end() && it2 != this->teamnumbers_.end())
+ return (it1->second == it2->second);
+ }
+ return false;
+ }
+
+ int TeamGametype::getTeam(PlayerInfo* player)
+ {
+ std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+ if (it_player != this->teamnumbers_.end())
+ return it_player->second;
+ else
+ return -1;
+ }
+
+ void TeamGametype::setTeamColour(PlayerInfo* player, Pawn* pawn)
+ {
+ // Set the team colour
+ std::map<PlayerInfo*, int>::const_iterator it_player = this->teamnumbers_.find(player);
+ if (it_player != this->teamnumbers_.end() && it_player->second >= 0 && it_player->second < static_cast<int>(this->teamcolours_.size()))
+ {
+ this->colourPawn(pawn, it_player->second);
+ }
+ }
+
+ void TeamGametype::setDefaultObjectColour(Pawn* pawn)
+ {
+ if(pawn == NULL)
+ return;
+
+ int teamnumber = pawn->getTeam();
+
+ if(teamnumber >= 0)
+ {
+ this->colourPawn(pawn, teamnumber); return;
+ }
+ //get Pawn's controller
+ ControllableEntity* entity = orxonox_cast<ControllableEntity*>(pawn);
+
+ Controller* controller = 0;
+ if (entity->getController())
+ controller = entity->getController();
+ else if (entity->getXMLController())
+ controller = entity->getXMLController();
+ else
+ return;
+
+ ArtificialController* artificial = orxonox_cast<ArtificialController*>(controller);
+ //get Teamnumber - get the data
+ if(artificial == NULL)
+ return;
+ teamnumber= artificial->getTeam();
+
+ //set ObjectColour
+ this->colourPawn(pawn, teamnumber);
+ }
+
+ void TeamGametype::colourPawn(Pawn* pawn, int teamNr)
+ {// catch no-colouring-case and wrong input
+ if(teamNr < 0 || pawn == NULL) return;
+ pawn->setRadarObjectColour(this->teamcolours_[teamNr]);
+
+ std::set<WorldEntity*> pawnAttachments = pawn->getAttachedObjects();
+ for (std::set<WorldEntity*>::iterator it = pawnAttachments.begin(); it != pawnAttachments.end(); ++it)
+ {
+ if ((*it)->isA(Class(TeamColourable)))
+ {
+ TeamColourable* tc = orxonox_cast<TeamColourable*>(*it);
+ tc->setTeamColour(this->teamcolours_[teamNr]);
+ }
+ }
+ }
+
+}
Copied: code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.h (from rev 8968, code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.h)
===================================================================
--- code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.h (rev 0)
+++ code/branches/presentation2011/src/orxonox/gametypes/TeamGametype.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -0,0 +1,82 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Johannes Ritz
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _TeamGametype_H__
+#define _TeamGametype_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <map>
+#include <vector>
+#include "Gametype.h"
+
+namespace orxonox
+{
+ class _OrxonoxExport TeamGametype : public Gametype
+ {
+ public:
+ TeamGametype(BaseObject* creator);
+ virtual ~TeamGametype() {}
+
+ void setConfigValues();
+
+ virtual void playerEntered(PlayerInfo* player);
+ virtual void findAndSetTeam(PlayerInfo* player);
+ virtual bool playerLeft(PlayerInfo* player);
+ virtual void spawnDeadPlayersIfRequested(); //!< Prevents players to respawn.
+
+ virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0);
+ virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0);
+ virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0);
+
+ virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn);
+
+
+ int getTeam(PlayerInfo* player);
+
+ inline const ColourValue& getTeamColour(int teamnr) const
+ { return this->teamcolours_[teamnr]; }
+
+ protected:
+ virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const;
+ bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
+
+ bool allowFriendlyFire_; //!< friendlyfire is per default switched off: friendlyFire_ = false;
+ std::map<PlayerInfo*, int> teamnumbers_;
+ std::vector<ColourValue> teamcolours_;
+ unsigned int teams_; //!< Number of teams. Value 0 : no teams!
+ //unsigned int playersPerTeam_; //!< Defines Maximum for players per team. Value 0: no maximum!
+ unsigned int maxPlayers_; //!< Defines Maximum for number of players. Value 0 : no maximum!
+ std::map<PlayerInfo*, bool> allowedInGame_; //!< Only those players are allowed to spawn which are listed here as 'true'.
+ void setTeamColour(PlayerInfo* player, Pawn* pawn);
+ void setDefaultObjectColour(Pawn* pawn);
+ void colourPawn(Pawn* pawn, int teamNr);
+ };
+}
+
+#endif /* _TeamGametype_H__ */
Modified: code/branches/presentation2011/src/orxonox/infos/GametypeInfo.h
===================================================================
--- code/branches/presentation2011/src/orxonox/infos/GametypeInfo.h 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/infos/GametypeInfo.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -118,6 +118,9 @@
inline const std::string& getHUDTemplate() const
{ return this->hudtemplate_; }
+
+ inline unsigned int getNumberOfPlayers() const
+ { return this->spawnedPlayers_.size(); }
void sendAnnounceMessage(const std::string& message);
void sendAnnounceMessage(const std::string& message, unsigned int clientID);
Modified: code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -73,7 +73,6 @@
this->currentCameraPosition_ = 0;
this->bMouseLook_ = false;
this->mouseLookSpeed_ = 200;
- this->bIsRocket_ = false;
this->server_position_ = Vector3::ZERO;
this->client_position_ = Vector3::ZERO;
@@ -87,6 +86,7 @@
this->setConfigValues();
this->setPriority( Priority::VeryHigh );
this->registerVariables();
+ this->team_ = -1;
}
ControllableEntity::~ControllableEntity()
@@ -119,6 +119,7 @@
{
SUPER(ControllableEntity, XMLPort, xmlelement, mode);
+ XMLPortParam(ControllableEntity, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1);
XMLPortParam(ControllableEntity, "hudtemplate", setHudTemplate, getHudTemplate, xmlelement, mode);
XMLPortParam(ControllableEntity, "camerapositiontemplate", setCameraPositionTemplate, getCameraPositionTemplate, xmlelement, mode);
Modified: code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.h 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/worldentities/ControllableEntity.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -162,9 +162,12 @@
virtual WorldEntity* getTarget()
{ return this->target_.get(); }
void setTargetInternal( uint32_t targetID );
- inline bool getRocket() const
- { return this-> bIsRocket_; }
+ inline void setTeam(int team)
+ { this->team_ = team; }
+ inline float getTeam() const
+ { return this->team_; }
+
protected:
virtual void preDestroy();
@@ -182,7 +185,6 @@
void destroyHud(void);
Ogre::SceneNode* cameraPositionRootNode_;
- bool bIsRocket_; //Workaround to see, if the controllable entity is a Rocket.
private:
void registerVariables();
@@ -239,6 +241,8 @@
WeakPtr<Controller> controller_;
CameraPosition* reverseCamera_;
WeakPtr<WorldEntity> target_;
+
+ int team_ ; //<! teamnumber
};
}
Modified: code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc 2011-12-14 13:38:37 UTC (rev 8980)
@@ -128,6 +128,8 @@
XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0);
XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f);
+
+
}
void Pawn::registerVariables()
@@ -454,7 +456,7 @@
{
SUPER(Pawn, changedActivity);
- this->setRadarVisibility(this->isActive());
+ this->setRadarVisibility(this->isVisible());
}
void Pawn::changedVisibility(void)
Modified: code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.h 2011-12-14 13:16:45 UTC (rev 8979)
+++ code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.h 2011-12-14 13:38:37 UTC (rev 8980)
@@ -53,6 +53,7 @@
inline bool isAlive() const
{ return this->bAlive_; }
+
virtual void setHealth(float health);
inline void addHealth(float health)
{ this->setHealth(this->health_ + health); }
@@ -193,6 +194,7 @@
virtual PickupCarrier* getCarrierParent(void) const
{ return NULL; }
+
float health_;
float maxHealth_;
float initialHealth_;
More information about the Orxonox-commit
mailing list