- Timestamp:
- Feb 15, 2012, 11:51:58 PM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 110 edited
- 20 copied
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/data/defaultConfig/keybindings.ini
r8706 r9016 71 71 KeyNumLock= 72 72 KeyNumRow0= 73 KeyNumRow1= 74 KeyNumRow2= 73 KeyNumRow1="toggleFormationFlight" 74 KeyNumRow2="FFChangeMode" 75 75 KeyNumRow3= 76 76 KeyNumRow4= -
code/trunk/data/gui/layouts/CreditsMenu.layout
r8888 r9016 7 7 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" /> 8 8 <Window Type="MenuWidgets/StaticText" Name="orxonox/CreditsWindow" > 9 <Property Name="Text" Value=" Keybindings" />9 <Property Name="Text" Value="Credits" /> 10 10 <Property Name="Alpha" Value="0.8" /> 11 11 <Property Name="InheritsAlpha" Value="False" /> … … 15 15 <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.2125,0},{0.85,0},{0.6375,0}}" /> 16 16 <Window Type="MenuWidgets/StaticText" Name="orxonox/CreditsMenuWrapper" > 17 <Property Name="TextColours" Value="FF4444FF" />18 17 <Property Name="InheritsAlpha" Value="False" /> 19 18 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> … … 27 26 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 28 27 <Property Name="HorzOverlapSize" Value="0.01" /> 29 <Property Name="UnifiedAreaRect" Value="{{0 .005,0},{0.01,0},{0.995,0},{0.99,0}}" />28 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0.997,0},{0.997,0}}" /> 30 29 <Property Name="VertOverlapSize" Value="0.01" /> 31 30 <Property Name="HorzScrollPosition" Value="0" /> … … 38 37 <Property Name="VertFormatting" Value="TopAligned" /> 39 38 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" /> 40 <Property Name="Text">wird sowieso nicht gelesen 41 Orxonox version 0.0.3 42 43 Programming Language: C++ - lua - tcl 44 Environment: OpenAL - Ogre - OIS - CEGUI - enet - ODE 45 Licence: GNU General Public Licence - Creative Commons 46 47 das ist mein text höhö 48 49 http://www.orxonox.net 39 <Property Name="Text">Orxonox version 0.0.3 40 41 Programming Language: C++ - lua - tcl 42 Environment: OpenAL - Ogre - OIS - CEGUI - enet - ODE 43 Licence: GNU General Public Licence - Creative Commons 44 45 http://www.orxonox.net 46 47 Credits: 50 48 </Property> 51 49 </Window> … … 61 59 </Window> 62 60 </GUILayout> 63 64 65 66 67 -
code/trunk/data/gui/layouts/MiscConfigMenu.layout
r7888 r9016 2 2 3 3 <GUILayout > 4 <Window Type="DefaultWindow" Name="orxonox/MiscConfigMenu/Background" > 4 <Window Type="MenuWidgets/StaticImage" Name="orxonox/MiscConfigMenu/Background" > 5 <Property Name="FrameEnabled" Value="False" /> 5 6 <Property Name="InheritsAlpha" Value="False" /> 6 7 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 7 8 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" /> 9 <Property Name="BackgroundEnabled" Value="False" /> 8 10 <Window Type="MenuWidgets/StaticText" Name="orxonox/MicsConfigMenu/ConfigWindow" > 9 11 <Property Name="Text" Value="Miscellaneous" /> … … 34 36 </Window> 35 37 </Window> 36 <Window Type="MenuWidgets/Button" Name="orxonox/MiscConfigMenu/ MiscConfigBackButton" >37 <Property Name="Text" Value=" Back" />38 <Window Type="MenuWidgets/Button" Name="orxonox/MiscConfigMenu/CancelButton" > 39 <Property Name="Text" Value="Cancel" /> 38 40 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 39 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.6625,0},{0.6,0},{0.7125,0}}" /> 40 <Event Name="Clicked" Function="MiscConfigMenu.MiscConfigBackButton_clicked"/> 41 <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.725,0},{0.4,0},{0.775,0}}" /> 42 <Event Name="Clicked" Function="MiscConfigMenu.MiscConfigCancelButton_clicked"/> 43 </Window> 44 <Window Type="MenuWidgets/Button" Name="orxonox/MiscConfigMenu/OKButton" > 45 <Property Name="Text" Value="OK" /> 46 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 47 <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.725,0},{0.75,0},{0.775,0}}" /> 48 <Event Name="Clicked" Function="MiscConfigMenu.MiscConfigOKButton_clicked"/> 41 49 </Window> 42 50 </Window> -
code/trunk/data/gui/layouts/SingleplayerMenu.layout
r7648 r9016 15 15 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 16 16 <Property Name="VertFormatting" Value="TopAligned" /> 17 <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2875,0},{0.75,0},{0.7,0}}" /> 18 <Window Type="MenuWidgets/Listbox" Name="orxonox/SingleplayerLevelListbox" > 17 <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.15,0},{0.8,0},{0.7,0}}" /> 18 <Window Type="MenuWidgets/TabControl" Name="orxonox/SingleplayerTabControl" > 19 <Property Name="TabHeight" Value="{0,26.4388}" /> 19 20 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 20 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.85,0}}" /> 21 <Property Name="TabPanePosition" Value="Top" /> 22 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.1,0},{0.95,0},{0.925,0}}" /> 21 23 </Window> 22 <Window Type="MenuWidgets/ Checkbox" Name="orxonox/SingleplayerShowAllCheckbox" >23 <Property Name=" Text" Value="show all" />24 <Window Type="MenuWidgets/StaticImage" Name="orxonox/SingleplayerLevelImage" > 25 <Property Name="AlwaysOnTop" Value="True" /> 24 26 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 25 <Property Name="UnifiedAreaRect" Value="{{0.65,0},{0.87,0},{0.8,0},{.97,0}}" /> 26 <Event Name="CheckStateChanged" Function="SingleplayerMenu.SingleplayerShowAll_clicked"/> 27 <Property Name="UnifiedAreaRect" Value="{{0.55,0},{0.25,0},{0.9,0},{0.675,0}}" /> 28 </Window> 29 <Window Type="MenuWidgets/StaticText" Name="orxonox/SingleplayerLevelDescription" > 30 <Property Name="AlwaysOnTop" Value="True" /> 31 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 32 <Property Name="VertScrollbar" Value="True" /> 33 <Property Name="HorzScrollbar" Value="True" /> 34 <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.725,0},{0.9,0},{0.875,0}}" /> 27 35 </Window> 28 36 </Window> … … 30 38 <Property Name="Text" Value="Start" /> 31 39 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 32 <Property Name="UnifiedAreaRect" Value="{{0.2 875,0},{0.725,0},{0.4875,0},{0.775,0}}" />40 <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.725,0},{0.4,0},{0.775,0}}" /> 33 41 <Event Name="Clicked" Function="SingleplayerMenu.SingleplayerStartButton_clicked"/> 42 </Window> 43 <Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerConfigButton" > 44 <Property Name="Text" Value="Configure" /> 45 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 46 <Property Name="UnifiedAreaRect" Value="{{0.425,0},{0.725,0},{0.575,0},{0.775,0}}" /> 47 <Property Name="Disabled" Value="True" /> 48 <Event Name="Clicked" Function="SingleplayerMenu.SingleplayerConfigButton_clicked"/> 34 49 </Window> 35 50 <Window Type="MenuWidgets/Button" Name="orxonox/SingleplayerBackButton" > 36 51 <Property Name="Text" Value="Back" /> 37 52 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 38 <Property Name="UnifiedAreaRect" Value="{{0. 5125,0},{0.725,0},{0.7125,0},{0.775,0}}" />53 <Property Name="UnifiedAreaRect" Value="{{0.6,0},{0.725,0},{0.75,0},{0.775,0}}" /> 39 54 <Event Name="Clicked" Function="SingleplayerMenu.SingleplayerBackButton_clicked"/> 40 55 </Window> -
code/trunk/data/gui/scripts/CreditsMenu.lua
r8888 r9016 14 14 function P.onShow() 15 15 local description = winMgr:getWindow("orxonox/CreditsText") 16 description:setProperty("HorzFormatting", "WordWrapLeftAligned")17 description:setProperty("VertFormatting", "TopAligned")18 description:setText(" Orxonox version 0.0.3 \n \19 Programming Language: C++ - lua - tcl \20 Environment: OpenAL - Ogre - OIS - CEGUI - enet - ODE \21 Licence: GNU General Public Licence - Creative Commons \n \22 http://www.orxonox.net \n \23 Credits:")24 16 25 description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))26 17 height = getStaticTextWindowHeight(description) 27 description:set Height(CEGUI.UDim(0, height))18 description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height))) 28 19 end 29 20 -
code/trunk/data/gui/scripts/InGameMenu.lua
r8079 r9016 43 43 -- events for ingamemenu 44 44 function P.button_quit_clicked(e) 45 openDecisionPopup( "Do you really want to quit the game?", InGameMenu. callback )45 openDecisionPopup( "Do you really want to quit the game?", InGameMenu.exitCallback ) 46 46 end 47 47 48 48 function P.button_mainmenu_clicked(e) 49 orxonox.execute("startMainMenu") 50 hideMenuSheet("InGameMenu") 49 openDecisionPopup( "Do you really want to return to the main menu?", InGameMenu.mainMenuCallback ) 51 50 end 52 51 … … 59 58 end 60 59 61 function P.callback(doExit) 60 function P.mainMenuCallback(doExit) 61 if doExit then 62 orxonox.execute("startMainMenu") 63 hideMenuSheet("InGameMenu") 64 else 65 P.onShow() 66 end 67 end 68 69 function P.exitCallback(doExit) 62 70 if doExit then 63 71 hideMenuSheet("InGameMenu") -
code/trunk/data/gui/scripts/MiscConfigMenu.lua
r8729 r9016 11 11 P.lineHeight = 0 12 12 P.commandWidth = 0 13 P. configWidth = 013 P.editboxWidth = 0 14 14 P.resetWidth = 0 15 15 P.spaceWidth = 0 … … 36 36 table.insert(P.commandList, "ChatOverlay displayTime_") 37 37 table.insert(P.commandList, "Core bDevMode_") 38 table.insert(P.commandList, "HUDNavigation MarkerLimit_") 39 table.insert(P.commandList, "HUDNavigation showDistance") 38 40 39 41 P.nameList = {} … … 56 58 table.insert(P.nameList, "Chat: display time") 57 59 table.insert(P.nameList, "Developer's Mode") 60 table.insert(P.nameList, "Marker Limit") 61 table.insert(P.nameList, "Show Distance next to cursor") 58 62 59 63 P.linesList = {} … … 75 79 end 76 80 77 P.sampleWindow:setText("configure")78 size = getMinTextSize(P.sampleWindow)79 P.configWidth = size[2]+2080 81 81 P.sampleWindow:setText("reset") 82 82 size = getMinTextSize(P.sampleWindow) 83 83 P.resetWidth = size[2]+20 84 84 85 P.spaceWidth = math.floor(1/8*P.configWidth) 85 P.spaceWidth = 10 86 87 local pane = tolua.cast(winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane"), "CEGUI::ScrollablePane") 88 size = pane:getViewableArea() 89 P.editboxWidth = size:getWidth() - P.commandWidth - P.resetWidth - 5*P.spaceWidth 86 90 87 91 P.createLines() 88 92 89 93 P:setButton(1, 1, { 90 ["button"] = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigBackButton"), 91 ["callback"] = P.MiscConfigBackButton_clicked 94 ["button"] = winMgr:getWindow("orxonox/MiscConfigMenu/CancelButton"), 95 ["callback"] = P.MiscConfigCancelButton_clicked 96 }) 97 98 P:setButton(1, 2, { 99 ["button"] = winMgr:getWindow("orxonox/MiscConfigMenu/OKButton"), 100 ["callback"] = P.MiscConfigOKButton_clicked 92 101 }) 93 102 end … … 95 104 function P.createLine(k) 96 105 local offset = 0 106 -- content window for the entire line 97 107 local line = winMgr:createWindow("DefaultWindow", "orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k) 98 108 line:setHeight(CEGUI.UDim(0, P.lineHeight)) 99 109 line:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, P.lineHeight*(k-1)))) 100 110 111 -- config name 101 112 local command = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Command") 102 113 command:setText(P.nameList[k]) … … 106 117 offset = offset + P.commandWidth + P.spaceWidth 107 118 119 -- config value (editable) 108 120 local configvalue = winMgr:createWindow("MenuWidgets/Editbox", "orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Configvalue") 109 121 configvalue:setProperty("ReadOnly", "set:False") 110 122 local value = orxonox.CommandExecutor:query("getConfig " .. P.commandList[k]) 111 123 configvalue:setText(value) 112 P.sampleWindow:setText(value) 113 local size = getMinTextSize(P.sampleWindow) 114 local configvalueWidth = 2*size[2] 115 configvalue:setSize(CEGUI.UVector2(CEGUI.UDim(0, configvalueWidth), CEGUI.UDim(0.9, 0))) 124 configvalue:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.editboxWidth), CEGUI.UDim(0.9, 0))) 116 125 configvalue:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.05, 0))) 126 -- enable the reset button if the value changed 127 orxonox.GUIManager:subscribeEventHelper(configvalue, "TextAccepted", P.name .. ".MiscConfigEditbox_textAccepted") 117 128 line:addChildWindow(configvalue) 118 offset = offset + configvalueWidth + P.spaceWidth 119 120 local config = winMgr:createWindow("MenuWidgets/Button", "orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Config") 121 config:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.configWidth), CEGUI.UDim(0.9, 0))) 122 config:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.05, 0))) 123 config:setText("configure") 124 orxonox.GUIManager:subscribeEventHelper(config, "Clicked", P.name .. ".MiscConfigConfigure_clicked") 125 line:addChildWindow(config) 126 offset = offset + P.configWidth + P.spaceWidth 127 129 offset = offset + P.editboxWidth + P.spaceWidth 130 131 -- reset button (only available when value changed) 128 132 local reset = winMgr:createWindow("MenuWidgets/Button", "orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Reset") 129 133 reset:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.resetWidth), CEGUI.UDim(0.9, 0))) 130 134 reset:setPosition(CEGUI.UVector2(CEGUI.UDim(0, offset), CEGUI.UDim(0.05, 0))) 131 135 reset:setText("reset") 132 orxonox.GUIManager:subscribeEventHelper(reset, "Clicked", P.name .. ".MiscConfigReset _clicked")136 orxonox.GUIManager:subscribeEventHelper(reset, "Clicked", P.name .. ".MiscConfigResetButton_clicked") 133 137 line:addChildWindow(reset) 134 138 reset:setEnabled(false) … … 153 157 end 154 158 155 function P.MiscConfigReset_clicked(e) 159 function P.MiscConfigOKButton_clicked(e) 160 for k,v in pairs(P.commandList) do 161 -- save the changes 162 local editbox = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Configvalue") 163 orxonox.CommandExecutor:execute("config " .. P.commandList[k] .. " " .. editbox:getText()) 164 local resetButton = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. k .. "/Reset") 165 resetButton:setEnabled(false) 166 end 167 168 hideMenuSheet("MiscConfigMenu") 169 end 170 171 function P.MiscConfigCancelButton_clicked(e) 172 hideMenuSheet("MiscConfigMenu") 173 end 174 175 function P.MiscConfigEditbox_textAccepted(e) 156 176 local we = CEGUI.toWindowEventArgs(e) 157 177 local name = we.window:getName() … … 160 180 local commandNr = tonumber(match()) 161 181 162 -- TODO: Implement reset. 163 end 164 165 function P.MiscConfigConfigure_clicked(e) 182 local resetButton = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. commandNr .. "/Reset") 183 resetButton:setEnabled(true) 184 end 185 186 function P.MiscConfigResetButton_clicked(e) 166 187 local we = CEGUI.toWindowEventArgs(e) 167 188 local name = we.window:getName() … … 170 191 local commandNr = tonumber(match()) 171 192 172 local window = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. commandNr .. "/Configvalue") 173 174 orxonox.CommandExecutor:execute("config " .. P.commandList[commandNr] .. " " .. window:getText()) 193 -- reload the old value 194 local editbox = winMgr:getWindow("orxonox/MiscConfigMenu/MiscConfigPane/ConfigCommand" .. commandNr .. "/Configvalue") 175 195 local value = orxonox.CommandExecutor:query("getConfig " .. P.commandList[commandNr]) 176 window:setText(value) 177 end 178 179 function P.MiscConfigBackButton_clicked(e) 180 hideMenuSheet("MiscConfigMenu") 196 editbox:setText(value) 197 198 we.window:setEnabled(false) 181 199 end 182 200 -
code/trunk/data/gui/scripts/SingleplayerMenu.lua
r8706 r9016 4 4 5 5 P.levelList = {} 6 P. itemList= {}7 P.s howAll = false6 P.activeTabIndexes = {} 7 P.scrollbarWidth = 13 8 8 9 9 function P.onLoad() 10 local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox")11 local button = tolua.cast(window,"CEGUI::Checkbox")12 button:setSelected(false)13 10 P.createLevelList() 14 15 --buttons are arranged in a 1x2 matrix 11 12 -- create tabs with desired tab as argument (nil for all) 13 P.createFilterTab("Gametypes", "gametype") 14 P.createFilterTab("Missions", "mission") 15 P.createFilterTab("Minigames", "minigame") 16 P.createFilterTab("Showcases", "showcase") 17 P.createFilterTab("Presentations", "presentation") 18 P.createFilterTab("Tests", "test") 19 P.createFilterTab("Show All", nil) 20 21 -- update description and screenshot boxes 22 P.SingleplayerSelectionChanged() 23 24 --buttons are arranged in a 1x3 matrix 16 25 P:setButton(1, 1, { 17 26 ["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"), … … 20 29 21 30 P:setButton(1, 2, { 31 ["button"] = winMgr:getWindow("orxonox/SingleplayerConfigButton"), 32 ["callback"] = P.SingleplayerConfigButton_clicked 33 }) 34 35 P:setButton(1, 3, { 22 36 ["button"] = winMgr:getWindow("orxonox/SingleplayerBackButton"), 23 37 ["callback"] = P.SingleplayerBackButton_clicked … … 25 39 end 26 40 27 function P.onShow()28 if P.showAll ~= orxonox.GUIManager:inDevMode() then29 local window = winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox")30 local button = tolua.cast(window,"CEGUI::Checkbox")31 P.showAll = not P.showAll32 button:setSelected(P.showAll)33 P.createLevelList()34 end35 end36 37 41 function P.createLevelList() 38 42 P.levelList = {} 39 P.itemList = {}40 local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/SingleplayerLevelListbox"))41 listbox:resetList()42 orxonox.GUIManager:setItemTooltipsEnabledHelper(listbox, true)43 local preselect = orxonox.LevelManager:getInstance():getDefaultLevel()44 43 local size = orxonox.LevelManager:getInstance():getNumberOfLevels() 45 44 local index = 0 … … 48 47 level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index) 49 48 if level ~= nil then 50 if P.showAll or not level:hasTag("test") then 51 table.insert(P.levelList, level) 49 local levelXMLFilename = level:getXMLFilename() 50 -- create an imageset for each screenshot 51 local imageName = level:getScreenshot() 52 if imageName ~= "" then 53 CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile(levelXMLFilename..imageName, imageName) 54 else 55 CEGUI.ImagesetManager:getSingleton():createImagesetFromImageFile(levelXMLFilename..imageName, "noscreenshot.png") 52 56 end 57 table.insert(P.levelList, level) 53 58 end 54 59 index = index + 1 55 60 end 61 end 56 62 63 function P.createFilterTab(name, tag) 64 -- create unique tab window name 65 local tabName = "orxonox/SingleplayerLevelTab" 66 if tag ~= nil then 67 tabName = tabName..tag 68 end 69 -- create new tab window with desired name 70 local listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName)) 71 listbox:setText(name) 72 listbox:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}") 73 listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}") 74 -- fill listbox with items 75 listbox:resetList() 76 orxonox.GUIManager:setItemTooltipsEnabledHelper(listbox, true) 77 local preselect = orxonox.LevelManager:getInstance():getDefaultLevel() 78 local tabIndexes = {} 57 79 for k,v in pairs(P.levelList) do 58 local item = CEGUI.createListboxTextItem(v:getName()) 59 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 60 listbox:addItem(item) 61 if v:getXMLFilename() == preselect then 62 listbox:setItemSelectState(item, true) 80 -- only add level if it has desired tag 81 if tag == nil or v:hasTag(tag) then 82 local item = CEGUI.createListboxTextItem(v:getName()) 83 item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") 84 listbox:addItem(item) 85 table.insert(tabIndexes, k) 86 if v:getXMLFilename() == preselect then 87 listbox:setItemSelectState(item, true) 88 end 89 orxonox.GUIManager:setTooltipTextHelper(item, v:getDescription()) 63 90 end 64 P.itemList[k] = listbox:getListboxItemFromIndex(k-1) 65 orxonox.GUIManager:setTooltipTextHelper(P.itemList[k], v:getDescription()) 91 end 92 table.insert(P.activeTabIndexes, tabIndexes) 93 -- listen to selection changes 94 orxonox.GUIManager:subscribeEventHelper(listbox, "ItemSelectionChanged", P.name..".SingleplayerSelectionChanged") 95 local tabControl = winMgr:getWindow("orxonox/SingleplayerTabControl") 96 orxonox.GUIManager:subscribeEventHelper(tabControl, "TabSelectionChanged", P.name..".SingleplayerSelectionChanged") 97 if listbox:getItemCount() > 0 then 98 tabControl:addChildWindow(tabName) 99 end 100 end 101 102 function P.SingleplayerGetSelectedLevel() 103 -- choose the active listbox 104 local tabControl = CEGUI.toTabControl(winMgr:getWindow("orxonox/SingleplayerTabControl")) 105 local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex())) 106 local choice = listbox:getFirstSelectedItem() 107 if choice ~= nil then 108 -- get the right tab and the right index 109 local tabIndexes = P.activeTabIndexes[tabControl:getSelectedTabIndex()+1] 110 local index = tabIndexes[listbox:getItemIndex(choice)+1] 111 return P.levelList[index] 112 else 113 return nil 114 end 115 end 116 117 function P.SingleplayerSelectionChanged(e) 118 local levelImage = winMgr:getWindow("orxonox/SingleplayerLevelImage") 119 local levelDescription = winMgr:getWindow("orxonox/SingleplayerLevelDescription") 120 local configButton = winMgr:getWindow("orxonox/SingleplayerConfigButton") 121 local level = P.SingleplayerGetSelectedLevel() 122 if level ~= nil then 123 local levelXMLFilename = level:getXMLFilename() 124 local imageName = level:getScreenshot() 125 -- set the screenshot and the description for the selected level 126 levelImage:setProperty("Image", "set:"..levelXMLFilename..imageName.." image:full_image") 127 levelDescription:setText(level:getDescription()) 128 -- only enable config button for "gametype" levels 129 if level:hasTag("gametype") then 130 configButton:setProperty("Disabled", "False") 131 else 132 configButton:setProperty("Disabled", "True") 133 end 134 else 135 -- also take care of "no level selected" 136 levelImage:setProperty("Image", nil) 137 levelDescription:setText("") 138 configButton:setProperty("Disabled", "True") 66 139 end 67 140 end 68 141 69 142 function P.SingleplayerStartButton_clicked(e) 70 local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/SingleplayerLevelListbox")) 71 local choice = listbox:getFirstSelectedItem() 72 if choice ~= nil then 73 local index = listbox:getItemIndex(choice) 74 local level = P.levelList[index+1] 75 if level ~= nil then 76 orxonox.execute("startGame " .. level:getXMLFilename()) 77 hideAllMenuSheets() 78 end 143 local level = P.SingleplayerGetSelectedLevel() 144 if level ~= nil then 145 orxonox.execute("startGame " .. level:getXMLFilename()) 146 hideAllMenuSheets() 79 147 end 80 148 end 81 149 82 function P.SingleplayerShowAll_clicked(e) 83 local checkbox = tolua.cast(winMgr:getWindow("orxonox/SingleplayerShowAllCheckbox"), "CEGUI::Checkbox") 84 local show = checkbox:isSelected() 85 if show ~= P.showAll then 86 P.showAll = show 87 P.createLevelList() 88 end 150 function P.SingleplayerConfigButton_clicked(e) 151 local level = P.SingleplayerGetSelectedLevel() 152 if level ~= nil then 153 local configMenu = showMenuSheet("SingleplayerConfigMenu") 154 configMenu:loadConfig(level) 155 end 89 156 end 90 157 … … 94 161 95 162 return P 96 -
code/trunk/data/levels/FPSTest.oxw
r8706 r9016 3 3 description = "Level to test First Person Shooter" 4 4 tags = "test" 5 screenshot = "fpstestlevel.png" 5 6 /> 6 7 … … 14 15 ?> 15 16 16 <Level 17 name = "fps" 18 description = "tests" 19 > 17 <Level> 20 18 <templates> 21 19 <Template link=lodtemplate_default /> -
code/trunk/data/levels/asteroids.oxw
r8706 r9016 1 <LevelInfo 2 name = "Asteroids Race" 3 description = "Reach the checkpoints and avoid asteroids." 4 tags = "gametype" 5 screenshot = "asteroids.png" 6 /> 7 1 8 <?lua 2 9 include("HUDTemplates3.oxo") … … 7 14 8 15 <Level 9 name = "Asteroids Race" 10 description = "testmap for gametype asteroid race" 11 gametype = Asteroids 16 gametype = "Asteroids" 12 17 > 13 18 <templates> -
code/trunk/data/levels/docking.oxw
r8706 r9016 2 2 name = "Transporter" 3 3 description = "Level with a Transporter. Demonstrates the docking system." 4 tags = "" 4 tags = "showcase" 5 screenshot = "transporter.png" 5 6 /> 6 7 … … 12 13 ?> 13 14 14 <Level 15 name = "Transporter" 16 description = "Docking example level" 17 > 15 <Level> 18 16 <templates> 19 17 <Template link="lodtemplate_default" /> -
code/trunk/data/levels/dynamicMatch.oxw
r8706 r9016 1 <LevelInfo 2 name = "Dynamic Match" 3 description = "Dynamicmatch: Take care of what you're shooting at." 4 tags = "gametype" 5 screenshot = "dynamicMatch.png" 6 /> 7 1 8 <?lua 2 9 include("HUDTemplates3.oxo") … … 9 16 10 17 <Level 11 name = "Dynamic Match" 12 description = "In progress -level for dynamicmatch" 13 gametype = "Dynamicmatch" 18 gametype = "Dynamicmatch" 14 19 > 15 20 <templates> … … 33 38 34 39 <!-- -----------12-Spawnpoints around the planet------------- --> 40 <!-- inner Spawnpoints --> 35 41 <TeamSpawnPoint team=0 position="1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/> 36 42 <TeamSpawnPoint team=0 position="-1000,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff/> -
code/trunk/data/levels/earth.oxw
r8706 r9016 3 3 description = "1:100 Scale Model of Earth with Gravity" 4 4 tags = "showcase" 5 screenshot = "earthdemonstration.png" 5 6 /> 6 7 … … 12 13 ?> 13 14 14 <Level 15 name = "Planet Earth" 16 description = "1:100 Scale Model of Earth with Gravity" 17 > 15 <Level> 18 16 <templates> 19 17 <Template link="lodtemplate_default" /> -
code/trunk/data/levels/emptyLevel.oxw
r8706 r9016 3 3 description = "A level with absolutely nothing in it." 4 4 tags = "test" 5 screenshot = "emptylevel.png" 5 6 /> 6 7 … … 16 17 ?> 17 18 18 <Level 19 name = "Sample" 20 description = "Just a few tests" 21 > 19 <Level> 22 20 <templates> 23 21 <Template link=lodtemplate_default /> -
code/trunk/data/levels/events.oxw
r8706 r9016 2 2 name = "Events showcase" 3 3 description = "Level to test and showcase events." 4 tags = "test, showcase" 4 tags = "test, showcase" 5 screenshot = "eventsshowcase.png" 5 6 /> 6 7 … … 13 14 ?> 14 15 15 <Level 16 name = "Event testing" 17 description = "A simple level to test the event-system (with comments)" 18 > 16 <Level> 19 17 <templates> 20 18 <Template link=lodtemplate_default /> -
code/trunk/data/levels/fightInOurBack.oxw
r8891 r9016 2 2 name = "Fight in our Back" 3 3 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!" 4 tags = "singleplayer" 4 screenshot = "fightinourback.png" 5 tags = "mission" 5 6 /> 6 7 … … 110 111 name="Fight in our back" 111 112 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!" 112 gametype= TeamDeathmatch113 gametype=Mission 113 114 > 114 115 <templates> … … 214 215 <?lua for i=0,0,1 do 215 216 x=800 216 health= 2050217 health=1500 217 218 ?> 218 219 <!--Transporter 1--> … … 239 240 240 241 <?lua for j=0,1,1 do 241 health=1 600242 health=1300 242 243 x=800 243 244 z=j*300 -
code/trunk/data/levels/includes/weaponSettingsSpacecruiser.oxi
r8891 r9016 1 1 <weaponslots> 2 <WeaponSlot position="-20,-15,-108" /> 3 <WeaponSlot position=" 20,-15,-108" /> 4 <WeaponSlot position=" 0, -7,-110" /> 5 <WeaponSlot position="-14,-31,-184" /> 6 <WeaponSlot position=" 14,-31,-184" /> 7 <WeaponSlot position="-34,-30,-169" /> 8 <WeaponSlot position=" 34,-30,-169" /> 9 2 <WeaponSlot position="-20,10,2" /> 3 <WeaponSlot position=" 20,10,2" /> 4 <WeaponSlot position=" 0,18,0" /> 5 <WeaponSlot position="-14,-6,-74" /> 6 <WeaponSlot position=" 14,-6,-74" /> 7 <WeaponSlot position="-34,-5,-59" /> 8 <WeaponSlot position=" 34,-5,-59" /> 10 9 </weaponslots> 11 10 <weaponsets> -
code/trunk/data/levels/lastManStanding.oxw
r8706 r9016 2 2 name = "Last Man Standing" 3 3 description = "Be the sole survivor." 4 tags = "" 4 tags = "gametype" 5 screenshot = "lastmanstanding.png" 5 6 /> 6 7 … … 16 17 17 18 <Level 18 name = "Last Man Standing" 19 description = "testmap for gametype last man standing" 20 gametype = "LastManStanding" 19 gametype = "LastManStanding" 21 20 > 22 21 <templates> … … 51 50 <Model position="0,0,0" scale=140 mesh="asteroid_UV.mesh" shadow=true /> 52 51 <Model position="-160,40,28.4" scale=1 mesh="sphere.mesh" /><!--EasterEgg indicator--> 53 <PickupSpawner position="-160,40,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="15"><!--EasterEgg -->52 <PickupSpawner position="-160,40,17" triggerDistance="20" respawnTime="5" maxSpawnedItems="15"><!--EasterEgg : invisible pickup is hidden inside the asteroid --> 54 53 <pickup> 55 54 <InvisiblePickup template=hugeinvisiblepickup /> -
code/trunk/data/levels/lastTeamStanding.oxw
r8891 r9016 2 2 name = "Last Team Standing" 3 3 description = "Survive as a team." 4 tags = "singleplayer" 4 tags = "gametype" 5 screenshot = "lastteamstanding.png" 5 6 /> 6 7 <?lua … … 17 18 name = "Last Team Standing" 18 19 description = "testmap for gametype last team standing" 19 gametype = " LastTeamStanding"20 gametype = "TeamGametype" 20 21 > 21 22 <templates> -
code/trunk/data/levels/lastTeamStandingII.oxw
r8891 r9016 1 1 <LevelInfo 2 name = "On the fly" 3 description = "Survive as a team." 4 tags = "" 2 name = "Last Team Standing II" 3 description = "Last Team Standing in an abstract level." 4 screenshot = "onthefly.png" 5 tags = "gametype" 5 6 /> 6 7 <?lua … … 15 16 16 17 <Level 17 name = "On the fly"18 description = "testmap for gametype last team standing"19 18 gametype = "LastTeamStanding" 20 19 > … … 95 94 </StaticEntity> 96 95 <!-- END of CUBE--> 96 97 97 <!-------------- Centered Thin Gate --------------> 98 98 … … 412 412 <TeamSpawnPoint team=3 position="845,350,835" direction="0,0,-1" spawnclass=SpaceShip pawndesign=spaceshipassff /> 413 413 <TeamSpawnPoint team=3 position="845,-300,835" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff /> 414 <Bot /> 414 <Bot /><!-- at least one bot is needed to stat the game properly. Else the game finishes. This could be avoided, if the menue allows a preselection of the number of players. --> 415 415 416 416 </Scene> -
code/trunk/data/levels/missionOne.oxw
r8891 r9016 1 1 <LevelInfo 2 2 name = "Mission One" 3 description = "First guided steps in the orxonoxian universe." 4 tags = "singleplayer" 3 description = "First Guided Steps in the Orxonoxian Universe." 4 screenshot = "missionOne.png" 5 tags = "mission" 5 6 /> 6 7 … … 20 21 21 22 <Level 22 name = "Mission One" 23 description = "How to steer a spaceship." 23 gametype = "Mission" 24 24 > 25 25 <templates> … … 47 47 ?> 48 48 49 <WorldAmbientSound source=" Mars.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.ogg-->49 <WorldAmbientSound source="Earth.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.ogg, Mars.ogg--> 50 50 51 51 <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"/> 52 <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />53 54 55 52 <!-- END OF INCLUDES & NECESSARITIES --> 56 53 54 <!-- SPAWNPOINT & START OF QUESTS via spawntrigger --> 55 <EventMultiTrigger name=spawntrigger> 56 <events> 57 <trigger> 58 <TeamSpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff> 59 <EventTrigger invert=true> 60 <events> 61 <trigger> 62 <EventListener event="attack" /> 63 </trigger> 64 </events> 65 </EventTrigger> 66 </TeamSpawnPoint> 67 </trigger> 68 </events> 69 </EventMultiTrigger> 70 71 <QuestEffectBeacon times=1> 72 <effects> 73 <AddQuest questId="missionOne.basicFlying" /> 74 <!--AddQuestHint hintId ="quest1hint3" /--> 75 </effects> 76 <events> 77 <execute> 78 <EventListener event=spawntrigger /> 79 </execute> 80 </events> 81 </QuestEffectBeacon> 82 83 <QuestEffectBeacon times=1> 84 <effects> 85 <CompleteQuest questId="missionOne.basicFlying" /> 86 </effects> 87 <events> 88 <execute> 89 <EventListener event="flying4" /> 90 </execute> 91 </events> 92 </QuestEffectBeacon> 93 94 <QuestEffectBeacon times=1> 95 <effects> 96 <CompleteQuest questId="missionOne.navigation" /> 97 </effects> 98 <events> 99 <execute> 100 <EventListener event="navigationend" /> 101 </execute> 102 </events> 103 </QuestEffectBeacon> 104 105 <!--helper trigger to end the weaponsystemI quest --> 106 <DistanceTrigger name="boxend" position="0,0,0" distance=950 target="SpaceShip" stayActive="false" delay=0.1> 107 <EventTrigger> 108 <events> 109 <trigger> 110 <EventListener event="boxtrigger4" /> 111 </trigger> 112 </events> 113 </EventTrigger> 114 </DistanceTrigger> 115 116 <QuestEffectBeacon times=1> 117 <effects> 118 <CompleteQuest questId="missionOne.weaponsystemI" /> 119 </effects> 120 <events> 121 <execute> 122 <EventListener event="boxend" /> 123 </execute> 124 </events> 125 </QuestEffectBeacon> 126 127 <!--helper trigger to end the weaponsystemII quest --> 128 <DistanceTrigger name="piratesend" position="0,0,0" distance=2000 target="SpaceShip" stayActive="false" delay=0.1> 129 <EventTrigger> 130 <events> 131 <trigger> 132 <EventListener event="movingpirates2" /> 133 </trigger> 134 </events> 135 </EventTrigger> 136 </DistanceTrigger> 137 138 <QuestEffectBeacon times=1> 139 <effects> 140 <CompleteQuest questId="missionOne.weaponsystemII" /> 141 </effects> 142 <events> 143 <execute> 144 <EventListener event=piratesend /> 145 </execute> 146 </events> 147 </QuestEffectBeacon> 148 149 <!--helper trigger to end the DuBallStation quest --> 150 <DistanceTrigger name="duballend" position="-1000,-300,700" distance=2000 target="SpaceShip" stayActive="false" delay=0.1> 151 <EventTrigger> 152 <events> 153 <trigger> 154 <EventListener event="duball3" /> 155 </trigger> 156 </events> 157 </EventTrigger> 158 </DistanceTrigger> 159 160 161 <QuestEffectBeacon times=1> 162 <effects> 163 <CompleteQuest questId="missionOne.DuballStation" /> 164 </effects> 165 <events> 166 <execute> 167 <EventListener event=duballend /> 168 </execute> 169 </events> 170 </QuestEffectBeacon> 171 172 <QuestEffectBeacon times=1> <!-- alternative quest end --> 173 <effects> 174 <CompleteQuest questId="missionOne.DuballStation" /> 175 </effects> 176 <events> 177 <execute> 178 <EventListener event=toHydroFarmer /> 179 </execute> 180 </events> 181 </QuestEffectBeacon> 182 183 <!--helper trigger to end the getHelp quest --> 184 <DistanceTrigger name="getHelpEnd" position="-47000,-1000,1300" distance=1400 target="SpaceShip" stayActive="false" delay=0.1> 185 <EventTrigger> 186 <events> 187 <trigger> 188 <EventListener event="ondock" /> 189 </trigger> 190 </events> 191 </EventTrigger> 192 </DistanceTrigger> 193 194 <QuestEffectBeacon times=1> 195 <effects> 196 <CompleteQuest questId="missionOne.getHelp" /> 197 </effects> 198 <events> 199 <execute> 200 <EventListener event=getHelpEnd /> 201 </execute> 202 </events> 203 </QuestEffectBeacon> 204 205 <!--helper trigger to end the getHome quest --> 206 <DistanceTrigger name="getHomeEnd" position="0,0,0" distance=4000 target="SpaceShip" stayActive="false" delay=0.1> 207 <EventTrigger> 208 <events> 209 <trigger> 210 <EventListener event="attack" /> 211 </trigger> 212 </events> 213 </EventTrigger> 214 </DistanceTrigger> 215 216 <QuestEffectBeacon times=1> 217 <effects> 218 <CompleteQuest questId="missionOne.getHome" /> 219 </effects> 220 <events> 221 <execute> 222 <EventListener event=getHomeEnd /> 223 </execute> 224 </events> 225 </QuestEffectBeacon> 226 227 <!--helper trigger to end the defence quest --> 228 <DistanceTrigger name="defenceEnd" position="0,0,0" distance=4000 target="SpaceShip" stayActive="false" delay=0.1> 229 <EventTrigger> 230 <events> 231 <trigger> 232 <EventListener event="attacktrigger6" /> 233 </trigger> 234 </events> 235 </EventTrigger> 236 </DistanceTrigger> 237 238 <QuestEffectBeacon times=1> 239 <effects> 240 <CompleteQuest questId="missionOne.defence" /> 241 </effects> 242 <events> 243 <execute> 244 <EventListener event=defenceEnd /> 245 </execute> 246 </events> 247 </QuestEffectBeacon> 248 249 <!-- End the quest after own destruction of spacecruiser --> 250 <QuestEffectBeacon position="-100,0,0" times=1> 251 <effects> 252 <FailQuest questId="missionOne.getHelp" /> 253 </effects> 254 <events> 255 <execute> 256 <EventListener event="failQuest" /> 257 </execute> 258 </events> 259 <attached> 260 <DistanceTrigger name="failQuest" position="-47000,-1000,1300" distance=2300 target="SpaceShip"> 261 <EventTrigger> 262 <events> 263 <trigger> 264 <EventListener event="gameEnd" /> 265 </trigger> 266 </events> 267 </EventTrigger> 268 </DistanceTrigger> 269 </attached> 270 </QuestEffectBeacon> 271 272 273 274 57 275 <LocalQuest id="missionOne.basicFlying"> 58 <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." /> 276 <QuestDescription title="Flying" description="Can you see the blinking light straight ahead? Your goal is to fly through it. 277 Use (W) to accelerate and steer with your mouse. 278 279 Further flying moves: 280 break (S) 281 roll (Q) and (E) 282 boost (Space) 283 284 Whenever a new quest is added you can view it by pressing (F3). Quit this menu via (Esc)." failmessage="" completeMessage="" /> 59 285 <complete-effects> 60 <AddQuest questId="missionOne. weaponsystem" />286 <AddQuest questId="missionOne.navigation" /> 61 287 </complete-effects> 62 288 </LocalQuest> 63 289 64 <LocalQuest id="missionOne.weaponsystem"> 65 <QuestDescription title="Weaponsystem" description="INSERT STORY HERE." failmessage="" completeMessage="All right." /> 66 <subquests> 290 <LocalQuest id="missionOne.navigation"> 291 <QuestDescription title="Navigation" description="The next goal is to find and move towards the test targets for your weaponsystem. The three arrows that just appeared down in the right corner of your screen indicate in which direction you have to turn your spacefighter to find your next targets. 292 293 Alternative navigation: There's a green circle in the left corner - the radar. The red dots on the radar represent your targets. If you manage to move your spaceship in a way such that a dot is at the center of the radar, you will be able to see the concerning object straight ahead." failmessage="" completeMessage="" /> 294 <complete-effects> 295 <AddQuest questId="missionOne.weaponsystemI" /> 296 </complete-effects> 297 </LocalQuest> 298 67 299 <LocalQuest id ="missionOne.weaponsystemI"> 68 <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="" /> 300 <QuestDescription title="Destroy the Boxes" description="Test your four different weapons on the four boxes: 301 1. laser (left click) 302 2. plasma (right click) 303 3. target seeking rockets (middle click) 304 4. manual rockets (T) 305 306 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="" /> 307 <hints> 308 <QuestHint id="missionOne.weaponsystem.laser"> 309 <QuestDescription title="Laser" description="The laser is a standard weapon. It is fast and precise but does not deal much damage." /> 310 </QuestHint> 311 <QuestHint id="missionOne.weaponsystem.lightningGun"> 312 <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." /> 313 </QuestHint> 314 <QuestHint id="missionOne.weaponsystem.targetSeekingRocket"> 315 <QuestDescription title="Target Seeking Rocket" description="The target seeking rockets follow slow targets on their own." /> 316 </QuestHint> 317 <QuestHint id="missionOne.weaponsystem.manualrocket"> 318 <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." /> 319 </QuestHint> 320 </hints> 69 321 <complete-effects> 70 322 <AddQuest questId="missionOne.weaponsystemII" /> 71 323 </complete-effects> 72 324 </LocalQuest> 325 73 326 <LocalQuest id="missionOne.weaponsystemII"> 74 <QuestDescription title="" description="" failmessage="" completeMessage="" /> 327 <QuestDescription title="Kill the pirates" description="Get rid of the patrolling pirates. 328 Find out which weapon is best to tackle moving targets. Get close enough." failmessage="" completeMessage="" /> 75 329 <complete-effects> 76 330 <AddQuest questId="missionOne.DuballStation" /> 77 331 </complete-effects> 78 332 </LocalQuest> 79 </subquests>80 <hints>81 <QuestHint id="missionOne.weaponsystem.laser">82 <QuestDescription title="Laser" description="The laser is a standard weapon. It is fast and precise but does not deal much damage." />83 </QuestHint>84 <QuestHint id="missionOne.weaponsystem.lightningGun">85 <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." />86 </QuestHint>87 <QuestHint id="missionOne.weaponsystem.targetSeekingRocket">88 <QuestDescription title="Target Seeking Rocket" description="The target seeking rockets follow slow targets on their own." />89 </QuestHint>90 <QuestHint id="missionOne.weaponsystem.manualrocket">91 <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." />92 </QuestHint>93 </hints>94 <complete-effects>95 </complete-effects>96 </LocalQuest>97 333 98 334 <LocalQuest id="missionOne.DuballStation"> 99 <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." />335 <QuestDescription title="Duball Space Station" description="Fly towards the Duball Space Station. The grey radar marker will lead you to its position." failmessage="" completeMessage="" /> 100 336 <complete-effects> 101 337 <AddQuest questId="missionOne.getHelp" /> … … 104 340 105 341 <LocalQuest id="missionOne.getHelp"> 106 <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." /> 342 <QuestDescription title="Get Help" description="There are several enemies approaching. You can't handle it on your own. Fortunately there's a shortcut to the next friendly unit. Use the portal (grey dot) to get near the Hydrogen Farmer. 343 The Hydrogen Farmer is a large spaceship with three legs. 344 There you might get help - as far as we know there should be a strong spaceruiser docked to the Hydrogen Farmer. In order to be able to use that stronger spaceship, you have to dock to the Hydrogen Farmer. 345 Simply fly to the center of the Hydrogen Farmer, which is between its three legs. 346 347 How to dock: Accept the dialogue, take your hands off the keyboard and watch." failmessage="" completeMessage="" /> 107 348 <complete-effects> 108 349 <AddQuest questId="missionOne.getHome" /> … … 111 352 112 353 <LocalQuest id="missionOne.getHome"> 113 <QuestDescription title="Return ASAP" description="" failmessage="" completeMessage="Well done." /> 354 <QuestDescription title="Return ASAP" description="So you managed to get the spacecruiser. Use the portal to return to the DuBall Space Station. 355 Hurry! Your help is desperately needed." failmessage="" completeMessage="" /> 114 356 <complete-effects> 115 357 <AddQuest questId="missionOne.defence" /> … … 118 360 119 361 <LocalQuest id="missionOne.defence"> 120 <QuestDescription title="Defence" description="" failmessage="" completeMessage="Well done." /> 362 <QuestDescription title="Defence" description="Seven enemies were detected that seem to launch a coordinated attack. 363 Do not hesitate to fight or you will be the target. 364 365 Always take care of the enemy that is the closest to you." failmessage="" completeMessage="Yeah! You did it." /> 121 366 </LocalQuest> 122 123 124 <QuestEffectBeacon position="800,700,600" times="1"> 125 <effects> 126 <AddQuest questId="missionOne.basicFlying" /> 127 </effects> 128 <events> 129 <execute> 130 <EventListener event="questStart"/> 131 </execute> 132 </events> 133 <attached> 134 <DistanceTrigger name="questStart" position="0,0,0" distance="50" target="Pawn" beaconMode="identify" targetname="PlayerDistanceTrigger" delay="2" /> 135 </attached> 136 </QuestEffectBeacon> 137 138 139 <!-- TUTORIAL-TODO: --> 140 <!-- 1. Flying & manoeuvring (basic flying, using pickups, forcefields, docks & portals) --> <!-- "W","S","SPACE"--> 141 <!-- 2. Aiming & Weapons (static targets, moving targets, dangerous targets)--> <!-- 3 Mouse buttons + "T"--> 142 <!-- 3. Game handling (quests, knowing when a game is over :-), pausing, chat, ... ) --> <!--"F3", "F2", "ESC" --> 143 <!-- 4. Extras (other things to discover) --> <!-- "Q","E","A","D","C", "CTRL", "", ... --> 144 145 <!-- 146 147 "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 .." 148 149 --> 150 151 <DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true"/> 152 <SimpleNotification message="Welcome to the Orxonox Tutorial."> 367 <!-- --------------------- END OF QUESTS -------------------------- --> 368 369 370 <DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=2/> 371 <SimpleNotification message="Press (F3) to see your mission briefing."> 153 372 <events> 154 373 <trigger> … … 158 377 </SimpleNotification> 159 378 160 <BlinkingBillboard position="-900,640,600" frequency=0.4 amplitude=2 material="Flares/lensflare" colour="1,1,0"> 379 <!-- Blinking Billboard should be replaced with WAYPOINT --> 380 <BlinkingBillboard position="-900,640,600" frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,1,0.05"> 161 381 <events> 162 382 <visibility> … … 184 404 </events> 185 405 </Billboard> 406 186 407 <!-------------------------------------- PART ZERO: How to fly ---------------------------------------> 187 <DistanceTrigger name="flying1" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=4/> 408 409 <DistanceTrigger name="flying1" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=6/> 188 410 <SimpleNotification message="Let's fly to the blinking light."> 189 411 <events> … … 194 416 </SimpleNotification> 195 417 196 <DistanceTrigger name="flying2" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay= 8/>197 <SimpleNotification message="Use 'W'to accelerate and the mouse to steer.">418 <DistanceTrigger name="flying2" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=10/> 419 <SimpleNotification message="Use (W) to accelerate and the mouse to steer."> 198 420 <events> 199 421 <trigger> … … 203 425 </SimpleNotification> 204 426 205 <!--DistanceTrigger name="flying3" position="800,700,600" target="Pawn" distance=20 stayActive="true" delay=12/> 206 <SimpleNotification message="Point with the mouse to the blinking light."> 207 <events> 208 <trigger> 209 <EventListener event="flying3" /> 210 </trigger> 211 </events> 212 </SimpleNotification--> 213 214 <DistanceTrigger name="flying4" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=1/> 215 <SimpleNotification message="Three red arrows just appeared."> 427 <!-- QUEST-Trigger && Message Trigger: navigationend is activated after flying4 was triggered --> 428 <DistanceTrigger name="navigationend" position="0,0,0" distance=950 target="SpaceShip" stayActive="false" delay=1.1> 429 <DistanceTrigger name="flying4" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=1/> 430 </DistanceTrigger> 431 432 433 <SimpleNotification message="Three arrows just appeared."> 216 434 <events> 217 435 <trigger> … … 222 440 223 441 <DistanceTrigger name="flying5" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=5/> 224 <SimpleNotification message="Follow those redarrows.">442 <SimpleNotification message="Follow those arrows."> 225 443 <events> 226 444 <trigger> … … 230 448 </SimpleNotification> 231 449 232 233 234 450 <!-------------------------------------- PART ONE : Destroy boxes ---------------------------------------> 235 <DistanceTrigger name="spawndelaytrigger1" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=9 /> 236 <SimpleNotification message="Destroy the four boxes."> 451 <!-- @ triggers: spawndelaytriggerX: textoutput only if no box was destroyed --> 452 <Trigger name="spawndelaytrigger1" mode="and" stayActive="true"> 453 <DistanceTrigger position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=9 /> 454 <EventTrigger activations="1" invert="true"> 455 <events> 456 <trigger> 457 <EventListener event="boxtrigger1" /> 458 </trigger> 459 </events> 460 </EventTrigger> 461 </Trigger> 462 463 <Trigger name="spawndelaytrigger2" mode="and" stayActive="true"> 464 <DistanceTrigger position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=13 /> 465 <EventTrigger activations="1" invert="true"> 466 <events> 467 <trigger> 468 <EventListener event="boxtrigger1" /> 469 </trigger> 470 </events> 471 </EventTrigger> 472 </Trigger> 473 474 <Trigger name="spawndelaytrigger3" mode="and" stayActive="true"> 475 <DistanceTrigger position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=17 /> 476 <EventTrigger activations="1" invert="true"> 477 <events> 478 <trigger> 479 <EventListener event="boxtrigger1" /> 480 </trigger> 481 </events> 482 </EventTrigger> 483 </Trigger> 484 485 <!-- @Text: How to shoot--> 486 <SimpleNotification message="Destroy the four boxes." broadcast="true"> 237 487 <events> 238 488 <trigger> … … 242 492 </SimpleNotification> 243 493 244 <DistanceTrigger name="spawndelaytrigger2" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=13 /> 245 <SimpleNotification message=" 1. Aim the a red cycle."> 494 <SimpleNotification message=" 1. Aim the a red cycle." broadcast="true"> 246 495 <events> 247 496 <trigger> … … 251 500 </SimpleNotification> 252 501 253 <DistanceTrigger name="spawndelaytrigger3" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=17 /> 254 <SimpleNotification message="2. Click! (hold the left mouse button)"> 502 <SimpleNotification message="2. Click! (hold the left mouse button)" broadcast="true"> 255 503 <events> 256 504 <trigger> … … 261 509 262 510 <!-- @Objects: 4 boxes (uncontrolled pawns) --> 263 <Pawn health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box > 264 <events> 265 <visibility> 266 <EventListener event="flying4" /> 267 </visibility> 268 </events> 269 <attached> 270 <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /> 271 </attached> 272 <collisionShapes> 273 <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" /> 274 </collisionShapes> 275 </Pawn> 276 277 <Pawn health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box visible="true"> 278 <events> 279 <visibility> 280 <EventListener event="flying4" /> 281 </visibility> 282 </events> 283 <attached> 284 <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /> 285 </attached> 286 <collisionShapes> 287 <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" /> 288 </collisionShapes> 289 </Pawn> 290 <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box > 291 <events> 292 <visibility> 293 <EventListener event="flying4" /> 294 </visibility> 295 </events> 296 <attached> 297 <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /> 298 </attached> 299 <collisionShapes> 300 <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" /> 301 </collisionShapes> 302 </Pawn> 303 <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box > 304 <events> 305 <visibility> 306 <EventListener event="flying4" /> 307 </visibility> 308 </events> 309 <attached> 310 <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /> 311 </attached> 312 <collisionShapes> 313 <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" /> 314 </collisionShapes> 315 </Pawn> 511 <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" > 512 <events> 513 <visibility> 514 <EventListener event="flying4" /> 515 </visibility> 516 </events> 517 <attached> 518 <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /> 519 </attached> 520 <collisionShapes> 521 <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" /> 522 </collisionShapes> 523 </Pawn> 524 525 <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 3"> 526 <events> 527 <visibility> 528 <EventListener event="flying4" /> 529 </visibility> 530 </events> 531 <attached> 532 <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /> 533 </attached> 534 <collisionShapes> 535 <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" /> 536 </collisionShapes> 537 </Pawn> 538 539 <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 2"> 540 <events> 541 <visibility> 542 <EventListener event="flying4" /> 543 </visibility> 544 </events> 545 <attached> 546 <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /> 547 </attached> 548 <collisionShapes> 549 <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" /> 550 </collisionShapes> 551 </Pawn> 552 553 <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 1"> 554 <events> 555 <visibility> 556 <EventListener event="flying4" /> 557 </visibility> 558 </events> 559 <attached> 560 <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" /> 561 </attached> 562 <collisionShapes> 563 <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" /> 564 </collisionShapes> 565 </Pawn> 316 566 317 567 <!-- @Triggers: boxtrigger1 <-> one box destroyed … … 365 615 </SimpleNotification> 366 616 367 368 <SimpleNotification message="Aim at the last target and press 'T'." broadcast="true"> 617 <SimpleNotification message="Aim at the last target and press (T)." broadcast="true"> 369 618 <events> 370 619 <trigger> … … 386 635 387 636 <!-- @Objects: 2 pirates moving in squares, nonlethal --> 388 <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" >637 <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" RVName="Pirate"> 389 638 <events> 390 639 <visibility> … … 396 645 </templates> 397 646 <controller> 398 <WaypointController >647 <WaypointController team=1> 399 648 <waypoints> 400 649 <Model mesh="cube.mesh" scale=8 position=" 0,1700,-200" /> … … 407 656 </SpaceShip> 408 657 409 <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget" >658 <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget" RVName="Pirate"> 410 659 <events> 411 660 <visibility> … … 417 666 </templates> 418 667 <controller> 419 <WaypointController >668 <WaypointController team=1> 420 669 <waypoints> 421 670 <Model mesh="cube.mesh" scale=8 position=" 0,2400,1000" /> … … 473 722 </DistanceTrigger> 474 723 475 <EventTrigger name="duball2" activations="1" stayactive="true" delay=4 > 476 <events> 477 <trigger> 478 <EventListener event="duball1" /> 479 </trigger> 480 </events> 481 </EventTrigger> 482 483 <EventTrigger name="duball3" activations="1" stayactive="true" delay=4 > 484 <events> 485 <trigger> 486 <EventListener event="duball2" /> 487 </trigger> 488 </events> 489 </EventTrigger> 724 <Trigger name="duball2" mode="and" stayActive="true"> 725 <EventTrigger activations="1" stayactive="true" delay=4 > 726 <events> 727 <trigger> 728 <EventListener event="duball1" /> 729 </trigger> 730 </events> 731 </EventTrigger> 732 <EventTrigger activations="1" invert="true"> 733 <events> 734 <trigger> 735 <EventListener event="toHydroFarmer" /> 736 </trigger> 737 </events> 738 </EventTrigger> 739 </Trigger> 740 741 <Trigger name="duball3" mode="and" stayActive="true"> 742 <EventTrigger activations="1" stayactive="true" delay=4 > 743 <events> 744 <trigger> 745 <EventListener event="duball2" /> 746 </trigger> 747 </events> 748 </EventTrigger> 749 <EventTrigger activations="1" invert="true"> 750 <events> 751 <trigger> 752 <EventListener event="toHydroFarmer" /> 753 </trigger> 754 </events> 755 </EventTrigger> 756 </Trigger> 757 490 758 491 759 <SimpleNotification message="Welcome to the Duball Space Station!"> … … 520 788 <Model scale=13 mesh="DuBall2.mesh" position = "100,0,0"/> 521 789 <Billboard scale=7 material="Examples/Flare" colour="0.5,0.5,0.5" position = "-100,0,0"/> 522 <Billboard scale=7 material="Examples/Flare" colour="0.5,0.5,0.5" position = "100,0,0"/> 790 <Billboard scale=7 material="Examples/Flare" colour="0.5,0.5,0.5" position = "100,0,0"/> 523 791 </attached> 524 792 <collisionShapes> … … 657 925 658 926 659 <SimpleNotification message="Dock to the Hydrogen Farmer." >927 <SimpleNotification message="Dock to the Hydrogen Farmer." broadcast="true"> 660 928 <events> 661 929 <trigger> … … 665 933 </SimpleNotification> 666 934 667 <!-------------------------------------- PART FOUR : Get Help ---------------------------------------> 668 <DistanceTrigger name="famer1" position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=0 /> 669 <SimpleNotification message="We just received a message from DuBall."> 935 <!-------------------------------------- PART FOUR : Get Help ---------------------------------------> 936 937 <Trigger name="famer1" mode="and" stayActive="true"> 938 <DistanceTrigger position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=0 /> 939 <EventTrigger name="notGameEnd" activations="1" invert="true"> 940 <events> 941 <trigger> 942 <EventListener event="gameEnd" /> 943 </trigger> 944 </events> 945 </EventTrigger> 946 </Trigger> 947 948 <Trigger name="famer2" mode="and" stayActive="true"> 949 <DistanceTrigger position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=4 /> 950 <EventTrigger activations="1" invert="true"> 951 <events> 952 <trigger> 953 <EventListener event="gameEnd" /> 954 </trigger> 955 </events> 956 </EventTrigger> 957 </Trigger> 958 959 <SimpleNotification message="We just received a message from DuBall." broadcast="true"> 670 960 <events> 671 961 <trigger> … … 675 965 </SimpleNotification> 676 966 677 <DistanceTrigger name="famer2" position="-48200,100,0" target="Pawn" distance=650 stayActive="true" delay=4 /> 678 <SimpleNotification message="We will lend you our strongest ship." >967 968 <SimpleNotification message="We will lend you our strongest ship." broadcast="true"> 679 969 <events> 680 970 <trigger> … … 686 976 687 977 <!-- @Objects: HYDROGEN FARMER & DOCKING --> 688 <SpaceShip position="-48900,100,0" roll=90 yaw=0 pitch=20 mass=10000 health=100000 name="HydroFarmer"> 978 <SpaceShip 979 team = 0 980 position = "-48900,100,0" 981 roll = 90 yaw=0 pitch=20 982 mass = 10000 983 health = 100000 initialhealth=100000 maxhealth="100000" 984 name = "HydroFarmer" 985 RVName = "Hydrogen Farmer" > 689 986 <attached> 690 987 <!-- Docking --> … … 730 1027 </SpaceShip> 731 1028 732 <Billboard position="-48900,0,0" material="Examples/Flare" colour="0.6,0,0" scale=3/>733 1029 <Dock position="-48900,0,0" roll=90 yaw=180 > 734 1030 <animations> … … 742 1038 <EventListener event="dockMe" /> 743 1039 </execute> 1040 <activity> 1041 <EventListener event=notGameEnd /> 1042 </activity> 744 1043 </events> 745 1044 <attached> … … 748 1047 /> 749 1048 </attached> 1049 750 1050 </Dock> 751 1051 752 <SpaceShip template="spaceshipspacecruiser" position="-48900,800,0" orientation="-0.14, 0.68, 0.68, 0.223" health="300" maxhealth="400" initialhealth="300" name="cruiser" > 1052 <!--@Objects: SpaceCruiser as docking target --> 1053 <SpaceShip 1054 template = "spaceshipspacecruiser" 1055 team = "0" 1056 position = "-48900,800,0" 1057 orientation = "-0.14, 0.68, 0.68, 0.223" 1058 health = "400" 1059 initialhealth = "400" 1060 maxhealth = "500" 1061 shieldhealth = "80" 1062 initialshieldhealth = "80" 1063 maxshieldhealth = "120" 1064 shieldabsorption = "0.8" 1065 reloadrate = "1" 1066 reloadwaittime = "1" 1067 name = "cruiser" 1068 RVName = "Spacecruiser" > 753 1069 <attached> 754 1070 <DockingTarget name="spaceShip" /> … … 756 1072 </SpaceShip> 757 1073 758 <!-- TESTBOX--> 759 760 <!-- TESTBOX--> 761 1074 1075 <!-- cruiserKilled: if cuiser is killed & player hasn't taken control of spacecrusier --> 762 1076 <Trigger name="cruiserKilled" mode="and" stayActive="true"> 763 1077 <EventTrigger stayActive="true"> … … 778 1092 779 1093 1094 <!-- triggers when either hydrofarmer or cruiser is killed --> 1095 <Trigger mode=or name="gameEnd"> 1096 <EventTrigger activations="1"> 1097 <events> 1098 <trigger> 1099 <EventListener event="HydroFarmer" /> 1100 </trigger> 1101 </events> 1102 </EventTrigger> 1103 <EventTrigger activations="1"> 1104 <events> 1105 <trigger> 1106 <EventListener event="cruiserKilled" /> 1107 </trigger> 1108 </events> 1109 </EventTrigger> 1110 </Trigger> 1111 1112 <!-- triggers delayed when either hydrofarmer or cruiser is killed --> 780 1113 <EventTrigger delay=4 name="earlyEnd"> 781 1114 <events> 782 1115 <trigger> 783 <EventListener event=" cruiserKilled" />1116 <EventListener event="gameEnd" /> 784 1117 </trigger> 785 1118 </events> … … 791 1124 </EventTrigger> 792 1125 793 <EventTrigger delay=4 name="earlyEnd">794 <events>795 <trigger>796 <EventListener event="HydroFarmer" />797 </trigger>798 </events>799 <events>800 <activity>801 <EventListener event="movingpirates2" />802 </activity>803 </events>804 </EventTrigger>805 806 807 1126 808 1127 <SimpleNotification message="Oh no! You killed the Hydrogen Farmer!" broadcast="true"> … … 822 1141 </SimpleNotification> 823 1142 824 <SimpleNotification message="Press 'Esc'and restart the mission." broadcast="true">1143 <SimpleNotification message="Press (Esc) and restart the mission." broadcast="true"> 825 1144 <events> 826 1145 <trigger> … … 829 1148 </events> 830 1149 </SimpleNotification> 831 832 1150 833 1151 <!-- hydrogen farmer & docking END --> … … 872 1190 > 873 1191 <!--attached> 874 <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-50" /> 1192 <ForceField position="0,0,0" mode="sphere" diameter="10000" velocity="-50" /> 875 1193 </attached--> <!-- Forcefield kills HYDROGEN FARMER--> 876 1194 <collisionShapes> … … 881 1199 882 1200 <!-------------------------------------- The attack ---------------------------------------> 883 884 1201 <!-- TODO: 885 1202 - update spaceshipTransporter 886 - bots do friendly fire (is drone function reusable?) 1203 - bots do friendly fire (is drone function reusable?) 887 1204 --> 1205 1206 <!-- Fallback Spawnpoint: on cruiserdeath caused by pirates. Unfortunately unstable behaviour concerning activity. --> 1207 <TeamSpawnPoint team=0 position="2000,1500,-1500" direction="-1,-1,1" spawnclass=SpaceShip pawndesign=spaceshipspacecruiser> 1208 <events> 1209 <activity> 1210 <EventListener event="attack" /> 1211 </activity> 1212 </events> 1213 </TeamSpawnPoint> 888 1214 889 1215 <!-- @Triggers: toHydroFamer <-> first portal usage … … 891 1217 attack <-> second portal usage --> 892 1218 893 <DistanceTrigger name="attack" position="-1400,-500,800" target="Pawn" distance=100 stayActive="true" >1219 <DistanceTrigger name="attack" position="-1400,-500,800" target="Pawn" distance=100 stayActive="true" mode="and"> 894 1220 <EventTrigger name="ondock" activations="1" stayactive="true" delay=6> 895 1221 <events> … … 898 1224 </trigger> 899 1225 </events> 900 <DistanceTrigger name="toHydroFarmer" position="-47000,-1000,1300" target="Pawn" distance=100 stayActive="true" /> 1226 <Trigger mode=and> 1227 <DistanceTrigger name="toHydroFarmer" position="-47000,-1000,1300" target="Pawn" distance=100 stayActive="true" /> 1228 <EventTrigger activations="1" invert="true"> 1229 <events> 1230 <trigger> 1231 <EventListener event="gameEnd" /> 1232 </trigger> 1233 </events> 1234 </EventTrigger> 1235 </Trigger> 1236 </EventTrigger> 1237 <EventTrigger activations="1" invert="true"> 1238 <events> 1239 <trigger> 1240 <EventListener event="earlyEnd" /> 1241 </trigger> 1242 </events> 901 1243 </EventTrigger> 902 1244 </DistanceTrigger> 903 1245 904 <SimpleNotification message="Return before it's too late. Boost with 'Space'." broadcast="true">1246 <SimpleNotification message="Return before it's too late. Boost with (Space)." broadcast="true"> 905 1247 <events> 906 1248 <trigger> … … 919 1261 920 1262 921 922 1263 <!-- @Objects: 6 pirates, heading towards DuBall, attacking --> 1264 <!-- TODO: re-hide pirates on early end--> 923 1265 <!-- 1 --> 924 1266 <SpaceShip position="3000,-4000,4000" lookat="-1300,-600,900" name="attacker"visible="true"> … … 1065 1407 </controller> 1066 1408 </SpaceShip> 1409 1067 1410 1068 1411 <!-- @Triggers: attacktriggerX <-> X enemies destroyed , X is an element of [1,6] --> … … 1142 1485 </events> 1143 1486 </SimpleNotification> 1487 1144 1488 <SimpleNotification message="One enemy left!" broadcast="true"> 1145 1489 <events> … … 1149 1493 </events> 1150 1494 </SimpleNotification> 1495 1151 1496 <SimpleNotification message="Well done. You finished this tutorial." broadcast="true"> 1152 1497 <events> … … 1158 1503 1159 1504 <!-- @Triggers: postAttack <-> delayed attacktrigger6 --> 1160 <EventTrigger name="postAttack1" activations="1" stayactive="true" delay= 3>1505 <EventTrigger name="postAttack1" activations="1" stayactive="true" delay=4.1> 1161 1506 <events> 1162 1507 <trigger> … … 1166 1511 </EventTrigger> 1167 1512 1168 <EventTrigger name="postAttack2" activations="1" stayactive="true" delay= 6>1513 <EventTrigger name="postAttack2" activations="1" stayactive="true" delay=8.2> 1169 1514 <events> 1170 1515 <trigger> … … 1174 1519 </EventTrigger> 1175 1520 1176 <SimpleNotification message="Either quit by pressing 'Esc'or ..." broadcast="true">1521 <SimpleNotification message="Either quit by pressing (Esc) or ..." broadcast="true"> 1177 1522 <events> 1178 1523 <trigger> … … 1192 1537 <!-------------------------------------- |Bonus Part| ---------------------------------------> 1193 1538 <!-- @Triggers: "bonusX" <-> delayed "attacktrigger6" --> 1194 <EventTrigger name="bonus1" activations="1" stayactive="true" delay=1 0>1539 <EventTrigger name="bonus1" activations="1" stayactive="true" delay=12.3> 1195 1540 <events> 1196 1541 <trigger> … … 1199 1544 </events> 1200 1545 </EventTrigger> 1201 <EventTrigger name="bonus2" activations="1" stayactive="true" delay=16 >1546 <EventTrigger name="bonus2" activations="1" stayactive="true" delay=16.4> 1202 1547 <events> 1203 1548 <trigger> … … 1213 1558 </events> 1214 1559 </EventTrigger> 1215 <EventTrigger name="bonus4" activations="1" stayactive="true" delay=28 >1560 <EventTrigger name="bonus4" activations="1" stayactive="true" delay=28.1> 1216 1561 <events> 1217 1562 <trigger> … … 1220 1565 </events> 1221 1566 </EventTrigger> 1222 <EventTrigger name="bonus5" activations="1" stayactive="true" delay=32. 1>1567 <EventTrigger name="bonus5" activations="1" stayactive="true" delay=32.3> 1223 1568 <events> 1224 1569 <trigger> … … 1227 1572 </events> 1228 1573 </EventTrigger> 1229 <EventTrigger name="bonus6" activations="1" stayactive="true" delay=36. 2>1574 <EventTrigger name="bonus6" activations="1" stayactive="true" delay=36.5> 1230 1575 <events> 1231 1576 <trigger> … … 1234 1579 </events> 1235 1580 </EventTrigger> 1236 <EventTrigger name="bonus7" activations="1" stayactive="true" delay=4 >1581 <EventTrigger name="bonus7" activations="1" stayactive="true" delay=4.1> 1237 1582 <events> 1238 1583 <trigger> … … 1244 1589 1245 1590 1246 <SimpleNotification message="Rotate your ship. Press 'Q' or 'E'. " broadcast="true">1591 <SimpleNotification message="Rotate your ship. Press (Q) or (E). " broadcast="true"> 1247 1592 <events> 1248 1593 <trigger> … … 1252 1597 </SimpleNotification> 1253 1598 1254 <SimpleNotification message="Switch the camera's position. Press 'C'. " broadcast="true">1599 <SimpleNotification message="Switch the camera's position. Press (C). " broadcast="true"> 1255 1600 <events> 1256 1601 <trigger> … … 1260 1605 </SimpleNotification> 1261 1606 1262 <SimpleNotification message="360° view: press 'Ctrl'+ use the mouse " broadcast="true">1607 <SimpleNotification message="360° view: press (Ctrl) + use the mouse " broadcast="true"> 1263 1608 <events> 1264 1609 <trigger> … … 1292 1637 </SimpleNotification> 1293 1638 1294 <SimpleNotification message="Press 'Esc'and return to the main menu." broadcast="true">1639 <SimpleNotification message="Press (Esc) and return to the main menu." broadcast="true"> 1295 1640 <events> 1296 1641 <trigger> … … 1319 1664 </Scene> 1320 1665 </Level> 1321 <!-- TODO: 1322 ! Quest Interface 1323 - Foolproof text messages (e.g. verspätete Nachrichten unterdrücken) 1324 - Radar visibility & Hud Markers (done) 1666 1667 <!-- TODO: 1668 - Story & more precise Questmessages; more quest hints; fail-quest; 1669 - Colouring: Show who is friend or foe via the colour 1670 - Waypoints: show the player the way 1671 - Foolproof text messages (e.g. verspätete Nachrichten unterdrücken ~done ) 1325 1672 - End Tutorial, if either the Hydrogen Farmer or the SpaceCruiser gets destroyed. (~done) 1326 1327 1673 --> -
code/trunk/data/levels/myTestLevel.oxw
r8706 r9016 3 3 description = "A level to test the Class SpaceBoundaries." 4 4 tags = "test" 5 screenshot = "mytestlevel.png" 5 6 /> 6 7 … … 16 17 ?> 17 18 18 <Level 19 name = "Sample" 20 description = "Just a few tests" 21 > 19 <Level> 22 20 <templates> 23 21 <Template link=lodtemplate_default /> -
code/trunk/data/levels/notifications.oxw
r8706 r9016 3 3 description = "Level to test and showcase notifications." 4 4 tags = "test, showcase" 5 screenshot = "notificationsshowcase.png" 5 6 /> 6 7 … … 12 13 ?> 13 14 14 <Level 15 name = "Presentation" 16 description = "A simple testlevel" 17 > 15 <Level> 18 16 <templates> 19 17 <Template link=lodtemplate_default /> -
code/trunk/data/levels/pickups.oxw
r8706 r9016 3 3 description = "Level to test and showcase pickups." 4 4 tags = "test, showcase" 5 screenshot = "pickupsshowcase.png" 5 6 /> 6 7 … … 16 17 ?> 17 18 18 <Level 19 name = "Sample" 20 description = "Just a few tests" 21 > 19 <Level> 22 20 <templates> 23 21 <Template link=lodtemplate_default /> -
code/trunk/data/levels/pirateAttack.oxw
r8706 r9016 2 2 name = "Pirate Attack" 3 3 description = "Dani's Testlevel" 4 tags = "test" 4 tags = "mission" 5 screenshot = "pirateattack.png" 5 6 /> 6 7 … … 28 29 name="Dani's Testlevel" 29 30 description="Erste Versuche mit den Quests" 30 gametype= TeamDeathmatch31 gametype=Mission 31 32 > 32 33 -
code/trunk/data/levels/planets.oxw
r8891 r9016 3 3 description = "Demonstration of Planets" 4 4 tags = "showcase" 5 screenshot = "planetdemonstration.png" 5 6 /> 6 7 … … 12 13 ?> 13 14 14 <Level 15 name = "Planet" 16 description = "Demonstration of Planets" 17 > 15 <Level> 18 16 <templates> 19 17 <Template link="lodtemplate_default" /> -
code/trunk/data/levels/pong.oxw
r8706 r9016 2 2 name = "Pong" 3 3 description = "Pong in space!" 4 tags = "" 4 tags = "minigame" 5 screenshot = "pong.png" 5 6 /> 6 7 … … 49 50 50 51 <Level 51 name = "Presentation" 52 description = "A simple testlevel" 53 gametype = Pong 52 gametype = "Pong" 54 53 > 55 54 <templates> -
code/trunk/data/levels/portals.oxw
r8706 r9016 3 3 name = "Portals" 4 4 description = "Level for testing portals" 5 tags = "tutorial" 5 tags = "test" 6 screenshot = "portals.png" 6 7 /> 7 8 … … 14 15 ?> 15 16 16 <Level 17 name = "Presentation" 18 description = "A simple testlevel" 19 > 17 <Level> 20 18 <templates> 21 19 <Template link=lodtemplate_default /> -
code/trunk/data/levels/presentation.oxw
r8706 r9016 3 3 description = "Presentation Level" 4 4 tags = "presentation" 5 screenshot = "presentation.png" 5 6 /> 6 7 … … 12 13 ?> 13 14 14 <Level 15 name = "Sample" 16 description = "Just a few tests" 17 > 15 <Level> 18 16 <templates> 19 17 <Template link=lodtemplate_default /> -
code/trunk/data/levels/presentation09.oxw
r8706 r9016 3 3 description = "3rd Presentation level for Orxonox Convention X" 4 4 tags = "presentation" 5 screenshot = "presentationx3rd.png" 5 6 /> 6 7 … … 13 14 ?> 14 15 15 <Level 16 name = "Presentation09" 17 description = "presentation level for Orxonox Convention X" 18 19 > 16 <Level> 20 17 <templates> 21 18 <Template link=lodtemplate_default /> -
code/trunk/data/levels/presentation09b.oxw
r8706 r9016 3 3 description = "2nd Presentation level for Orxonox Convention X" 4 4 tags = "presentation" 5 screenshot = "presentationx2.png" 5 6 /> 6 7 … … 16 17 17 18 <Level 18 name = "Presentation09" 19 description = "presentation level for Orxonox Convention X" 20 gametype = TeamDeathmatch 19 gametype = "TeamDeathmatch" 21 20 > 22 21 <templates> -
code/trunk/data/levels/presentationDM.oxw
r8858 r9016 3 3 description = "Presentation Level" 4 4 tags = "presentation" 5 screenshot = "presentationdm.png" 5 6 /> 6 7 … … 14 15 15 16 <Level 16 name = "Presentation" 17 description = "A simple testlevel" 18 gametype = Deathmatch 17 gametype = "Deathmatch" 19 18 > 20 19 <templates> -
code/trunk/data/levels/presentationFS10.oxw
r8706 r9016 3 3 description = "1st Presentation level for Orxonox Convention XI" 4 4 tags = "presentation" 5 screenshot = "presentationxi.png" 5 6 /> 6 7 … … 19 20 20 21 <Level 21 name = "Sample" 22 description = "Just a few tests" 23 gametype = TeamDeathmatch 22 gametype = "TeamDeathmatch" 24 23 > 25 24 <templates> -
code/trunk/data/levels/presentationFS102.oxw
r8706 r9016 3 3 description = "2nd Presentation level for Orxonox Convention XI, FPS" 4 4 tags = "presentation" 5 screenshot = "presentationxifps1st.png" 5 6 /> 6 7 … … 14 15 ?> 15 16 16 <Level 17 name = "fps" 18 description = "tests" 19 > 17 <Level> 20 18 <templates> 21 19 <Template link=lodtemplate_default /> -
code/trunk/data/levels/presentationFS10Ed.oxw
r8706 r9016 3 3 description = "3rd Presentation level for Orxonox Convention XI, FPS" 4 4 tags = "presentation" 5 screenshot = "presentationxifps2nd.png" 5 6 /> 6 7 … … 14 15 ?> 15 16 16 <Level 17 name = "fps" 18 description = "tests" 19 > 17 <Level> 20 18 <templates> 21 19 <Template link=lodtemplate_default /> -
code/trunk/data/levels/presentationFS11.oxw
r8706 r9016 2 2 name = "Presentation FS11" 3 3 description = "Presentation level spring semester '11" 4 tags = "test" 4 tags = "presentation" 5 screenshot = "presentationfs11.png" 5 6 /> 6 7 … … 21 22 ?> 22 23 23 <Level 24 name = "Sample" 25 description = "Just a few tests" 26 > 24 <Level> 27 25 <templates> 28 26 <Template link=lodtemplate_default /> -
code/trunk/data/levels/presentationHS09.oxw
r8706 r9016 3 3 description = "1st Presentation level for Orxonox Convention X" 4 4 tags = "presentation" 5 screenshot = "presentationx1st.png" 5 6 /> 6 7 … … 16 17 17 18 <Level 18 name = "Presentation09" 19 description = "presentation level for Orxonox Convention X" 20 gametype = TeamDeathmatch 19 gametype = "TeamDeathmatch" 21 20 hasPhysics = true 22 21 > -
code/trunk/data/levels/presentationHS09b.oxw
r8706 r9016 3 3 description = "2nd Presentation level for Orxonox Convention X" 4 4 tags = "presentation" 5 screenshot = "presentationx2nd.png" 5 6 /> 6 7 … … 22 23 23 24 <Level 24 name = "Sample" 25 description = "Just a few tests" 26 gametype = TeamDeathmatch 25 gametype = "TeamDeathmatch" 27 26 > 28 27 <templates> -
code/trunk/data/levels/princessAeryn.oxw
r8706 r9016 2 2 name = "The Tale of Princess Aeryn" 3 3 description = "The Tale of the elusive but beautiful Princess Aeryn" 4 tags = "" 4 tags = "mission" 5 screenshot = "thetaleofprincessaeryn.png" 5 6 /> 6 7 … … 16 17 ?> 17 18 18 <Level 19 name = "The Tale of Princess Aeryn" 20 description = "The Tale of Princess Aeryn" 21 > 19 <Level> 22 20 23 21 <templates> -
code/trunk/data/levels/quests.oxw
r8706 r9016 3 3 description = "Level to test and showcase quests." 4 4 tags = "test, showcase" 5 screenshot = "questsshowcase.png" 5 6 /> 6 7 … … 12 13 ?> 13 14 14 <Level 15 name = "Questsystem" 16 description = "Just a few tests" 17 > 15 <Level> 18 16 <templates> 19 17 <Template link=lodtemplate_default /> -
code/trunk/data/levels/screenshot.oxw
r8706 r9016 2 2 name = "Screenshot" 3 3 description = "Level to make awesome screenshots in." 4 tags = "test" 4 tags = "test, showcase" 5 screenshot = "screenshot.png" 5 6 /> 6 7 … … 15 16 16 17 <Level 17 name = "Waypoints" 18 description = "Testing waypoings for AI controlled spaceships." 19 gametype = TeamDeathmatch 18 gametype = "TeamDeathmatch" 20 19 > 21 20 <templates> -
code/trunk/data/levels/shieldTest.oxw
r8706 r9016 3 3 description = "A simple Level with one shielded drone to shoot at" 4 4 tags = "test" 5 screenshot = "shieldtestlevel.png" 5 6 /> 6 7 … … 12 13 ?> 13 14 14 <Level 15 name = "shieldTL" 16 description = "LEVEL-DESCRIPTION" 17 > 15 <Level> 18 16 19 17 <templates> -
code/trunk/data/levels/sound.oxw
r8706 r9016 2 2 name = "Sound showcase" 3 3 description = "Level to test and showcase sound." 4 tags = "test" 4 tags = "test, showcase" 5 screenshot = "soundshowcase.png" 5 6 /> 6 7 … … 16 17 ?> 17 18 18 <Level 19 name = "Sample" 20 description = "Just a few tests" 21 > 19 <Level> 22 20 <templates> 23 21 <Template link=lodtemplate_default /> -
code/trunk/data/levels/spaceRace.oxw
r8706 r9016 1 1 <LevelInfo 2 name = "Space Race" 3 description = "Test level for the gametype Space Race." 4 tags = "test" 2 name = "Old Space Race" 3 description = "Have a furious Race in Space: Reach the checkpoints as fast as possible." 4 tags = "gametype" 5 screenshot = "spacerace.png" 5 6 /> 6 7 … … 17 18 18 19 <Level 19 name = "Space Race" 20 description = "Test level for the gametype Space Race." 21 gametype = SpaceRace 20 gametype = "OldSpaceRace" 22 21 > 23 22 <templates> … … 53 52 54 53 <!-- ------------------CheckPoints----------------- --> 55 < RaceCheckPoint name="checkpoint1" position="0,-2000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false">56 <attached> 57 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> 58 </attached> 59 <collisionShapes> 60 <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" /> 61 <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" /> 62 <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" /> 63 <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" /> 64 </collisionShapes> 65 </ RaceCheckPoint>66 67 < RaceCheckPoint name="checkpoint2" position="0,-900,2300" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false">54 <OldRaceCheckPoint name="checkpoint1" position="0,-2000,1000" direction="0,-1,1" collisionType="static" scale="1" distance="40" checkpointindex="0" islast="false"> 55 <attached> 56 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> 57 </attached> 58 <collisionShapes> 59 <BoxCollisionShape position="0,0,55" halfExtents="55, 10, 10" /> 60 <BoxCollisionShape position="0,0,-55" halfExtents="55, 10, 10" /> 61 <BoxCollisionShape position="55,0,0" halfExtents="10, 10, 55" /> 62 <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" /> 63 </collisionShapes> 64 </OldRaceCheckPoint> 65 66 <OldRaceCheckPoint name="checkpoint2" position="0,-900,2300" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="1" islast="false"> 68 67 <attached> 69 68 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> … … 97 96 <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" /> 98 97 </collisionShapes> 99 </ RaceCheckPoint>100 101 < RaceCheckPoint name="checkpoint3" position="0,700,2700" stayActive="true" direction="0,0,1" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false">98 </OldRaceCheckPoint> 99 100 <OldRaceCheckPoint name="checkpoint3" position="0,700,2700" stayActive="true" direction="0,0,1" collisionType="static" scale="1" distance="40" checkpointindex="2" islast="false"> 102 101 <attached> 103 102 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> … … 131 130 <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" /> 132 131 </collisionShapes> 133 </ RaceCheckPoint>134 135 < RaceCheckPoint name="checkpoint4" position="0,2100,2300" stayActive="true" direction="0,1,1" collisionType="static" scale="1" distance="40" checkpointindex="3" islast="false">132 </OldRaceCheckPoint> 133 134 <OldRaceCheckPoint name="checkpoint4" position="0,2100,2300" stayActive="true" direction="0,1,1" collisionType="static" scale="1" distance="40" checkpointindex="3" islast="false"> 136 135 <attached> 137 136 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> … … 166 165 <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" /> 167 166 </collisionShapes> 168 </ RaceCheckPoint>169 170 < RaceCheckPoint name="checkpoint5" position="0,2200,500" stayActive="true" direction="0,1,0" collisionType="static" scale="1" distance="40" checkpointindex="4" islast="false">167 </OldRaceCheckPoint> 168 169 <OldRaceCheckPoint name="checkpoint5" position="0,2200,500" stayActive="true" direction="0,1,0" collisionType="static" scale="1" distance="40" checkpointindex="4" islast="false"> 171 170 <attached> 172 171 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> … … 201 200 <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" /> 202 201 </collisionShapes> 203 </ RaceCheckPoint>204 205 < RaceCheckPoint name="checkpoint6" position="0,1500,-800" stayActive="true" direction="0,1,-1" collisionType="static" scale="1" distance="40" checkpointindex="5" islast="false">202 </OldRaceCheckPoint> 203 204 <OldRaceCheckPoint name="checkpoint6" position="0,1500,-800" stayActive="true" direction="0,1,-1" collisionType="static" scale="1" distance="40" checkpointindex="5" islast="false"> 206 205 <attached> 207 206 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> … … 236 235 <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" /> 237 236 </collisionShapes> 238 </ RaceCheckPoint>239 240 < RaceCheckPoint name="checkpoint7" position="0,200,-1900" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="6" islast="false">237 </OldRaceCheckPoint> 238 239 <OldRaceCheckPoint name="checkpoint7" position="0,200,-1900" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="6" islast="false"> 241 240 <attached> 242 241 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> … … 271 270 <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" /> 272 271 </collisionShapes> 273 </ RaceCheckPoint>274 275 < RaceCheckPoint name="checkpoint8" position="0,-700,-1400" stayActive="true" direction="0,-1,-1" collisionType="static" scale="1" distance="40" checkpointindex="7" islast="false">272 </OldRaceCheckPoint> 273 274 <OldRaceCheckPoint name="checkpoint8" position="0,-700,-1400" stayActive="true" direction="0,-1,-1" collisionType="static" scale="1" distance="40" checkpointindex="7" islast="false"> 276 275 <attached> 277 276 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> … … 306 305 <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" /> 307 306 </collisionShapes> 308 </ RaceCheckPoint>309 310 < RaceCheckPoint name="checkpoint9" position="0,-1300,-800" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="8" islast="false">307 </OldRaceCheckPoint> 308 309 <OldRaceCheckPoint name="checkpoint9" position="0,-1300,-800" stayActive="true" collisionType="static" scale="1" distance="40" checkpointindex="8" islast="false"> 311 310 <attached> 312 311 <Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> … … 332 331 <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" /> 333 332 </collisionShapes> 334 </ RaceCheckPoint>335 336 < RaceCheckPoint name="checkpoint10" position="0,-2100,0" collisionType="static" scale="1" distance="40" checkpointindex="9" islast="true" timelimit="150">333 </OldRaceCheckPoint> 334 335 <OldRaceCheckPoint name="checkpoint10" position="0,-2100,0" collisionType="static" scale="1" distance="40" checkpointindex="9" islast="true" timelimit="150"> 337 336 <attached> 338 337 < Model mass="50" scale="50" mesh="raceCheckPoint.mesh" /> … … 344 343 <BoxCollisionShape position="-55,0,0" halfExtents="10, 10, 55" /> 345 344 </collisionShapes> 346 </ RaceCheckPoint>345 </OldRaceCheckPoint> 347 346 348 347 <!-- ------------------Planet----------------- --> -
code/trunk/data/levels/teamBaseMatch.oxw
r8706 r9016 1 1 <LevelInfo 2 2 name = "Teambase Match" 3 description = "Fight for the bases." 4 tags = "" 3 description = "Fight for the bases. Capture bases by shooting at them and defend them against attackers." 4 tags = "gametype" 5 screenshot = "teambasematch.png" 5 6 /> 6 7 … … 15 16 16 17 <Level 17 name = "Presentation" 18 description = "A simple testlevel" 19 gametype = TeamBaseMatch 18 gametype = "TeamBaseMatch" 20 19 > 21 20 -
code/trunk/data/levels/teamDeathMatch.oxw
r8706 r9016 2 2 name = "Team Deathmatch" 3 3 description = "Fight against each other in teams." 4 tags = "" 4 tags = "gametype" 5 screenshot = "teamdeathmatch.png" 5 6 /> 6 7 … … 15 16 16 17 <Level 17 name = "Waypoints" 18 description = "Testing waypoings for AI controlled spaceships." 19 gametype = TeamDeathmatch 18 gametype = "TeamDeathmatch" 20 19 > 21 20 <templates> -
code/trunk/data/levels/templates/spaceshipSpacecruiser.oxt
r8891 r9016 11 11 initialhealth = 300 12 12 13 shieldhealth = 6014 initialshieldhealth = 6015 maxshieldhealth = 8016 shieldabsorption = 0. 813 shieldhealth = 75 14 initialshieldhealth = 75 15 maxshieldhealth = 90 16 shieldabsorption = 0.9 17 17 reloadrate = 1 18 18 reloadwaittime = 1 … … 45 45 </engines> 46 46 <attached> 47 <Model position="12,- 30,-120" yaw=90 pitch=-90 roll=0 scale=6 mesh="spacecruiser.mesh" />47 <Model position="12,-5,-10" yaw=90 pitch=-90 roll=0 scale=6 mesh="spacecruiser.mesh" /> 48 48 <!--Model mesh="cube.mesh" mass=10 position="0,-30,-108" scale3D="38,6,62" /> 49 49 <Model mesh="cube.mesh" mass=10 position="0,-20,-108" scale3D="20,6,40" /> … … 57 57 </attached> 58 58 <collisionShapes> 59 <BoxCollisionShape position="0,- 30,-108"halfExtents="38,6,62" />60 <BoxCollisionShape position="0, -20,-108"halfExtents="20,6,40" />61 <BoxCollisionShape position="-16,- 35,-112"halfExtents="15,5,57" roll=-14 pitch=3.5/>62 <BoxCollisionShape position="16,- 35,-112" halfExtents="15,5,57" roll=14pitch=3.5/>63 <BoxCollisionShape position="19, -21.5,-108"halfExtents="18,5,52" roll=-21 />64 <BoxCollisionShape position="-19, -21.5,-108"halfExtents="18,5,52" roll=21/>65 <BoxCollisionShape position="0, -21,-169"halfExtents="18,1,16" pitch=-30x/>59 <BoxCollisionShape position="0,-5,2" halfExtents="38,6,62" /> 60 <BoxCollisionShape position="0,5,2" halfExtents="20,6,40" /> 61 <BoxCollisionShape position="-16,-10,-2" halfExtents="15,5,57" roll=-14 pitch=3.5/> 62 <BoxCollisionShape position="16,-10,-2" halfExtents="15,5,57" roll=14 pitch=3.5/> 63 <BoxCollisionShape position="19,3.5,2" halfExtents="18,5,52" roll=-21 /> 64 <BoxCollisionShape position="-19,4.5,2" halfExtents="18,5,52" roll=21 /> 65 <BoxCollisionShape position="0,4,-59" halfExtents="18,1,16" pitch=-30/> 66 66 67 67 </collisionShapes> 68 68 <?lua 69 include(" includes/weaponSettingsSpacecruiser.oxi")69 include("../includes/weaponSettingsSpacecruiser.oxi") 70 70 ?> 71 71 </SpaceShip> … … 75 75 <SpaceShip> 76 76 <camerapositions> 77 <CameraPosition position="0,10, 40" drag=true mouselook=true /> 78 <CameraPosition position="0,20, 80" drag=true mouselook=true /> 79 <CameraPosition position="0,30, 120" drag=true mouselook=true /> 80 <CameraPosition position="0,20,-260" drag=true mouselook=true yaw=180/> 81 <CameraPosition position="0,30,-350" drag=true mouselook=true yaw=180/> 82 <!--CameraPosition position="0,150,-25" pitch=-90 drag=true /> 83 <CameraPosition position="0,0,-40" yaw=180 drag=true /> 84 <CameraPosition position="0,3,-14" yaw=0 /> 85 <CameraPosition position="-50,5,-8" yaw=-90 drag=true /> 86 <CameraPosition position="50,5,-8" yaw=90 drag=true /--> 77 <CameraPosition position="0,40, 170" drag=true mouselook=true /> 78 <CameraPosition position="0,55, 230" drag=true mouselook=true /> 79 <CameraPosition position="0,65, 460" drag=true mouselook=true /> 87 80 </camerapositions> 88 81 </SpaceShip> … … 93 86 boostfactor = 2 94 87 95 speedfront = 15096 speedback = 5097 speedleftright = 5098 speedupdown = 5088 speedfront = 200 89 speedback = 70 90 speedleftright = 70 91 speedupdown = 70 99 92 100 93 defEngineSndNormal = "sounds/Engine_low.ogg" … … 111 104 </EffectContainer> 112 105 <EffectContainer condition="not idle"> 113 <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 />114 <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 />106 <FadingBillboard mainstate=activity active=false scale=0.1 position="20, 0, 70" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 /> 107 <FadingBillboard mainstate=activity active=false scale=0.1 position="-20, 0, 70" colour="0.2, 0.65, 1.0, 1.0" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 /> 115 108 </EffectContainer> 116 109 <EffectContainer condition="normal or brake"> … … 118 111 </EffectContainer> 119 112 <EffectContainer condition="normal or boost"> 120 <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" />121 <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" />113 <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 20, 0, 70" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1300 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" /> 114 <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-20, 0, 70" colour="0.2, 0.65, 1.0, 1.0" width=15 length=1300 lifetime=2 elements=50 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Flares/ThrusterFlare1" /> 122 115 </EffectContainer> 123 116 <EffectContainer condition="boost"> 124 <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" />125 <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" />117 <Backlight mainstate=activity active=false scale=0.4 name=bltest position=" 20, 0, 70" colour="0.6, 0.75, 0.8, 0.7" width=40 length=800 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" /> 118 <Backlight mainstate=activity active=false scale=0.4 name=bltest position="-20, 0, 70" colour="0.6, 0.75, 0.8, 0.7" width=40 length=800 lifetime=1 elements=30 trailmaterial="Trail/backlighttrail" turnontime=1 turnofftime=1 material="Examples/Flare" /> 126 119 </EffectContainer> 127 120 <!-- <EffectContainer condition="brake"> 128 <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 />129 <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 />130 <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 />131 <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 />121 <FadingBillboard mainstate=activity active=false scale=0.3 position=" 20, 0, 70" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 /> 122 <FadingBillboard mainstate=activity active=false scale=0.3 position="-20, 0, 70" colour="0.5, 0.0, 0.0, 0.3" material="Examples/Flare" turnontime=0.5 turnofftime=0.5 /> 123 <FadingBillboard mainstate=activity active=false scale=0.15 position="20, 0, 70" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 /> 124 <FadingBillboard mainstate=activity active=false scale=0.15 position="-20, 0, 70" colour="1.0, 0.0, 0.0, 1.0" material="Flares/backlightflare" turnontime=0.5 turnofftime=0.5 /> 132 125 </EffectContainer> 133 126 --> -
code/trunk/data/levels/testStars.oxw
r8706 r9016 3 3 description = "Level to test stars" 4 4 tags = "test" 5 screenshot = "starstestlevel.png" 5 6 /> 6 7 … … 16 17 ?> 17 18 18 <Level 19 name = "Sample" 20 description = "Just a few tests" 21 > 19 <Level> 22 20 <templates> 23 21 <Template link=lodtemplate_default /> -
code/trunk/data/levels/testSwallow.oxw
r8706 r9016 3 3 description = "Level to test the swallow spaceship." 4 4 tags = "test" 5 screenshot = "swallowtestlevel.png" 5 6 /> 6 7 … … 13 14 ?> 14 15 15 <Level 16 name = "Presentation_swallow" 17 description = "presentation level for Orxonox Convention X" 18 19 > 16 <Level> 20 17 21 18 <templates> -
code/trunk/data/levels/tetris.oxw
r8706 r9016 2 2 name = "Tetris" 3 3 description = "Tetris in space!" 4 tags = "" 4 tags = "minigame" 5 screenshot = "tetris.png" 5 6 /> 6 7 … … 30 31 31 32 <Level 32 name = "Presentation" 33 description = "A simple testlevel" 34 gametype = "Tetris" 33 gametype = "Tetris" 35 34 > 36 35 <templates> -
code/trunk/data/levels/theTimeMachine.oxw
r8706 r9016 2 2 name = "The Time Machine" 3 3 description = "A simple level. The only goal is to defeat as much enemies as you can." 4 tags = "singleplayer" 4 tags = "gametype" 5 screenshot = "thetimemachine.png" 5 6 /> 6 7 … … 61 62 62 63 <Level 63 name="The Time Machine" 64 description="A simple level. The only goal is to defeat as much enemies as you can." 65 gametype=TeamDeathmatch 64 gametype = "TeamDeathmatch" 66 65 > 67 66 <templates> -
code/trunk/data/levels/tutorial.oxw
r8706 r9016 3 3 description = "Level for the coding tutorial." 4 4 tags = "tutorial" 5 screenshot = "codingtutorial.png" 5 6 /> 6 7 … … 12 13 ?> 13 14 14 <Level 15 name = "Presentation" 16 description = "A simple testlevel" 17 > 15 <Level> 18 16 <templates> 19 17 <Template link=lodtemplate_default /> -
code/trunk/data/levels/underAttack.oxw
r8706 r9016 1 <LevelInfo 2 name = "Under Attack" 3 description = "Fight the transporter." 4 tags = "gametype" 5 screenshot = "underattack.png" 6 /> 7 1 8 <?lua 2 9 include("HUDTemplates3.oxo") 3 10 include("stats.oxo") 4 include("underAttackHUD.oxo")5 11 include("templates/spaceshipAssff.oxt") 6 12 include("templates/lodInformation.oxt") 7 13 ?> 14 <!--OUTDATED: include("underAttackHUD.oxo") --> 8 15 9 16 <Level 10 name = "UnderAttack testing" 11 description = "A simple testlevel" 12 gametype = UnderAttack 17 gametype = "UnderAttack" 13 18 > 14 19 <templates> … … 51 56 maxhealth = 10000 52 57 initialhealth = 10000 58 RVName = "Transporter" 53 59 > 54 60 -
code/trunk/data/levels/waypoints.oxw
r8706 r9016 3 3 description = "Testing waypoings for AI controlled spaceships." 4 4 tags = "test" 5 screenshot = "waypointstestlevel.png" 5 6 /> 6 7 … … 14 15 ?> 15 16 16 <Level 17 name = "Waypoints" 18 description = "Testing waypoings for AI controlled spaceships." 19 > 17 <Level> 20 18 <templates> 21 19 <Template link=lodtemplate_default /> -
code/trunk/data/overlays/HUDTemplates3.oxo
r8706 r9016 78 78 </HUDBoostBar> 79 79 80 <HUDEnemyHealthBar 81 name = "EnemyHealthBar" 82 background = "Orxonox/HealthBarBackground" 83 size = "0.35, 0.0875" 84 position = "1.0 , 0.1 " 85 pickpoint = "1, 1" 86 bartexture = "healthbar_bar.png" 87 textfont = "VeraMono" 88 textusebarcolour = true 89 textsize = 0.039 90 textoffset = "0.315, 0.05" 91 textpickpoint = "0, 0" 92 textalign = "right" 93 correctaspect = false 94 textcorrectaspect = false 95 > 96 <BarColour position = 0.0 colour = "0.7,0.2,0.2" /> 97 <BarColour position = 0.5 colour = "0.7,0.7,0.2" /> 98 <BarColour position = 1.0 colour = "0.2,0.7,0.2" /> 99 </HUDEnemyHealthBar> 100 80 101 <HUDNavigation 81 102 name = "Navigation" -
code/trunk/data/overlays/underAttackHUD.oxo
r7679 r9016 1 < Template name="UnderAttackHUD">1 < Template name="UnderAttackHUD"> 2 2 <OverlayGroup name="UnderAttackHUD" scale = "1, 1"> 3 < UnderAttackHealthBar3 <OUTDATED-- UnderAttackHealthBar 4 4 name = "HealthBar" 5 5 background = "Orxonox/HealthBarBackground" -
code/trunk/src/libraries/core/GUIManager.cc
r8862 r9016 223 223 224 224 GUIManager* GUIManager::singletonPtr_s = 0; 225 /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen"; 225 /*static*/ const std::string GUIManager::defaultScheme_ = "TaharezGreen"; //Alternative: Orxonox (not fully complete yet, see the graphics menu) 226 226 227 227 SetConsoleCommand("showGUI", &GUIManager::showGUI).defaultValue(1, false).defaultValue(2, false); -
code/trunk/src/libraries/util/SignalHandler.cc
r8858 r9016 70 70 71 71 catchSignal( SIGSEGV ); 72 catchSignal( SIGABRT ); 72 catchSignal( SIGABRT ); 73 73 catchSignal( SIGILL ); 74 74 } … … 675 675 676 676 /// Returns a description of the given exception. 677 // Based on code from Dr. Mingw by Jos éFonseca677 // Based on code from Dr. Mingw by Jos\E9 Fonseca 678 678 /* static */ std::string SignalHandler::getExceptionType(PEXCEPTION_POINTERS pExceptionInfo) 679 679 { … … 745 745 746 746 /// Retrieves the base address of the module that contains the specified address. 747 // Code from Dr. Mingw by Jos éFonseca747 // Code from Dr. Mingw by Jos\E9 Fonseca 748 748 /* static */ DWORD SignalHandler::getModuleBase(DWORD dwAddress) 749 749 { -
code/trunk/src/modules/gametypes/CMakeLists.txt
r8706 r9016 2 2 SpaceRace.cc 3 3 RaceCheckPoint.cc 4 SpaceRaceManager.cc 5 OldSpaceRace.cc 6 OldRaceCheckPoint.cc 4 7 ) 5 8 -
code/trunk/src/modules/gametypes/GametypesPrereqs.h
r8706 r9016 66 66 { 67 67 class SpaceRace; 68 class OldSpaceRace; 68 69 } 69 70 -
code/trunk/src/modules/gametypes/RaceCheckPoint.cc
r8858 r9016 34 34 #include "chat/ChatManager.h" 35 35 36 #include <infos/PlayerInfo.h> 37 #include <worldentities/ControllableEntity.h> 38 36 39 #include "SpaceRace.h" 37 40 … … 39 42 { 40 43 CreateFactory(RaceCheckPoint); 44 45 41 46 42 RaceCheckPoint::RaceCheckPoint(BaseObject* creator): Distance Trigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this))47 RaceCheckPoint::RaceCheckPoint(BaseObject* creator): DistanceMultiTrigger(creator), RadarViewable(creator, static_cast<WorldEntity*>(this)) 43 48 { 44 49 RegisterObject(RaceCheckPoint); 45 46 this->bCheckpointIndex_ = 0; 47 this->bIsLast_ = false; 50 this->setDistance(100); 51 this->setBeaconMode("off"); 52 this->setBroadcast(false); 53 this->setSimultaneousTriggerers(100); 48 54 this->bTimeLimit_ = 0; 49 55 … … 51 57 this->setRadarObjectShape(RadarViewable::Triangle); 52 58 this->setRadarVisibility(false); 59 this->settingsChanged(); 60 this->reached_=NULL; 61 53 62 } 63 54 64 55 RaceCheckPoint::~RaceCheckPoint() 56 { 57 } 65 RaceCheckPoint::~RaceCheckPoint() 66 { 67 68 } 58 69 59 70 void RaceCheckPoint::tick(float dt) … … 63 74 SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get()); 64 75 assert(gametype); 65 if (this->getCheckpointIndex() == gametype->getCheckpointsReached())66 this->setRadarVisibility(true);67 else68 this->setRadarVisibility(false);69 76 } 70 77 … … 72 79 { 73 80 SUPER(RaceCheckPoint, XMLPort, xmlelement, mode); 74 81 Vector3 v= Vector3(0,0,0); 75 82 XMLPortParam(RaceCheckPoint, "checkpointindex", setCheckpointIndex, getCheckpointIndex, xmlelement, mode).defaultValues(0); 76 83 XMLPortParam(RaceCheckPoint, "islast", setLast, getLast, xmlelement, mode).defaultValues(false); 77 84 XMLPortParam(RaceCheckPoint, "timelimit", setTimelimit, getTimeLimit, xmlelement, mode).defaultValues(0); 85 XMLPortParamTemplate(RaceCheckPoint, "nextcheckpoints", setNextcheckpoint, getNextcheckpoint, xmlelement, mode,const Vector3&).defaultValues(v); 78 86 } 79 87 80 void RaceCheckPoint:: triggered(bool bIsTriggered)88 void RaceCheckPoint::fire(bool bIsTriggered,BaseObject* player) 81 89 { 82 Distance Trigger::triggered(bIsTriggered);83 90 DistanceMultiTrigger::fire((bool)bIsTriggered,player); 91 84 92 SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get()); 85 if (gametype && this->getCheckpointIndex() == gametype->getCheckpointsReached() && bIsTriggered) 86 { 87 gametype->clock_.capture(); 88 float time = gametype->clock_.getSecondsPrecise(); 89 if (this->bTimeLimit_!=0 && time > this->bTimeLimit_) 90 { 91 gametype->timeIsUp(); 92 gametype->end(); 93 } 94 else if (this->getLast()) 95 gametype->end(); 96 else 97 { 98 gametype->newCheckpointReached(); 99 this->setRadarObjectColour(ColourValue::Green); //sets the radar colour of the checkpoint to green if it is reached, else it is red. 100 } 101 } 93 assert(gametype); 94 ControllableEntity* entity = (ControllableEntity*) player; 95 96 PlayerInfo* player2 = entity->getPlayer(); 97 98 if(bIsTriggered) 99 this->reached_=player2; 102 100 } 103 101 … … 108 106 { 109 107 SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype().get()); 108 assert(gametype); 110 109 if (gametype) 111 110 { -
code/trunk/src/modules/gametypes/RaceCheckPoint.h
r8767 r9016 32 32 #include "gametypes/GametypesPrereqs.h" 33 33 34 #include "objects/triggers/DistanceTrigger.h" 34 35 36 #include "objects/triggers/DistanceMultiTrigger.h" 35 37 #include "interfaces/RadarViewable.h" 36 38 … … 40 42 @brief 41 43 The RaceCheckPoint class enables the creation of a check point to use in a SpaceRace level. 42 !!! Don't forget to control the indexes of your check points and to set one last check point!!!44 Don't forget to control the indexes of your check points and to set one last check point 43 45 */ 44 class _GametypesExport RaceCheckPoint : public Distance Trigger, public RadarViewable46 class _GametypesExport RaceCheckPoint : public DistanceMultiTrigger, public RadarViewable 45 47 { 46 48 public: … … 50 52 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 51 53 virtual void tick(float dt); 54 inline void setCheckpointIndex(int checkpointIndex) 55 { this->bCheckpointIndex_ = checkpointIndex; } 56 inline int getCheckpointIndex() 57 { return this->bCheckpointIndex_; } 52 58 53 protected: 54 virtual void triggered(bool bIsTriggered); 59 inline void setNextcheckpoint(const Vector3& checkpoints) 60 { this->nextcheckpoints_=checkpoints; } 61 inline void setNextcheckpoint(float x, float y, float z) 62 { this->setNextcheckpoint(Vector3(x, y, z)); } 63 inline const Vector3& getNextcheckpoint() const 64 { return this->nextcheckpoints_; } 55 65 inline void setLast(bool isLast) 56 66 { this->bIsLast_ = isLast; } 57 67 inline bool getLast() 58 68 { return this->bIsLast_; } 59 inline void setCheckpointIndex(int checkpointIndex) 60 { this->bCheckpointIndex_ = checkpointIndex; } 61 inline int getCheckpointIndex() 62 { return this->bCheckpointIndex_; } 69 70 bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level. 71 float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses. 72 PlayerInfo* reached_; 73 74 inline float getTimeLimit() 75 { return this->bTimeLimit_; } 76 77 protected: 78 virtual void fire(bool bIsTriggered,BaseObject* player); 63 79 virtual void setTimelimit(float timeLimit); 64 inline float getTimeLimit() 65 { return this->bTimeLimit_;} 80 66 81 inline const WorldEntity* getWorldEntity() const 67 82 { return this; } 68 83 69 84 private: 70 int bCheckpointIndex_; //The index of this check point. This value will be compared with the number of check points reached in the level. The check points must be indexed in ascending order beginning from zero and without any jumps between the indexes. 71 bool bIsLast_; //True if this check point is the last of the level. There can be only one last check point for each level and there must be a last check point in the level. 72 float bTimeLimit_; //The time limit (from the start of the level) to reach this check point. If the check point is reached after this time, the game ends and the player looses. 73 85 int bCheckpointIndex_; //The index of this check point. The race starts with the check point with the index 0 86 Vector3 nextcheckpoints_; //the indexes of the next check points 87 74 88 }; 75 89 } -
code/trunk/src/modules/gametypes/SpaceRace.cc
r8858 r9016 29 29 #include "SpaceRace.h" 30 30 31 32 #include "items/Engine.h" 33 31 34 #include "core/CoreIncludes.h" 32 35 #include "chat/ChatManager.h" 33 36 #include "util/Convert.h" 34 37 #include "util/Math.h" 38 39 #include "items/Engine.h" 35 40 36 41 namespace orxonox … … 41 46 { 42 47 RegisterObject(SpaceRace); 43 this->checkpointsReached_ = 0;48 44 49 this->bTimeIsUp_ = false; 45 50 this->numberOfBots_ = 0; 51 this->cantMove_=false; 52 46 53 } 54 55 56 // void SpaceRace::SetConfigValues(){ 57 //SUPER(Gametype,setConfigValues); 58 //this->Gametype::SetConfigValue(initialStartCountdown_, 3.0f);} 47 59 48 60 void SpaceRace::end() … … 56 68 int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s); 57 69 const std::string& message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n" 58 + "You didn't reach the check point " + multi_cast<std::string>(this->checkpointsReached_+1) 59 + " before the time limit. You lose!"; 70 + "You didn't reach the check point before the time limit. You lose!"; 60 71 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 61 72 ChatManager::message(message); … … 70 81 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 71 82 ChatManager::message(message); 72 /* 83 73 84 float time = this->clock_.getSecondsPrecise(); 74 85 this->scores_.insert(time); 75 86 std::set<float>::iterator it; 76 for (it=this->scores_.begin(); it!=this->scores_.end(); it++) 77 orxout(level::message) << multi_cast<std::string>(*it) << endl; 78 */ 87 88 79 89 } 80 90 } … … 82 92 void SpaceRace::start() 83 93 { 84 Gametype::start();85 94 86 std::string message("The match has started! Reach the check points as quickly as possible!"); 95 this->spawnPlayersIfRequested(); 96 Gametype::checkStart(); 97 this->cantMove_=true; 98 99 for(ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it) 100 { 101 it->setActive(false); 102 103 } 104 this->addBots(this->numberOfBots_); 105 } 106 107 void SpaceRace::tick(float dt) 108 { 109 SUPER(SpaceRace,tick,dt); 110 111 if(!this->isStartCountdownRunning() && this->cantMove_) 112 { 113 for(ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it; ++it) 114 { 115 it->setActive(true); 116 117 } 118 this->cantMove_= false; 119 120 std::string message("The match has started! Reach the check points as quickly as possible!"); 121 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 122 ChatManager::message(message); 123 } 124 125 } 126 127 128 129 void SpaceRace::newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl) 130 { 131 this->checkpointReached_[pl]=index; 132 this->clock_.capture(); 133 int s = this->clock_.getSeconds(); 134 int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s); 135 const std::string& message = "Checkpoint " + multi_cast<std::string>(index) 136 + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) 137 + " seconds.";// Message is too long for a normal screen. 87 138 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 88 139 ChatManager::message(message); 89 140 } 90 91 void SpaceRace::newCheckpointReached() 92 { 93 this->checkpointsReached_++; 141 142 void SpaceRace::newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl) 143 { 144 int index = p->getCheckpointIndex(); 145 this->checkpointReached_[pl]=index; 94 146 this->clock_.capture(); 95 147 int s = this->clock_.getSeconds(); 96 148 int ms = static_cast<int>(this->clock_.getMilliseconds()-1000*s); 97 const std::string& message = "Checkpoint " + multi_cast<std::string>( this->getCheckpointsReached())98 99 149 const std::string& message = "Checkpoint " + multi_cast<std::string>(index) 150 + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) 151 + " seconds."; 100 152 const_cast<GametypeInfo*>(this->getGametypeInfo())->sendAnnounceMessage(message); 101 153 ChatManager::message(message); 102 154 } 155 156 157 void SpaceRace::playerEntered(PlayerInfo* player) 158 { 159 Gametype::playerEntered(player); 160 161 this->checkpointReached_[player]=-1; 162 //this->playersAlive_++; 163 } 164 165 bool SpaceRace::playerLeft(PlayerInfo* player) 166 { 167 return Gametype::playerLeft(player); 168 // bool valid_player = true; 169 //if (valid_player) 170 // { 171 // this->playersAlive_--; 172 //} 103 173 174 // return valid_player; 175 } 176 177 bool SpaceRace::allowPawnHit(Pawn* victim, Pawn* originator) 178 { 179 return false; 180 } 181 182 bool SpaceRace::allowPawnDamage(Pawn* victim, Pawn* originator) 183 { 184 return false; 185 } 186 187 bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator) 188 { 189 return false; 190 } 104 191 } -
code/trunk/src/modules/gametypes/SpaceRace.h
r8767 r9016 34 34 #include <set> 35 35 #include <string> 36 # include <vector> 36 37 37 38 #include <util/Clock.h> … … 39 40 #include "gametypes/Gametype.h" 40 41 41 #include " RaceCheckPoint.h"42 #include "SpaceRaceManager.h" 42 43 43 44 namespace orxonox … … 50 51 { 51 52 friend class RaceCheckPoint; 53 52 54 53 55 public: … … 58 60 virtual void end(); 59 61 60 virtual void newCheckpointReached(); 62 virtual void newCheckpointReached(SpaceRaceManager* p, int index,PlayerInfo* pl); 63 virtual void newCheckpointReached(RaceCheckPoint* p, PlayerInfo* pl); 61 64 62 inline void setCheckpointsReached(int n) 63 { this->checkpointsReached_ = n;} 64 inline int getCheckpointsReached() 65 { return this->checkpointsReached_; } 65 inline void setCheckpointReached(int n, PlayerInfo* p) 66 { this->checkpointReached_[p] = n;} 67 inline int getCheckpointReached(PlayerInfo* p) 68 { return this->checkpointReached_[p]; } 69 66 70 inline void timeIsUp() 67 71 { this->bTimeIsUp_ = true;} 72 void tick(float dt); 73 Clock clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late. 68 74 75 76 bool allowPawnHit(Pawn* victim, Pawn* originator); 77 78 bool allowPawnDamage(Pawn* victim, Pawn* originator); 79 80 bool allowPawnDeath(Pawn* victim, Pawn* originator); 69 81 protected: 70 82 virtual void playerEntered(PlayerInfo* player); //!< Initializes values. 83 virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables. 71 84 private: 72 int checkpointsReached_; //The current number of check points reached by the player. 85 bool cantMove_; 86 std::map<PlayerInfo*, int>checkpointReached_; //The number of the last check point reached by each player. 73 87 std::set<float> scores_; //The times of the players are saved in a set. 74 88 bool bTimeIsUp_; //True if one of the check points is reached too late. 75 Clock clock_; //The clock starts running at the beginning of the game. It is used to give the time at each check point, the give the time at the end of the game, and to stop the game if a check point is reached too late. 89 90 int playersAlive_; 76 91 }; 77 92 } -
code/trunk/src/modules/objects/triggers/DistanceMultiTrigger.h
r8706 r9016 91 91 @ingroup MultiTrigger 92 92 */ 93 class _ObjectsExport DistanceMultiTrigger : public MultiTrigger 93 class _ObjectsExport DistanceMultiTrigger : public MultiTrigger 94 94 { 95 95 -
code/trunk/src/modules/objects/triggers/MultiTrigger.h
r8457 r9016 157 157 bool isTriggered(BaseObject* triggerer = NULL); //!< Get whether the MultiTrigger is triggered for a given object. 158 158 159 v oid fire(bool status, BaseObject* originator = NULL); //!< Helper method. Creates an Event for the given status and originator and fires it.159 virtual void fire(bool status, BaseObject* originator = NULL); //!< Helper method. Creates an Event for the given status and originator and fires it. 160 160 void broadcast(bool status); //!< Helper method. Broadcasts an Event for every object that is a target. 161 161 -
code/trunk/src/modules/overlays/hud/CMakeLists.txt
r8706 r9016 7 7 HUDHealthBar.cc 8 8 HUDTimer.cc 9 HUDEnemyHealthBar.cc 9 10 ChatOverlay.cc 10 11 AnnounceMessage.cc -
code/trunk/src/modules/overlays/hud/HUDHealthBar.h
r7401 r9016 110 110 { return this->textoverlay_->getSpaceWidth(); } 111 111 112 inline void setOverlayText(SmartPtr<OverlayText> textoverlay) 113 { this->textoverlay_ = textoverlay; } 114 inline SmartPtr<OverlayText> getOverlayText() const 115 {return this->textoverlay_; } 116 112 117 private: 113 118 WeakPtr<Pawn> owner_; -
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
r8891 r9016 25 25 * Reto Grieder 26 26 * Oliver Scheuss 27 * Matthias Spalinger 27 28 * 28 29 */ … … 63 64 { 64 65 SetConfigValue(markerLimit_, 3); 65 66 SetConfigValue(showDistance, false); 66 67 } 67 68 … … 75 76 76 77 // Set default values 77 setFont ( "Monofur" );78 setTextSize ( 0.05f );79 setNavMarkerSize ( 0.05f );80 setDetectionLimit( 10000.0f );78 this->setFont ( "Monofur" ); 79 this->setTextSize ( 0.05f ); 80 this->setNavMarkerSize ( 0.05f ); 81 this->setDetectionLimit( 10000.0f ); 81 82 } 82 83 … … 97 98 SUPER ( HUDNavigation, XMLPort, xmlelement, mode ); 98 99 99 XMLPortParam ( HUDNavigation, "font", setFont, getFont,xmlelement, mode );100 XMLPortParam ( HUDNavigation, "textSize", setTextSize, getTextSize,xmlelement, mode );101 XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize,xmlelement, mode );102 XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode ); 100 XMLPortParam ( HUDNavigation, "font", setFont, getFont, xmlelement, mode ); 101 XMLPortParam ( HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode ); 102 XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode ); 103 XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode ); 103 104 } 104 105 … … 144 145 } 145 146 146 147 float HUDNavigation::getArrowSizeX(int dist) 148 { 149 if (dist < 600) 150 dist = 600; 151 return this->getActualSize().x * 900 * navMarkerSize_ / dist; 152 } 153 154 float HUDNavigation::getArrowSizeY(int dist) 155 { 156 if (dist < 600) 157 dist = 600; 158 return this->getActualSize().y * 900 * navMarkerSize_ / dist; 159 } 147 160 148 161 void HUDNavigation::tick ( float dt ) … … 165 178 unsigned int markerCount_ = 0; 166 179 bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player 180 167 181 // for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it) 168 182 for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt ) … … 170 184 ObjectMap::iterator it = activeObjectList_.find ( listIt->first ); 171 185 closeEnough_ = listIt->second < detectionLimit_ ; 172 if ( markerCount_ < markerLimit_ && (closeEnough_ || detectionLimit_ < 0) ) // display on HUD if the statement is true 186 // display radarviewables on HUD if the marker limit and max-distance is not exceeded 187 if ( markerCount_ < markerLimit_ && (closeEnough_ || detectionLimit_ < 0) ) 173 188 { 174 189 … … 176 191 // Get Distance to HumanController and save it in the TextAreaOverlayElement. 177 192 int dist = listIt->second; 193 float textLength = 0.0f; 194 195 //display distance next to cursor 196 if (showDistance){ 178 197 it->second.text_->setCaption ( multi_cast<std::string> ( dist ) ); 179 float textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f; 198 textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f; 199 } 200 201 //display name next to cursor 202 else{ 203 it->second.text_->setCaption(it->first->getRVName()); 204 textLength = it->first->getRVName().size() * it->second.text_->getCharHeight() * 0.3f; 205 } 180 206 181 207 // Transform to screen coordinates … … 194 220 else 195 221 outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0; 196 // Get Distance to HumanController and save it in the TextAreaOverlayElement.197 it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );198 222 199 223 if ( outOfView ) … … 207 231 it->second.wasOutOfView_ = true; 208 232 } 233 234 //float xDistScale = this->getActualSize().x * 1000.0f * navMarkerSize_ / dist; 235 //float yDistScale = this->getActualSize().y * 1000.0f * navMarkerSize_ / dist; 236 237 // Adjust Arrowsize according to distance 238 it->second.panel_->setDimensions(getArrowSizeX(dist),getArrowSizeY(dist)); 209 239 210 240 // Switch between top, bottom, left and right position of the arrow at the screen border … … 263 293 //it->second.panel_->setMaterialName ( "Orxonox/NavTDC" ); 264 294 it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "tdc.png", it->first->getRadarObjectColour()) ); 295 it->second.panel_->setDimensions ( navMarkerSize_ * this->getActualSize().x, navMarkerSize_ * this->getActualSize().y ); 265 296 it->second.wasOutOfView_ = false; 266 297 } … … 280 311 it->second.text_->show(); 281 312 } 282 else // do not display on HUD 313 else // do not display on HUD 283 314 { 284 315 it->second.panel_->hide(); … … 312 343 void HUDNavigation::addObject ( RadarViewable* object ) 313 344 { 314 if( showObject(object) ==false )345 if( showObject(object)==false ) 315 346 return; 316 347 … … 399 430 return false; 400 431 assert( rv->getWorldEntity() ); 401 if ( rv->getWorldEntity()->isVisible() == false || rv->getRadarVisibility() ==false )432 if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false ) 402 433 return false; 403 434 return true; -
code/trunk/src/modules/overlays/hud/HUDNavigation.h
r8891 r9016 24 24 * Co-authors: 25 25 * Reto Grieder 26 * Matthias Spalinger 26 27 * 27 28 */ … … 54 55 virtual void tick ( float dt ); 55 56 57 // RadarListener interface 56 58 virtual void addObject ( RadarViewable* object ); 57 59 virtual void removeObject ( RadarViewable* viewable ); … … 66 68 inline float getRadarSensitivity() const 67 69 { return 1.0f; } 70 71 unsigned int getMarkerLimit() { return this->markerLimit_; } 68 72 69 73 private: … … 81 85 // XMLPort accessors 82 86 void setNavMarkerSize ( float size ) 83 { navMarkerSize_ = size; this->sizeChanged(); }87 { navMarkerSize_ = size; this->sizeChanged(); } 84 88 float getNavMarkerSize() const 85 { return navMarkerSize_; } 86 87 void setDetectionLimit( float limit ) 88 { this->detectionLimit_ = limit; } 89 float getDetectionLimit() const 90 { return this->detectionLimit_; } 89 { return navMarkerSize_; } 90 void setDetectionLimit( float limit ) 91 { this->detectionLimit_ = limit; } 92 float getDetectionLimit() const 93 { return this->detectionLimit_; } 91 94 92 95 void setTextSize ( float size ); … … 102 105 sortedList sortedObjectList_; 103 106 107 float getArrowSizeX(int dist); 108 float getArrowSizeY(int dist); 104 109 105 110 float navMarkerSize_; 106 111 std::string fontName_; 107 112 float textSize_; 113 bool showDistance; 108 114 109 unsigned int markerLimit_; //TODO: is it possible to set this over the console and/or the IG-Setting110 float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value. 111 //!< In order to bypass this behaviour, set a negative detectionLimit_. Then the detection range is "infinite". 115 unsigned int markerLimit_; 116 float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value. 117 112 118 }; 113 119 } -
code/trunk/src/modules/pong/Pong.cc
r8858 r9016 37 37 #include "core/EventIncludes.h" 38 38 #include "core/command/Executor.h" 39 #include "core/ConfigValueIncludes.h" 39 40 40 41 #include "gamestates/GSLevel.h" 42 #include "chat/ChatManager.h" 41 43 42 44 #include "PongCenterpoint.h" … … 45 47 #include "PongBot.h" 46 48 #include "PongAI.h" 47 48 49 namespace orxonox 49 50 { … … 75 76 // Set the type of Bots for this particular Gametype. 76 77 this->botclass_ = Class(PongBot); 78 this->scoreLimit_ = 10; 79 this->setConfigValues(); 77 80 } 78 81 … … 280 283 } 281 284 285 // If a palyer gets 21 points, he won the game -> end of game 286 287 PlayerInfo* player1 = this->getLeftPlayer(); 288 PlayerInfo* player2 = this->getRightPlayer(); 289 if(player1==NULL||player2==NULL) return; //safety 290 if(this->getScore(player1) >= scoreLimit_) 291 { 292 std::string name1=player1->getName(); 293 std::string message(name1 + " has won!"); 294 ChatManager::message(message); 295 this->end(); 296 } 297 else if(this->getScore(player2) >= scoreLimit_) 298 { 299 std::string name2=player2->getName(); 300 std::string message2(name2 + " has won!"); 301 ChatManager::message(message2); 302 this->end(); 303 } 282 304 // Restart the timer to start the ball. 283 305 this->starttimer_.startTimer(); 306 284 307 } 285 308 … … 321 344 return 0; 322 345 } 346 347 /** 348 @brief 349 Make scoreLimit_ configurable e.g. in the menu. 350 */ 351 void Pong::setConfigValues() 352 { 353 SetConfigValue(scoreLimit_, 10).description("The player first reaching those points wins."); 354 } 323 355 } -
code/trunk/src/modules/pong/Pong.h
r8351 r9016 81 81 void setCenterpoint(PongCenterpoint* center) 82 82 { this->center_ = center; } 83 84 PlayerInfo* getLeftPlayer() const; //!< Get the left player. 83 void setConfigValues(); //!< Makes scoreLimit configurable. 84 85 PlayerInfo* getLeftPlayer() const; //!< Get the left player. 85 86 PlayerInfo* getRightPlayer() const; //!< Get the right player. 86 87 … … 94 95 WeakPtr<PongBall> ball_; //!< The Pong ball. 95 96 WeakPtr<PongBat> bat_[2]; //!< The two bats. 96 Timer starttimer_; //!< A timer to delay the start of the game. 97 Timer starttimer_; //!< A timer to delay the start of the game. 98 int scoreLimit_; //!< If a player scored that much points, the game is ended. 97 99 }; 98 100 } -
code/trunk/src/modules/pong/PongAI.h
r8108 r9016 80 80 void delayedMove(); //!< Is called, when a delayed move takes effect. 81 81 82 PongBall* ball_; //!< Apointer to the ball.82 WeakPtr<PongBall> ball_; //!< A weak pointer to the ball. 83 83 Vector2 ballDirection_; //!< Vector to store the (x,z) direction in which the ball is flying. 84 84 float ballEndPosition_; //!< The calculated end position of the ball. -
code/trunk/src/modules/pong/PongScore.cc
r8108 r9016 60 60 this->bShowLeftPlayer_ = false; 61 61 this->bShowRightPlayer_ = false; 62 this->player1_ = NULL; 63 this->player2_ = NULL; 62 64 } 63 65 … … 98 100 if (this->owner_ != NULL) 99 101 { 100 // Get the two players. 101 PlayerInfo* player1 = this->owner_->getLeftPlayer(); 102 PlayerInfo* player2 = this->owner_->getRightPlayer(); 103 104 std::string name1; 105 std::string name2; 106 107 std::string score1("0"); 108 std::string score2("0"); 109 110 // Save the name and score of each player as a string. 111 if (player1 != NULL) 102 if(!this->owner_->hasEnded()) 112 103 { 113 name1 = player1->getName(); 114 score1 = multi_cast<std::string>(this->owner_->getScore(player1)); 115 } 116 if (player2 != NULL) 117 { 118 name2 = player2->getName(); 119 score2 = multi_cast<std::string>(this->owner_->getScore(player2)); 104 //get the two players 105 player1_ = this->owner_->getLeftPlayer(); 106 player2_ = this->owner_->getRightPlayer(); 120 107 } 121 108 122 // Assemble the strings, depending on what should all be displayed. 123 std::string output1; 124 if (this->bShowLeftPlayer_) 109 if(this->owner_->hasStarted()) 125 110 { 126 if (this->bShowName_ && this->bShowScore_ && player1 != NULL) 127 output1 = name1 + " - " + score1; 128 else if (this->bShowScore_) 129 output1 = score1; 130 else if (this->bShowName_) 131 output1 = name1; 132 } 111 // Get the two players. 133 112 134 std::string output2; 135 if (this->bShowRightPlayer_) 136 { 137 if (this->bShowName_ && this->bShowScore_ && player2 != NULL) 113 std::string name1; 114 std::string name2; 115 116 std::string score1("0"); 117 std::string score2("0"); 118 119 // Save the name and score of each player as a string. 120 if (player1_ != NULL) 121 { 122 name1 = player1_->getName(); 123 score1 = multi_cast<std::string>(this->owner_->getScore(player1_)); 124 } 125 if (player2_ != NULL) 126 { 127 name2 = player2_->getName(); 128 score2 = multi_cast<std::string>(this->owner_->getScore(player2_)); 129 } 130 131 // Assemble the strings, depending on what should all be displayed. 132 std::string output1; 133 if (this->bShowLeftPlayer_) 134 { 135 if (this->bShowName_ && this->bShowScore_ && player1_ != NULL) 136 output1 = name1 + " - " + score1; 137 else if (this->bShowScore_) 138 output1 = score1; 139 else if (this->bShowName_) 140 output1 = name1; 141 } 142 143 std::string output2; 144 if (this->bShowRightPlayer_) 145 { 146 if (this->bShowName_ && this->bShowScore_ && player2_ != NULL) 138 147 output2 = score2 + " - " + name2; 139 148 else if (this->bShowScore_) … … 143 152 } 144 153 145 std::string output("PONG"); 146 if (this->bShowName_ || this->bShowScore_) 147 { 148 if (this->bShowLeftPlayer_ && this->bShowRightPlayer_) 149 output = output1 + ':' + output2; 150 else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_) 151 output = output1 + output2; 154 std::string output("PONG"); 155 if (this->bShowName_ || this->bShowScore_) 156 { 157 if (this->bShowLeftPlayer_ && this->bShowRightPlayer_) 158 output = output1 + ':' + output2; 159 else if (this->bShowLeftPlayer_ || this->bShowRightPlayer_) 160 output = output1 + output2; 161 } 162 this->setCaption(output); 152 163 } 153 154 this->setCaption(output);155 164 } 156 165 } -
code/trunk/src/modules/pong/PongScore.h
r8108 r9016 122 122 bool bShowLeftPlayer_; //!< Whether the left player is shown. 123 123 bool bShowRightPlayer_; //!< Whether the right player is shown. 124 PlayerInfo* player1_; //!< Store information about left player permanently. 125 PlayerInfo* player2_; //!< Same for the right player. To end the game properly. 124 126 }; 125 127 } -
code/trunk/src/modules/weapons/projectiles/Rocket.cc
r8891 r9016 66 66 this->localAngularVelocity_ = 0; 67 67 this->lifetime_ = 100.0f; 68 this->bIsRocket_= true;69 68 70 69 if (GameMode::isMaster()) … … 135 134 if(this->isInitialized()) 136 135 { 137 this->bIsRocket_= false;138 136 if (GameMode::isMaster()) 139 137 { … … 163 161 164 162 this->player_ = this->getShooter()->getPlayer(); 165 this->getShooter()->getPlayer()->startTemporaryControl(this); 163 if(this->player_) 164 this->player_->startTemporaryControl(this); 166 165 167 166 if( GameMode::isMaster() ) -
code/trunk/src/modules/weapons/projectiles/Rocket.h
r8855 r9016 122 122 123 123 WeakPtr<PlayerInfo> player_; //!< The player that controls the Rocket. 124 //WeakPtr<Pawn> pawn_; //!< The pawn that controls the Rocket. TODO 124 125 Timer destroyTimer_; //!< Timer to destroy the projectile after its lifetime has run out. 125 126 float lifetime_; //!< The time the projectile exists. -
code/trunk/src/modules/weapons/weaponmodes/LightningGun.cc
r8855 r9016 52 52 this->reloadTime_ = 1.0f; 53 53 this->damage_ = 0.0f; 54 this->speed_ = 250.0f;54 this->speed_ = 700.0f; 55 55 56 56 this->setMunitionName("LaserMunition"); -
code/trunk/src/orxonox/Level.cc
r8858 r9016 71 71 SUPER(Level, XMLPort, xmlelement, mode); 72 72 73 XMLPortParam(Level, "description", setDescription, getDescription, xmlelement, mode);74 73 XMLPortParam(Level, "gametype", setGametypeString, getGametypeString, xmlelement, mode).defaultValues("Gametype"); 75 74 … … 82 81 registerVariable(this->xmlfilename_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::networkcallback_applyXMLFile)); 83 82 registerVariable(this->name_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::changedName)); 84 registerVariable(this->description_, VariableDirection::ToClient);85 83 registerVariable(this->networkTemplateNames_, VariableDirection::ToClient, new NetworkCallback<Level>(this, &Level::networkCallbackTemplatesChanged)); 86 84 } -
code/trunk/src/orxonox/Level.h
r7163 r9016 49 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 50 50 51 inline void setDescription(const std::string& description)52 { this->description_ = description; }53 inline const std::string& getDescription() const54 { return this->description_; }55 56 51 void playerEntered(PlayerInfo* player); 57 52 void playerLeft(PlayerInfo* player); … … 76 71 void networkcallback_applyXMLFile(); 77 72 78 std::string description_;79 73 std::string gametype_; 80 74 std::string xmlfilename_; -
code/trunk/src/orxonox/LevelInfo.cc
r8858 r9016 87 87 { 88 88 LevelInfoItem::possibleTags_s.insert("test"); 89 LevelInfoItem::possibleTags_s.insert("singleplayer");90 LevelInfoItem::possibleTags_s.insert("multiplayer");91 89 LevelInfoItem::possibleTags_s.insert("showcase"); 92 90 LevelInfoItem::possibleTags_s.insert("tutorial"); 93 91 LevelInfoItem::possibleTags_s.insert("presentation"); 92 LevelInfoItem::possibleTags_s.insert("mission"); 93 LevelInfoItem::possibleTags_s.insert("gametype"); 94 LevelInfoItem::possibleTags_s.insert("minigame"); 94 95 } 95 96 } … … 189 190 190 191 XMLPortParam(LevelInfo, "description", setDescription, getDescription, xmlelement, mode); 192 XMLPortParam(LevelInfo, "screenshot", setScreenshot, getScreenshot, xmlelement, mode); 191 193 XMLPortParam(LevelInfo, "tags", setTags, getTags, xmlelement, mode); 192 194 } … … 203 205 LevelInfoItem* info = new LevelInfoItem(this->BaseObject::getName(), this->getXMLFilename()); 204 206 info->setDescription(this->getDescription()); 207 info->setScreenshot(this->getScreenshot()); 205 208 info->setTags(this->getTags()); 206 209 return info; -
code/trunk/src/orxonox/LevelInfo.h
r8079 r9016 77 77 */ 78 78 inline const std::string& getName(void) const { return this->name_; } // tolua_export 79 80 /** 81 @brief Set the screenshot of the Level. 82 @param screenshot The screenshot to be set. 83 */ 84 inline void setScreenshot(const std::string& screenshot) { this->screenshot_ = std::string(screenshot); } 85 /** 86 @brief Get the screenshot of the Level. 87 @return Returns the screenshot of the Level. 88 */ 89 inline const std::string& getScreenshot() const { return this->screenshot_; } // tolua_export 79 90 80 91 /** … … 138 149 std::string name_; //!< The name of the Level. 139 150 std::string description_; //!< The description of the Level. 151 std::string screenshot_; //!< The screenshot of the Level. 140 152 std::set<std::string> tags_; //!< The set of tags the Level is tagged with. 141 153 std::string tagsString_; //!< The comma-seperated string of all the tags the Level is tagged with. … … 148 160 - @b name The name of the level. 149 161 - @b description The description of the level. 162 - @b screenshot The screenshot of the level. 150 163 - @b tags A comma-seperated string of tags. Allowed tags are: <em>test</em>, <em>singleplayer</em>, <em>multiplayer</em>, <em>showcase</em>, <em>tutorial</em>, <em>presentation</em>. 151 164 … … 155 168 name = "Levelname"lhs->compare(rhs) < 0 156 169 description = "This is just some awesome level." 170 screenshot = "Screenshot.png" 157 171 tags = "test, awesome" 158 172 /> … … 172 186 173 187 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Creates a LevelInfo object through XML. 188 189 /** 190 @brief Set the screenshot of the Level. 191 @param screenshot The screenshot to be set. 192 */ 193 inline void setScreenshot(const std::string& screenshot) { this->LevelInfoItem::setScreenshot(screenshot); } 194 /** 195 @brief Get the screenshot of the Level. 196 @return Returns the screenshot of the Level. 197 */ 198 inline const std::string& getScreenshot() const { return this->LevelInfoItem::getScreenshot(); } 174 199 175 200 /** -
code/trunk/src/orxonox/controllers/AIController.cc
r8891 r9016 59 59 if (this->state_ == FREE) 60 60 { 61 61 62 62 if (this->formationFlight_) 63 63 { 64 65 //changed order -> searchNewMaster MUSTN'T be called in SLAVE-state (bugfix for internal-error messages at quit) 66 random = rnd(maxrand); 67 if (random < 90 && (((!this->target_) || (random < 50 && this->target_)) && !this->forcedFree())) 68 this->searchNewMaster(); 69 64 70 // return to Master after being forced free 65 71 if (this->freedomCount_ == 1) … … 68 74 this->freedomCount_ = 0; 69 75 } 70 71 random = rnd(maxrand); 72 if (random < 90 && (((!this->target_) || (random < 50 && this->target_)) && !this->forcedFree())) 73 this->searchNewMaster(); 74 } 75 76 } 77 78 this->defaultBehaviour(maxrand); 79 80 } 81 82 if (this->state_ == SLAVE && this->formationMode_ == ATTACK) 83 { 76 84 // search enemy 77 85 random = rnd(maxrand); 78 if (random < ( 15 + botlevel_* 20) && (!this->target_))86 if (random < (botlevel_*100) && (!this->target_)) 79 87 this->searchNewTarget(); 80 88 81 // forget enemy82 random = rnd(maxrand);83 if (random < ((1-botlevel_)*6) && (this->target_))84 this->forgetTarget();85 86 89 // next enemy 87 90 random = rnd(maxrand); 88 if (random < (botlevel_* 20) && (this->target_))91 if (random < (botlevel_*30) && (this->target_)) 89 92 this->searchNewTarget(); 90 93 91 // fly somewhere92 random = rnd(maxrand);93 if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))94 this->searchRandomTargetPosition();95 96 // stop flying97 random = rnd(maxrand);98 if (random < 10 && (this->bHasTargetPosition_ && !this->target_))99 this->bHasTargetPosition_ = false;100 101 // fly somewhere else102 random = rnd(maxrand);103 if (random < 30 && (this->bHasTargetPosition_ && !this->target_))104 this->searchRandomTargetPosition();105 106 94 // shoot 107 95 random = rnd(maxrand); 108 if (!(this->passive_) && random < ( 75 + botlevel_*25) && (this->target_ && !this->bShooting_))96 if (!(this->passive_) && random < (botlevel_*100) && (this->target_ && !this->bShooting_)) 109 97 this->bShooting_ = true; 110 98 111 99 // stop shooting 112 100 random = rnd(maxrand); 113 if (random < ( (1 - botlevel_)*25)&& (this->bShooting_))101 if (random < (1-botlevel_)*50 && (this->bShooting_)) 114 102 this->bShooting_ = false; 115 103 116 // boost117 random = rnd(maxrand);118 if (random < botlevel_*100 )119 this->boostControl();120 121 // update Checkpoints122 /*random = rnd(maxrand);123 if (this->defaultWaypoint_ && random > (maxrand-10))124 this->manageWaypoints();125 else //if(random > maxrand-10) //CHECK USABILITY!!*/126 if (this->waypoints_.size() == 0 )127 this->manageWaypoints();128 129 }130 131 if (this->state_ == SLAVE)132 {133 134 104 } 135 105 136 106 if (this->state_ == MASTER) 137 107 { 138 139 140 108 this->commandSlaves(); 141 109 … … 155 123 this->spinInit(); 156 124 157 / / follow a randomly chosen human - a specific Master Action125 /*// follow a randomly chosen human - a specific Master Action 158 126 random = rnd(1000.0f); 159 127 if (random < 1) 160 128 this->followRandomHumanInit(); 161 129 */ 162 130 // lose master status (only if less than 4 slaves in formation) 163 131 random = rnd(maxrand); … … 170 138 this->searchNewMaster(); 171 139 172 // search enemy 173 random = rnd(maxrand); 174 if (random < (botlevel_)*25 && (!this->target_)) 175 this->searchNewTarget(); 176 177 // forget enemy 178 random = rnd(maxrand); 179 if (random < (1-botlevel_)*6 && (this->target_)) 180 this->forgetTarget(); 181 182 // next enemy 183 random = rnd(maxrand); 184 if (random < 10 && (this->target_)) 185 this->searchNewTarget(); 186 187 // fly somewhere 188 random = rnd(maxrand); 189 if (random < 50 && (!this->bHasTargetPosition_ && !this->target_)) 190 this->searchRandomTargetPosition(); 191 192 193 // fly somewhere else 194 random = rnd(maxrand); 195 if (random < 30 && (this->bHasTargetPosition_ && !this->target_)) 196 this->searchRandomTargetPosition(); 197 198 // shoot 199 random = rnd(maxrand); 200 if (!(this->passive_) && random < 25*(botlevel_)+1 && (this->target_ && !this->bShooting_)) 201 { 202 this->bShooting_ = true; 203 this->forceFreeSlaves(); 204 } 205 206 // stop shooting 207 random = rnd(maxrand); 208 if (random < ( (1- botlevel_)*25 ) && (this->bShooting_)) 209 this->bShooting_ = false; 210 211 // boost 212 random = rnd(maxrand); 213 if (random < botlevel_*100 ) 214 this->boostControl(); 215 216 // update Checkpoints 217 /*random = rnd(maxrand); 218 if (this->defaultWaypoint_ && random > (maxrand-10)) 219 this->manageWaypoints(); 220 else //if(random > maxrand-10) //CHECK USABILITY!!*/ 221 if (this->waypoints_.size() == 0 ) 222 this->manageWaypoints(); 140 this->defaultBehaviour(maxrand); 141 223 142 } 224 143 } … … 234 153 float maxrand = 100.0f / ACTION_INTERVAL; 235 154 ControllableEntity* controllable = this->getControllableEntity(); 236 155 //DOES: Either move to the waypoint or search for a Point of interest 237 156 if (controllable && this->mode_ == DEFAULT)// bot is ready to move to a target 238 157 { … … 256 175 } 257 176 } 258 if(this->mode_ == DEFAULT) 259 { 177 178 if (this->mode_ == DEFAULT) 179 { 260 180 if (this->state_ == MASTER) 261 181 { … … 270 190 this->aimAtTarget(); 271 191 random = rnd(maxrand); 272 if(this->botlevel_* 100 > random && !this->isCloseAtTarget(20))192 if(this->botlevel_*70 > random && !this->isCloseAtTarget(100)) 273 193 this->follow(); //If a bot is shooting a player, it shouldn't let him go away easily. 274 194 } … … 277 197 if (this->bHasTargetPosition_) 278 198 this->moveToTargetPosition(); 279 280 199 this->doFire(); 281 200 } … … 290 209 } 291 210 292 if (this->state_ == SLAVE )211 if (this->state_ == SLAVE && this->formationMode_ != ATTACK) 293 212 { 294 213 if (this->bHasTargetPosition_) … … 296 215 } 297 216 298 if (this->state_ == FREE )217 if (this->state_ == FREE || (this->state_==SLAVE && this->formationMode_ == ATTACK) ) 299 218 { 300 219 if (this->target_) … … 302 221 if (!this->target_->getRadarVisibility()) /* So AI won't shoot invisible Spaceships */ 303 222 this->forgetTarget(); 304 else 305 { 306 this->aimAtTarget(); 307 random = rnd(maxrand); 308 309 if(this->botlevel_*100 > random && !this->isCloseAtTarget(20)) 310 this->follow();//If a bot is shooting a player, it shouldn't let him go away easily. 311 } 223 else this->aimAtTarget(); 312 224 } 313 225 … … 315 227 this->moveToTargetPosition(); 316 228 317 this->doFire();318 } 319 } //END_OF DEFAULT MODE229 this->doFire(); 230 } 231 } 320 232 else if (this->mode_ == ROCKET)//Rockets do not belong to a group of bots -> bot states are not relevant. 321 233 { //Vector-implementation: mode_.back() == ROCKET; 322 234 if(controllable) 323 { 324 if(controllable->getRocket())//Check wether the bot is controlling the rocket and if the timeout is over. 235 {//Check wether the bot is controlling the rocket and if the timeout is over. 236 if(controllable->getIdentifier() == ClassByString("Rocket")) 237 325 238 { 326 239 this->follow(); … … 341 254 SUPER(AIController, tick, dt); 342 255 } 256 //**********************************************NEW 257 void AIController::defaultBehaviour(float maxrand) 258 { float random; 259 // search enemy 260 random = rnd(maxrand); 261 if (random < (botlevel_* 100) && (!this->target_)) 262 this->searchNewTarget(); 263 264 // forget enemy 265 random = rnd(maxrand); 266 if (random < ((1-botlevel_)*20) && (this->target_)) 267 this->forgetTarget(); 268 269 // next enemy 270 random = rnd(maxrand); 271 if (random < (botlevel_*30) && (this->target_)) 272 this->searchNewTarget(); 273 274 // fly somewhere 275 random = rnd(maxrand); 276 if (random < 50 && (!this->bHasTargetPosition_ && !this->target_)) 277 this->searchRandomTargetPosition(); 278 279 // stop flying 280 random = rnd(maxrand); 281 if (random < 10 && (this->bHasTargetPosition_ && !this->target_)) 282 this->bHasTargetPosition_ = false; 283 284 // fly somewhere else 285 random = rnd(maxrand); 286 if (random < 30 && (this->bHasTargetPosition_ && !this->target_)) 287 this->searchRandomTargetPosition(); 288 289 if (this->state_ == MASTER) // master: shoot 290 { 291 random = rnd(maxrand); 292 if (!(this->passive_) && random < (100*botlevel_) && (this->target_ && !this->bShooting_)) 293 { 294 this->bShooting_ = true; 295 this->forceFreeSlaves(); 296 } 297 } 298 else 299 { 300 // shoot 301 random = rnd(maxrand); 302 if (!(this->passive_) && random < (botlevel_*100) && (this->target_ && !this->bShooting_)) 303 this->bShooting_ = true; 304 } 305 306 // stop shooting 307 random = rnd(maxrand); 308 if (random < ((1 - botlevel_)*50) && (this->bShooting_)) 309 this->bShooting_ = false; 310 311 // boost 312 random = rnd(maxrand); 313 if (random < botlevel_*50 ) 314 this->boostControl(); 315 316 // update Checkpoints 317 /*random = rnd(maxrand); 318 if (this->defaultWaypoint_ && random > (maxrand-10)) 319 this->manageWaypoints(); 320 else //if(random > maxrand-10) //CHECK USABILITY!!*/ 321 if (this->waypoints_.size() == 0 ) 322 this->manageWaypoints(); 323 } 343 324 344 325 } -
code/trunk/src/orxonox/controllers/AIController.h
r8729 r9016 44 44 virtual ~AIController(); 45 45 46 virtual void tick(float dt); 46 virtual void tick(float dt); //<! Carrying out the targets set in action(). 47 47 48 48 protected: 49 virtual void action(); 49 virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets. 50 void defaultBehaviour(float maxrand); //<! Helper function for code reusage. Some concrete commands for a bot. 50 51 51 52 private: 52 53 static const float ACTION_INTERVAL; 53 54 54 Timer actionTimer_; 55 Timer actionTimer_; //<! Regularly calls action(). 55 56 }; 56 57 } -
code/trunk/src/orxonox/controllers/ArtificialController.cc
r8892 r9016 24 24 * Co-authors: 25 25 * Dominik Solenicki 26 * 26 * 27 27 */ 28 28 29 29 #include "ArtificialController.h" 30 31 #include <vector>32 #include <climits>33 34 #include "util/Math.h"35 30 #include "core/CoreIncludes.h" 36 #include "core/XMLPort.h"37 31 #include "core/command/ConsoleCommand.h" 38 #include "worldentities/ControllableEntity.h"39 32 #include "worldentities/pawns/Pawn.h" 40 #include "worldentities/pawns/TeamBaseMatchBase.h"41 33 #include "worldentities/pawns/SpaceShip.h" 42 #include "gametypes/TeamDeathmatch.h" 43 #include "gametypes/Dynamicmatch.h" 44 #include "controllers/WaypointPatrolController.h" 45 #include "controllers/NewHumanController.h" 46 #include "controllers/DroneController.h" 34 47 35 #include "weaponsystem/WeaponMode.h" 48 36 #include "weaponsystem/WeaponPack.h" … … 51 39 #include "weaponsystem/WeaponSlot.h" 52 40 41 53 42 namespace orxonox 54 43 { 55 SetConsoleCommand("ArtificialController", "formationflight", &ArtificialController::formationflight);56 SetConsoleCommand("ArtificialController", "masteraction", &ArtificialController::masteraction);57 SetConsoleCommand("ArtificialController", "followme", &ArtificialController::followme);58 SetConsoleCommand("ArtificialController", "passivebehaviour", &ArtificialController::passivebehaviour);59 SetConsoleCommand("ArtificialController", "formationsize", &ArtificialController::formationsize);60 44 SetConsoleCommand("ArtificialController", "setbotlevel", &ArtificialController::setAllBotLevel); 61 45 62 static const unsigned int STANDARD_MAX_FORMATION_SIZE = 7; 63 static const int RADIUS_TO_SEARCH_FOR_MASTERS = 5000; 64 static const int FORMATION_LENGTH = 130; 65 static const int FORMATION_WIDTH = 110; 66 static const int FREEDOM_COUNT = 4; //seconds the slaves in a formation will be set free when master attacks an enemy 67 static const float SPEED_MASTER = 0.6f; 68 static const float ROTATEFACTOR_MASTER = 0.2f; 69 static const float SPEED_FREE = 0.8f; 70 static const float ROTATEFACTOR_FREE = 0.8f; 71 72 73 ArtificialController::ArtificialController(BaseObject* creator) : Controller(creator) 74 { 75 RegisterObject(ArtificialController); 76 77 this->target_ = 0; 78 this->formationFlight_ = false; 79 this->passive_ = false; 80 this->maxFormationSize_ = STANDARD_MAX_FORMATION_SIZE; 81 this->myMaster_ = 0; 82 this->freedomCount_ = 0; 83 this->team_ = -1; 84 this->state_ = FREE; 85 this->specificMasterAction_ = NONE; 86 this->specificMasterActionHoldCount_ = 0; 87 this->bShooting_ = false; 88 this->bHasTargetPosition_ = false; 89 this->speedCounter_ = 0.2f; 90 this->targetPosition_ = Vector3::ZERO; 91 92 this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this)); 46 ArtificialController::ArtificialController(BaseObject* creator) : FormationController(creator) 47 { 93 48 this->bSetupWorked = false; 94 this->botlevel_ = 0.2f; 95 this->mode_ = DEFAULT;////Vector-implementation: mode_.push_back(DEFAULT); 49 this->botlevel_ = 0.5f; 96 50 this->timeout_ = 0; 97 51 this->currentWaypoint_ = 0; 98 52 this->setAccuracy(5); 99 53 this->defaultWaypoint_ = NULL; 54 this->mode_ = DEFAULT;//Vector-implementation: mode_.push_back(DEFAULT); 100 55 } 101 56 … … 105 60 {//Vector-implementation: mode_.erase(mode_.begin(),mode_.end()); 106 61 this->waypoints_.clear(); 107 this->removeFromFormation();108 62 this->weaponModes_.clear(); 109 for (ObjectList<ArtificialController>::iterator it = ObjectList<ArtificialController>::begin(); it; ++it) 110 { 111 if (*it != this) 112 { 113 if (it->myMaster_ == this) 114 { 115 orxout(internal_error) << this << " is still master in " << (*it) << endl; 116 it->myMaster_ = 0; 117 } 118 119 while (true) 120 { 121 std::vector<ArtificialController*>::iterator it2 = std::find(it->slaves_.begin(), it->slaves_.end(), this); 122 if (it2 != it->slaves_.end()) 123 { 124 orxout(internal_error) << this << " is still slave in " << (*it) << endl; 125 it->slaves_.erase(it2); 126 } 127 else 128 break; 129 } 130 } 131 } 132 } 133 } 134 135 void ArtificialController::XMLPort(Element& xmlelement, XMLPort::Mode mode) 136 { 137 SUPER(ArtificialController, XMLPort, xmlelement, mode); 138 139 XMLPortParam(ArtificialController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1); 140 XMLPortParam(ArtificialController, "formationFlight", setFormationFlight, getFormationFlight, xmlelement, mode).defaultValues(false); 141 XMLPortParam(ArtificialController, "formationSize", setFormationSize, getFormationSize, xmlelement, mode).defaultValues(STANDARD_MAX_FORMATION_SIZE); 142 XMLPortParam(ArtificialController, "passive", setPassive, getPassive, xmlelement, mode).defaultValues(false); 143 } 144 145 // Documentation only here to get a faster overview for creating a useful documentation... 146 147 /** 148 @brief Activates / deactivates formationflight behaviour 149 @param form activate formflight if form is true 150 */ 151 void ArtificialController::formationflight(const bool form) 152 { 153 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 154 { 155 Controller* controller = 0; 156 157 if (it->getController()) 158 controller = it->getController(); 159 else if (it->getXMLController()) 160 controller = it->getXMLController(); 161 162 if (!controller) 163 continue; 164 165 ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller); 166 167 if (aiController) 168 { 169 aiController->formationFlight_ = form; 170 if (!form) 171 { 172 aiController->removeFromFormation(); 173 } 174 } 175 } 176 } 177 178 /** 179 @brief Get all masters to do a "specific master action" 180 @param action which action to perform (integer, so it can be called with a console command (tmp solution)) 181 */ 182 void ArtificialController::masteraction(const int action) 183 { 184 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 185 { 186 Controller* controller = 0; 187 188 if (it->getController()) 189 controller = it->getController(); 190 else if (it->getXMLController()) 191 controller = it->getXMLController(); 192 193 if (!controller) 194 continue; 195 196 ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller); 197 198 if(aiController && aiController->state_ == MASTER) 199 { 200 if (action == 1) 201 aiController->spinInit(); 202 if (action == 2) 203 aiController->turn180Init(); 204 } 205 } 206 } 207 208 /** 209 @brief A human player gets followed by its nearest master. Initiated by console command, so far intended for demonstration puproses (possible future pickup). 210 */ 211 void ArtificialController::followme() 212 { 213 214 Pawn *humanPawn = NULL; 215 NewHumanController *currentHumanController = NULL; 216 std::vector<ArtificialController*> allMasters; 217 218 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 219 { 220 Controller* controller = 0; 221 222 if (it->getController()) 223 controller = it->getController(); 224 else if (it->getXMLController()) 225 controller = it->getXMLController(); 226 227 if (!controller) 228 continue; 229 230 currentHumanController = orxonox_cast<NewHumanController*>(controller); 231 232 if(currentHumanController) humanPawn = *it; 233 234 ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller); 235 236 if(aiController && aiController->state_ == MASTER) 237 allMasters.push_back(aiController); 238 239 } 240 241 if((humanPawn != NULL) && (allMasters.size() != 0)) 242 { 243 float posHuman = humanPawn->getPosition().length(); 244 float distance = 0.0f; 245 float minDistance = FLT_MAX; 246 int index = 0; 247 int i = 0; 248 249 for(std::vector<ArtificialController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++, i++) 250 { 251 if (!ArtificialController::sameTeam((*it)->getControllableEntity(), humanPawn, (*it)->getGametype())) continue; 252 distance = posHuman - (*it)->getControllableEntity()->getPosition().length(); 253 if(distance < minDistance) index = i; 254 } 255 allMasters[index]->followInit(humanPawn); 256 } 257 258 } 259 260 /** 261 @brief Sets shooting behaviour of pawns. 262 @param passive if true, bots won't shoot. 263 */ 264 void ArtificialController::passivebehaviour(const bool passive) 265 { 266 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 267 { 268 Controller* controller = 0; 269 270 if (it->getController()) 271 controller = it->getController(); 272 else if (it->getXMLController()) 273 controller = it->getXMLController(); 274 275 if (!controller) 276 continue; 277 278 ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller); 279 280 if(aiController) 281 { 282 aiController->passive_ = passive; 283 } 284 } 285 } 286 287 288 /** 289 @brief Sets maximal formation size 290 @param size maximal formation size. 291 */ 292 void ArtificialController::formationsize(const int size) 293 { 294 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 295 { 296 Controller* controller = 0; 297 298 if (it->getController()) 299 controller = it->getController(); 300 else if (it->getXMLController()) 301 controller = it->getXMLController(); 302 303 if (!controller) 304 continue; 305 306 ArtificialController *aiController = orxonox_cast<ArtificialController*>(controller); 307 308 if(aiController) 309 { 310 aiController->maxFormationSize_ = size; 311 } 312 } 313 } 63 } 64 } 65 314 66 315 67 /** … … 320 72 if (!this->getControllableEntity()) 321 73 this->removeFromFormation(); 322 this->bSetupWorked = false; // reset weapon information 323 this->setupWeapons(); 324 } 325 326 void ArtificialController::removeFromFormation() 327 { 328 if (this->state_ == SLAVE || this->myMaster_) // slaves can also be temporary free, so check if myMaster_ is set 329 this->unregisterSlave(); 330 else if (this->state_ == MASTER) 331 this->setNewMasterWithinFormation(); 332 } 333 334 void ArtificialController::moveToPosition(const Vector3& target) 335 { 336 if (!this->getControllableEntity()) 337 return; 338 339 // Slave uses special movement if its master is in FOLLOW mode 340 if(this->state_ == SLAVE && this->myMaster_ && this->myMaster_->specificMasterAction_ == FOLLOW) 341 { 342 // this->followForSlaves(target); 343 // return; 344 } 345 346 Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target); 347 float distance = (target - this->getControllableEntity()->getPosition()).length(); 348 349 350 if(this->state_ == FREE) 351 { 352 if (this->target_ || distance > 10) 353 { 354 // Multiply with ROTATEFACTOR_FREE to make them a bit slower 355 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x); 356 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y); 357 } 358 359 if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength()) 360 { 361 this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance 362 } else this->getControllableEntity()->moveFrontBack(SPEED_FREE); 363 } 364 365 366 367 if(this->state_ == MASTER) 368 { 369 if (this->target_ || distance > 10) 370 { 371 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x); 372 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y); 373 } 374 375 if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength()) 376 { 377 this->getControllableEntity()->moveFrontBack(-0.05f); 378 } else this->getControllableEntity()->moveFrontBack(SPEED_MASTER); 379 } 380 381 382 383 if(this->state_ == SLAVE) 384 { 385 386 this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x); 387 this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y); 388 389 if (distance < 300) 390 { 391 if (distance < 40) 392 { 393 this->getControllableEntity()->moveFrontBack(0.8f*SPEED_MASTER); 394 } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER); 395 396 } else { 397 this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f); 398 } 399 } 400 401 if (distance < 10) 402 { 403 this->positionReached(); 404 } 405 } 406 407 void ArtificialController::absoluteMoveToPosition(const Vector3& target) 408 { 409 float minDistance = 40.0f; 410 if (!this->getControllableEntity()) 411 return; 412 413 Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target); 414 float distance = (target - this->getControllableEntity()->getPosition()).length(); 415 416 if (this->target_ || distance > minDistance) 417 { 418 // Multiply with ROTATEFACTOR_FREE to make them a bit slower 419 this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x); 420 this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y); 421 this->getControllableEntity()->moveFrontBack(SPEED_FREE); 422 } 423 424 425 if (distance < minDistance) 426 { 427 this->positionReached(); 428 } 429 } 430 431 432 void ArtificialController::moveToTargetPosition() 433 { 434 this->moveToPosition(this->targetPosition_); 435 } 436 437 /** 438 @brief Unregisters a slave from its master. Initiated by a slave. 439 */ 440 void ArtificialController::unregisterSlave() 441 { 442 if (this->myMaster_) 443 { 444 std::vector<ArtificialController*>::iterator it = std::find(this->myMaster_->slaves_.begin(), this->myMaster_->slaves_.end(), this); 445 if (it != this->myMaster_->slaves_.end()) 446 this->myMaster_->slaves_.erase(it); 447 } 448 449 this->myMaster_ = 0; 450 this->state_ = FREE; 451 } 452 453 void ArtificialController::searchNewMaster() 454 { 455 456 if (!this->getControllableEntity()) 457 return; 458 459 this->targetPosition_ = this->getControllableEntity()->getPosition(); 460 this->forgetTarget(); 461 int teamSize = 0; 462 //go through all pawns 463 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 464 { 465 //same team? 466 if (!ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype())) 467 continue; 468 469 //has it an ArtificialController? 470 Controller* controller = 0; 471 472 if (it->getController()) 473 controller = it->getController(); 474 else if (it->getXMLController()) 475 controller = it->getXMLController(); 476 477 if (!controller) 478 continue; 479 480 //is pawn oneself? 481 if (orxonox_cast<ControllableEntity*>(*it) == this->getControllableEntity()) 482 continue; 483 484 teamSize++; 485 486 ArtificialController *newMaster = orxonox_cast<ArtificialController*>(controller); 487 488 //is it a master? 489 if (!newMaster || newMaster->state_ != MASTER) 490 continue; 491 492 float distance = (it->getPosition() - this->getControllableEntity()->getPosition()).length(); 493 494 // is pawn in range? 495 if (distance < RADIUS_TO_SEARCH_FOR_MASTERS) 496 { 497 if(newMaster->slaves_.size() > this->maxFormationSize_) continue; 498 499 for(std::vector<ArtificialController*>::iterator itSlave = this->slaves_.begin(); itSlave != this->slaves_.end(); itSlave++) 500 { 501 (*itSlave)->myMaster_ = newMaster; 502 newMaster->slaves_.push_back(*itSlave); 503 } 504 this->slaves_.clear(); 505 this->state_ = SLAVE; 506 507 this->myMaster_ = newMaster; 508 newMaster->slaves_.push_back(this); 509 510 break; 511 } 512 } 513 514 if (this->state_ != SLAVE && teamSize != 0) 515 { 516 this->state_ = MASTER; 517 this->myMaster_ = 0; 518 } 519 } 520 521 /** 522 @brief Commands the slaves of a master into a formation. Sufficiently fast not to be called within tick. Initiated by a master. 523 */ 524 void ArtificialController::commandSlaves() 525 { 526 if(this->state_ != MASTER) return; 527 528 Quaternion orient = this->getControllableEntity()->getOrientation(); 529 Vector3 dest = this->getControllableEntity()->getPosition(); 530 531 // 1 slave: follow 532 if (this->slaves_.size() == 1) 533 { 534 dest += 4*orient*WorldEntity::BACK; 535 this->slaves_.front()->setTargetPosition(dest); 536 } 537 else 538 { 539 dest += 1.0f*orient*WorldEntity::BACK; 540 Vector3 pos = Vector3::ZERO; 541 int i = 1; 542 543 for(std::vector<ArtificialController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++) 544 { 545 pos = Vector3::ZERO; 546 if (i <= 1) pos += dest + (float)FORMATION_WIDTH*(orient*WorldEntity::LEFT); 547 if (i == 2) pos += dest + (float)FORMATION_WIDTH*(orient*WorldEntity::RIGHT); 548 if (i == 3) pos += dest + (float)FORMATION_WIDTH*(orient*WorldEntity::UP); 549 if (i >= 4) 550 { 551 pos += dest + (float)FORMATION_WIDTH*(orient*WorldEntity::DOWN); 552 i = 1; 553 dest += (float)FORMATION_LENGTH*(orient*WorldEntity::BACK); 554 (*it)->setTargetPosition(pos); 555 continue; 556 } 557 i++; 558 (*it)->setTargetPosition(pos); 559 } 560 } 561 } 562 563 /** 564 @brief Sets a new master within the formation. Called by a master. 565 */ 566 void ArtificialController::setNewMasterWithinFormation() 567 { 568 if(this->state_ != MASTER) return; 569 570 if (!this->slaves_.empty()) 571 { 572 ArtificialController *newMaster = this->slaves_.back(); 573 this->slaves_.pop_back(); 574 575 newMaster->state_ = MASTER; 576 newMaster->slaves_ = this->slaves_; 577 newMaster->myMaster_ = 0; 578 579 for(std::vector<ArtificialController*>::iterator it = newMaster->slaves_.begin(); it != newMaster->slaves_.end(); it++) 580 { 581 (*it)->myMaster_ = newMaster; 582 } 583 } 584 585 this->slaves_.clear(); 586 this->specificMasterAction_ = NONE; 587 this->state_ = FREE; 588 } 589 590 /** 591 @brief Frees all slaves form a master. Initiated by a master. 592 */ 593 void ArtificialController::freeSlaves() 594 { 595 if(this->state_ != MASTER) return; 596 597 for(std::vector<ArtificialController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++) 598 { 599 (*it)->state_ = FREE; 600 (*it)->myMaster_ = 0; 601 } 602 this->slaves_.clear(); 603 } 604 605 /** 606 @brief Master sets its slaves free for @ref FREEDOM_COUNT seconds. 607 */ 608 void ArtificialController::forceFreeSlaves() 609 { 610 if(this->state_ != MASTER) return; 611 612 for(std::vector<ArtificialController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++) 613 { 614 (*it)->state_ = FREE; 615 (*it)->forceFreedom(); 616 (*it)->targetPosition_ = this->targetPosition_; 617 (*it)->bShooting_ = true; 618 // (*it)->getControllableEntity()->fire(0);// fire once for fun 619 } 620 } 621 622 void ArtificialController::loseMasterState() 623 { 624 this->freeSlaves(); 625 this->state_ = FREE; 626 } 627 628 629 void ArtificialController::forceFreedom() 630 { 631 this->freedomCount_ = FREEDOM_COUNT; 632 } 633 634 /** 635 @brief Checks wether caller has been forced free, decrements time to stay forced free. 636 @return true if forced free. 637 */ 638 bool ArtificialController::forcedFree() 639 { 640 if(this->freedomCount_ > 0) 641 { 642 this->freedomCount_--; 643 return true; 644 } else return false; 645 } 646 647 /** 648 @brief Used to continue a "specific master action" for a certain time and resuming normal behaviour after. 649 */ 650 void ArtificialController::specificMasterActionHold() 651 { 652 if(this->state_ != MASTER) return; 653 654 if (specificMasterActionHoldCount_ == 0) 655 { 656 this->specificMasterAction_ = NONE; 657 this->searchNewTarget(); 658 } 659 else specificMasterActionHoldCount_--; 660 } 661 662 /** 663 @brief Master initializes a 180 degree turn. Leads to a "specific master action". 664 */ 665 void ArtificialController::turn180Init() 666 { 667 if(this->state_ != MASTER) return; 668 669 Quaternion orient = this->getControllableEntity()->getOrientation(); 670 671 this->setTargetPosition(this->getControllableEntity()->getPosition() + 1000.0f*orient*WorldEntity::BACK); 672 673 this->specificMasterActionHoldCount_ = 4; 674 675 this->specificMasterAction_ = TURN180; 676 } 677 678 /** 679 @brief Execute the 180 degree turn. Called within tick. 680 */ 681 void ArtificialController::turn180() 682 { 683 Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->targetPosition_); 684 685 this->getControllableEntity()->rotateYaw(-2.0f * sgn(coord.x) * coord.x*coord.x); 686 this->getControllableEntity()->rotatePitch(2.0f * sgn(coord.y) * coord.y*coord.y); 687 688 this->getControllableEntity()->moveFrontBack(SPEED_MASTER); 689 } 690 691 /** 692 @brief Master initializes a spin around its looking direction axis. Leads to a "specific master action". 693 */ 694 void ArtificialController::spinInit() 695 { 696 if(this->state_ != MASTER) return; 697 this->specificMasterAction_ = SPIN; 698 this->specificMasterActionHoldCount_ = 10; 699 } 700 701 /** 702 @brief Execute the spin. Called within tick. 703 */ 704 void ArtificialController::spin() 705 { 706 this->moveToTargetPosition(); 707 this->getControllableEntity()->rotateRoll(0.8f); 708 } 709 710 /** 711 @brief Master begins to follow a pawn. Is a "specific master action". 712 @param pawn pawn to follow. 713 @param always follows pawn forever if true (false if omitted). 714 @param secondsToFollow seconds to follow the pawn if always is false. Will follow pawn 100 seconds if omitted (set in header). 715 */ 716 void ArtificialController::followInit(Pawn* pawn, const bool always, const int secondsToFollow) 717 { 718 if (pawn == NULL || this->state_ != MASTER) 719 return; 720 this->specificMasterAction_ = FOLLOW; 721 722 this->setTarget(pawn); 723 if (!always) 724 this->specificMasterActionHoldCount_ = secondsToFollow; 725 else 726 this->specificMasterActionHoldCount_ = INT_MAX; //for now... 727 728 } 729 730 731 /** 732 @brief Master begins to follow a randomly chosen human player of the same team. Is a "specific master action". 733 */ 734 void ArtificialController::followRandomHumanInit() 735 { 736 737 Pawn *humanPawn = NULL; 738 NewHumanController *currentHumanController = NULL; 739 740 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 741 { 742 if (!it->getController()) 743 continue; 744 745 currentHumanController = orxonox_cast<NewHumanController*>(it->getController()); 746 if(currentHumanController) 747 { 748 if (!ArtificialController::sameTeam(this->getControllableEntity(), *it, this->getGametype())) continue; 749 humanPawn = *it; 750 break; 751 } 752 } 753 754 if((humanPawn != NULL)) 755 this->followInit(humanPawn); 756 } 757 758 /** 759 @brief Master follows target with adjusted speed. Called within tick. 760 */ 761 void ArtificialController::follow() 762 { 763 if (this->target_) 764 this->moveToPosition(this->target_->getPosition()); 765 else 766 this->specificMasterActionHoldCount_ = 0; 767 /* 768 if (!this->getControllableEntity()) 769 return; 770 771 float distance = (this->target_->getPosition() - this->getControllableEntity()->getPosition()).length(); 772 773 Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->target_->getPosition()); 774 775 776 this->getControllableEntity()->rotateYaw(-0.8f * sgn(coord.x) * coord.x*coord.x); 777 this->getControllableEntity()->rotatePitch(0.8f * sgn(coord.y) * coord.y*coord.y); 778 779 float speedDiv = this->getControllableEntity()->getVelocity().squaredLength() - this->target_->getVelocity().squaredLength(); 780 781 orxout() << "~follow distance: " << distance << "SpeedCounter: " << this->speedCounter_ << "~speedDiv: " << speedDiv << endl; 782 if (distance < 800) 783 { 784 if (distance < 200) 785 { 786 this->speedCounter_ -= 0.5f; 787 if(this->speedCounter_ < 0) this->speedCounter_ = 0.0f; 788 this->getControllableEntity()->moveFrontBack(speedCounter_); 789 } else { 790 if(speedDiv < 0) 791 this->speedCounter_ += 0.01f; 792 else 793 this->speedCounter_ -= 0.05f; 794 this->getControllableEntity()->moveFrontBack(speedCounter_); 795 } 796 797 } else { 798 this->speedCounter_ += 0.05f; 799 this->getControllableEntity()->moveFrontBack(speedCounter_ + distance/300.0f); 800 } 801 // if (this->getControllableEntity()->getVelocity().squaredLength() > 50.0f) this->speedCounter_ = 0; 802 803 */ 804 } 805 806 807 /** 808 @brief Slave moving behaviour when master is following a pawn, gets redirected from moveToPosition(const Vector3& target)). Called within tick. 809 */ 810 void ArtificialController::followForSlaves(const Vector3& target) 811 { 812 813 /* 814 if (!this->getControllableEntity() && !this->myMaster_ && this->myMaster_->state_ != FOLLOW && !this->myMaster_->target_) 815 return; 816 817 float distance = (target - this->getControllableEntity()->getPosition()).length(); 818 819 Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, target); 820 821 822 this->getControllableEntity()->rotateYaw(-0.8f * sgn(coord.x) * coord.x*coord.x); 823 this->getControllableEntity()->rotatePitch(0.8f * sgn(coord.y) * coord.y*coord.y); 824 825 826 float speedDiv = this->getControllableEntity()->getVelocity().squaredLength() - this->myMaster_->target_->getVelocity().squaredLength(); 827 828 829 if (distance < 800) 830 { 831 if (distance < 200) 832 { 833 this->speedCounter_ -= 5.0f; 834 if(this->speedCounter_ < 0) this->speedCounter_ = 0.0f; 835 this->getControllableEntity()->moveFrontBack(speedCounter_); 836 } else { 837 if(speedDiv < 0) 838 this->speedCounter_ += 0.01f; 839 else 840 this->speedCounter_ -= 0.05f; 841 this->getControllableEntity()->moveFrontBack(speedCounter_); 842 } 843 844 } else { 845 this->speedCounter_ += 0.05f; 846 this->getControllableEntity()->moveFrontBack(speedCounter_ + distance/300.0f); 847 } 848 // if (this->getControllableEntity()->getVelocity().squaredLength() > 50.0f) this->speedCounter_ = 0; 849 */ 850 } 851 852 853 void ArtificialController::setTargetPosition(const Vector3& target) 854 { 855 this->targetPosition_ = target; 856 this->bHasTargetPosition_ = true; 857 } 858 859 void ArtificialController::searchRandomTargetPosition() 860 { 861 this->targetPosition_ = Vector3(rnd(-2000,2000), rnd(-2000,2000), rnd(-2000,2000)); 862 this->bHasTargetPosition_ = true; 863 } 864 865 void ArtificialController::setTarget(Pawn* target) 866 { 867 this->target_ = target; 868 869 if (target) 870 this->targetPosition_ = target->getPosition(); 871 } 872 873 void ArtificialController::searchNewTarget() 874 { 875 if (!this->getControllableEntity()) 876 return; 877 878 this->targetPosition_ = this->getControllableEntity()->getPosition(); 879 this->forgetTarget(); 880 881 for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it) 882 { 883 if (ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype())) 884 continue; 885 886 /* So AI won't choose invisible Spaceships as target */ 887 if (!it->getRadarVisibility()) 888 continue; 889 890 if (static_cast<ControllableEntity*>(*it) != this->getControllableEntity()) 891 { 892 float speed = this->getControllableEntity()->getVelocity().length(); 893 Vector3 distanceCurrent = this->targetPosition_ - this->getControllableEntity()->getPosition(); 894 Vector3 distanceNew = it->getPosition() - this->getControllableEntity()->getPosition(); 895 if (!this->target_ || it->getPosition().squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceNew) / speed / distanceNew.length()) / math::twoPi) 896 < this->targetPosition_.squaredDistance(this->getControllableEntity()->getPosition()) * (1.5f + acos((this->getControllableEntity()->getOrientation() * WorldEntity::FRONT).dotProduct(distanceCurrent) / speed / distanceCurrent.length()) / math::twoPi) + rnd(-250, 250)) 897 { 898 this->target_ = (*it); 899 this->targetPosition_ = it->getPosition(); 900 } 901 } 902 } 903 } 904 905 void ArtificialController::forgetTarget() 906 { 907 this->target_ = 0; 908 this->bShooting_ = false; 909 } 74 } 75 910 76 911 77 void ArtificialController::aimAtTarget() … … 947 113 if (target == this->target_) 948 114 this->targetDied(); 949 }950 951 void ArtificialController::targetDied()952 {953 this->forgetTarget();954 this->searchRandomTargetPosition();955 }956 957 bool ArtificialController::sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype)958 {959 if(!entity1 || !entity2)960 return true;961 if (entity1 == entity2)962 return true;963 964 int team1 = -1;965 int team2 = -1;966 967 Controller* controller = 0;968 if (entity1->getController())969 controller = entity1->getController();970 else971 controller = entity1->getXMLController();972 if (controller)973 {974 ArtificialController* ac = orxonox_cast<ArtificialController*>(controller);975 if (ac)976 team1 = ac->getTeam();977 }978 979 if (entity2->getController())980 controller = entity2->getController();981 else982 controller = entity2->getXMLController();983 if (controller)984 {985 ArtificialController* ac = orxonox_cast<ArtificialController*>(controller);986 if (ac)987 team2 = ac->getTeam();988 }989 990 TeamDeathmatch* tdm = orxonox_cast<TeamDeathmatch*>(gametype);991 if (tdm)992 {993 if (entity1->getPlayer())994 team1 = tdm->getTeam(entity1->getPlayer());995 996 if (entity2->getPlayer())997 team2 = tdm->getTeam(entity2->getPlayer());998 }999 1000 TeamBaseMatchBase* base = 0;1001 base = orxonox_cast<TeamBaseMatchBase*>(entity1);1002 if (base)1003 {1004 switch (base->getState())1005 {1006 case BaseState::ControlTeam1:1007 team1 = 0;1008 break;1009 case BaseState::ControlTeam2:1010 team1 = 1;1011 break;1012 case BaseState::Uncontrolled:1013 default:1014 team1 = -1;1015 }1016 }1017 base = orxonox_cast<TeamBaseMatchBase*>(entity2);1018 if (base)1019 {1020 switch (base->getState())1021 {1022 case BaseState::ControlTeam1:1023 team2 = 0;1024 break;1025 case BaseState::ControlTeam2:1026 team2 = 1;1027 break;1028 case BaseState::Uncontrolled:1029 default:1030 team2 = -1;1031 }1032 }1033 1034 DroneController* droneController = 0;1035 droneController = orxonox_cast<DroneController*>(entity1->getController());1036 if (droneController && static_cast<ControllableEntity*>(droneController->getOwner()) == entity2)1037 return true;1038 droneController = orxonox_cast<DroneController*>(entity2->getController());1039 if (droneController && static_cast<ControllableEntity*>(droneController->getOwner()) == entity1)1040 return true;1041 DroneController* droneController1 = orxonox_cast<DroneController*>(entity1->getController());1042 DroneController* droneController2 = orxonox_cast<DroneController*>(entity2->getController());1043 if (droneController1 && droneController2 && droneController1->getOwner() == droneController2->getOwner())1044 return true;1045 1046 Dynamicmatch* dynamic = orxonox_cast<Dynamicmatch*>(gametype);1047 if (dynamic)1048 {1049 if (dynamic->notEnoughPigs||dynamic->notEnoughKillers||dynamic->notEnoughChasers) {return false;}1050 1051 if (entity1->getPlayer())1052 team1 = dynamic->getParty(entity1->getPlayer());1053 1054 if (entity2->getPlayer())1055 team2 = dynamic->getParty(entity2->getPlayer());1056 1057 if (team1 ==-1 ||team2 ==-1 ) {return false;}1058 else if (team1 == dynamic->chaser && team2 != dynamic->chaser) {return false;}1059 else if (team1 == dynamic->piggy && team2 == dynamic->chaser) {return false;}1060 else if (team1 == dynamic->killer && team2 == dynamic->chaser) {return false;}1061 else return true;1062 }1063 1064 return (team1 == team2 && team1 != -1);1065 115 } 1066 116 … … 1110 160 { 1111 161 Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity()); 1112 if(pawn )162 if(pawn && pawn->isA(Class(SpaceShip))) //fix for First Person Mode: check for SpaceShip 1113 163 { 1114 164 this->weaponModes_.clear(); // reset previous weapon information … … 1217 267 1218 268 /** 1219 @brief Adds point of interest depending on context. Further Possibilites: "ForceField", "PortalEndPoint", "MovableEntity", "Dock"269 @brief Adds point of interest depending on context. TODO: Further Possibilites: "ForceField", "PortalEndPoint", "MovableEntity", "Dock" 1220 270 */ 1221 271 void ArtificialController::manageWaypoints() … … 1226 276 this->updatePointsOfInterest("PickupSpawner", 20.0f); // take pickup en passant if there is a default waypoint 1227 277 } 1228 278 1229 279 } -
code/trunk/src/orxonox/controllers/ArtificialController.h
r8891 r9016 31 31 32 32 #include "OrxonoxPrereqs.h" 33 #include "controllers/FormationController.h" 33 34 34 #include <map>35 36 #include "util/Math.h"37 #include "Controller.h"38 #include "controllers/NewHumanController.h"39 #include "weaponsystem/WeaponSystem.h"40 35 41 36 namespace orxonox 42 37 { 43 class _OrxonoxExport ArtificialController : public Controller38 class _OrxonoxExport ArtificialController : public FormationController 44 39 { 45 40 public: … … 47 42 virtual ~ArtificialController(); 48 43 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);50 51 44 void abandonTarget(Pawn* target); 52 45 53 inline void setTeam(int team)54 { this->team_ = team; }55 inline int getTeam() const56 { return this->team_; }57 58 inline void setFormationFlight(bool formation)59 { this->formationFlight_ = formation; }60 inline bool getFormationFlight() const61 { return this->formationFlight_; }62 63 inline void setFormationSize(int size)64 { this->maxFormationSize_ = size; }65 inline int getFormationSize() const66 { return this->maxFormationSize_; }67 68 inline void setPassive(bool passive)69 { this->passive_ = passive; }70 inline bool getPassive() const71 { return this->passive_; }72 73 46 virtual void changedControllableEntity(); 74 75 static void formationflight(const bool form);76 static void masteraction(const int action);77 static void followme();78 static void passivebehaviour(const bool passive);79 static void formationsize(const int size);80 47 81 48 virtual void doFire(); … … 95 62 void manageWaypoints(); 96 63 64 65 97 66 protected: 98 99 int team_; 100 bool formationFlight_; 101 bool passive_; 102 unsigned int maxFormationSize_; 103 int freedomCount_; 104 enum State {SLAVE, MASTER, FREE}; 105 State state_; 106 std::vector<ArtificialController*> slaves_; 107 ArtificialController *myMaster_; 108 enum SpecificMasterAction {NONE, HOLD, SPIN, TURN180, FOLLOW}; 109 SpecificMasterAction specificMasterAction_; 110 int specificMasterActionHoldCount_; 111 float speedCounter_; //for speed adjustment when following 112 113 void moveToPosition(const Vector3& target); 114 void moveToTargetPosition(); 115 void absoluteMoveToPosition(const Vector3& target); 116 117 virtual void positionReached() {} 118 119 void removeFromFormation(); 120 void unregisterSlave(); 121 void searchNewMaster(); 122 void commandSlaves(); 123 void setNewMasterWithinFormation(); 124 125 void freeSlaves(); 126 void forceFreeSlaves(); 127 void loseMasterState(); 128 void forceFreedom(); 129 bool forcedFree(); 130 131 void specificMasterActionHold(); 132 void turn180Init(); 133 void turn180(); 134 void spinInit(); 135 void spin(); 136 void followInit(Pawn* pawn, const bool always = false, const int secondsToFollow = 100); 137 void followRandomHumanInit(); 138 void follow(); 139 void followForSlaves(const Vector3& target); 140 141 void setTargetPosition(const Vector3& target); 142 void searchRandomTargetPosition(); 143 144 void setTarget(Pawn* target); 145 void searchNewTarget(); 146 void forgetTarget(); 67 147 68 void aimAtTarget(); 148 69 149 70 bool isCloseAtTarget(float distance) const; 150 71 bool isLookingAtTarget(float angle) const; 151 152 void targetDied();153 154 static bool sameTeam(ControllableEntity* entity1, ControllableEntity* entity2, Gametype* gametype); // hack155 void boostControl(); //<! Sets and resets the boost parameter of the spaceship. Bots alternate between boosting and saving boost.156 157 bool bHasTargetPosition_;158 Vector3 targetPosition_;159 WeakPtr<Pawn> target_;160 bool bShooting_;161 72 162 73 float botlevel_; //<! Makes the level of a bot configurable. … … 165 76 void setPreviousMode(); 166 77 78 167 79 //WEAPONSYSTEM DATA 168 std::map<std::string, int> weaponModes_; //<! Links each "weapon" to it's weaponmode - managed by setupWeapons()80 std::map<std::string, int> weaponModes_; //<! Links each "weapon" to it's weaponmode - managed by setupWeapons() 169 81 //std::vector<int> projectiles_; //<! Displays amount of projectiles of each weapon. - managed by setupWeapons() 170 82 float timeout_; //<! Timeout for rocket usage. (If a rocket misses, a bot should stop using it.) … … 173 85 int getFiremode(std::string name); 174 86 87 175 88 //WAYPOINT DATA 176 89 std::vector<WeakPtr<WorldEntity> > waypoints_; … … 178 91 float squaredaccuracy_; 179 92 WorldEntity* defaultWaypoint_; 93 94 void boostControl(); //<! Sets and resets the boost parameter of the spaceship. Bots alternate between boosting and saving boost. 95 96 private: 180 97 }; 181 98 } -
code/trunk/src/orxonox/controllers/CMakeLists.txt
r7163 r9016 9 9 WaypointPatrolController.cc 10 10 DroneController.cc 11 FormationController.cc 11 12 ) -
code/trunk/src/orxonox/controllers/HumanController.cc
r8858 r9016 50 50 SetConsoleCommand("HumanController", "rotatePitch", &HumanController::rotatePitch ).addShortcut().setAsInputCommand(); 51 51 SetConsoleCommand("HumanController", "rotateRoll", &HumanController::rotateRoll ).addShortcut().setAsInputCommand(); 52 SetConsoleCommand("HumanController", "toggleFormationFlight", &HumanController::toggleFormationFlight).addShortcut().keybindMode(KeybindMode::OnPress); 53 SetConsoleCommand("HumanController", "FFChangeMode", &HumanController::FFChangeMode).addShortcut().keybindMode(KeybindMode::OnPress); 52 54 SetConsoleCommand("HumanController", __CC_fire_name, &HumanController::fire ).addShortcut().keybindMode(KeybindMode::OnHold); 53 55 SetConsoleCommand("HumanController", "reload", &HumanController::reload ).addShortcut(); … … 69 71 /*static*/ const float HumanController::BOOSTING_TIME = 0.1f; 70 72 71 HumanController::HumanController(BaseObject* creator) : Controller(creator)73 HumanController::HumanController(BaseObject* creator) : FormationController(creator) 72 74 { 73 75 RegisterObject(HumanController); … … 76 78 this->boosting_ = false; 77 79 this->boosting_ = false; 78 79 80 HumanController::localController_s = this; 80 81 this->boostingTimeout_.setTimer(HumanController::BOOSTING_TIME, false, createExecutor(createFunctor(&HumanController::terminateBoosting, this))); … … 84 85 HumanController::~HumanController() 85 86 { 87 if (HumanController::localController_s) 88 { 89 HumanController::localController_s->removeFromFormation(); 90 } 86 91 HumanController::localController_s = 0; 87 92 } … … 95 100 orxout(internal_warning) << "HumanController, Warning: Using a ControllableEntity without Camera" << endl; 96 101 } 102 103 // commandslaves when Master of a formation 104 if (HumanController::localController_s && HumanController::localController_s->state_==MASTER) 105 { 106 if (HumanController::localController_s->formationMode_ != ATTACK) 107 HumanController::localController_s->commandSlaves(); 108 } 97 109 } 98 110 … … 160 172 { 161 173 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 174 { 162 175 HumanController::localController_s->controllableEntity_->fire(firemode); 176 //if human fires, set slaves free. See FormationController::forceFreeSlaves() 177 if (HumanController::localController_s->state_==MASTER && HumanController::localController_s->formationMode_ == NORMAL) 178 { 179 HumanController::localController_s->forceFreeSlaves(); 180 } 181 } 163 182 } 164 183 … … 195 214 this->boosting_ = true; 196 215 this->boostingTimeout_.startTimer(); 197 198 this->controllableEntity_->boost(this->boosting_);216 if(this->controllableEntity_) 217 this->controllableEntity_->boost(this->boosting_); 199 218 // orxout() << "Start boosting" << endl; 200 219 } … … 209 228 this->boosting_ = false; 210 229 this->boostingTimeout_.stopTimer(); 211 212 this->controllableEntity_->boost(this->boosting_);230 if(this->controllableEntity_) 231 this->controllableEntity_->boost(this->boosting_); 213 232 // orxout() << "Stop boosting" << endl; 214 233 } … … 262 281 } 263 282 283 /** 284 @brief 285 toggle the formation. Not usable, if formationflight is disabled generally (formationFlight_) 286 */ 287 void HumanController::toggleFormationFlight() 288 { 289 if (HumanController::localController_s) 290 { 291 if (!HumanController::localController_s->formationFlight_) 292 { 293 return; //dont use when formationFlight is disabled 294 } 295 if (HumanController::localController_s->state_==MASTER) 296 { 297 HumanController::localController_s->loseMasterState(); 298 orxout(message) <<"FormationFlight disabled "<< endl; 299 } else //SLAVE or FREE 300 { 301 HumanController::localController_s->takeLeadOfFormation(); 302 orxout(message) <<"FormationFlight enabled "<< endl; 303 } 304 305 } 306 307 } 308 309 /** 310 @brief 311 Switch through the different Modes of formationflight. You must be a master of a formation to use. 312 */ 313 void HumanController::FFChangeMode() 314 { 315 if (HumanController::localController_s && HumanController::localController_s->state_==MASTER) 316 { 317 switch (HumanController::localController_s->getFormationMode()) { 318 case NORMAL: 319 HumanController::localController_s->setFormationMode(DEFEND); 320 orxout(message) <<"Mode: DEFEND "<< endl; 321 break; 322 case DEFEND: 323 HumanController::localController_s->setFormationMode(ATTACK); 324 orxout(message) <<"Mode: ATTACK "<< endl; 325 break; 326 case ATTACK: 327 HumanController::localController_s->setFormationMode(NORMAL); 328 orxout(message) <<"Mode: NORMAL "<< endl; 329 break; 330 } 331 } 332 } 333 334 335 //used, when slaves are in DEFEND mode. 336 void HumanController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) 337 { 338 if (!this->formationFlight_ || this->state_!=MASTER || this->formationMode_!=DEFEND) return; 339 this->masterAttacked(originator); 340 } 341 264 342 void HumanController::addBots(unsigned int amount) 265 343 { -
code/trunk/src/orxonox/controllers/HumanController.h
r8706 r9016 34 34 #include "tools/Timer.h" 35 35 #include "tools/interfaces/Tickable.h" 36 #include " Controller.h"36 #include "FormationController.h" 37 37 38 38 // tolua_begin … … 41 41 class _OrxonoxExport HumanController 42 42 // tolua_end 43 : public Controller, public Tickable43 : public FormationController, public Tickable 44 44 { // tolua_export 45 45 public: … … 74 74 void keepBoosting(void); 75 75 void terminateBoosting(void); 76 76 77 77 78 static void greet(); 78 79 static void switchCamera(); … … 84 85 static void toggleGodMode(); 85 86 static void myposition(); 87 88 static void toggleFormationFlight(); 89 static void FFChangeMode(); 90 virtual void hit(Pawn* originator, btManifoldPoint& contactpoint, float damage); 91 86 92 87 93 static void addBots(unsigned int amount); -
code/trunk/src/orxonox/controllers/NewHumanController.cc
r8858 r9016 291 291 } 292 292 else 293 HumanController::localController_s->getControllableEntity()->fire(firemode); 294 293 HumanController::doFire(firemode); //call for formationflight 295 294 } 296 295 297 296 void NewHumanController::hit(Pawn* originator, btManifoldPoint& contactpoint, float damage) 298 297 { 298 //Used in HumanController for formationFlight 299 HumanController::hit(originator,contactpoint,damage); 300 299 301 if (this->showDamageOverlay_ && !this->controlPaused_ && this->controllableEntity_ && !this->controllableEntity_->isInMouseLook()) 300 302 { -
code/trunk/src/orxonox/controllers/NewHumanController.h
r7859 r9016 69 69 virtual void doResumeControl(); 70 70 71 float getCurrentYaw(){ return this->currentYaw_; } 72 float getCurrentPitch(){ return this->currentPitch_; } 73 71 74 72 75 protected: -
code/trunk/src/orxonox/controllers/WaypointPatrolController.cc
r7184 r9016 42 42 RegisterObject(WaypointPatrolController); 43 43 44 //this->team_ = 0;45 44 this->alertnessradius_ = 500; 46 45 … … 53 52 54 53 XMLPortParam(WaypointPatrolController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f); 55 // XMLPortParam(WaypointPatrolController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(0);56 54 } 57 55 -
code/trunk/src/orxonox/controllers/WaypointPatrolController.h
r7163 r9016 46 46 virtual void tick(float dt); 47 47 48 /* inline void setTeam(int team)49 { this->team_ = team; }50 inline int getTeam() const51 { return this->team_; } */52 53 48 inline void setAlertnessRadius(float radius) 54 49 { this->alertnessradius_ = radius; } … … 59 54 void searchEnemy(); 60 55 61 //int team_;62 56 float alertnessradius_; 63 57 Timer patrolTimer_; -
code/trunk/src/orxonox/gametypes/CMakeLists.txt
r8178 r9016 9 9 LastManStanding.cc 10 10 LastTeamStanding.cc 11 TeamGametype.cc 12 Mission.cc 11 13 ) -
code/trunk/src/orxonox/gametypes/Gametype.cc
r8858 r9016 123 123 if (this->gtinfo_->isStartCountdownRunning() && !this->gtinfo_->hasStarted()) 124 124 this->gtinfo_->countdownStartCountdown(dt); 125 125 126 126 if (!this->gtinfo_->hasStarted()) 127 127 { … … 131 131 if(it->first->isHumanPlayer() && it->first->isReadyToSpawn()) 132 132 this->gtinfo_->playerReadyToSpawn(it->first); 133 } 134 133 134 135 } 135 136 this->checkStart(); 136 137 } … … 143 144 void Gametype::start() 144 145 { 146 145 147 this->addBots(this->numberOfBots_); 146 148 … … 148 150 149 151 this->spawnPlayersIfRequested(); 152 153 150 154 } 151 155 … … 376 380 { 377 381 this->gtinfo_->stopStartCountdown(); 378 this->gtinfo_->setStartCountdown(0.0f); ;382 this->gtinfo_->setStartCountdown(0.0f); 379 383 this->start(); 380 384 } … … 397 401 hashumanplayers = true; 398 402 } 403 399 404 if (allplayersready && hashumanplayers) 400 405 { … … 408 413 } 409 414 } 415 410 416 } 411 417 } … … 439 445 if(player->isHumanPlayer()) 440 446 this->gtinfo_->playerSpawned(player); 441 447 442 448 this->playerPostSpawn(player); 443 449 } -
code/trunk/src/orxonox/gametypes/Gametype.h
r8706 r9016 123 123 { return this->gtinfo_->getHUDTemplate(); } 124 124 125 v oid addBots(unsigned int amount);125 virtual void addBots(unsigned int amount); 126 126 void killBots(unsigned int amount = 0); 127 128 inline unsigned int getNumberOfPlayers() const129 { return this->players_.size(); }130 127 131 128 virtual void addTime(float t); … … 151 148 152 149 //inline bool getForceSpawn() 153 // { return this->bForceSpawn_; } 150 // { return this->bForceSpawn_; } 154 151 155 152 virtual void resetTimer(); 156 153 virtual void resetTimer(float t); 154 inline unsigned int getNumberOfPlayers() 155 { return this->gtinfo_->getNumberOfPlayers(); } 156 157 157 158 158 159 protected: … … 192 193 ConsoleCommand* dedicatedKillBots_; 193 194 /* HACK HACK HACK */ 195 194 196 }; 195 197 } -
code/trunk/src/orxonox/gametypes/TeamDeathmatch.h
r5781 r9016 56 56 57 57 int getTeam(PlayerInfo* player); 58 59 58 inline const ColourValue& getTeamColour(int teamnr) const 60 59 { return this->teamcolours_[teamnr]; } -
code/trunk/src/orxonox/gametypes/UnderAttack.cc
r8858 r9016 49 49 this->gameEnded_ = false; 50 50 51 this->setHUDTemplate("UnderAttackHUD");52 51 //this->setHUDTemplate("UnderAttackHUD"); 52 //This HUD is in conflict with the HUDEnemyHealthBar 53 53 this->setConfigValues(); 54 54 this->timesequence_ = static_cast<int>(this->gameTime_); -
code/trunk/src/orxonox/infos/GametypeInfo.cc
r8858 r9016 71 71 this->bStarted_ = false; 72 72 this->bEnded_ = false; 73 this->startCountdown_ = 0.0f;73 this->startCountdown_ = 10.0f; 74 74 this->bStartCountdownRunning_ = false; 75 this->counter_ = 0;75 this->counter_ = 10; 76 76 this->spawned_ = false; 77 77 this->readyToSpawn_ = false; … … 164 164 { 165 165 if(this->bStarted_) 166 return;166 { return;} 167 167 168 168 this->bStarted_ = true; 169 169 this->changedStarted(); 170 171 170 172 } 171 173 -
code/trunk/src/orxonox/infos/GametypeInfo.h
r8706 r9016 119 119 inline const std::string& getHUDTemplate() const 120 120 { return this->hudtemplate_; } 121 122 inline unsigned int getNumberOfPlayers() const 123 { return this->spawnedPlayers_.size(); } 121 124 122 125 void sendAnnounceMessage(const std::string& message); -
code/trunk/src/orxonox/infos/PlayerInfo.cc
r8891 r9016 36 36 #include "worldentities/ControllableEntity.h" 37 37 #include "controllers/Controller.h" 38 #include "worldentities/pawns/SpaceShip.h" 38 39 39 40 namespace orxonox … … 57 58 58 59 this->registerVariables(); 60 59 61 } 60 62 … … 170 172 171 173 this->changedControllableEntity(); 174 SpaceShip* spaceship = dynamic_cast<SpaceShip*>(entity); 175 if (spaceship != NULL) 176 { 177 spaceship->setRVName(this->getName()); 178 } 172 179 } 173 180 -
code/trunk/src/orxonox/interfaces/RadarViewable.cc
r8858 r9016 51 51 , radarObjectDescription_("staticObject") 52 52 , scale_(1.0f) 53 , RVName("") 53 54 { 54 55 RegisterRootObject(RadarViewable); -
code/trunk/src/orxonox/interfaces/RadarViewable.h
r8738 r9016 60 60 RadarViewable(BaseObject* creator, const WorldEntity* wePtr); 61 61 virtual ~RadarViewable(); 62 63 virtual void setRVName(std::string name) 64 { 65 if (this->RVName != name) 66 { 67 this->RVName = name; 68 this->settingsChanged(); 69 } 70 } 71 std::string getRVName() const 72 { return this->RVName; } 62 73 63 74 inline void setRadarObjectCamouflage(float camouflage) … … 152 163 ColourValue radarObjectColour_; 153 164 float scale_; 165 std::string RVName; 154 166 }; 155 167 } -
code/trunk/src/orxonox/worldentities/ControllableEntity.cc
r8891 r9016 74 74 this->bMouseLook_ = false; 75 75 this->mouseLookSpeed_ = 200; 76 this->bIsRocket_ = false;77 76 78 77 this->server_position_ = Vector3::ZERO; … … 88 87 this->setPriority( Priority::VeryHigh ); 89 88 this->registerVariables(); 89 this->team_ = -1; 90 90 } 91 91 … … 120 120 SUPER(ControllableEntity, XMLPort, xmlelement, mode); 121 121 122 XMLPortParam(ControllableEntity, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1); 122 123 XMLPortParam(ControllableEntity, "hudtemplate", setHudTemplate, getHudTemplate, xmlelement, mode); 123 124 XMLPortParam(ControllableEntity, "camerapositiontemplate", setCameraPositionTemplate, getCameraPositionTemplate, xmlelement, mode); -
code/trunk/src/orxonox/worldentities/ControllableEntity.h
r8891 r9016 163 163 { return this->target_.get(); } 164 164 void setTargetInternal( uint32_t targetID ); 165 inline bool getRocket() const 166 { return this-> bIsRocket_; } 165 166 inline void setTeam(int team) 167 { this->team_ = team; } 168 inline float getTeam() const 169 { return this->team_; } 167 170 168 171 protected: … … 183 186 184 187 Ogre::SceneNode* cameraPositionRootNode_; 185 bool bIsRocket_; //Workaround to see, if the controllable entity is a Rocket.186 188 187 189 private: … … 240 242 CameraPosition* reverseCamera_; 241 243 WeakPtr<WorldEntity> target_; 244 245 int team_ ; //<! teamnumber 242 246 }; 243 247 } -
code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.cc
r8858 r9016 270 270 } 271 271 272 void FpsPlayer::boost( ) //acctually jump272 void FpsPlayer::boost(bool bBoost) //acctually jump 273 273 { 274 274 if (this->isFloor_) -
code/trunk/src/orxonox/worldentities/pawns/FpsPlayer.h
r7163 r9016 65 65 { return this->meshSrc_; } 66 66 67 void boost( ); //acctually jump67 void boost(bool bBoost); //acctually jump 68 68 69 69 virtual void fire(); -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r8891 r9016 129 129 XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0); 130 130 XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f); 131 132 XMLPortParam ( RadarViewable, "RVName", setRVName, getRVName, xmlelement, mode ); 131 133 } 132 134 … … 455 457 SUPER(Pawn, changedActivity); 456 458 457 this->setRadarVisibility(this->is Active());459 this->setRadarVisibility(this->isVisible()); 458 460 } 459 461 -
code/trunk/src/orxonox/worldentities/pawns/Pawn.h
r8891 r9016 53 53 inline bool isAlive() const 54 54 { return this->bAlive_; } 55 55 56 56 57 virtual void setHealth(float health); … … 194 195 { return NULL; } 195 196 197 196 198 float health_; 197 199 float maxHealth_;
Note: See TracChangeset
for help on using the changeset viewer.