[Orxonox-commit 4220] r8891 - in code/trunk: . data/gui/scripts data/levels data/levels/includes data/levels/templates src/modules/notifications src/modules/overlays/hud src/modules/pickup src/modules/questsystem src/modules/weapons/projectiles src/orxonox src/orxonox/controllers src/orxonox/infos src/orxonox/weaponsystem src/orxonox/worldentities src/orxonox/worldentities/pawns
jo at orxonox.net
jo at orxonox.net
Wed Oct 12 19:50:43 CEST 2011
Author: jo
Date: 2011-10-12 19:50:43 +0200 (Wed, 12 Oct 2011)
New Revision: 8891
Added:
code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi
code/trunk/data/levels/missionOne.oxw
code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt
Modified:
code/trunk/
code/trunk/data/gui/scripts/QuestGUI.lua
code/trunk/data/levels/fightInOurBack.oxw
code/trunk/data/levels/includes/weaponSettingsSwallow.oxi
code/trunk/data/levels/includes/weaponSettingsTransporter.oxi
code/trunk/data/levels/lastTeamStanding.oxw
code/trunk/data/levels/lastTeamStandingII.oxw
code/trunk/data/levels/planets.oxw
code/trunk/src/modules/notifications/NotificationDispatcher.cc
code/trunk/src/modules/notifications/NotificationDispatcher.h
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
code/trunk/src/modules/overlays/hud/HUDNavigation.h
code/trunk/src/modules/overlays/hud/HUDRadar.cc
code/trunk/src/modules/overlays/hud/HUDRadar.h
code/trunk/src/modules/pickup/PickupSpawner.cc
code/trunk/src/modules/questsystem/QuestItem.h
code/trunk/src/modules/questsystem/QuestManager.cc
code/trunk/src/modules/weapons/projectiles/Rocket.cc
code/trunk/src/orxonox/LevelManager.cc
code/trunk/src/orxonox/controllers/AIController.cc
code/trunk/src/orxonox/controllers/ArtificialController.cc
code/trunk/src/orxonox/controllers/ArtificialController.h
code/trunk/src/orxonox/controllers/DroneController.cc
code/trunk/src/orxonox/controllers/DroneController.h
code/trunk/src/orxonox/controllers/WaypointController.cc
code/trunk/src/orxonox/controllers/WaypointController.h
code/trunk/src/orxonox/infos/PlayerInfo.cc
code/trunk/src/orxonox/weaponsystem/WeaponSlot.h
code/trunk/src/orxonox/worldentities/ControllableEntity.cc
code/trunk/src/orxonox/worldentities/ControllableEntity.h
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
code/trunk/src/orxonox/worldentities/pawns/Pawn.h
code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
Log:
Ai and tutorial improvements merged back to the trunk. AI features: all weapons are used, the ai-firestrength is configurable, bots are able to collect pickups . I've set the tutorial level as default level.
Property changes on: code/trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/ai:6592-7033
/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/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/menu:5941-6146,6148,7536-7687
/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/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/menu:5941-6146,6148,7536-7687
/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/trunk/data/gui/scripts/QuestGUI.lua
===================================================================
--- code/trunk/data/gui/scripts/QuestGUI.lua 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/data/gui/scripts/QuestGUI.lua 2011-10-12 17:50:43 UTC (rev 8891)
@@ -4,7 +4,6 @@
P.questManager = nil -- The QuestManager.
P.showActive = true -- Whether the active or finished quest list is displayed.
-P.currentQuest = nil -- The quest that is currently displayed.
P.player = nil -- The player the quests are displayed for.
P.quests = {}
P.subquests = {}
@@ -28,9 +27,15 @@
P.player = orxonox.GUIManager:getInstance():getPlayer(P.name)
-- Load the list of quests to be displayed.
- P.loadQuestsList(P.currentQuest)
+ P.loadQuestsList()
+ -- Pause the game - possible conflict for multiplayer quests
+ orxonox.execute("setPause 1")
end
+function P.onQuit()
+ orxonox.execute("setPause 0")
+end
+
-- Loads the list of quests, depending on P.showActive, either the active (P.showActive == true) or the finished, i.e. inactive quests are loaded.
-- selectQuest is a pointer to a quest that should be selected, if it is nil the first quest is selected.
function P.loadQuestsList(selectQuest)
@@ -170,8 +175,6 @@
local window = winMgr:getWindow("orxonox/QuestGUI/Quest/Wrapper")
window:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.borderSize-P.scrollbarWidth), CEGUI.UDim(0,offset+P.borderSize)))
end
-
- P.currentQuest = quest
end
-- Clear the currently displayed quest.
@@ -203,8 +206,6 @@
i = i+1
end
hints:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.scrollbarWidth-P.borderSize), CEGUI.UDim(0, 0)))
-
- P.currentQuest = nil
end
-- Clear the quests list
Modified: code/trunk/data/levels/fightInOurBack.oxw
===================================================================
--- code/trunk/data/levels/fightInOurBack.oxw 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/data/levels/fightInOurBack.oxw 2011-10-12 17:50:43 UTC (rev 8891)
@@ -1,7 +1,7 @@
<LevelInfo
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!"
- tags = ""
+ tags = "singleplayer"
/>
<?lua
Copied: code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi (from rev 8880, code/branches/ai2/data/levels/includes/weaponSettingsSpacecruiser.oxi)
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi (rev 0)
+++ code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi 2011-10-12 17:50:43 UTC (rev 8891)
@@ -0,0 +1,90 @@
+ <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" />
+
+ </weaponslots>
+ <weaponsets>
+ <WeaponSet firemode=0 />
+ <WeaponSet firemode=1 />
+ <WeaponSet firemode=2 />
+ <WeaponSet firemode=3 />
+ </weaponsets>
+ <weapons>
+ <WeaponPack>
+ <links>
+ <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
+ <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
+ <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
+ <DefaultWeaponmodeLink firemode=3 weaponmode=3 />
+ </links>
+ <Weapon>
+ <attached>
+ <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,0" />
+ <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
+ <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+ </Weapon>
+ <Weapon>
+ <attached>
+ <Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,-1.35,0" />
+ <Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
+ <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+ </Weapon>
+ <Weapon>
+ <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
+ <RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
+ </Weapon>
+ <Weapon>
+ <attached>
+ <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,0" />
+ <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
+ <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+ </Weapon>
+ <Weapon>
+ <attached>
+ <Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,-1.35,0" />
+ <Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
+ <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+ </Weapon>
+ <Weapon>
+ <attached>
+ <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,0" />
+ <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
+ <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
+ </Weapon>
+ <Weapon>
+ <attached>
+ <Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,-1.35,0" />
+ <Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
+ <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
+ </attached>
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
+ <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
+ </Weapon>
+ </WeaponPack>
+ </weapons>
Modified: code/trunk/data/levels/includes/weaponSettingsSwallow.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsSwallow.oxi 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/data/levels/includes/weaponSettingsSwallow.oxi 2011-10-12 17:50:43 UTC (rev 8891)
@@ -13,13 +13,14 @@
<DefaultWeaponmodeLink firemode=1 weaponmode=1 />
</links>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=2.5 material="Flares/point_lensflare" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
+
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20/>
</Weapon>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=2.5 material="Flares/point_lensflare" />
- <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20/>
</Weapon>
</WeaponPack>
Modified: code/trunk/data/levels/includes/weaponSettingsTransporter.oxi
===================================================================
--- code/trunk/data/levels/includes/weaponSettingsTransporter.oxi 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/data/levels/includes/weaponSettingsTransporter.oxi 2011-10-12 17:50:43 UTC (rev 8891)
@@ -13,13 +13,13 @@
<DefaultWeaponmodeLink firemode=1 weaponmode=1 />
</links>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0.1 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="0,0,0" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="0.5,0.6,1.7" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.1 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
<Weapon>
- <HsW01 mode=0 munitionpershot=0 delay=0.1 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0,0,0" />
- <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
+ <HsW01 mode=0 munitionpershot=0 delay=0.1 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
+ <HsW01 mode=0 munitionpershot=0 delay=0 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
<LightningGun mode=1 muzzleoffset="0,0,0" damage=3.14159 shielddamage=20 />
</Weapon>
</WeaponPack>
Modified: code/trunk/data/levels/lastTeamStanding.oxw
===================================================================
--- code/trunk/data/levels/lastTeamStanding.oxw 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/data/levels/lastTeamStanding.oxw 2011-10-12 17:50:43 UTC (rev 8891)
@@ -46,13 +46,8 @@
</collisionShapes>
</StaticEntity>
- <PickupSpawner position="-160,65,10" triggerDistance="10" respawnTime="5" maxSpawnedItems="10"><!--EasterEgg-->
+ <PickupSpawner position="-160,60,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="10"><!--EasterEgg-->
<pickup>
- <InvisiblePickup template=mediuminvisiblepickup />
- </pickup>
- </PickupSpawner>
- <PickupSpawner position="-160,60,17" triggerDistance="10" respawnTime="5" maxSpawnedItems="10"><!--EasterEgg-->
- <pickup>
<InvisiblePickup template=hugeinvisiblepickup />
</pickup>
</PickupSpawner>
Modified: code/trunk/data/levels/lastTeamStandingII.oxw
===================================================================
--- code/trunk/data/levels/lastTeamStandingII.oxw 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/data/levels/lastTeamStandingII.oxw 2011-10-12 17:50:43 UTC (rev 8891)
@@ -16,7 +16,7 @@
<Level
name = "On the fly"
description = "testmap for gametype last team standing"
- gametype = "LastTeamStanding"
+ gametype = "LastTeamStanding"
>
<templates>
<Template link=lodtemplate_default />
Copied: code/trunk/data/levels/missionOne.oxw (from rev 8880, code/branches/ai2/data/levels/missionOne.oxw)
===================================================================
--- code/trunk/data/levels/missionOne.oxw (rev 0)
+++ code/trunk/data/levels/missionOne.oxw 2011-10-12 17:50:43 UTC (rev 8891)
@@ -0,0 +1,1327 @@
+<LevelInfo
+ name = "Mission One"
+ description = "First guided steps in the orxonoxian universe."
+ tags = "singleplayer"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipSpacecruiser.oxt")
+ include("templates/spaceshipTransporter.oxt")
+?>
+
+<?lua
+include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<Level
+ name = "Mission One"
+ description = "How to steer a spaceship."
+>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+ <?lua include("includes/notifications.oxi") ?>
+
+ <NotificationQueueCEGUI
+ name="narrative"
+ targets="simpleNotification"
+ size=3
+ displayTime=3.9
+ position="0.2, 0, 0.1, 0"
+ fontSize="23"
+ fontColor="0.3, 1, 0.2, 0.8"
+ alignment="HorzCentred"
+ displaySize="0.6, 0, 0, 0"
+ />
+ <Scene
+ ambientlight = "0.8, 0.8, 0.8"
+ skybox = "Orxonox/Starbox"
+ >
+ <?lua
+ include("includes/pickups.oxi")
+ ?>
+
+ <WorldAmbientSound source="Mars.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.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 -->
+
+ <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." />
+ <complete-effects>
+ <AddQuest questId="missionOne.weaponsystem" />
+ </complete-effects>
+ </LocalQuest>
+
+ <LocalQuest id="missionOne.weaponsystem">
+ <QuestDescription title="Weaponsystem" description="INSERT STORY HERE." failmessage="" completeMessage="All right." />
+ <subquests>
+ <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="" />
+ <complete-effects>
+ <AddQuest questId="missionOne.weaponsystemII" />
+ </complete-effects>
+ </LocalQuest>
+ <LocalQuest id="missionOne.weaponsystemII">
+ <QuestDescription title="" description="" 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." />
+ <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." />
+ <complete-effects>
+ <AddQuest questId="missionOne.getHome" />
+ </complete-effects>
+ </LocalQuest>
+
+ <LocalQuest id="missionOne.getHome">
+ <QuestDescription title="Return ASAP" description="" failmessage="" completeMessage="Well done." />
+ <complete-effects>
+ <AddQuest questId="missionOne.defence" />
+ </complete-effects>
+ </LocalQuest>
+
+ <LocalQuest id="missionOne.defence">
+ <QuestDescription title="Defence" description="" failmessage="" completeMessage="Well done." />
+ </LocalQuest>
+
+
+ <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.">
+ <events>
+ <trigger>
+ <EventListener event="spawndelaytrigger0" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+<BlinkingBillboard position="-900,640,600" frequency=0.4 amplitude=2 material="Flares/lensflare" colour="1,1,0">
+ <events>
+ <visibility>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event=flying4 />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </visibility>
+ </events>
+</BlinkingBillboard>
+<Billboard position="-900,640,600" amplitude=1 material="Flares/lensflare" colour="0,0.8,0.1">
+ <events>
+ <visibility>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event=flying4 />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </visibility>
+ </events>
+</Billboard>
+<!-------------------------------------- PART ZERO: How to fly --------------------------------------->
+ <DistanceTrigger name="flying1" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=4/>
+ <SimpleNotification message="Let's fly to the blinking light.">
+ <events>
+ <trigger>
+ <EventListener event="flying1" />
+ </trigger>
+ </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.">
+ <events>
+ <trigger>
+ <EventListener event="flying2" />
+ </trigger>
+ </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-->
+
+ <DistanceTrigger name="flying4" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=1/>
+ <SimpleNotification message="Three red arrows just appeared.">
+ <events>
+ <trigger>
+ <EventListener event="flying4" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <DistanceTrigger name="flying5" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=5/>
+ <SimpleNotification message="Follow those red arrows.">
+ <events>
+ <trigger>
+ <EventListener event="flying5" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+
+
+<!-------------------------------------- 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.">
+ <events>
+ <trigger>
+ <EventListener event="spawndelaytrigger1" />
+ </trigger>
+ </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.">
+ <events>
+ <trigger>
+ <EventListener event="spawndelaytrigger2" />
+ </trigger>
+ </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)">
+ <events>
+ <trigger>
+ <EventListener event="spawndelaytrigger3" />
+ </trigger>
+ </events>
+ </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 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>
+
+<!-- @Triggers: boxtrigger1 <-> one box destroyed
+ boxtrigger2 <-> two boxes destroyed
+ boxtrigger3 <-> three boxes destroyed
+ boxtrigger4 <-> four boxes destroyed -->
+ <EventTrigger name="boxtrigger4" activations="1" stayactive="true" delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event="box" />
+ </trigger>
+ </events>
+ <EventTrigger name="boxtrigger3" activations="1" stayactive="true" delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event="box" />
+ </trigger>
+ </events>
+ <EventTrigger name="boxtrigger2" activations="1" stayactive="true" delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event="box" />
+ </trigger>
+ </events>
+ <EventTrigger name="boxtrigger1" activations="1" stayactive="true" delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event="box" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </EventTrigger>
+ </EventTrigger>
+ </EventTrigger>
+
+
+ <SimpleNotification message="Right click on the next target." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="boxtrigger1" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Middle click on the next target." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="boxtrigger2" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+
+ <SimpleNotification message="Aim at the last target and press 'T'." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="boxtrigger3" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Try to hit the pirates while you are flying." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="boxtrigger4" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+
+<!--------------------------------------PART TWO: Moving targets --------------------------------------->
+
+<!-- @Objects: 2 pirates moving in squares, nonlethal -->
+ <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" >
+ <events>
+ <visibility>
+ <EventListener event="boxtrigger4" />
+ </visibility>
+ </events>
+ <templates>
+ <Template link=spaceshippirate />
+ </templates>
+ <controller>
+ <WaypointController>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=8 position=" 0,1700,-200" />
+ <Model mesh="cube.mesh" scale=8 position=" 0,1700,-700" />
+ <Model mesh="cube.mesh" scale=8 position="500,1700,-700" />
+ <Model mesh="cube.mesh" scale=8 position="500,1700,-200" />
+ </waypoints>
+ </WaypointController>
+ </controller>
+ </SpaceShip>
+
+ <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget">
+ <events>
+ <visibility>
+ <EventListener event="boxtrigger4" />
+ </visibility>
+ </events>
+ <templates>
+ <Template link=spaceshippirate />
+ </templates>
+ <controller>
+ <WaypointController>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=8 position=" 0,2400,1000" />
+ <Model mesh="cube.mesh" scale=8 position=" 0,2400, 500" />
+ <Model mesh="cube.mesh" scale=8 position="500,2400, 500" />
+ <Model mesh="cube.mesh" scale=8 position="500,2400,1000" />
+ </waypoints>
+ </WaypointController>
+ </controller>
+ </SpaceShip>
+
+<!-- @Triggers: movingpirates1 <-> one pirate dead
+ movingpirates2 <-> both pirates dead -->
+ <EventTrigger name="movingpirates2" activations="1" stayactive="true" delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event="movingtarget" />
+ </trigger>
+ </events>
+ <EventTrigger name="movingpirates1" activations="1" stayactive="true" delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event="movingtarget" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </EventTrigger>
+
+
+ <SimpleNotification message="Now get the other one." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="movingpirates1" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Fly towards the space station (grey dot)." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="movingpirates2" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+
+
+<!--------------------------------------PART THREE: the space station --------------------------------------->
+ <DistanceTrigger name="duball1" position="-1000,-300,700" target="Pawn" distance=700 stayActive="true" delay=1 >
+ <events>
+ <activity>
+ <EventListener event="movingpirates2" />
+ </activity>
+ </events>
+ </DistanceTrigger>
+
+ <EventTrigger name="duball2" activations="1" stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="duball1" />
+ </trigger>
+ </events>
+ </EventTrigger>
+
+ <EventTrigger name="duball3" activations="1" stayactive="true" delay=4 >
+ <events>
+ <trigger>
+ <EventListener event="duball2" />
+ </trigger>
+ </events>
+ </EventTrigger>
+
+ <SimpleNotification message="Welcome to the Duball Space Station!">
+ <events>
+ <trigger>
+ <EventListener event=duball1 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Warning: Something big is coming." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=duball2 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Use the portals to get help. (grey dot)" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=duball3 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+
+<!-- @Objects: DuBall Space Station, (no pawn!) -->
+ <StaticEntity position="-1000,-300,700" collisionType=static>
+ <attached>
+ <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"/>
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="80" position = "-100,0,0" />
+ <SphereCollisionShape radius="120" position = "100,0,0" />
+ <BoxCollisionShape halfExtents="90,25,45" position = "-155,0,40" />
+ </collisionShapes>
+ </StaticEntity>
+
+
+<!-- @Objects: PORTAL: from DuBall to HydroHarvester -->
+ <Template name=PortalDefault>
+ <PortalEndPoint>
+ <attached>
+ <Billboard material="Portals/Default" />
+ </attached>
+ </PortalEndPoint>
+ </Template>
+
+ <PortalEndPoint position="-1400,-500,800" id="1" distance="50" target="MobileEntity" design="PortalDefault">
+ <events>
+ <activity>
+ <Trigger mode="or" activations="2">
+ <Trigger mode="and" activations="1">
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="movingpirates2" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="toHydroFarmer" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ <Trigger mode="and" activations="1">
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="ondock" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="attack" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="HydroFarmer" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ </events>
+ </PortalEndPoint>
+
+ <PortalEndPoint position="-47000,-1000,1300" id="2" distance="70" target="MobileEntity" design="PortalDefault">
+ <events>
+ <activity>
+ <Trigger mode="or" activations="3">
+ <Trigger mode="and" activations="1">
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="movingpirates2" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="toHydroFarmer" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ <Trigger mode="and" activations="1">
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="ondock" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="attack" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="HydroFarmer" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+ </activity>
+ </events>
+ </PortalEndPoint>
+ <PortalLink fromID="1" toID="2" />
+ <PortalLink fromID="2" toID="1" />
+<!-- ????????????????????????????????????????????????????? why does this NOT work ??
+ <Trigger mode="and" activations="1">
+ <EventTrigger>
+ <events>
+ <trigger>
+ <EventListener event="HydroFarmer" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="attack" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+-->
+<!-- PORTALS END-->
+
+
+ <SimpleNotification message="Dock to the Hydrogen Farmer.">
+ <events>
+ <trigger>
+ <EventListener event=toHydroFarmer />
+ </trigger>
+ </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.">
+ <events>
+ <trigger>
+ <EventListener event=famer1 />
+ </trigger>
+ </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.">
+ <events>
+ <trigger>
+ <EventListener event=famer2 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+
+<!-- @Objects: HYDROGEN FARMER & DOCKING -->
+ <SpaceShip position="-48900,100,0" roll=90 yaw=0 pitch=20 mass=10000 health=100000 name="HydroFarmer">
+ <attached>
+ <!-- Docking -->
+ <DistanceTriggerBeacon name="bcnDestroyer" />
+ <DockingTarget name="destroyer" />
+
+ <Model mesh="HydroHarvester.mesh" mass=10 position="0,0,0" scale=50 />
+ <!-- <Model mesh="cube.mesh" mass=10 position="-560,0,0" scale3D="115,100,245" />
+ <Model mesh="cube.mesh" mass=10 position="290,0,-480" scale3D="115,100,245" yaw=-120 />
+ <Model mesh="cube.mesh" mass=10 position="290,0,480" scale3D="115,100,245" yaw=-240 />
+ <Model mesh="cube.mesh" mass=10 position="-280,0,0" scale3D="163,50,50" />
+ <Model mesh="cube.mesh" mass=10 position="140,0,-240" scale3D="163,50,50" yaw=-120/>
+ <Model mesh="cube.mesh" mass=10 position="140,0,240" scale3D="163,50,50" yaw=-240/>
+ <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" />
+ <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" yaw=-120/>
+ <Model mesh="cube.mesh" mass=10 position="0,530,0" scale3D="172,52,298" yaw=-240/>
+ <Model mesh="cube.mesh" mass=10 position="0,400,0" scale3D="43,110,26" yaw=-30 />
+ <Model mesh="cube.mesh" mass=10 position="-200,100,0" scale3D="26,50,43" />
+ <Model mesh="cube.mesh" mass=10 position="100,100,-173" scale3D="43,50,26" yaw=-30/>
+ <Model mesh="cube.mesh" mass=10 position="100,100,173" scale3D="43,50,26" yaw=30/>
+ <Model mesh="cube.mesh" mass=10 position="-100,264,0" scale3D="26,105,43" roll=-49/>
+ <Model mesh="cube.mesh" mass=10 position="50,264,-87" scale3D="26,105,43" roll=-49 yaw=-120/>
+ <Model mesh="cube.mesh" mass=10 position="50,264,87" scale3D="26,105,43" roll=-49 yaw=-240/> -->
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
+ <BoxCollisionShape position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
+ <BoxCollisionShape position="290,0,480" halfExtents="115,100,245" yaw=-240 />
+ <BoxCollisionShape position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
+ <BoxCollisionShape position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
+ <BoxCollisionShape position="140,0,240" halfExtents="163,50,50" yaw=-240 />
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-120 />
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-240 />
+ <BoxCollisionShape position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
+ <BoxCollisionShape position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
+ <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
+ <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=30 />
+ <BoxCollisionShape position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
+ <BoxCollisionShape position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
+ <BoxCollisionShape position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
+ </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" />
+ </animations>
+ <effects>
+ <DockToShip target="spaceShip" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockMe" />
+ </execute>
+ </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" >
+ <attached>
+ <DockingTarget name="spaceShip" />
+ </attached>
+ </SpaceShip>
+
+<!-- TESTBOX-->
+
+<!-- TESTBOX-->
+
+ <Trigger name="cruiserKilled" mode="and" stayActive="true">
+ <EventTrigger stayActive="true">
+ <events>
+ <trigger>
+ <EventListener event="cruiser"/>
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger invert=true>
+ <events>
+ <trigger>
+ <EventListener event="ondock" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </Trigger>
+
+
+ <EventTrigger delay=4 name="earlyEnd">
+ <events>
+ <trigger>
+ <EventListener event="cruiserKilled" />
+ </trigger>
+ </events>
+ <events>
+ <activity>
+ <EventListener event="movingpirates2" />
+ </activity>
+ </events>
+ </EventTrigger>
+
+ <EventTrigger delay=4 name="earlyEnd">
+ <events>
+ <trigger>
+ <EventListener event="HydroFarmer" />
+ </trigger>
+ </events>
+ <events>
+ <activity>
+ <EventListener event="movingpirates2" />
+ </activity>
+ </events>
+ </EventTrigger>
+
+
+
+ <SimpleNotification message="Oh no! You killed the Hydrogen Farmer!" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="HydroFarmer" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Oh no! You killed the SpaceCruiser!" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="cruiserKilled" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Press 'Esc' and restart the mission." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="earlyEnd" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+
+<!-- hydrogen farmer & docking END -->
+
+
+<!-- @Objects: Pickup - find better place !! -->
+ <PickupSpawner position="-48650,700,100" triggerDistance="70" respawnTime="30" maxSpawnedItems="1">
+ <pickup>
+ <ShieldPickup template=hugeshieldpickup />
+ </pickup>
+ </PickupSpawner>
+
+
+ <DistanceTrigger name="pickup" position="-48650,700,100" target="Pawn" distance=60 stayActive="true" delay=0 />
+ <SimpleNotification message="This pickup protects your spaceship.">
+ <events>
+ <trigger>
+ <EventListener event=pickup />
+ </trigger>
+ </events>
+ </SimpleNotification>
+<!-- Pickup-->
+
+
+<!-- @Objects: planet && spaceboundaries -->
+ <Planet
+ position="-44000,0,0"
+ scale="2500"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="10000000"
+ pitch="0"
+ mesh="planets/muunilinst.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="1,0,0"
+ rotationrate="1.0"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage = "2"
+ enablecollisiondamage = "false"
+ >
+ <!--attached>
+ <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-50" />
+ </attached--> <!-- Forcefield kills HYDROGEN FARMER-->
+ <collisionShapes>
+ <SphereCollisionShape radius="2500" position="0,0,0" />
+ </collisionShapes>
+ </Planet>
+
+
+<!-------------------------------------- The attack --------------------------------------->
+
+<!-- TODO:
+ - update spaceshipTransporter
+ - bots do friendly fire (is drone function reusable?)
+-->
+
+<!-- @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" >
+ <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" />
+ </EventTrigger>
+ </DistanceTrigger>
+
+ <SimpleNotification message="Return before it's too late. Boost with 'Space'." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=ondock />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Several serious enemies are approaching!">
+ <events>
+ <trigger>
+ <EventListener event=attack />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+
+
+<!-- @Objects: 6 pirates, heading towards DuBall, attacking -->
+<!-- 1 -->
+ <SpaceShip position="3000,-4000,4000" lookat="-1300,-600,900" name="attacker"visible="true">
+ <events>
+ <visibility>
+ <EventListener event="ondock" />
+ </visibility>
+ </events>
+ <templates>
+ <Template link=spaceshippirate /> <!--spaceshipTransporter -->
+ </templates>
+ <controller>
+ <WaypointPatrolController alertnessradius=3129 team=1 active=false>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position="-1300,-600,900" />
+ <Model mesh="cube.mesh" scale=0 position="0,0,0" />
+ </waypoints>
+ <events>
+ <activity>
+ <EventListener event="attack" /> <!-- activates enemies-->
+ </activity>
+ </events>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+<!-- 2 -->
+ <SpaceShip position="3000,-4000,-4000" lookat="-1300,-600,900" name="attacker" visible="true">
+ <events>
+ <visibility>
+ <EventListener event="ondock" />
+ </visibility>
+ </events>
+ <templates>
+ <Template link=spaceshippirate /> <!--spaceshipTransporter -->
+ </templates>
+ <controller>
+ <WaypointPatrolController alertnessradius=3129 team=1 active=false>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position="-1300,-600,900" />
+ <Model mesh="cube.mesh" scale=0 position="0,0,0" />
+ </waypoints>
+ <events>
+ <activity>
+ <EventListener event="attack" /> <!-- activates enemies-->
+ </activity>
+ </events>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+<!-- 3 -->
+ <SpaceShip position="-4000,-3000,4000" lookat="-1300,-600,900" name="attacker" visible="true">
+ <events>
+ <visibility>
+ <EventListener event="ondock" />
+ </visibility>
+ </events>
+ <templates>
+ <Template link=spaceshippirate /> <!--spaceshipTransporter -->
+ </templates>
+ <controller>
+ <WaypointPatrolController alertnessradius=3129 team=1 active=false>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position="-1300,-600,900" />
+ <Model mesh="cube.mesh" scale=0 position="0,0,0" />
+ </waypoints>
+ <events>
+ <activity>
+ <EventListener event="attack" /> <!-- activates enemies-->
+ </activity>
+ </events>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+<!-- 4 -->
+ <SpaceShip position="-3000,-3000,-5000" lookat="-1300,-600,900" name="attacker" visible="true">
+ <events>
+ <visibility>
+ <EventListener event="ondock" />
+ </visibility>
+ </events>
+ <templates>
+ <Template link=spaceshippirate /> <!--spaceshipTransporter -->
+ </templates>
+ <controller>
+ <WaypointPatrolController alertnessradius=3129 team=1 active=false>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position="-1300,-600,900" />
+ <Model mesh="cube.mesh" scale=0 position="0,0,0" />
+ </waypoints>
+ <events>
+ <activity>
+ <EventListener event="attack" /> <!-- activates enemies-->
+ </activity>
+ </events>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+<!-- 5 -->
+ <SpaceShip position="4000,4000,3000" lookat="-1300,-600,900" name="attacker"visible="true">
+ <events>
+ <visibility>
+ <EventListener event="ondock" />
+ </visibility>
+ </events>
+ <templates>
+ <Template link=spaceshippirate /> <!--spaceshipTransporter -->
+ </templates>
+ <controller>
+ <WaypointPatrolController alertnessradius=3129 team=1 active=false>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position="-1300,-600,900" />
+ <Model mesh="cube.mesh" scale=0 position="0,0,0" />
+ </waypoints>
+ <events>
+ <activity>
+ <EventListener event="attack" /> <!-- activates enemies-->
+ </activity>
+ </events>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+<!-- 6 -->
+ <SpaceShip position="2000,-4000,5000" lookat="-1300,-600,900" name="attacker" visible="true">
+ <events>
+ <visibility>
+ <EventListener event="ondock" />
+ </visibility>
+ </events>
+ <templates>
+ <Template link=spaceshippirate /> <!--spaceshipTransporter -->
+ </templates>
+ <controller>
+ <WaypointPatrolController alertnessradius=3129 team=1 active=false>
+ <waypoints>
+ <Model mesh="cube.mesh" scale=0 position="-1300,-600,900" />
+ <Model mesh="cube.mesh" scale=0 position="0,0,0" />
+ </waypoints>
+ <events>
+ <activity>
+ <EventListener event="attack" /> <!-- activates enemies-->
+ </activity>
+ </events>
+ </WaypointPatrolController>
+ </controller>
+ </SpaceShip>
+
+<!-- @Triggers: attacktriggerX <-> X enemies destroyed , X is an element of [1,6] -->
+ <EventTrigger name="attacktrigger6" activations="1" stayactive="true">
+ <events>
+ <trigger>
+ <EventListener event="attacker" />
+ </trigger>
+ </events>
+ <EventTrigger name="attacktrigger5" activations="1" stayactive="true" delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event="attacker" />
+ </trigger>
+ </events>
+ <EventTrigger name="attacktrigger4" activations="1" stayactive="true" delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event="attacker" />
+ </trigger>
+ </events>
+ <EventTrigger name="attacktrigger3" activations="1" stayactive="true" delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event="attacker" />
+ </trigger>
+ </events>
+ <EventTrigger name="attacktrigger2" activations="1" stayactive="true" delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event="attacker" />
+ </trigger>
+ </events>
+ <EventTrigger name="attacktrigger1" activations="1" stayactive="true" delay=0.1>
+ <events>
+ <trigger>
+ <EventListener event="attacker" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ </EventTrigger>
+ </EventTrigger>
+ </EventTrigger>
+ </EventTrigger>
+ </EventTrigger>
+
+
+ <SimpleNotification message="5 enemies left!" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger1" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="4 enemies left!" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger2" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="3 enemies left!" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger3" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="2 enemies left!" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger4" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+ <SimpleNotification message="One enemy left!" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger5" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+ <SimpleNotification message="Well done. You finished this tutorial." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger6" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+<!-- @Triggers: postAttack <-> delayed attacktrigger6 -->
+ <EventTrigger name="postAttack1" activations="1" stayactive="true" delay=3>
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+
+ <EventTrigger name="postAttack2" activations="1" stayactive="true" delay=6>
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+
+ <SimpleNotification message="Either quit by pressing 'Esc' or ..." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="postAttack1" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="... stay here to learn some tricks." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event="postAttack2" />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+<!-------------------------------------- |Bonus Part| --------------------------------------->
+<!-- @Triggers: "bonusX" <-> delayed "attacktrigger6" -->
+ <EventTrigger name="bonus1" activations="1" stayactive="true" delay=10>
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger name="bonus2" activations="1" stayactive="true" delay=16>
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger name="bonus3" activations="1" stayactive="true" delay=22>
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger name="bonus4" activations="1" stayactive="true" delay=28>
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger name="bonus5" activations="1" stayactive="true" delay=32.1>
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger name="bonus6" activations="1" stayactive="true" delay=36.2>
+ <events>
+ <trigger>
+ <EventListener event="attacktrigger6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+ <EventTrigger name="bonus7" activations="1" stayactive="true" delay=4>
+ <events>
+ <trigger>
+ <EventListener event="bonus6" />
+ </trigger>
+ </events>
+ </EventTrigger>
+
+
+
+ <SimpleNotification message="Rotate your ship. Press 'Q' or 'E'. " broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=bonus1 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Switch the camera's position. Press 'C'. " broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=bonus2 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="360° view: press 'Ctrl' + use the mouse " broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=bonus3 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Have a look at the main menu's settings." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=bonus4 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="E.g: Settings > Miscellaneous > Nr. of bots" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=bonus5 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="You successfully finished Mission One!" broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=bonus6 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+ <SimpleNotification message="Press 'Esc' and return to the main menu." broadcast="true">
+ <events>
+ <trigger>
+ <EventListener event=bonus7 />
+ </trigger>
+ </events>
+ </SimpleNotification>
+
+
+ <!--Script code="addBots 3" onLoad="false">
+ <events>
+ <trigger>
+ <EventListener event=bonus6 />
+ </trigger>
+ </events>
+ </Script>
+
+ <Script code="artificialcontroller setbotlevel 0.1" onLoad="false">
+ <events>
+ <trigger>
+ <EventListener event=bonus6 />
+ </trigger>
+ </events>
+ </Script-->
+ <!-- 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)
+- End Tutorial, if either the Hydrogen Farmer or the SpaceCruiser gets destroyed. (~done)
+
+ -->
Modified: code/trunk/data/levels/planets.oxw
===================================================================
--- code/trunk/data/levels/planets.oxw 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/data/levels/planets.oxw 2011-10-12 17:50:43 UTC (rev 8891)
@@ -79,7 +79,7 @@
angularDamping="0"
mass="5000000"
pitch="0"
- mesh="planets/ganymede.mesh"
+ mesh="planets/muunilinst.mesh"
atmosphere="atmosphere1"
rotationaxis="1,0,0"
rotationrate="1.0"
Copied: code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt (from rev 8880, code/branches/ai2/data/levels/templates/spaceshipSpacecruiser.oxt)
===================================================================
--- code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt (rev 0)
+++ code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt 2011-10-12 17:50:43 UTC (rev 8891)
@@ -0,0 +1,136 @@
+<Template name=spaceshipspacecruiser>
+ <SpaceShip
+ hudtemplate = spaceshiphud
+ camerapositiontemplate = spaceshipcruisercameras
+ spawnparticlesource = "Orxonox/fairytwirl"
+ spawnparticleduration = 2
+ explosionchunks = 12
+
+ health = 300
+ maxhealth = 400
+ initialhealth = 300
+
+ shieldhealth = 60
+ initialshieldhealth = 60
+ maxshieldhealth = 80
+ shieldabsorption = 0.8
+ reloadrate = 1
+ reloadwaittime = 1
+
+ primaryThrust = 90
+ auxilaryThrust = 30
+ rotationThrust = 50
+
+ lift = 1;
+ stallSpeed = 220;
+
+ boostPower = 16
+ boostPowerRate = 1
+ boostRate = 5
+ boostCooldownDuration = 10
+
+ shakeFrequency = 12
+ shakeAmplitude = 7
+
+ collisionType = "dynamic"
+ mass = 300
+ linearDamping = 0.7
+ angularDamping = 0.9999999
+ >
+ <engines>
+ <MultiStateEngine position=" 7.6, -20, 6" template=spaceshipcruiserengine />
+ <MultiStateEngine position="-7.6, -20, 0" template=spaceshipcruiserengine />
+ <MultiStateEngine position=" 7.6, 20, 6" template=spaceshipcruiserengine />
+ <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 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/>
+ <Model mesh="cube.mesh" mass=10 position="16,-35,-112" scale3D="15,5,57" roll=14 pitch=3.5/>
+ <Model mesh="cube.mesh" mass=10 position="19,-21.5,-108" scale3D="18,5,52" roll=-21 />
+ <Model mesh="cube.mesh" mass=10 position="-19,-21.5,-108" scale3D="18,5,52" roll=21 />
+ <Model mesh="cube.mesh" mass=10 position="0,-21,-169" scale3D="18,1,16" pitch=-30 /-->
+
+
+ </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 />
+
+ </collisionShapes>
+<?lua
+ include("includes/weaponSettingsSpacecruiser.oxi")
+?>
+ </SpaceShip>
+</Template>
+
+<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 /-->
+ </camerapositions>
+ </SpaceShip>
+</Template>
+
+<Template name=spaceshipcruiserengine baseclass=MultiStateEngine>
+ <MultiStateEngine
+ boostfactor = 2
+
+ speedfront = 150
+ speedback = 50
+ speedleftright = 50
+ speedupdown = 50
+
+ defEngineSndNormal = "sounds/Engine_low.ogg"
+ defEngineSndBoost = "sounds/Engine_high.ogg"
+
+ accelerationfront = 500
+ accelerationbrake = 500
+ accelerationback = 125
+ accelerationleftright = 125
+ accelerationupdown = 125
+ >
+ <EffectContainer condition="idle">
+ <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 />
+ </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" />
+ </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" />
+ </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 />
+ </EffectContainer>
+-->
+ </MultiStateEngine>
+</Template>
+
Modified: code/trunk/src/modules/notifications/NotificationDispatcher.cc
===================================================================
--- code/trunk/src/modules/notifications/NotificationDispatcher.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/modules/notifications/NotificationDispatcher.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -49,6 +49,7 @@
CreateUnloadableFactory(NotificationDispatcher);
+ registerMemberNetworkFunction(NotificationDispatcher, broadcastHelper);
registerMemberNetworkFunction(NotificationDispatcher, dispatch);
/**
@@ -60,6 +61,7 @@
RegisterObject(NotificationDispatcher);
this->sender_ = NotificationListener::NONE;
+ this->bBroadcast_ = false;
this->registerVariables();
}
@@ -80,9 +82,10 @@
{
SUPER(NotificationDispatcher, XMLPort, xmlelement, mode);
- XMLPortParam(NotificationDispatcher, "sender", getSender, setSender, xmlelement, mode);
-
- XMLPortEventSink(NotificationDispatcher, BaseObject, "trigger", trigger, xmlelement, mode); //TODO: Change BaseObject to MultiTrigger as soon as MultiTrigger is the base of all triggers.
+ XMLPortParam(NotificationDispatcher, "sender", setSender, getSender, xmlelement, mode);
+ XMLPortParam(NotificationDispatcher, "broadcast", setBroadcasting, isBroadcasting, xmlelement, mode);
+
+ XMLPortEventSink(NotificationDispatcher, BaseObject, "trigger", trigger, xmlelement, mode);
}
void NotificationDispatcher::XMLEventPort(Element& xmlelement, XMLPort::Mode mode)
@@ -103,13 +106,40 @@
/**
@brief
+ Broadcasts a specific Notification.
+ */
+ void NotificationDispatcher::broadcast(void)
+ {
+ // TODO: Needed?
+ const std::string message = this->createNotificationMessage();
+ NotificationListener::sendNotification(message, this->getSender(), notificationMessageType::info, notificationSendMode::local);
+
+ // Broadcast
+ if(!GameMode::isStandalone())
+ {
+ callMemberNetworkFunction(NotificationDispatcher, broadcastHelper, this->getObjectID(), NETWORK_PEER_ID_BROADCAST);
+ }
+ }
+
+ /**
+ @brief
+ Helper function for broadcast.
+ */
+ void NotificationDispatcher::broadcastHelper(void)
+ {
+ this->dispatch(Host::getPlayerID());
+ }
+
+ /**
+ @brief
Dispatches a Notification with a message supplied by the createNotificationMessage() method, which can be overloaded.
@param clientId
The id of the client the notification should be dispatched to.
*/
void NotificationDispatcher::dispatch(unsigned int clientId)
{
- if(GameMode::isStandalone() || Host::getPlayerID() == clientId || this->getSyncMode() == 0x0)
+ // We don't call sendNotification() directly on the server, because if might be necessary that createNotificationMessage() is executed on the client as the message may be client-specific.
+ if(GameMode::isStandalone() || Host::getPlayerID() == clientId || this->getSyncMode() == ObjectDirection::None)
{
const std::string message = this->createNotificationMessage();
// TODO: Make the type configurable.
@@ -138,6 +168,13 @@
orxout(verbose, context::notifications) << "NotificationDispatcher (&" << this << ") triggered." << endl;
+ // If the NotificationDispatcher is set to broadcast.
+ if(this->isBroadcasting())
+ {
+ this->broadcast();
+ return true;
+ }
+
PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
PlayerInfo* player = NULL;
Modified: code/trunk/src/modules/notifications/NotificationDispatcher.h
===================================================================
--- code/trunk/src/modules/notifications/NotificationDispatcher.h 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/modules/notifications/NotificationDispatcher.h 2011-10-12 17:50:43 UTC (rev 8891)
@@ -49,7 +49,9 @@
@brief
A NotificationDispatcher is an entity that, upon being triggered, dispatches (or sends) a specified @ref orxonox::Notification "Notification".
- There is one parameter to be set, the @b sender . The sender specifies the part of Orxonox the sent @ref orxonox::Notification "Notification" comes from. The default value is set by the classes implementing NotificationDispatcher.
+ There are two parameter to be set:
+ - The @b sender . The sender specifies the part of Orxonox the sent @ref orxonox::Notification "Notification" comes from. The default value is set by the classes implementing NotificationDispatcher.
+ - The @b broadcast . Specifies whether messages are broadcast (i.e. sent to all clients) or just sent to a specific player.
Its standard usage is:
@code
@@ -61,7 +63,9 @@
</event>
</NotificationDispatcher>
@endcode
- But keep in mind, that NotificationDispatcher is an abstract class and in this example @ref orxonox::PlayerTrigger "PlayerTrigger" stands for any event that is caused by a @ref orxonox::PlayerTrigger "PlayerTrigger", so instead of @ref orxonox::PlayerTrigger "PlayerTrigger", there could be a @ref orxonox::DistanceTrigger "DistanceTrigger", or a @ref orxonox::DistanceMultiTrigger "DistanceMutliTrigger", or even an @ref orxonox::EventListener "EventListener" that waits for an event coming from any kind of @ref orxonox::PlayerTrigger "PlayerTrigger".
+ But keep in mind, that NotificationDispatcher is an abstract class.
+ Also in this example @ref orxonox::PlayerTrigger "PlayerTrigger" stands for any event that is caused by a @ref orxonox::PlayerTrigger "PlayerTrigger", so instead of @ref orxonox::PlayerTrigger "PlayerTrigger", there could be a @ref orxonox::DistanceTrigger "DistanceTrigger", or a @ref orxonox::DistanceMultiTrigger "DistanceMutliTrigger", or even an @ref orxonox::EventListener "EventListener" that waits for an event coming from any kind of @ref orxonox::PlayerTrigger "PlayerTrigger".
+ If the NotificationDispatcher is not set to broadcast only events caused by @ref orxonox::PlayerTrigger "PlayerTriggers" trigger a message since the information obtained by the @ref orxonox::PlayerTrigger "PlayerTrigger" is used to identify the client to which the message should be sent.
@author
Damian 'Mozork' Frick
@@ -83,18 +87,34 @@
*/
const std::string& getSender(void) const
{ return this->sender_; }
- /**
+ /**
@brief Set the sender of the Notification dispatched by this NotificationDispatcher.
@param sender The name of the sender.
*/
void setSender(const std::string& sender)
{ this->sender_ = sender; }
- void dispatch(unsigned int clientId); //!< Dispatches a specific Notification.
+ /**
+ @brief Check whether the NotificationDispatcher is set to broadcast.
+ @return Returns true if the NotificationDispatcher is set to broadcast.
+ */
+ bool isBroadcasting(void) const
+ { return this->bBroadcast_; }
+ /**
+ @brief Set the NotificationDispatcher to broadcast.
+ @param broadcast Whether the NotificationDispatcher is set to broadcast or singlecast.
+ */
+ void setBroadcasting(bool v)
+ { this->bBroadcast_ = v; }
+
+ void broadcast(void); //!< Broadcasts a specific Notification.
+ void broadcastHelper(void); //!< Helper function for broadcast.
+ void dispatch(unsigned int clientId); //!< Dispatches a specific Notification to a given client.
bool trigger(bool triggered, BaseObject* trigger); //!< Is called when the NotificationDispatcher is triggered.
protected:
std::string sender_; //!< The name of the sender of the Notification dispatched by this NotificationDispatcher.
+ bool bBroadcast_; //!< Whether the NotificationDispatcher is broadcasting.
void registerVariables(void); //!< Register some variables for synchronisation.
@@ -104,7 +124,7 @@
@return Returns the notification message.
*/
virtual const std::string& createNotificationMessage(void)
- { return *(new std::string("")); }
+ { return BLANKSTRING; }
};
Modified: code/trunk/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -62,6 +62,7 @@
void HUDNavigation::setConfigValues()
{
SetConfigValue(markerLimit_, 3);
+
}
CreateFactory ( HUDNavigation );
@@ -76,6 +77,7 @@
setFont ( "Monofur" );
setTextSize ( 0.05f );
setNavMarkerSize ( 0.05f );
+ setDetectionLimit( 10000.0f );
}
HUDNavigation::~HUDNavigation()
@@ -94,9 +96,10 @@
{
SUPER ( HUDNavigation, XMLPort, xmlelement, mode );
- XMLPortParam ( HUDNavigation, "font", setFont, getFont, xmlelement, mode );
- XMLPortParam ( HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode );
- XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode );
+ XMLPortParam ( HUDNavigation, "font", setFont, getFont, xmlelement, mode );
+ XMLPortParam ( HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode );
+ XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode );
+ XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode );
}
void HUDNavigation::setFont ( const std::string& font )
@@ -160,13 +163,13 @@
sortedObjectList_.sort ( compareDistance );
unsigned int markerCount_ = 0;
-
+ bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player
// for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it)
for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt )
{
ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
-
- if ( markerCount_ < markerLimit_ )
+ closeEnough_ = listIt->second < detectionLimit_ ;
+ if ( markerCount_ < markerLimit_ && (closeEnough_ || detectionLimit_ < 0) ) // display on HUD if the statement is true
{
@@ -276,7 +279,7 @@
it->second.panel_->show();
it->second.text_->show();
}
- else
+ else // do not display on HUD
{
it->second.panel_->hide();
it->second.text_->hide();
@@ -308,7 +311,7 @@
void HUDNavigation::addObject ( RadarViewable* object )
{
- if( showObject(object)==false )
+ if( showObject(object) == false )
return;
if ( activeObjectList_.size() >= markerLimit_ )
@@ -395,7 +398,7 @@
if ( rv == dynamic_cast<RadarViewable*> ( this->getOwner() ) )
return false;
assert( rv->getWorldEntity() );
- if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false )
+ if ( rv->getWorldEntity()->isVisible() == false || rv->getRadarVisibility() == false )
return false;
return true;
}
Modified: code/trunk/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.h 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.h 2011-10-12 17:50:43 UTC (rev 8891)
@@ -84,6 +84,11 @@
float getNavMarkerSize() const
{ return navMarkerSize_; }
+ void setDetectionLimit( float limit )
+ { this->detectionLimit_ = limit; }
+ float getDetectionLimit() const
+ { return this->detectionLimit_; }
+
void setTextSize ( float size );
float getTextSize() const;
@@ -101,9 +106,9 @@
std::string fontName_;
float textSize_;
- unsigned int markerLimit_;; //TODO: is it possible to set this over the console and/or the IG-Setting
-
-
+ unsigned int markerLimit_; //TODO: is it possible to set this over the console and/or the IG-Setting
+ float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value.
+ //!< In order to bypass this behaviour, set a negative detectionLimit_. Then the detection range is "infinite".
};
}
Modified: code/trunk/src/modules/overlays/hud/HUDRadar.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRadar.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/modules/overlays/hud/HUDRadar.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -63,7 +63,7 @@
this->shapeMaterials_[RadarViewable::Dot] = "RadarDot.png";
this->shapeMaterials_[RadarViewable::Triangle] = "RadarTriangle.png";
this->shapeMaterials_[RadarViewable::Square] = "RadarSquare.png";
-
+ this->setDetectionLimit( 10000.0f );
this->owner_ = 0;
}
@@ -93,6 +93,8 @@
{
if (object == dynamic_cast<RadarViewable*>(this->owner_))
return;
+ if( showObject(object) == false ) //do not show objects that are "invisible" or "radar invisible"
+ return;
// Make sure the object hasn't been added yet
assert( this->radarObjects_.find(object) == this->radarObjects_.end() );
@@ -122,13 +124,9 @@
}
void HUDRadar::objectChanged( RadarViewable* rv )
- {
- if (rv == dynamic_cast<RadarViewable*>(this->owner_))
- return;
- assert( this->radarObjects_.find(rv) != this->radarObjects_.end() );
- Ogre::PanelOverlayElement* panel = this->radarObjects_[rv];
- panel->setMaterialName(TextureGenerator::getMaterialName(
- shapeMaterials_[rv->getRadarObjectShape()], rv->getRadarObjectColour()));
+ {// The new implementation behaves more precisely, since inactive RadarViewables are not displayed anymore.
+ this->removeObject(rv);
+ this->addObject(rv);
}
void HUDRadar::gatherObjects()
@@ -173,7 +171,10 @@
Vector2 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition());
coord *= math::pi / 3.5f; // small adjustment to make it fit the texture
it->second->setPosition((1.0f + coord.x - size) * 0.5f, (1.0f - coord.y - size) * 0.5f);
- it->second->show();
+ if( distance < detectionLimit_ || detectionLimit_ < 0 )
+ it->second->show();
+ else
+ it->second->hide();
// if this object is in focus, then set the focus marker
if (isFocus)
@@ -185,6 +186,17 @@
}
}
+ bool HUDRadar::showObject(RadarViewable* rv)
+ {
+ if ( rv == dynamic_cast<RadarViewable*> ( this->getOwner() ) )
+ return false;
+ assert( rv->getWorldEntity() );
+ if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false )
+ return false;
+ return true;
+ }
+
+
void HUDRadar::changedOwner()
{
SUPER(HUDRadar, changedOwner);
Modified: code/trunk/src/modules/overlays/hud/HUDRadar.h
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDRadar.h 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/modules/overlays/hud/HUDRadar.h 2011-10-12 17:50:43 UTC (rev 8891)
@@ -56,6 +56,11 @@
float getHalfDotSizeDistance() const { return this->halfDotSizeDistance_; }
void setHalfDotSizeDistance(float distance) { this->halfDotSizeDistance_ = distance; }
+ void setDetectionLimit( float limit )
+ { this->detectionLimit_ = limit; }
+ float getDetectionLimit() const
+ { return this->detectionLimit_; }
+
float getMaximumDotSize() const { return this->maximumDotSize_; }
void setMaximumDotSize(float size) { this->maximumDotSize_ = size; }
@@ -68,6 +73,7 @@
virtual void removeObject(RadarViewable* viewable);
virtual void objectChanged( RadarViewable* rv );
void radarTick(float dt);
+ bool showObject( RadarViewable* rv ); //!< Do not display an object on radar, if showObject(.) is false.
void gatherObjects();
@@ -82,7 +88,7 @@
float maximumDotSize_;
float sensitivity_;
-
+ float detectionLimit_;
ControllableEntity* owner_;
};
}
Modified: code/trunk/src/modules/pickup/PickupSpawner.cc
===================================================================
--- code/trunk/src/modules/pickup/PickupSpawner.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/modules/pickup/PickupSpawner.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -180,7 +180,7 @@
// If the PickupSpawner is active.
if(GameMode::isMaster() && this->isActive())
{
- SmartPtr<PickupSpawner> temp = this; //Create a smart pointer to keep the PickupSpawner alive until we iterated through all Pawns (in case a Pawn takes the last pickup)
+ WeakPtr<PickupSpawner> spawner = this; // Create a smart pointer to keep the PickupSpawner alive until we iterated through all Pawns (in case a Pawn takes the last pickup)
// Remove PickupCarriers from the blocked list if they have exceeded their time.
for(std::map<PickupCarrier*, std::time_t>::iterator it = this->blocked_.begin(); it != this->blocked_.end(); )
@@ -194,9 +194,12 @@
// Iterate trough all Pawns.
for(ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
{
+ if(spawner == NULL) // Stop if the PickupSpawner has been deleted (e.g. because it has run out of pickups to distribute).
+ break;
+
Vector3 distance = it->getWorldPosition() - this->getWorldPosition();
PickupCarrier* carrier = dynamic_cast<PickupCarrier*>(*it);
- // If a PickupCarrier, that fits the target-range of the Pickupable spawned by this PickupSpawnder, is in trigger-distance and the carrier is not blocked.
+ // If a PickupCarrier, that fits the target-range of the Pickupable spawned by this PickupSpawner, is in trigger-distance and the carrier is not blocked.
if(distance.length() < this->triggerDistance_ && carrier != NULL && this->blocked_.find(carrier) == this->blocked_.end())
{
if(carrier->isTarget(this->pickup_))
Modified: code/trunk/src/modules/questsystem/QuestItem.h
===================================================================
--- code/trunk/src/modules/questsystem/QuestItem.h 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/modules/questsystem/QuestItem.h 2011-10-12 17:50:43 UTC (rev 8891)
@@ -104,7 +104,7 @@
std::string id_; //!< Identifier. Must be unique.
QuestDescription* description_; //!< The QuestDescription of the QuestItem.
- bool registered_;
+ bool registered_; //!< Whether the QuestItem is registered with the QuestManager.
};
Modified: code/trunk/src/modules/questsystem/QuestManager.cc
===================================================================
--- code/trunk/src/modules/questsystem/QuestManager.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/modules/questsystem/QuestManager.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -34,6 +34,7 @@
#include "QuestManager.h"
#include "util/Exception.h"
+#include "util/OrxAssert.h"
#include "util/ScopedSingletonManager.h"
#include "core/command/ConsoleCommand.h"
#include "core/CoreIncludes.h"
@@ -59,7 +60,6 @@
QuestManager::QuestManager()
{
RegisterRootObject(QuestManager);
-
orxout(internal_info, context::quests) << "QuestManager created." << endl;
}
@@ -94,7 +94,11 @@
*/
bool QuestManager::registerQuest(Quest* quest)
{
- assert(quest);
+ if(quest == NULL)
+ {
+ COUT(1) << "Quest pointer is NULL." << endl;
+ return false;
+ }
std::pair<std::map<std::string, Quest*>::iterator,bool> result;
result = this->questMap_.insert( std::pair<std::string,Quest*>(quest->getId(),quest) ); // Inserting the Quest.
@@ -132,7 +136,11 @@
*/
bool QuestManager::registerHint(QuestHint* hint)
{
- assert(hint);
+ if(hint == NULL)
+ {
+ COUT(1) << "Hint pointer is NULL." << endl;
+ return false;
+ }
std::pair<std::map<std::string, QuestHint*>::iterator,bool> result;
result = this->hintMap_.insert ( std::pair<std::string,QuestHint*>(hint->getId(),hint) ); // Inserting the QuestHSint.
@@ -360,6 +368,7 @@
*/
Quest* QuestManager::getParentQuest(Quest* quest)
{
+ OrxAssert(quest, "The input Quest is NULL.");
return quest->getParentQuest();
}
@@ -373,6 +382,7 @@
*/
QuestDescription* QuestManager::getDescription(Quest* item)
{
+ OrxAssert(item, "The input Quest is NULL.");
return item->getDescription();
}
@@ -386,6 +396,7 @@
*/
QuestDescription* QuestManager::getDescription(QuestHint* item)
{
+ OrxAssert(item, "The input QuestHint is NULL.");
return item->getDescription();
}
@@ -399,6 +410,7 @@
*/
const std::string QuestManager::getId(Quest* item) const
{
+ OrxAssert(item, "The input Quest is NULL.");
return item->getId();
}
@@ -412,6 +424,7 @@
*/
const std::string QuestManager::getId(QuestHint* item) const
{
+ OrxAssert(item, "The input QuestHint is NULL.");
return item->getId();
}
Modified: code/trunk/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/Rocket.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/modules/weapons/projectiles/Rocket.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -65,6 +65,7 @@
this->localAngularVelocity_ = 0;
this->lifetime_ = 100.0f;
+ this->bIsRocket_= true;
if (GameMode::isMaster())
{
@@ -133,6 +134,7 @@
{
if(this->isInitialized())
{
+ this->bIsRocket_= false;
if (GameMode::isMaster())
{
this->destructionEffect();
Modified: code/trunk/src/orxonox/LevelManager.cc
===================================================================
--- code/trunk/src/orxonox/LevelManager.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/LevelManager.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -86,7 +86,7 @@
*/
void LevelManager::setConfigValues()
{
- SetConfigValue(defaultLevelName_, "presentationDM.oxw")
+ SetConfigValue(defaultLevelName_, "missionOne.oxw")
.description("Sets the pre selection of the level in the main menu.");
}
@@ -157,7 +157,7 @@
{
if (this->levels_.size() > 0)
{
- // Activate the level that is the first in the list of levels whose activity has been requested.
+ // Activate the level that is the first in the list of levels whose activity has been requested.
this->levels_.front()->setActive(true);
// Make every player enter the newly activated level.
for (std::map<unsigned int, PlayerInfo*>::const_iterator it = PlayerManager::getInstance().getClients().begin(); it != PlayerManager::getInstance().getClients().end(); ++it)
@@ -271,7 +271,7 @@
// We don't need the loaded stuff anymore
Loader::unload(&file);
- if(info == NULL)
+ if(info == NULL)
{
// Create a default LevelInfoItem object that merely contains the name
std::string filenameWOExtension = it->substr(0, it->find(".oxw"));
Modified: code/trunk/src/orxonox/controllers/AIController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/AIController.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/controllers/AIController.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -64,8 +64,8 @@
// return to Master after being forced free
if (this->freedomCount_ == 1)
{
- this->state_ = SLAVE;
- this->freedomCount_ = 0;
+ this->state_ = SLAVE;
+ this->freedomCount_ = 0;
}
random = rnd(maxrand);
@@ -75,17 +75,17 @@
// search enemy
random = rnd(maxrand);
- if (random < 15 && (!this->target_))
+ if (random < (15 + botlevel_* 20) && (!this->target_))
this->searchNewTarget();
// forget enemy
random = rnd(maxrand);
- if (random < 5 && (this->target_))
+ if (random < ((1-botlevel_)*6) && (this->target_))
this->forgetTarget();
// next enemy
random = rnd(maxrand);
- if (random < 10 && (this->target_))
+ if (random < (botlevel_*20) && (this->target_))
this->searchNewTarget();
// fly somewhere
@@ -105,14 +105,27 @@
// shoot
random = rnd(maxrand);
- if (!(this->passive_) && random < 75 && (this->target_ && !this->bShooting_))
+ if (!(this->passive_) && random < (75 + botlevel_*25) && (this->target_ && !this->bShooting_))
this->bShooting_ = true;
// stop shooting
random = rnd(maxrand);
- if (random < 25 && (this->bShooting_))
+ 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();
+
}
if (this->state_ == SLAVE)
@@ -158,12 +171,12 @@
// search enemy
random = rnd(maxrand);
- if (random < 15 && (!this->target_))
+ if (random < (botlevel_)*25 && (!this->target_))
this->searchNewTarget();
// forget enemy
random = rnd(maxrand);
- if (random < 5 && (this->target_))
+ if (random < (1-botlevel_)*6 && (this->target_))
this->forgetTarget();
// next enemy
@@ -184,17 +197,29 @@
// shoot
random = rnd(maxrand);
- if (!(this->passive_) && random < 9 && (this->target_ && !this->bShooting_))
+ if (!(this->passive_) && random < 25*(botlevel_)+1 && (this->target_ && !this->bShooting_))
{
- this->bShooting_ = true;
- this->forceFreeSlaves();
+ this->bShooting_ = true;
+ this->forceFreeSlaves();
}
// stop shooting
random = rnd(maxrand);
- if (random < 25 && (this->bShooting_))
+ 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();
}
}
@@ -205,57 +230,114 @@
if (!this->isActive())
return;
- if (this->state_ == MASTER)
+ float random;
+ float maxrand = 100.0f / ACTION_INTERVAL;
+ ControllableEntity* controllable = this->getControllableEntity();
+
+ if (controllable && this->mode_ == DEFAULT)// bot is ready to move to a target
{
- if (this->specificMasterAction_ == NONE)
+ if (this->waypoints_.size() > 0 ) //Waypoint functionality.
{
- if (this->target_)
+ WorldEntity* wPoint = this->waypoints_[this->waypoints_.size()-1];
+ if(wPoint)
{
- if (!this->target_->getRadarVisibility()) /* So AI won't shoot invisible Spaceships */
- this->forgetTarget();
- else this->aimAtTarget();
+ this->moveToPosition(wPoint->getWorldPosition()); //BUG ?? sometime wPoint->getWorldPosition() causes crash
+ if (wPoint->getWorldPosition().squaredDistance(controllable->getPosition()) <= this->squaredaccuracy_)
+ this->waypoints_.pop_back(); // if goal is reached, remove it from the list
}
+ else
+ this->waypoints_.pop_back(); // remove invalid waypoints
- if (this->bHasTargetPosition_)
- this->moveToTargetPosition();
-
- if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(math::pi / 20.0f))
- this->getControllableEntity()->fire(0);
}
+ else if(this->defaultWaypoint_ && ((this->defaultWaypoint_->getPosition()-controllable->getPosition()).length() > 200.0f))
+ {
+ this->moveToPosition(this->defaultWaypoint_->getPosition()); // stay within a certain range of the defaultWaypoint_
+ random = rnd(maxrand);
+ }
+ }
+ if(this->mode_ == DEFAULT)
+ {
+ if (this->state_ == MASTER)
+ {
+ if (this->specificMasterAction_ == NONE)
+ {
+ if (this->target_)
+ {
+ if (!this->target_->getRadarVisibility()) /* So AI won't shoot invisible Spaceships */
+ this->forgetTarget();
+ else
+ {
+ this->aimAtTarget();
+ random = rnd(maxrand);
+ if(this->botlevel_*100 > random && !this->isCloseAtTarget(20))
+ this->follow(); //If a bot is shooting a player, it shouldn't let him go away easily.
+ }
+ }
- if (this->specificMasterAction_ == TURN180)
+ if (this->bHasTargetPosition_)
+ this->moveToTargetPosition();
+
+ this->doFire();
+ }
+
+ if (this->specificMasterAction_ == TURN180)
this->turn180();
- if (this->specificMasterAction_ == SPIN)
+ if (this->specificMasterAction_ == SPIN)
this->spin();
- if (this->specificMasterAction_ == FOLLOW)
+ if (this->specificMasterAction_ == FOLLOW)
this->follow();
- }
+ }
- if (this->state_ == SLAVE)
- {
+ if (this->state_ == SLAVE)
+ {
+ if (this->bHasTargetPosition_)
+ this->moveToTargetPosition();
+ }
- if (this->bHasTargetPosition_)
- this->moveToTargetPosition();
+ if (this->state_ == FREE)
+ {
+ if (this->target_)
+ {
+ if (!this->target_->getRadarVisibility()) /* So AI won't shoot invisible Spaceships */
+ this->forgetTarget();
+ else
+ {
+ this->aimAtTarget();
+ random = rnd(maxrand);
- }
+ if(this->botlevel_*100 > random && !this->isCloseAtTarget(20))
+ this->follow();//If a bot is shooting a player, it shouldn't let him go away easily.
+ }
+ }
- if (this->state_ == FREE)
- {
- if (this->target_)
+ if (this->bHasTargetPosition_)
+ this->moveToTargetPosition();
+
+ this->doFire();
+ }
+ }//END_OF DEFAULT MODE
+ 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 (!this->target_->getRadarVisibility()) /* So AI won't shoot invisible Spaceships */
- this->forgetTarget();
- else this->aimAtTarget();
+ if(controllable->getRocket())//Check wether the bot is controlling the rocket and if the timeout is over.
+ {
+ this->follow();
+ this->timeout_ -= dt;
+ if((timeout_< 0)||(!target_))//Check if the timeout is over or target died.
+ {
+ controllable->fire(0);//kill the rocket
+ this->setPreviousMode();//get out of rocket mode
+ }
+ }
+ else
+ this->setPreviousMode();//no rocket entity -> get out of rocket mode
}
+ else
+ this->setPreviousMode();//If bot dies -> getControllableEntity == NULL -> get out of ROCKET mode
+ }//END_OF ROCKET MODE
- if (this->bHasTargetPosition_)
- this->moveToTargetPosition();
-
- if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(math::pi / 20.0f))
- this->getControllableEntity()->fire(0);
- }
-
SUPER(AIController, tick, dt);
}
Modified: code/trunk/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/ArtificialController.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/controllers/ArtificialController.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -38,11 +38,17 @@
#include "worldentities/ControllableEntity.h"
#include "worldentities/pawns/Pawn.h"
#include "worldentities/pawns/TeamBaseMatchBase.h"
+#include "worldentities/pawns/SpaceShip.h"
#include "gametypes/TeamDeathmatch.h"
#include "gametypes/Dynamicmatch.h"
#include "controllers/WaypointPatrolController.h"
#include "controllers/NewHumanController.h"
#include "controllers/DroneController.h"
+#include "weaponsystem/WeaponMode.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/Weapon.h"
+#include "weaponsystem/WeaponSlot.h"
+#include "weaponsystem/WeaponSlot.h"
namespace orxonox
{
@@ -51,6 +57,7 @@
SetConsoleCommand("ArtificialController", "followme", &ArtificialController::followme);
SetConsoleCommand("ArtificialController", "passivebehaviour", &ArtificialController::passivebehaviour);
SetConsoleCommand("ArtificialController", "formationsize", &ArtificialController::formationsize);
+ SetConsoleCommand("ArtificialController", "setbotlevel", &ArtificialController::setAllBotLevel);
static const unsigned int STANDARD_MAX_FORMATION_SIZE = 7;
static const int RADIUS_TO_SEARCH_FOR_MASTERS = 5000;
@@ -83,14 +90,22 @@
this->targetPosition_ = Vector3::ZERO;
this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this));
+ this->bSetupWorked = false;
+ this->botlevel_ = 0.5f;
+ this->mode_ = DEFAULT;////Vector-implementation: mode_.push_back(DEFAULT);
+ this->timeout_ = 0;
+ this->currentWaypoint_ = 0;
+ this->setAccuracy(5);
+ this->defaultWaypoint_ = NULL;
}
ArtificialController::~ArtificialController()
{
if (this->isInitialized())
- {
+ {//Vector-implementation: mode_.erase(mode_.begin(),mode_.end());
+ this->waypoints_.clear();
this->removeFromFormation();
-
+ this->weaponModes_.clear();
for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it; ++it)
{
if (*it != this)
@@ -304,6 +319,8 @@
{
if (!this->getControllableEntity())
this->removeFromFormation();
+ this->bSetupWorked = false; // reset weapon information
+ this->setupWeapons();
}
void ArtificialController::removeFromFormation()
@@ -387,6 +404,31 @@
}
}
+ void ArtificialController::absoluteMoveToPosition(const Vector3& target)
+ {
+ float minDistance = 40.0f;
+ if (!this->getControllableEntity())
+ return;
+
+ Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target);
+ float distance = (target - this->getControllableEntity()->getPosition()).length();
+
+ if (this->target_ || distance > minDistance)
+ {
+ // Multiply with ROTATEFACTOR_FREE to make them a bit slower
+ this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
+ this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
+ this->getControllableEntity()->moveFrontBack(SPEED_FREE);
+ }
+
+
+ if (distance < minDistance)
+ {
+ this->positionReached();
+ }
+ }
+
+
void ArtificialController::moveToTargetPosition()
{
this->moveToPosition(this->targetPosition_);
@@ -914,6 +956,8 @@
bool ArtificialController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)
{
+ if(!entity1 || !entity2)
+ return true;
if (entity1 == entity2)
return true;
@@ -1019,4 +1063,167 @@
return (team1 == team2 && team1 != -1);
}
+
+ /**
+ @brief DoFire is called when a bot should shoot and decides which weapon is used and whether the bot shoots at all.
+ */
+ void ArtificialController::doFire()
+ {
+ if(!this->bSetupWorked)//setup: find out which weapons are active ! hard coded: laser is "0", lens flare is "1", ...
+ {
+ this->setupWeapons();
+ }
+ else if(this->getControllableEntity() && weaponModes_.size()&&this->bShooting_ && this->isCloseAtTarget((1 + 2*botlevel_)*1000) && this->isLookingAtTarget(math::pi / 20.0f))
+ {
+ int firemode;
+ float random = rnd(1);//
+ if (this->isCloseAtTarget(130) && (firemode = getFiremode("LightningGun")) > -1 )
+ {//LENSFLARE: short range weapon
+ this->getControllableEntity()->fire(firemode); //ai uses lens flare if they're close enough to the target
+ }
+ else if( this->isCloseAtTarget(400) && (random < this->botlevel_) && (firemode = getFiremode("RocketFire")) > -1 )
+ {//ROCKET: mid range weapon
+ this->mode_ = ROCKET; //Vector-implementation: mode_.push_back(ROCKET);
+ this->getControllableEntity()->fire(firemode); //launch rocket
+ if(this->getControllableEntity() && this->target_) //after fire(3) is called, getControllableEntity() refers to the rocket!
+ {
+ float speed = this->getControllableEntity()->getVelocity().length() - target_->getVelocity().length();
+ if(!speed) speed = 0.1f;
+ float distance = target_->getPosition().length() - this->getControllableEntity()->getPosition().length();
+ this->timeout_= distance/speed*sgn(speed*distance) + 1.8f; //predicted time of target hit (+ tolerance)
+ }
+ else
+ this->timeout_ = 4.0f; //TODO: find better default value
+ }
+ else if ((firemode = getFiremode("HsW01")) > -1 ) //LASER: default weapon
+ this->getControllableEntity()->fire(firemode);
+ }
+ }
+
+ /**
+ @brief Information gathering: Which weapons are ready to use?
+ */
+ void ArtificialController::setupWeapons() //TODO: Make this function generic!! (at the moment is is based on conventions)
+ {
+ this->bSetupWorked = false;
+ if(this->getControllableEntity())
+ {
+ Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
+ if(pawn)
+ {
+ this->weaponModes_.clear(); // reset previous weapon information
+ WeaponSlot* wSlot = 0;
+ for(int l=0; (wSlot = pawn->getWeaponSlot(l)) ; l++)
+ {
+ WeaponMode* wMode = 0;
+ for(int i=0; (wMode = wSlot->getWeapon()->getWeaponmode(i)) ; i++)
+ {
+ std::string wName = wMode->getIdentifier()->getName();
+ if(this->getFiremode(wName) == -1) //only add a weapon, if it is "new"
+ weaponModes_[wName] = wMode->getMode();
+ }
+ }
+ if(weaponModes_.size())//at least one weapon detected
+ this->bSetupWorked = true;
+ }//pawn->weaponSystem_->getMunition(SubclassIdentifier< Munition > *identifier)->getNumMunition (WeaponMode *user);
+ }
+ }
+
+
+ void ArtificialController::setBotLevel(float level)
+ {
+ if (level < 0.0f)
+ this->botlevel_ = 0.0f;
+ else if (level > 1.0f)
+ this->botlevel_ = 1.0f;
+ else
+ this->botlevel_ = level;
+ }
+
+ void ArtificialController::setAllBotLevel(float level)
+ {
+ for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it != ObjectList<ArtificialController>::end(); ++it)
+ it->setBotLevel(level);
+ }
+
+ void ArtificialController::setPreviousMode()
+ {
+ this->mode_ = DEFAULT; //Vector-implementation: mode_.pop_back();
+ }
+
+ /**
+ @brief Manages boost. Switches between boost usage and boost safe mode.
+ */
+ void ArtificialController::boostControl()
+ {
+ SpaceShip* ship = orxonox_cast<SpaceShip*>(this->getControllableEntity());
+ if(ship == NULL) return;
+ if(ship->getBoostPower()*1.5f > ship->getInitialBoostPower() ) //upper limit ->boost
+ this->getControllableEntity()->boost(true);
+ else if(ship->getBoostPower()*4.0f < ship->getInitialBoostPower()) //lower limit ->do not boost
+ this->getControllableEntity()->boost(false);
+ }
+
+ int ArtificialController::getFiremode(std::string name)
+ {
+ for (std::map< std::string, int >::iterator it = this->weaponModes_.begin(); it != this->weaponModes_.end(); ++it)
+ {
+ if (it->first == name)
+ return it->second;
+ }
+ return -1;
+ }
+
+ void ArtificialController::addWaypoint(WorldEntity* waypoint)
+ {
+ this->waypoints_.push_back(waypoint);
+ }
+
+ WorldEntity* ArtificialController::getWaypoint(unsigned int index) const
+ {
+ if (index < this->waypoints_.size())
+ return this->waypoints_[index];
+ else
+ return 0;
+ }
+
+ /**
+ @brief Adds first waypoint of type name to the waypoint stack, which is within the searchDistance
+ @param name object-name of a point of interest (e.g. "PickupSpawner", "ForceField")
+ */
+ void ArtificialController::updatePointsOfInterest(std::string name, float searchDistance)
+ {
+ WorldEntity* waypoint = NULL;
+ for (ObjectList<WorldEntity>::iterator it = ObjectList<WorldEntity>::begin(); it != ObjectList<WorldEntity>::end(); ++it)
+ {
+ if((*it)->getIdentifier() == ClassByString(name))
+ {
+ ControllableEntity* controllable = this->getControllableEntity();
+ if(!controllable) continue;
+ float actualDistance = ( (*it)->getPosition() - controllable->getPosition() ).length();
+ if(actualDistance > searchDistance || actualDistance < 5.0f) continue;
+ // TODO: PickupSpawner: adjust waypoint accuracy to PickupSpawner's triggerdistance
+ // TODO: ForceField: analyze is angle between forcefield boost and own flying direction is acceptable
+ else
+ {
+ waypoint = *it;
+ break;
+ }
+ }
+ }
+ if(waypoint)
+ this->waypoints_.push_back(waypoint);
+ }
+
+ /**
+ @brief Adds point of interest depending on context. Further Possibilites: "ForceField", "PortalEndPoint", "MovableEntity", "Dock"
+ */
+ void ArtificialController::manageWaypoints()
+ {
+ if(!defaultWaypoint_)
+ this->updatePointsOfInterest("PickupSpawner", 200.0f); // long search radius if there is no default goal
+ else
+ this->updatePointsOfInterest("PickupSpawner", 20.0f); // take pickup en passant if there is a default waypoint
+ }
+
}
Modified: code/trunk/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/trunk/src/orxonox/controllers/ArtificialController.h 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/controllers/ArtificialController.h 2011-10-12 17:50:43 UTC (rev 8891)
@@ -31,11 +31,12 @@
#include "OrxonoxPrereqs.h"
-#include <vector>
+#include <map>
#include "util/Math.h"
#include "Controller.h"
#include "controllers/NewHumanController.h"
+#include "weaponsystem/WeaponSystem.h"
namespace orxonox
{
@@ -77,6 +78,22 @@
static void passivebehaviour(const bool passive);
static void formationsize(const int size);
+ virtual void doFire();
+ void setBotLevel(float level=1.0f);
+ inline float getBotLevel() const
+ { return this->botlevel_; }
+ static void setAllBotLevel(float level);
+ //WAYPOINT FUNCTIONS
+ void addWaypoint(WorldEntity* waypoint);
+ WorldEntity* getWaypoint(unsigned int index) const;
+
+ inline void setAccuracy(float accuracy)
+ { this->squaredaccuracy_ = accuracy*accuracy; }
+ inline float getAccuracy() const
+ { return sqrt(this->squaredaccuracy_); }
+ void updatePointsOfInterest(std::string name, float distance);
+ void manageWaypoints();
+
protected:
int team_;
@@ -95,6 +112,7 @@
void moveToPosition(const Vector3& target);
void moveToTargetPosition();
+ void absoluteMoveToPosition(const Vector3& target);
virtual void positionReached() {}
@@ -134,13 +152,31 @@
void targetDied();
static bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype); // hack
+ void boostControl(); //<! Sets and resets the boost parameter of the spaceship. Bots alternate between boosting and saving boost.
bool bHasTargetPosition_;
Vector3 targetPosition_;
WeakPtr<Pawn> target_;
bool bShooting_;
- private:
+ float botlevel_; //<! Makes the level of a bot configurable.
+ enum Mode {DEFAULT, ROCKET, DEFENCE, MOVING};//TODO; implement DEFENCE, MOVING modes
+ Mode mode_; //TODO: replace single value with stack-like implementation: std::vector<Mode> mode_;
+ void setPreviousMode();
+
+ //WEAPONSYSTEM DATA
+ std::map<std::string, int> weaponModes_; //<! Links each "weapon" to it's weaponmode- managed by setupWeapons()
+ //std::vector<int> projectiles_; //<! Displays amount of projectiles of each weapon. - managed by setupWeapons()
+ float timeout_; //<! Timeout for rocket usage. (If a rocket misses, a bot should stop using it.)
+ void setupWeapons(); //<! Defines which weapons are available for a bot. Is recalled whenever a bot was killed.
+ bool bSetupWorked; //<! If false, setupWeapons() is called.
+ int getFiremode(std::string name);
+
+ //WAYPOINT DATA
+ std::vector<WeakPtr<WorldEntity> > waypoints_;
+ size_t currentWaypoint_;
+ float squaredaccuracy_;
+ WorldEntity* defaultWaypoint_;
};
}
Modified: code/trunk/src/orxonox/controllers/DroneController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/DroneController.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/controllers/DroneController.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -51,6 +51,7 @@
this->owner_ = 0;
this->drone_ = 0;
this->isShooting_ = false;
+ this->setAccuracy(10);
this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&DroneController::action, this)));
@@ -91,48 +92,78 @@
@param dt
The duration of the tick.
*/
+ /* PORTALS workaround:
+ if the owner uses a portal -> distance between owner and drone is huge -> is detected by drone
+ -> drone searches for portal -> drone adds portal as waypoint -> drone flies towards portal //ignores owner
+ -> if the drone used a portal, then the distance to the owner is small -> remove waypoint // back to normal mode
+
+ */
void DroneController::tick(float dt)
{
if (this->getDrone() && this->getOwner())
{
- if (this->target_)
- {
- float distanceToTargetSquared = (this->getDrone()->getWorldPosition() - this->target_->getWorldPosition()).squaredLength();
- if (distanceToTargetSquared < (this->getDrone()->getMaxShootingRange()*this->getDrone()->getMaxShootingRange()))
+ if (this->waypoints_.size() > 0 ) //Waypoint functionality: Drone should follow it's master through portals
+ {// Idea: after using the the portal, the master is far away.
+ WorldEntity* wPoint = this->waypoints_[this->waypoints_.size()-1];
+ if(wPoint)
{
- this->isShooting_ = true;
- this->aimAtTarget();
- this->getDrone()->fire(0);
+ float distanceToOwnerSquared = (this->getDrone()->getWorldPosition() - this->getOwner()->getWorldPosition()).squaredLength();
+ this->absoluteMoveToPosition(wPoint->getWorldPosition()); //simplified function - needs WORKAROUND
+ if (distanceToOwnerSquared <= 90000.0f) //WORKAROUND: if the Drone is again near its owner, the portal has been used correctly.
+ {
+ this->waypoints_.pop_back(); // if goal is reached, remove it from the list
+ this->positionReached(); //needed??
+ }
+
}
+ else
+ this->waypoints_.pop_back(); // remove invalid waypoints
}
+ else
+ {
+ if (this->target_)
+ {
+ float distanceToTargetSquared = (this->getDrone()->getWorldPosition() - this->target_->getWorldPosition()).squaredLength();
+ if (distanceToTargetSquared < (this->getDrone()->getMaxShootingRange()*this->getDrone()->getMaxShootingRange()))
+ {
+ this->isShooting_ = true;
+ this->aimAtTarget();
+ if(!this->friendlyFire())
+ this->getDrone()->fire(0);
+ }
+ }
- float maxDistanceSquared = this->getDrone()->getMaxDistanceToOwner()*this->getDrone()->getMaxDistanceToOwner();
- float minDistanceSquared = this->getDrone()->getMinDistanceToOwner()*this->getDrone()->getMinDistanceToOwner();
- if ((this->getDrone()->getWorldPosition() - this->getOwner()->getWorldPosition()).squaredLength() > maxDistanceSquared)
- {
- this->moveToPosition(this->getOwner()->getWorldPosition()); //fly towards owner
+
+ float maxDistanceSquared = this->getDrone()->getMaxDistanceToOwner()*this->getDrone()->getMaxDistanceToOwner();
+ float minDistanceSquared = this->getDrone()->getMinDistanceToOwner()*this->getDrone()->getMinDistanceToOwner();
+ if((this->getDrone()->getWorldPosition() - this->getOwner()->getWorldPosition()).squaredLength() > 20.0f*maxDistanceSquared)
+ {//FIX: if the drone's owner uses portal, the drone searches for the portal & adds it as a waypoint.
+ this->updatePointsOfInterest("PortalEndPoint", 500.0f); //possible conflict: speed-pickup
+ }
+ if ((this->getDrone()->getWorldPosition() - this->getOwner()->getWorldPosition()).squaredLength() > maxDistanceSquared)
+ {
+ this->moveToPosition(this->getOwner()->getWorldPosition()); //fly towards owner
+ }
+ else if((this->getDrone()->getWorldPosition() - this->getOwner()->getWorldPosition()).squaredLength() < minDistanceSquared)
+ {
+ this->moveToPosition(-this->getOwner()->getWorldPosition()); //fly away from owner
+ }
+ else if (!this->isShooting_)
+ {
+ float random = rnd(2.0f);
+ float randomSelection = rnd(6.0f);
+ if((int)randomSelection==0) drone_->moveUpDown(random);
+ else if((int)randomSelection==1) drone_->moveRightLeft(random);
+ else if((int)randomSelection==2) drone_->moveFrontBack(random);
+ else if((int)randomSelection==3) drone_->rotateYaw(random);
+ else if((int)randomSelection==4) drone_->rotatePitch(random);
+ else if((int)randomSelection==5) drone_->rotateRoll(random);
+ }
+
+ this->isShooting_ = false;
}
- else if((this->getDrone()->getWorldPosition() - this->getOwner()->getWorldPosition()).squaredLength() < minDistanceSquared)
- {
- this->moveToPosition(-this->getOwner()->getWorldPosition()); //fly away from owner
- }
- else if (!this->isShooting_)
- {
- float random = rnd(2.0f);
- float randomSelection = rnd(6.0f);
- if((int)randomSelection==0) drone_->moveUpDown(random);
- else if((int)randomSelection==1) drone_->moveRightLeft(random);
- else if((int)randomSelection==2) drone_->moveFrontBack(random);
- else if((int)randomSelection==3) drone_->rotateYaw(random);
- else if((int)randomSelection==4) drone_->rotatePitch(random);
- else if((int)randomSelection==5) drone_->rotateRoll(random);
- }
-
- this->isShooting_ = false;
}
-
SUPER(AIController, tick, dt);
-
}
void DroneController::ownerDied()
@@ -146,4 +177,23 @@
else
this->destroy();
}
+
+ bool DroneController::friendlyFire()
+ { ControllableEntity* droneEntity_ = this->getControllableEntity();
+ if (!droneEntity_) return false;
+ if(!owner_) return false;
+ if(this->bHasTargetPosition_)
+ {
+ Vector3 ownerPosition_ = owner_->getPosition();
+ Vector3 toOwner_ = owner_->getPosition() - droneEntity_->getPosition();
+ Vector3 toTarget_ = targetPosition_ - droneEntity_->getPosition();
+ if(toTarget_.length() < toOwner_.length()) return false; //owner is far away = in safty
+ float angleToOwner = getAngle(droneEntity_->getPosition(), droneEntity_->getOrientation() * WorldEntity::FRONT, ownerPosition_);
+ float angleToTarget = getAngle(droneEntity_->getPosition(), droneEntity_->getOrientation() * WorldEntity::FRONT, targetPosition_);
+ float angle = angleToOwner - angleToTarget;//angle between target and owner, observed by the drone
+ if(std::sin(angle)*toOwner_.length() < 5.0f)//calculate owner's distance to shooting line
+ return true;
+ }
+ return false;//Default return value: Usually there is no friendlyFire
+ }
}
Modified: code/trunk/src/orxonox/controllers/DroneController.h
===================================================================
--- code/trunk/src/orxonox/controllers/DroneController.h 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/controllers/DroneController.h 2011-10-12 17:50:43 UTC (rev 8891)
@@ -65,6 +65,7 @@
protected:
virtual void action();
void ownerDied();
+ bool friendlyFire(); //<! returns true if the owner_ would be hit.
bool isShooting_;
private:
Modified: code/trunk/src/orxonox/controllers/WaypointController.cc
===================================================================
--- code/trunk/src/orxonox/controllers/WaypointController.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/controllers/WaypointController.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -39,16 +39,14 @@
WaypointController::WaypointController(BaseObject* creator) : ArtificialController(creator)
{
RegisterObject(WaypointController);
-
- this->currentWaypoint_ = 0;
this->setAccuracy(100);
}
WaypointController::~WaypointController()
{
- if (this->isInitialized())
+ for (size_t i = 0; i < this->waypoints_.size(); ++i)
{
- for (size_t i = 0; i < this->waypoints_.size(); ++i)
+ if(this->waypoints_[i])
this->waypoints_[i]->destroy();
}
}
@@ -57,8 +55,8 @@
{
SUPER(WaypointController, XMLPort, xmlelement, mode);
- XMLPortParam(WaypointController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
- XMLPortObject(WaypointController, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode);
+ XMLPortParam(ArtificialController, "accuracy", setAccuracy, getAccuracy, xmlelement, mode).defaultValues(100.0f);
+ XMLPortObject(ArtificialController, WorldEntity, "waypoints", addWaypoint, getWaypoint, xmlelement, mode);
}
void WaypointController::tick(float dt)
@@ -75,16 +73,4 @@
this->moveToPosition(this->waypoints_[this->currentWaypoint_]->getWorldPosition());
}
- void WaypointController::addWaypoint(WorldEntity* waypoint)
- {
- this->waypoints_.push_back(waypoint);
- }
-
- WorldEntity* WaypointController::getWaypoint(unsigned int index) const
- {
- if (index < this->waypoints_.size())
- return this->waypoints_[index];
- else
- return 0;
- }
}
Modified: code/trunk/src/orxonox/controllers/WaypointController.h
===================================================================
--- code/trunk/src/orxonox/controllers/WaypointController.h 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/controllers/WaypointController.h 2011-10-12 17:50:43 UTC (rev 8891)
@@ -46,18 +46,8 @@
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
virtual void tick(float dt);
- void addWaypoint(WorldEntity* waypoint);
- WorldEntity* getWaypoint(unsigned int index) const;
-
- inline void setAccuracy(float accuracy)
- { this->squaredaccuracy_ = accuracy*accuracy; }
- inline float getAccuracy() const
- { return sqrt(this->squaredaccuracy_); }
-
protected:
- std::vector<WorldEntity*> waypoints_;
- size_t currentWaypoint_;
- float squaredaccuracy_;
+
};
}
Modified: code/trunk/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/PlayerInfo.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/infos/PlayerInfo.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -234,7 +234,8 @@
return;
this->controllableEntity_->setController(0);
- this->controllableEntity_->destroyHud(); // HACK-ish
+ if(this->isHumanPlayer()) // TODO: Multiplayer?
+ this->controllableEntity_->destroyHud(); // HACK-ish
// this->controllableEntity_ = this->previousControllableEntity_.back();
do {
@@ -247,7 +248,7 @@
this->controller_->setControllableEntity(this->controllableEntity_);
// HACK-ish
- if(this->controllableEntity_ != NULL)
+ if(this->controllableEntity_ != NULL && this->isHumanPlayer())
this->controllableEntity_->createHud();
if ( GameMode::isMaster() )
Modified: code/trunk/src/orxonox/weaponsystem/WeaponSlot.h
===================================================================
--- code/trunk/src/orxonox/weaponsystem/WeaponSlot.h 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/weaponsystem/WeaponSlot.h 2011-10-12 17:50:43 UTC (rev 8891)
@@ -34,6 +34,25 @@
namespace orxonox
{
+ /**
+ @brief
+ The a WeaponSlot defines where a @ref orxonox::Weapon "Weapon" is placed on a pawn. (A WeaponSlot is a StaticEntity)
+ In a WeaponSlot there can be only one "Weapon", but a Weapon can have several @ref orxonox::WeaponMode "WeaponModes".
+ A WeaponMode is what one intuitively imagines as weapon. (E.g. RocketFire, LightningGun, LaserFire are weaponmodes)
+
+ A WeaponSlot is created in XML (in a weaponsettings file), which can be done in the following fashion:
+ @code
+ <weaponslots>
+ <WeaponSlot position="-15.0,-1.5,0" />
+ <WeaponSlot position=" 15.0,-1.5,0" />
+ <WeaponSlot position=" 0, 0,0" />
+ </weaponslots>
+
+ @author
+ Martin Polak
+
+ @ingroup Weaponsystem
+ */
class _OrxonoxExport WeaponSlot : public StaticEntity
{
public:
Modified: code/trunk/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -66,13 +66,14 @@
this->hud_ = 0;
this->camera_ = 0;
this->xmlcontroller_ = 0;
- this->controller_ = 0;
+ //this->controller_ = 0;
this->reverseCamera_ = 0;
this->bDestroyWhenPlayerLeft_ = false;
this->cameraPositionRootNode_ = this->node_->createChildSceneNode();
this->currentCameraPosition_ = 0;
this->bMouseLook_ = false;
this->mouseLookSpeed_ = 200;
+ this->bIsRocket_ = false;
this->server_position_ = Vector3::ZERO;
this->client_position_ = Vector3::ZERO;
@@ -188,7 +189,7 @@
return counter;
}
-
+
bool ControllableEntity::setCameraPosition(unsigned int index)
{
if(this->camera_ != NULL && this->cameraPositions_.size() > 0)
@@ -308,6 +309,11 @@
}
}
+ void ControllableEntity::setController(Controller* val)
+ {
+ this->controller_ = val;
+ }
+
void ControllableEntity::setTarget( WorldEntity* target )
{
this->target_ = target;
Modified: code/trunk/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/trunk/src/orxonox/worldentities/ControllableEntity.h 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/worldentities/ControllableEntity.h 2011-10-12 17:50:43 UTC (rev 8891)
@@ -98,7 +98,7 @@
@param bBoost If true the ControllableEntity is told to start boosting, if false it is told to stop.
*/
virtual void boost(bool bBoost) {}
-
+
virtual void greet() {}
virtual void switchCamera();
virtual void mouseLook();
@@ -154,14 +154,16 @@
{ return this->xmlcontroller_; }
inline Controller* getController() const
- { return this->controller_; }
- inline void setController(Controller* val)
- { this->controller_ = val; }
+ { return this->controller_.get(); }
+ void setController(Controller* val);
+
virtual void setTarget( WorldEntity* target );
virtual WorldEntity* getTarget()
{ return this->target_.get(); }
void setTargetInternal( uint32_t targetID );
+ inline bool getRocket() const
+ { return this-> bIsRocket_; }
protected:
virtual void preDestroy();
@@ -180,6 +182,7 @@
void destroyHud(void);
Ogre::SceneNode* cameraPositionRootNode_;
+ bool bIsRocket_; //Workaround to see, if the controllable entity is a Rocket.
private:
void registerVariables();
@@ -233,7 +236,7 @@
CameraPosition* currentCameraPosition_;
std::string cameraPositionTemplate_;
Controller* xmlcontroller_;
- Controller* controller_;
+ WeakPtr<Controller> controller_;
CameraPosition* reverseCamera_;
WeakPtr<WorldEntity> target_;
};
Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -92,7 +92,7 @@
this->registerVariables();
this->isHumanShip_ = this->hasLocalController();
-
+
this->setSyncMode(ObjectDirection::Bidirectional); // needed to synchronise e.g. aimposition
}
@@ -449,4 +449,19 @@
ControllableEntity::startLocalHumanControl();
this->isHumanShip_ = true;
}
+
+ void Pawn::changedActivity(void)
+ {
+ SUPER(Pawn, changedActivity);
+
+ this->setRadarVisibility(this->isActive());
+ }
+
+ void Pawn::changedVisibility(void)
+ {
+ SUPER(Pawn, changedVisibility);
+ //this->setVisible(this->isVisible());
+ this->setRadarVisibility(this->isVisible());
+ }
+
}
Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.h 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.h 2011-10-12 17:50:43 UTC (rev 8891)
@@ -169,6 +169,8 @@
virtual const Vector3& getCarrierPosition(void) const
{ return this->getWorldPosition(); };
+ virtual void changedActivity(void); //!< To enable radarviewability when the activity is changed
+ virtual void changedVisibility(void); //!< To enable proper radarviewability when the visibility is changed
protected:
virtual void preDestroy();
@@ -194,7 +196,7 @@
float health_;
float maxHealth_;
float initialHealth_;
-
+
float shieldHealth_;
float maxShieldHealth_;
float initialShieldHealth_;
Modified: code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc 2011-10-12 14:04:35 UTC (rev 8890)
+++ code/trunk/src/orxonox/worldentities/pawns/SpaceShip.cc 2011-10-12 17:50:43 UTC (rev 8891)
@@ -297,12 +297,6 @@
}
}
- /**
- @brief
- Add an Engine to the SpaceShip.
- @param engine
- A pointer to the Engine to be added.
- */
void SpaceShip::addEngine(orxonox::Engine* engine)
{
OrxAssert(engine != NULL, "The engine cannot be NULL.");
@@ -503,16 +497,18 @@
*/
void SpaceShip::resetCamera()
{
- Camera *camera = this->getCamera();
- if (camera == 0)
- {
- orxout(internal_warning) << "Failed to reset camera!" << endl;
- return;
- }
-
- this->shakeDt_ = 0.0f;
- camera->setPosition(this->cameraOriginalPosition_);
- camera->setOrientation(this->cameraOriginalOrientation_);
+ if(this->hasLocalController() && this->hasHumanController())
+ {
+ Camera *camera = this->getCamera();
+ if (camera == 0)
+ {
+ orxout(internal_warning) << "Failed to reset camera!" << endl;
+ return;
+ }
+ this->shakeDt_ = 0.0f;
+ camera->setPosition(this->cameraOriginalPosition_);
+ camera->setOrientation(this->cameraOriginalOrientation_);
+ }
}
}
More information about the Orxonox-commit
mailing list