Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7163


Ignore:
Timestamp:
Aug 11, 2010, 8:55:13 AM (10 years ago)
Author:
dafrick
Message:

Merged presentation3 branch into trunk.

Location:
code/trunk
Files:
35 deleted
301 edited
119 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/CMakeLists.txt

    r6444 r7163  
    7676
    7777# This sets where to look for CMake modules (e.g. "Find*.cmake" files)
    78 SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
     78SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_SOURCE_DIR}/cmake/tools)
    7979
    8080# Set Debug build to default when not having multi-config generator like msvc
  • code/trunk/README

    r6417 r7163  
    44
    55This game is free, if you have paid for this, get your money back! The source code of this game is licensed under the GPL (GNU General Public License).
    6 The game content is licensed under the Creative Commons Attribution-Sharealike 2.5 license. For more information read LICENSE in the same folder you found this file.
     6The game content is licensed under the Creative Commons Attribution-Sharealike 3.0 license. For more information read LICENSE in the same folder you found this file.
    77
    88For directions to install this game, please check out the file INSTALL or http://www.orxonox.net/wiki/Running
  • code/trunk/cmake/CompilerConfigMSVC.cmake

    r6723 r7163  
    6868ADD_COMPILER_FLAGS("-D__WIN32__ -D_WIN32"      CACHE)
    6969ADD_COMPILER_FLAGS("-D_CRT_SECURE_NO_WARNINGS" CACHE)
     70ADD_COMPILER_FLAGS("-D_SCL_SECURE_NO_WARNINGS" CACHE)
    7071
    7172# Overwrite CMake default flags here.
  • code/trunk/cmake/InstallConfig.cmake

    r5695 r7163  
    5252  IF(UNIX) # Apple too?
    5353    # Using absolute paths
    54     SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)
    55     SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/orxonox)
    56     SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/orxonox/static)
    57     SET(MODULE_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/lib/orxonox/modules)
     54    SET(RUNTIME_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/games)
     55    SET(LIBRARY_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox)
     56    SET(ARCHIVE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/static)
     57    SET(MODULE_INSTALL_DIRECTORY  ${CMAKE_INSTALL_PREFIX}/lib/games/orxonox/modules)
    5858    SET(DOC_INSTALL_DIRECTORY     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
    59     SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/share/orxonox)
     59    SET(DATA_INSTALL_DIRECTORY    ${CMAKE_INSTALL_PREFIX}/share/games/orxonox)
    6060  ENDIF()
    6161
  • code/trunk/cmake/LibraryConfig.cmake

    r6461 r7163  
    188188
    189189# More plugins: Plugin_BSPSceneManager, Plugin_OctreeSceneManager
    190 SET(OGRE_PLUGINS_INT Plugin_ParticleFX)
     190SET(OGRE_PLUGINS_INT "Plugin_ParticleFX;Plugin_BSPSceneManager")
    191191IF(WIN32)
    192192  # CG program manager is probably DirectX related (not available under unix)
  • code/trunk/data/CMakeLists.txt

    r5794 r7163  
    5959  DIRECTORY ${EXTERNAL_DATA_DIRECTORY}/
    6060  DESTINATION ${DATA_INSTALL_DIRECTORY}
    61   REGEX "\\.svn$|_svn$|resources\\.oxr" EXCLUDE
     61  REGEX "\\.svn$|_svn$|resources\\.oxr|AUTHORS|LICENSE" EXCLUDE
    6262)
    6363# Configure the install scripts (variables not available during installation)
  • code/trunk/data/DataInstallScript.cmake

    r6417 r7163  
    2929
    3030# Write some comment
    31 FILE(APPEND @DATA_INSTALL_DIRECTORY@/DefaultResources.oxr "\n\n\n <!-- ---------------------------------------- -->")
    32 FILE(APPEND @DATA_INSTALL_DIRECTORY@/DefaultResources.oxr     "\n <!-- Content from the external data directory -->")
    33 FILE(APPEND @DATA_INSTALL_DIRECTORY@/DefaultResources.oxr     "\n <!-- ---------------------------------------- -->\n\n")
     31FILE(APPEND $ENV{DESTDIR}/@DATA_INSTALL_DIRECTORY@/DefaultResources.oxr "\n\n\n <!-- ---------------------------------------- -->")
     32FILE(APPEND $ENV{DESTDIR}/@DATA_INSTALL_DIRECTORY@/DefaultResources.oxr     "\n <!-- Content from the external data directory -->")
     33FILE(APPEND $ENV{DESTDIR}/@DATA_INSTALL_DIRECTORY@/DefaultResources.oxr     "\n <!-- ---------------------------------------- -->\n\n")
    3434
    3535# Append the external file
    3636FILE(READ   @EXTERNAL_DATA_DIRECTORY@/resources.oxr _external_file)
    37 FILE(APPEND @DATA_INSTALL_DIRECTORY@/DefaultResources.oxr ${_external_file})
     37FILE(APPEND $ENV{DESTDIR}/@DATA_INSTALL_DIRECTORY@/DefaultResources.oxr ${_external_file})
  • code/trunk/data/defaultConfig/keybindings.ini

    r6802 r7163  
    77KeyApostrophe=
    88KeyApps=
    9 KeyB=
     9KeyB =
    1010KeyBack=
    1111KeyBackslash=
     
    5959KeyLeftWindows=
    6060KeyLessThan=
    61 KeyM=openMap
     61KeyM=
    6262KeyMail=
    6363KeyMediaSelect=
     
    123123KeyStop=
    124124KeySystemRequest=
    125 KeyT="onpress fire 2"
     125KeyT="onpress fire 3"
    126126KeyTab="NewHumanController changeMode"
    127127KeyU=""
     
    154154Button7=
    155155Left="fire 0"
    156 Middle=
     156Middle="fire 2"
    157157Right= fire 1 | unfire
    158158Wheel1Down="NewHumanController decelerate"
  • code/trunk/data/gui/layouts/MultiplayerMenu.layout

    r6746 r7163  
    1616            <Property Name="VertFormatting" Value="TopAligned" />
    1717            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2875,0},{0.75,0},{0.6375,0}}" />
    18             <Window Type="MenuWidgets/Listbox" Name="orxonox/MultiplayerLevelListbox" >
     18            <Window Type="MenuWidgets/Listbox" Name="orxonox/MultiplayerListbox" >
    1919                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    2020                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.8,0}}" />
  • code/trunk/data/gui/layouts/SettingsMenu.layout

    r6746 r7163  
    22
    33<GUILayout >
    4     <Window Type="MenuWidgets/StaticImage" Name="orxonox/SettingsBackground" >
     4    <Window Type="MenuWidgets/StaticImage" Name="orxonox/SettingsMenu/Background" >
    55        <Property Name="InheritsAlpha" Value="False" />
    66        <Property Name="FrameEnabled" Value="False" />
     
    88        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
    99        <Property Name="BackgroundEnabled" Value="False" />
    10         <Window Type="MenuWidgets/StaticText" Name="orxonox/SettingsWindow" >
     10        <Window Type="MenuWidgets/StaticText" Name="orxonox/SettingsMenu/SettingsWindow" >
    1111            <Property Name="Text" Value="Settings" />
    1212            <Property Name="Alpha" Value="0.8" />
     
    1616            <Property Name="VertFormatting" Value="TopAligned" />
    1717            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.3625,0},{0.75,0},{0.6375,0}}" />
    18             <Window Type="MenuWidgets/Button" Name="orxonox/GameplayButton" >
     18            <Window Type="MenuWidgets/Button" Name="orxonox/SettingsMenu/GameplayButton" >
    1919                <Property Name="Text" Value="Gameplay" />
    2020                <Property Name="Disabled" Value="True" />
     
    2323                <Event Name="Clicked" Function="SettingsMenu.SettingsGameplayButton_clicked"/>
    2424            </Window>
    25             <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerOptionsButton" >
     25            <Window Type="MenuWidgets/Button" Name="orxonox/SettingsMenu/MultiplayerOptionsButton" >
    2626                <Property Name="Text" Value="Multiplayer options" />
    2727                <Property Name="Disabled" Value="True" />
     
    3030                <Event Name="Clicked" Function="SettingsMenu.SettingsMultiplayerOptionsButton_clicked"/>
    3131            </Window>
    32             <Window Type="MenuWidgets/Button" Name="orxonox/ControlsButton" >
     32            <Window Type="MenuWidgets/Button" Name="orxonox/SettingsMenu/ControlsButton" >
    3333                <Property Name="Text" Value="Controls" />
    3434                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     
    3636                <Event Name="Clicked" Function="SettingsMenu.SettingsControlsButton_clicked"/>
    3737            </Window>
    38             <Window Type="MenuWidgets/Button" Name="orxonox/GraphicsButton" >
     38            <Window Type="MenuWidgets/Button" Name="orxonox/SettingsMenu/GraphicsButton" >
    3939                <Property Name="Text" Value="Graphics" />
    4040                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     
    4242                <Event Name="Clicked" Function="SettingsMenu.SettingsGraphicsButton_clicked"/>
    4343            </Window>
    44             <Window Type="MenuWidgets/Button" Name="orxonox/AudioButton" >
     44            <Window Type="MenuWidgets/Button" Name="orxonox/SettingsMenu/AudioButton" >
    4545                <Property Name="Text" Value="Audio" />
    4646                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     
    4848                <Event Name="Clicked" Function="SettingsMenu.SettingsAudioButton_clicked"/>
    4949            </Window>
    50             <Window Type="MenuWidgets/Button" Name="orxonox/ResetSettingsButton" >
    51                 <Property Name="Text" Value="Reset settings" />
    52                 <Property Name="Disabled" Value="True" />
     50            <Window Type="MenuWidgets/Button" Name="orxonox/SettingsMenu/MiscellaneousButton" >
     51                <Property Name="Text" Value="Miscellaneous" />
    5352                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    5453                <Property Name="UnifiedAreaRect" Value="{{0.55,0},{0.727272,0},{0.95,0},{0.909090,0}}" />
    55                 <Event Name="Clicked" Function="SettingsMenu.SettingsResetSettingsButton_clicked"/>
     54                <Event Name="Clicked" Function="SettingsMenu.SettingsMiscellaneousButton_clicked"/>
    5655            </Window>
    5756        </Window>
    58         <Window Type="MenuWidgets/Button" Name="orxonox/SettingsBackButton" >
     57        <Window Type="MenuWidgets/Button" Name="orxonox/SettingsMenu/SettingsBackButton" >
    5958            <Property Name="Text" Value="Back" />
    6059            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
  • code/trunk/data/gui/schemes/OrxonoxGUIScheme.scheme

    r6746 r7163  
    66    <Font Name="BlueHighway-10" Filename="bluehighway-10.font" />
    77    <Font Name="BlueHighway-8"  Filename="bluehighway-8.font"  />
     8    <Font Name="Monofur-10"     Filename="Monofur-10.font" />
    89</GUIScheme>
  • code/trunk/data/gui/scripts/GUITools.lua

    r6746 r7163  
    4545    return 0.008*ratio/0.3204
    4646end
     47
     48function getStaticTextWindowHeight(window)
     49    local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(window:getLookNFeel())
     50    local formattedArea = lookAndFeel:getNamedArea("WithFrameTextRenderArea"):getArea():getPixelRect(window)
     51    local frameHeight = window:getUnclippedPixelRect():getHeight() - formattedArea:getHeight()
     52    local lines = window:getFont():getFormattedLineCount(window:getText(), formattedArea, CEGUI.WordWrapLeftAligned)
     53    local height = lines * window:getFont():getLineSpacing() + frameHeight
     54    return height
     55end
  • code/trunk/data/gui/scripts/HUDSheet.lua

    • Property svn:eol-style set to native
  • code/trunk/data/gui/scripts/KeyBindMenu.lua

    r6748 r7163  
    1010    table.insert(commandList, "fire 1 | unfire")
    1111    table.insert(commandList, "onpress fire 2")
     12    table.insert(commandList, "onpress fire 3")
    1213    table.insert(commandList, "scale 1 moveFrontBack")
    1314    table.insert(commandList, "scale -1 moveFrontBack")
     
    2829    table.insert(commandList, "OverlayGroup toggleVisibility Debug")
    2930    table.insert(commandList, "OverlayGroup toggleVisibility Stats")
     31    table.insert(commandList, "OrxonoxOverlay toggleVisibility QuestGUI")
     32    table.insert(commandList, "OrxonoxOverlay toggleVisibility PickupInventory")
     33    table.insert(commandList, "startchat")
     34    table.insert(commandList, "startchat_small")
    3035    table.insert(commandList, "mouseLook")
    3136    table.insert(commandList, "pause")
     
    3540    table.insert(nameList, "Secondary Fire")
    3641    table.insert(nameList, "Fire Rocket")
     42    table.insert(nameList, "Fire Alternative Rocket")
    3743    table.insert(nameList, "Accelerate")
    3844    table.insert(nameList, "Break")
     
    5359    table.insert(nameList, "Show Debug")
    5460    table.insert(nameList, "Show Stats")
     61    table.insert(nameList, "Show Quests")
     62    table.insert(nameList, "Show Pickups")
     63    table.insert(nameList, "Show Chat")
     64    table.insert(nameList, "Show small Chat")
    5565    table.insert(nameList, "Look Around")
    5666    table.insert(nameList, "Pause")
     
    170180    end
    171181
    172     pane = tolua.cast(window, "CEGUI::ScrollablePane")
     182    local pane = tolua.cast(window, "CEGUI::ScrollablePane")
    173183    pane:setVerticalStepSize(getScrollingStepSize(window))
    174184end
  • code/trunk/data/gui/scripts/MainMenu.lua

    r6748 r7163  
    66-- events for MainMenu
    77function P.QuickGameTestButton_clicked(e)
     8    hideAllMenuSheets()
    89    orxonox.execute("startGame")
    910end
  • code/trunk/data/gui/scripts/MenuSheet.lua

    • Property svn:eol-style set to native
  • code/trunk/data/gui/scripts/MultiplayerMenu.lua

    r6746 r7163  
    44
    55function P.onLoad()
    6     listbox = winMgr:getWindow("orxonox/MultiplayerLevelListbox")
    7     preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
     6    P.multiplayerMode = "startClient"
     7end
     8
     9function P.onShow()
     10    if P.multiplayerMode == "startClient" then
     11        local window = winMgr:getWindow("orxonox/MultiplayerJoinButton")
     12        local button = tolua.cast(window,"CEGUI::RadioButton")
     13        button:setSelected(true)
     14        P.showServerList()
     15    end
     16    if P.multiplayerMode == "startServer" then
     17        local window = winMgr:getWindow("orxonox/MultiplayerHostButton")
     18        local button = tolua.cast(window,"CEGUI::RadioButton")
     19        button:setSelected(true)
     20        P.showLevelList()
     21    end
     22    if P.multiplayerMode == "startDedicated" then
     23        local window = winMgr:getWindow("orxonox/MultiplayerDedicatedButton")
     24        local button = tolua.cast(window,"CEGUI::RadioButton")
     25        button:setSelected(true)
     26        P.showLevelList()
     27    end
     28end
     29
     30function P.MultiplayerJoinButton_clicked(e)
     31    P.multiplayerMode = "startClient"
     32    P.showServerList()
     33end
     34
     35function P.MultiplayerHostButton_clicked(e)
     36    P.multiplayerMode = "startServer"
     37    P.showLevelList()
     38end
     39
     40function P.MultiplayerDedicatedButton_clicked(e)
     41    P.multiplayerMode = "startDedicated"
     42    P.showLevelList()
     43end
     44
     45function P.MultiplayerStartButton_clicked(e)
     46    local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem()
     47    if P.multiplayerMode == "startClient" then
     48        if choice then
     49            local client = orxonox.Client:getInstance()
     50            local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID()
     51            client:setDestination( P.serverList[index][2], 55556 )
     52        else
     53            return
     54        end
     55    else
     56        if choice then
     57            orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
     58        else
     59            return
     60        end
     61    end
     62    orxonox.execute(P.multiplayerMode)
     63    hideAllMenuSheets()
     64end
     65
     66function P.MultiplayerBackButton_clicked(e)
     67    hideMenuSheet(P.name)
     68end
     69
     70function P.showLevelList()
     71    local listbox = winMgr:getWindow("orxonox/MultiplayerListbox")
     72    CEGUI.toListbox(listbox):resetList()
     73    local preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
    874    orxonox.LevelManager:getInstance():compileAvailableLevelList()
    975    local levelList = {}
     
    1985    end
    2086    table.sort(levelList)
     87    index = 1
    2188    for k,v in pairs(levelList) do
    22         item = CEGUI.createListboxTextItem(v)
     89        local item = CEGUI.createListboxTextItem(v)
    2390        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
     91        item:setID(index)
     92        index = index + 1
    2493        CEGUI.toListbox(listbox):addItem(item)
    2594        if v .. ".oxw" == preselect then
     
    2796        end
    2897    end
    29     local multiplayerMode = "startClient"
    30     if multiplayerMode == "startClient" then
    31         window = winMgr:getWindow("orxonox/MultiplayerJoinButton")
    32         button = tolua.cast(window,"CEGUI::RadioButton")
    33         button:setSelected(true)
    3498    end
    35     if multiplayerMode == "startServer" then
    36         window = winMgr:getWindow("orxonox/MultiplayerHostButton")
    37         button = tolua.cast(window,"CEGUI::RadioButton")
    38         button:setSelected(true)
     99   
     100function P.showServerList()
     101    local listbox = winMgr:getWindow("orxonox/MultiplayerListbox")
     102    CEGUI.toListbox(listbox):resetList()
     103    local discovery = orxonox.LANDiscovery:getInstance()
     104    discovery:discover()
     105    P.serverList = {}
     106    local index = 0
     107    local servername = ""
     108    local serverip = ""
     109    while true do
     110        servername = discovery:getServerListItemName(index)
     111        if servername == "" then
     112            break
     113        end
     114        serverip = discovery:getServerListItemIP(index)
     115        if serverip == "" then
     116          break
     117        end
     118        table.insert(P.serverList, {servername, serverip})
     119        index = index + 1
    39120    end
    40     if multiplayerMode == "startDedicated" then
    41         window = winMgr:getWindow("orxonox/MultiplayerDedicatedButton")
    42         button = tolua.cast(window,"CEGUI::RadioButton")
    43         button:setSelected(true)
     121    index = 1
     122    for k,v in pairs(P.serverList) do
     123        local item = CEGUI.createListboxTextItem( v[1] .. ": " .. v[2] )
     124        item:setID(index)
     125        index = index + 1
     126        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
     127        CEGUI.toListbox(listbox):addItem(item)
    44128    end
    45 end
    46 
    47 function P.MultiplayerJoinButton_clicked(e)
    48     multiplayerMode = "startClient"
    49 end
    50 
    51 function P.MultiplayerHostButton_clicked(e)
    52     multiplayerMode = "startServer"
    53 end
    54 
    55 function P.MultiplayerDedicatedButton_clicked(e)
    56     multiplayerMode = "startDedicated"
    57 end
    58 
    59 function P.MultiplayerStartButton_clicked(e)
    60     local choice = winMgr:getWindow("orxonox/MultiplayerLevelListbox"):getFirstSelectedItem()
    61     if choice then
    62         orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
    63         orxonox.execute(multiplayerMode)
    64         hideAllMenuSheets()
    65     end
    66 end
    67 
    68 function P.MultiplayerBackButton_clicked(e)
    69     hideMenuSheet(P.name)
    70129end
    71130
  • code/trunk/data/gui/scripts/PickupInventory.lua

    r6906 r7163  
    33local P = createMenuSheet("PickupInventory")
    44
    5 P.carrierList = {}
    65P.wrapper = nil
    76P.detailsWindows = {}
     7P.detailPickups = {}
     8P.pickupsList = {}
     9
     10P.showing = false
     11
     12-- Design parameters
     13P.imageHeight = 50
     14P.detailImageSize = 100
     15P.textHeight = 30
     16P.buttonWidth = 85
    817
    918function P.onLoad()
    10     carrierList = {}
     19    P.wrapper = nil
     20    P.detailsWindows = {}
     21    P.detailPickups = {}
     22    P.pickupsList = {}
    1123end
    1224
    1325function P.onShow()
    1426    P.createInventory()
     27    P.showing = true
    1528end
    1629
    1730function P.onHide()
    18     P.cleanup()
     31    P.showing = false
     32    P.cleanup(true)
    1933end
    2034
    2135function P.update()
    22     P.cleanup()
    23    
     36    if P.showing == false then
     37        return
     38    end
     39
     40    -- Update opened detail windows.
     41    for k,v in pairs(P.detailsWindows) do
     42        if v ~= nil then
     43            local pickup = P.detailPickups[k]
     44            if pickup ~= nil and pickup ~= 0 then
     45                local useButton = winMgr:getWindow("orxonox/PickupInventory/Details" .. k .. "/UseButton")
     46                local dropButton = winMgr:getWindow("orxonox/PickupInventory/Details" .. k .. "/DropButton")
     47                if orxonox.PickupManager:getInstance():isValidPickup(pickup) == false then
     48                    useButton:setEnabled(false)
     49                    dropButton:setEnabled(false)
     50                    P.detailPickups[k] = nil
     51                else
     52                    useButton:setEnabled(true)
     53                    if pickup:isUsed() == true then
     54                        useButton:setText("unuse")
     55                        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseDetailButton_clicked")
     56                        if pickup:isUsable() == false then
     57                            useButton:setEnabled(false)
     58                        end
     59                    else
     60                        useButton:setText("use")
     61                        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseDetailButton_clicked")
     62                        if pickup:isUnusable() == false then
     63                            useButton:setEnabled(false)
     64                        end
     65                    end
     66
     67                    if pickup:isPickedUp() == false then
     68                        useButton:setEnabled(false)
     69                        dropButton:setEnabled(false)
     70                        P.detailPickups[k] = nil
     71                    end
     72                end
     73            end
     74        end
     75    end
     76
     77    -- Update main inventory.
     78    P.cleanup(false)
    2479    P.createInventory()
     80    -- TODO: Recover scrolling position
     81   
    2582end
    2683
    2784function P.createInventory()
    2885    local pickupManager = orxonox.PickupManager:getInstance()
    29     local carrier = pickupManager:getPawn()
    3086   
    3187    local root = winMgr:getWindow("orxonox/PickupInventory/Inventory")
     
    3490    root:addChildWindow(P.wrapper)
    3591   
    36     P.carrierList = {}
    37    
    38     --Design parameters:
    39     local space = 15
    40    
    41     P.getCarrierList(carrier)
     92    P.pickupsList = {}
     93
     94    local numPickups = pickupManager:getNumPickups()
     95    local counter = 1
    4296    local offset = 0
    43     for k,v in pairs(P.carrierList) do
    44         local window = P.createCarrierBox(v,k)
     97    while counter <= numPickups do
     98        local pickup = pickupManager:popPickup()
     99        table.insert(P.pickupsList, pickup)
     100        local window = P.createPickupEntry(counter, pickup)
    45101        window:setYPosition(CEGUI.UDim(0,offset))
    46         offset = offset + window:getHeight():asAbsolute(1) + space
     102        offset = offset + window:getHeight():asAbsolute(1)
    47103        P.wrapper:addChildWindow(window)
    48     end
    49 end
    50 
    51 function P.getCarrierList(carrier)
    52 
    53     -- TODO: Test for nil or 0?
    54     if carrier == nil then
    55         return
    56     end
    57    
    58     table.insert(P.carrierList, carrier)
    59    
    60     local numCarriers = orxonox.PickupManager:getInstance():getNumCarrierChildren(carrier)
    61     if numCarriers == 0 then
    62         return
    63     end
    64    
    65     for i=0,numCarriers-1,1 do
    66         local child = orxonox.PickupManager:getInstance():getCarrierChild(i, carrier)
    67         if child ~= nil then
    68             P.getCarrierList(child)
    69         end
    70     end
    71 end
    72 
    73 function P.createCarrierBox(carrier, index)
    74 
    75     local name = "orxonox/PickupInventory/Carrier" .. index
    76    
    77     --Design parameters:
    78     local imageHeight = 50
    79     local textHeight = 30
    80     local horizontalOffset = 20
    81     local buttonWidth = 85
    82    
    83     local offset = 0
    84 
    85     local box = winMgr:createWindow("MenuWidgets/ScrollablePane", name .. "/Box")
    86     box:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horizontalOffset), CEGUI.UDim(0, 0)))
    87     box:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -horizontalOffset), CEGUI.UDim(1, 0)))
    88    
    89     local numPickups = orxonox.PickupManager:getInstance():getNumPickups(carrier)
    90     for i=0,numPickups-1,1 do
    91         local pickup = orxonox.PickupManager:getInstance():getPickupRepresentation(i, carrier)
    92        
    93         local item = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Box/Pickup" .. i)
    94         item:setSize(CEGUI.UVector2(CEGUI.UDim(1, -horizontalOffset), CEGUI.UDim(0, imageHeight)))
    95         item:setPosition(CEGUI.UVector2(CEGUI.UDim(0, horizontalOffset), CEGUI.UDim(0, offset)))
    96         box:addChildWindow(item)
    97         offset = offset + imageHeight+5
    98        
    99         local image = winMgr:createWindow("MenuWidgets/StaticImage", name .. "/Box/Pickup" .. i .. "/Image")
    100         image:setProperty("Image", "set:PickupInventory image:" .. pickup:getInventoryRepresentation())
    101         image:setProperty("BackgroundEnabled", "set:False")
    102         image:setProperty("FrameEnabled", "set:True")
    103         image:setSize(CEGUI.UVector2(CEGUI.UDim(0, imageHeight), CEGUI.UDim(0, imageHeight)))
    104         item:addChildWindow(image)
    105        
    106         local title = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Box/Pickup" .. i .. "/Title")
    107         title:setPosition(CEGUI.UVector2(CEGUI.UDim(0, imageHeight+5), CEGUI.UDim(0, (imageHeight-textHeight)/2)))
    108         title:setSize(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(0, textHeight)))
    109         title:setText(pickup:getPickupName())
    110         title:setProperty("FrameEnabled", "set:False")
    111         item:addChildWindow(title)
    112        
    113         local useButton = winMgr:createWindow("MenuWidgets/Button", name .. "/Box/Pickup" .. i .. "/UseButton")
    114         useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, imageHeight+10),CEGUI.UDim(0, (imageHeight-textHeight)/2)))
    115         useButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0, textHeight)))
     104        counter = counter + 1
     105    end
     106
     107end
     108
     109function P.createPickupEntry(index, pickup)
     110    local representation = orxonox.PickupManager:getInstance():getPickupRepresentation(pickup)
     111
     112    local name = "orxonox/PickupInventory/Box/Pickup" .. index
     113
     114    local item = winMgr:createWindow("MenuWidgets/StaticText", name)
     115    item:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight)))
     116    item:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0)))
     117
     118    local image = winMgr:createWindow("MenuWidgets/StaticImage", name .. "/Image")
     119    image:setProperty("Image", "set:PickupInventory image:" .. representation:getInventoryRepresentation())
     120    image:setProperty("BackgroundEnabled", "set:False")
     121    image:setProperty("FrameEnabled", "set:True")
     122    image:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.imageHeight), CEGUI.UDim(0, P.imageHeight)))
     123    item:addChildWindow(image)
     124
     125    local title = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Title")
     126    title:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.imageHeight+5), CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
     127    title:setSize(CEGUI.UVector2(CEGUI.UDim(0.3, 0), CEGUI.UDim(0, P.textHeight)))
     128    title:setText(representation:getPickupName())
     129    title:setProperty("FrameEnabled", "set:False")
     130    item:addChildWindow(title)
     131
     132    local useButton = winMgr:createWindow("MenuWidgets/Button", name .. "/UseButton")
     133    useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+10),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
     134    useButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     135    if pickup:isUsed() == false then
    116136        useButton:setText("use")
    117137        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseButton_clicked")
    118         item:addChildWindow(useButton)
    119        
    120         local dropButton = winMgr:createWindow("MenuWidgets/Button", name .. "/Box/Pickup" .. i .. "/DropButton")
    121         dropButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, imageHeight+15+buttonWidth),CEGUI.UDim(0, (imageHeight-textHeight)/2)))
    122         dropButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0, textHeight)))
    123         dropButton:setText("drop")
    124         orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropButton_clicked")
    125         item:addChildWindow(dropButton)
    126        
    127         local detailsButton = winMgr:createWindow("MenuWidgets/Button", name .. "/Box/Pickup" .. i .. "/DetailsButton")
    128         detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.4, imageHeight+20+2*buttonWidth),CEGUI.UDim(0, (imageHeight-textHeight)/2)))
    129         detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0, textHeight)))
    130         detailsButton:setText("details")
    131         orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name .. ".InventoryDetailsButton_clicked")
    132         item:addChildWindow(detailsButton)
    133     end
    134    
    135     box:setHeight(CEGUI.UDim(0,offset))
    136    
    137     return box
    138 end
    139 
    140 function P.cleanup()
     138        if pickup:isUsable() == false then
     139            useButton:setEnabled(false)
     140        end
     141    else
     142        useButton:setText("unuse")
     143        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseButton_clicked")
     144        if pickup:isUnusable() == false then
     145            useButton:setEnabled(false)
     146        end
     147    end
     148    item:addChildWindow(useButton)
     149
     150    local dropButton = winMgr:createWindow("MenuWidgets/Button", name .. "/DropButton")
     151    dropButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+15+P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
     152    dropButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     153    dropButton:setText("drop")
     154    orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropButton_clicked")
     155    item:addChildWindow(dropButton)
     156
     157    local detailsButton = winMgr:createWindow("MenuWidgets/Button", name .. "/DetailsButton")
     158    detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+20+2*P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
     159    detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     160    detailsButton:setText("details")
     161    orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name .. ".InventoryDetailsButton_clicked")
     162    item:addChildWindow(detailsButton)
     163
     164    return item
     165end
     166
     167function P.cleanup(destroyDetails)
    141168    if P.wrapper ~= nil then
    142169        winMgr:destroyWindow(P.wrapper)
     
    144171   
    145172    --Destroy details windows.
     173    if destroyDetails == false then
     174        return
     175    end
    146176    for k,v in pairs(P.detailsWindows) do
    147177        if v ~= nil then
     
    151181end
    152182
    153 function P.windowToCarrierHelper(e)
     183function P.windowToPickupHelper(e)
    154184    local we = CEGUI.toWindowEventArgs(e)
    155185    local name = we.window:getName()
    156186
    157187    local match = string.gmatch(name, "%d+")
    158     local carrierNr = tonumber(match())
    159     local pickupNr = tonumber(match())
    160 
    161     local arguments = {}
    162     arguments[1] = carrierNr
    163     arguments[2] = pickupNr
    164     return arguments
    165 end
    166 
    167 function P.createDetailsWindow(pickupIndex, carrierIndex)
    168     local carrier = P.carrierList[carrierIndex]
    169     local pickup = orxonox.PickupManager:getInstance():getPickupRepresentation(pickupIndex, carrier)
    170    
    171     local headerOffset = 35
    172     --Design parameters
    173     local titleHeight = 30
    174     local imageSize = 100
    175     local buttonWidth = 85
    176    
    177     local name = "orxonox/PickupInventory/Carrier" .. carrierIndex .. "/Pickup" .. pickupIndex .. "/Details" .. P.getNewDetailNumber()
     188    local pickupIndex = tonumber(match())
     189
     190    return pickupIndex
     191end
     192
     193function P.createDetailsWindow(pickupIndex)
     194    local pickup = P.pickupsList[pickupIndex]
     195    local representation = orxonox.PickupManager:getInstance():getPickupRepresentation(pickup)
     196
     197    local index = P.getNewDetailNumber()
     198    local name = "orxonox/PickupInventory/Details" .. index
    178199   
    179200    local window = winMgr:createWindow("MenuWidgets/FrameWindow", name)
     
    190211   
    191212    local title = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Title")
    192     title:setText(pickup:getPickupName())
    193     title:setHeight(CEGUI.UDim(0, titleHeight))
     213    title:setText(representation:getPickupName())
     214    title:setHeight(CEGUI.UDim(0, P.textHeight))
    194215    title:setProperty("FrameEnabled", "set:False")
    195216    title:setProperty("BackgroundEnabled", "set:False")
     
    197218   
    198219    local image = winMgr:createWindow("MenuWidgets/StaticImage", name .. "/Image")
    199     image:setProperty("Image", "set:PickupInventory image:" .. pickup:getInventoryRepresentation())
     220    image:setProperty("Image", "set:PickupInventory image:" .. representation:getInventoryRepresentation())
    200221    image:setProperty("BackgroundEnabled", "set:False")
    201222    image:setProperty("FrameEnabled", "set:True")
    202     image:setSize(CEGUI.UVector2(CEGUI.UDim(0, imageSize), CEGUI.UDim(0, imageSize)))
    203     image:setYPosition(CEGUI.UDim(0, titleHeight + 5))
     223    image:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize), CEGUI.UDim(0, P.detailImageSize)))
     224    image:setYPosition(CEGUI.UDim(0, P.textHeight + 5))
    204225    wrapper:addChildWindow(image)
    205226   
    206227    local box = winMgr:createWindow("MenuWidgets/ScrollablePane", name .. "/Description")
    207     box:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -1*(imageSize + 10)),CEGUI.UDim(1, -(titleHeight + 5 + titleHeight + 20))))
    208     box:setPosition(CEGUI.UVector2(CEGUI.UDim(0, imageSize + 10),CEGUI.UDim(0, titleHeight + 5)))
    209     local description = winMgr:createWindow("TaharezLook/StaticText", name .. "/Description/Text")
    210     description:setText(pickup:getPickupDescription())
     228    box:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -1*(P.detailImageSize + 10)),CEGUI.UDim(1, -(P.textHeight + 5 + P.textHeight + 20))))
     229    box:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize + 10),CEGUI.UDim(0, P.textHeight + 5)))
     230    local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Text")
     231    description:setText(representation:getPickupDescription())
    211232    description:setProperty("HorzFormatting", "WordWrapLeftAligned")
    212233    description:setProperty("VertFormatting", "TopAligned")
    213234    box:addChildWindow(description)
    214235    wrapper:addChildWindow(box)
    215    
     236
    216237    local useButton = winMgr:createWindow("MenuWidgets/Button", name .. "/UseButton")
    217     useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0, imageSize+10),CEGUI.UDim(1, -40)))
    218     useButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0, titleHeight)))
    219     useButton:setText("use")
    220     orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseButton_clicked")
     238    useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize+10),CEGUI.UDim(1, -40)))
     239    useButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     240    if pickup:isUsed() == false then
     241        useButton:setText("use")
     242        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseDetailButton_clicked")
     243        if pickup:isUsable() == false then
     244            useButton:setEnabled(false)
     245        end
     246    else
     247        useButton:setText("unuse")
     248        orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUnuseDetailButton_clicked")
     249        if pickup:isUnusable() == false then
     250            useButton:setEnabled(false)
     251        end
     252    end
    221253    wrapper:addChildWindow(useButton)
    222254   
    223255    local dropButton = winMgr:createWindow("MenuWidgets/Button", name .. "/DropButton")
    224     dropButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0, imageSize+10+buttonWidth+10),CEGUI.UDim(1, -40)))
    225     dropButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, buttonWidth), CEGUI.UDim(0, titleHeight)))
     256    dropButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize+10+P.buttonWidth+10),CEGUI.UDim(1, -40)))
     257    dropButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
    226258    dropButton:setText("drop")
    227     orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropButton_clicked")
     259    orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropDetailButton_clicked")
    228260    wrapper:addChildWindow(dropButton)
    229    
    230     table.insert(P.detailsWindows, window)
     261
     262    P.detailsWindows[index] = window
     263    P.detailPickups[index] = pickup
    231264   
    232265end
     
    239272        end
    240273    end
    241     return number
     274    return number+1
    242275end
    243276
    244277function P.InventoryUseButton_clicked(e)
    245     local arguments = P.windowToCarrierHelper(e)
    246     orxonox.PickupManager:getInstance():usePickup(arguments[2], P.carrierList[arguments[1]], true)
     278    local pickupIndex = P.windowToPickupHelper(e)
     279    orxonox.PickupManager:getInstance():usePickup(P.pickupsList[pickupIndex], true)
     280end
     281
     282function P.InventoryUnuseButton_clicked(e)
     283    local pickupIndex = P.windowToPickupHelper(e)
     284    orxonox.PickupManager:getInstance():usePickup(P.pickupsList[pickupIndex], false)
    247285end
    248286
    249287function P.InventoryDropButton_clicked(e)
    250     local arguments = P.windowToCarrierHelper(e)
    251     orxonox.PickupManager:getInstance():dropPickup(arguments[2], P.carrierList[arguments[1]])
     288    local pickupIndex = P.windowToPickupHelper(e)
     289    orxonox.PickupManager:getInstance():dropPickup(P.pickupsList[pickupIndex])
    252290end
    253291
    254292function P.InventoryDetailsButton_clicked(e)
    255     local arguments = P.windowToCarrierHelper(e)
    256     P.createDetailsWindow(arguments[2], arguments[1])
     293    local pickupIndex = P.windowToPickupHelper(e)
     294    P.createDetailsWindow(pickupIndex)
     295end
     296
     297function P.InventoryUseDetailButton_clicked(e)
     298    local pickupIndex = P.windowToPickupHelper(e)
     299    orxonox.PickupManager:getInstance():usePickup(P.detailPickups[pickupIndex], true)
     300end
     301
     302function P.InventoryUnuseDetailButton_clicked(e)
     303    local pickupIndex = P.windowToPickupHelper(e)
     304    orxonox.PickupManager:getInstance():usePickup(P.detailPickups[pickupIndex], false)
     305end
     306
     307function P.InventoryDropDetailButton_clicked(e)
     308    local pickupIndex = P.windowToPickupHelper(e)
     309    orxonox.PickupManager:getInstance():dropPickup(P.detailPickups[pickupIndex])
    257310end
    258311
     
    262315    local name = we.window:getName()
    263316    local match = string.gmatch(name, "%d+")
    264     local carrierNr = tonumber(match())
    265     local pickupNr = tonumber(match())
    266317    local detailNr = tonumber(match())
    267318   
    268     local window = P.detailsWindows[detailNr+1]
     319    local window = P.detailsWindows[detailNr]
    269320    winMgr:destroyWindow(window)
    270     P.detailsWindows[detailNr+1] = nil
     321    P.detailsWindows[detailNr] = nil
     322    P.detailPickups[detailNr] = nil
    271323end
    272324
  • code/trunk/data/gui/scripts/QuestGUI.lua

    r6746 r7163  
    33local P = createMenuSheet("QuestGUI")
    44
    5 function P.show()
    6     P.window:show() -- TODO: Do this through parent...
    7     P.visible = true
    8 
     5P.rootWindow = nil
     6P.detailsWindows = {}
     7P.quests = {}
     8P.hints = {}
     9P.player = nil
     10
     11-- design parameters
     12P.indentWidth = 20
     13P.scrollbarWidth = 13
     14P.buttonHeight = 30
     15P.titleHeight = 26
     16P.borderWidth = 5
     17
     18function P.onShow()
     19
     20    local questsList = winMgr:getWindow("orxonox/QuestGUI/QuestsList")
     21
     22    P.player = orxonox.GUIManager:getInstance():getPlayer(P.name)
     23    P.rootWindow = P.createQuestGUI();
     24
     25    questsList:addChildWindow(P.rootWindow)
     26end
     27
     28function P.onHide()
     29    P.cleanup()
     30end
     31
     32function P.createQuestGUI()
    933    local questManager = orxonox.QuestManager:getInstance()
    1034
    11     local questsList = winMgr:getWindow("orxonox/QuestGUI/QuestsList")
    12 
    13     local window = questManager:getQuestGUI(P.name)
    14 
    15     questsList:addChildWindow(window)
    16 
     35    local depth = 0
     36    local index = 0
     37
     38    local questWindow = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/QuestGUI/Quests")
     39    questWindow:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0),CEGUI.UDim(1, 0)))
     40
     41    -- Iterate through all parent-quests.
     42    local numParentQuests = orxonox.QuestManager:getInstance():getNumParentQuests(P.player)
     43    local i = 0
     44    while i <= numParentQuests-1 do
     45        local quest = orxonox.QuestManager:getInstance():getParentQuest(P.player, i)
     46        index = P.createQuestNodes(questWindow, quest, depth, index)
     47        i = i+1
     48    end
     49
     50    return questWindow
     51end
     52
     53function P.createQuestNodes(root, parent, depth, index)
     54    local number = table.getn(P.quests)+1
     55    local name = "orxonox/QuestGUI/Quests/" .. number
     56    local node = winMgr:createWindow("MenuWidgets/TabButton", name)
     57    node:setText(orxonox.QuestManager:getInstance():getDescription(parent):getTitle())
     58    node:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.indentWidth*depth), CEGUI.UDim(0, P.buttonHeight*index)))
     59    node:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.indentWidth*depth-P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))
     60    orxonox.GUIManager:subscribeEventHelper(node, "Clicked", P.name .. ".openDetails_clicked")
     61    root:addChildWindow(node)
     62   
     63    table.insert(P.quests, parent)
     64
     65    index = index+1
     66
     67    -- Iterate through all sub-quests.
     68    local numQuests = orxonox.QuestManager:getInstance():getNumSubQuests(parent, P.player)
     69    local i = 0
     70    while i <= numQuests-1 do
     71        local quest = orxonox.QuestManager:getInstance():getSubQuest(parent, P.player, i)
     72        index = P.createQuestNodes(root, quest, depth+1, index)
     73        i = i+1
     74    end
     75
     76    return index;
     77end
     78
     79function P.cleanup()
     80    winMgr:destroyWindow(P.rootWindow)
     81    for k,v in pairs(P.detailsWindows) do
     82        if v ~= nil then
     83            winMgr:destroyWindow(v)
     84            P.detailsWindows[k] = nil
     85        end
     86    end
     87    P.detailsWindows = {}
     88
     89    P.quests = {}
     90    P.hints = {}
     91    P.player = nil
     92
     93    winMgr:destroyWindow(P.rootWindow)
     94    P.rootWindow = nil
     95end
     96
     97function P.openDetails_clicked(e)
     98    --Get some numbers from the window
     99    local we = CEGUI.toWindowEventArgs(e)
     100    local name = we.window:getName()
     101    local match = string.gmatch(name, "%d+")
     102    local questNr = tonumber(match())
     103
     104    name = name .. "/Details" .. P.getNewDetailNumber()
     105    quest = P.quests[questNr]
     106
     107    local details = winMgr:createWindow("MenuWidgets/FrameWindow", name)
     108    details:setSize(CEGUI.UVector2(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))
     109    details:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0), CEGUI.UDim(0.1, 0)))
     110    details:setText(orxonox.QuestManager:getInstance():getDescription(quest):getTitle())
     111    details:setProperty("Alpha", 1.0)
     112    details:setProperty("InheritsAlpha", "setFalse")
     113    orxonox.GUIManager:subscribeEventHelper(details, "CloseClicked", P.name .. ".closeDetails_clicked")
     114
     115    table.insert(P.detailsWindows, details)
     116
     117    name = name .. "/Scrollable"
     118    local window = winMgr:createWindow("MenuWidgets/ScrollablePane", name)
     119    window:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))
     120    window:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderWidth), CEGUI.UDim(0, P.titleHeight)))
     121    details:addChildWindow(window)
     122
     123    local offset = 0
     124
     125    local status = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Status")
     126    window:addChildWindow(status)
     127    status:setProperty("HorzFormatting", "WordWrapLeftAligned")
     128    status:setProperty("VertFormatting", "TopAligned")
     129    if quest:isActive(P.player) then
     130        status:setText("This quest is active.")
     131    elseif quest:isCompleted(P.player) then
     132        status:setText("This quest was completed.")
     133    elseif quest:isFailed(P.player) then
     134        status:setText("This quest was failed.")
     135    end
     136    status:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
     137    status:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     138    local height = getStaticTextWindowHeight(status)
     139    status:setHeight(CEGUI.UDim(0, height))
     140    offset = offset + height
     141
     142    local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title");
     143    window:addChildWindow(descriptionTitle)
     144    descriptionTitle:setProperty("HorzFormatting", "HorzCentred")
     145    descriptionTitle:setProperty("VertFormatting", "TopAligned")
     146    descriptionTitle:setText("Description:")
     147    descriptionTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
     148    descriptionTitle:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     149    height = getStaticTextWindowHeight(descriptionTitle)
     150    descriptionTitle:setHeight(CEGUI.UDim(0, height))
     151    offset = offset + height
     152
     153    local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description");
     154    window:addChildWindow(description)
     155    description:setProperty("HorzFormatting", "WordWrapLeftAligned")
     156    description:setProperty("VertFormatting", "TopAligned")
     157    description:setText(orxonox.QuestManager:getInstance():getDescription(quest):getDescription())
     158    description:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
     159    description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     160    height = getStaticTextWindowHeight(description)
     161    description:setHeight(CEGUI.UDim(0, height))
     162    offset = offset + height
     163
     164    -- Display the hints of this quest
     165    local numHints = orxonox.QuestManager:getInstance():getNumHints(quest, P.player)
     166    if numHints > 0 then
     167        local hintsTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Hints/Title");
     168        window:addChildWindow(hintsTitle)
     169        hintsTitle:setProperty("HorzFormatting", "HorzCentred")
     170        hintsTitle:setProperty("VertFormatting", "TopAligned")
     171        hintsTitle:setText("Hints:")
     172        hintsTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
     173        hintsTitle:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     174        height = getStaticTextWindowHeight(hintsTitle)
     175        hintsTitle:setHeight(CEGUI.UDim(0, height))
     176        offset = offset + height
     177    end
     178    local i = 0
     179    while i <= numHints-1 do
     180        local hint = orxonox.QuestManager:getInstance():getHints(quest, P.player, i)
     181        table.insert(P.hints, hint)
     182        local number = table.getn(P.hints)
     183        local node = winMgr:createWindow("MenuWidgets/TabButton", name .. "/Hints" .. number)
     184        node:setText(orxonox.QuestManager:getInstance():getDescription(hint):getTitle())
     185        node:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
     186        node:setSize(CEGUI.UVector2(CEGUI.UDim(1, -P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))
     187        window:addChildWindow(node)
     188        offset = offset + P.buttonHeight
     189
     190        orxonox.GUIManager:subscribeEventHelper(node, "Clicked", P.name .. ".openHintDetails_clicked")
     191        i = i+1
     192    end
     193
     194    local window = winMgr:getWindow("orxonox/QuestGUI/Background")
     195    window:addChildWindow(details)
     196end
     197
     198function P.getNewDetailNumber()
     199    local number = table.getn(P.detailsWindows)
     200    for k,v in pairs(P.detailsWindows) do
     201        if v == nil then
     202            number = k-1
     203        end
     204    end
     205    return number+1
     206end
     207
     208function P.closeDetails_clicked(e)
     209    local we = CEGUI.toWindowEventArgs(e)
     210    local name = we.window:getName()
     211    local match = string.gmatch(name, "%d+")
     212    match()
     213    local detailsNr = tonumber(match())
     214
     215    winMgr:destroyWindow(P.detailsWindows[detailsNr])
     216    P.detailsWindows[detailsNr] = nil
     217end
     218
     219function P.openHintDetails_clicked(e)
     220    --Get some numbers from the window
     221    local we = CEGUI.toWindowEventArgs(e)
     222    local name = we.window:getName()
     223    local match = string.gmatch(name, "%d+")
     224    match()
     225    match()
     226    local hintNr = tonumber(match())
     227
     228    name = name .. "/Details" .. P.getNewDetailNumber()
     229    hint = P.hints[hintNr]
     230
     231    local details = winMgr:createWindow("MenuWidgets/FrameWindow", name)
     232    details:setSize(CEGUI.UVector2(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))
     233    details:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0), CEGUI.UDim(0.1, 0)))
     234    details:setText(orxonox.QuestManager:getInstance():getDescription(hint):getTitle())
     235    details:setProperty("Alpha", 1.0)
     236    details:setProperty("InheritsAlpha", "setFalse")
     237    orxonox.GUIManager:subscribeEventHelper(details, "CloseClicked", P.name .. ".closeHintDetails_clicked")
     238
     239    table.insert(P.detailsWindows, details)
     240
     241    name = name .. "/Scrollable"
     242    local window = winMgr:createWindow("MenuWidgets/ScrollablePane", name)
     243    window:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))
     244    window:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderWidth), CEGUI.UDim(0, P.titleHeight)))
     245    details:addChildWindow(window)
     246
     247    local offset = 0
     248   
     249    local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title");
     250    window:addChildWindow(descriptionTitle)
     251    descriptionTitle:setProperty("HorzFormatting", "HorzCentred")
     252    descriptionTitle:setProperty("VertFormatting", "TopAligned")
     253    descriptionTitle:setText("Description:")
     254    descriptionTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
     255    descriptionTitle:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     256    height = getStaticTextWindowHeight(descriptionTitle)
     257    descriptionTitle:setHeight(CEGUI.UDim(0, height))
     258    offset = offset + height
     259
     260    local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description");
     261    window:addChildWindow(description)
     262    description:setProperty("HorzFormatting", "WordWrapLeftAligned")
     263    description:setProperty("VertFormatting", "TopAligned")
     264    description:setText(orxonox.QuestManager:getInstance():getDescription(hint):getDescription())
     265    description:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset)))
     266    description:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))
     267    height = getStaticTextWindowHeight(description)
     268    description:setHeight(CEGUI.UDim(0, height))
     269
     270    local window = winMgr:getWindow("orxonox/QuestGUI/Background")
     271    window:addChildWindow(details)
     272end
     273
     274function P.closeHintDetails_clicked(e)
     275    local we = CEGUI.toWindowEventArgs(e)
     276    local name = we.window:getName()
     277    local match = string.gmatch(name, "%d+")
     278    match()
     279    match()
     280    match()
     281    local detailsNr = tonumber(match())
     282
     283    winMgr:destroyWindow(P.detailsWindows[detailsNr])
     284    P.detailsWindows[detailsNr] = nil
    17285end
    18286
  • code/trunk/data/gui/scripts/SettingsMenu.lua

    r6748 r7163  
    2424end
    2525
    26 function P.SettingsResetSettingsButton_clicked(e)
    27     -- reset settings
    28     logMessage(0, "event: reset settings")
     26function P.SettingsMiscellaneousButton_clicked(e)
     27    showMenuSheet("MiscConfigMenu", true)
    2928end
    3029
  • code/trunk/data/gui/scripts/SingleplayerMenu.lua

    r6754 r7163  
    2727        end
    2828    end
     29
    2930end
    3031
  • code/trunk/data/levels/empty_level.oxw

    r6560 r7163  
    22  include("stats.oxo")
    33  include("hudtemplates3.oxo")
     4  include("templates/lodinformation.oxt")
    45?>
    56
     
    1314 description  = "Just a few tests"
    1415>
     16  <templates>
     17    <Template link=lodtemplate_default />
     18  </templates>
     19
    1520  <Scene
    1621    ambientlight = "0.8, 0.8, 0.8"
    1722    skybox       = "Orxonox/Starbox"
    1823  >
     24
     25    <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"/>
     26    <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
    1927   
    20     <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" />
    21     <SpawnPoint position="0,0,100" spawnclass=SpaceShip pawndesign=spaceshipassff />
    2228  </Scene>
    2329</Level>
     30
  • code/trunk/data/levels/events.oxw

    r6417 r7163  
    44  include("templates/spaceship_assff.oxt")
    55  include("templates/spaceship_H2.oxt")
     6  include("templates/lodinformation.oxt")
    67?>
    78
     
    1011 description  = "A simple level to test the event-system (with comments)"
    1112>
     13  <templates>
     14    <Template link=lodtemplate_default />
     15  </templates>
     16
    1217  <Scene
    1318   ambientlight = "0.5, 0.5, 0.5"
  • code/trunk/data/levels/gametype_asteroids.oxw

    r6417 r7163  
    33  include("stats.oxo")
    44  include("templates/spaceship_assff.oxt")
     5  include("templates/lodinformation.oxt")
    56?>
    67
     
    1011 gametype     =  Asteroids
    1112>
    12 <Scene
    13  ambientlight = "0.5, 0.5, 0.5"
    14  skybox       = "Orxonox/Starbox"
    15 >
    16 
    17 <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" />
    18 
    19 
    20 
    21 <SpawnPoint position="-300,300,0" name="playerstart" direction="1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
    22 
    23 
    24 <?lua
    25 for i = 1, 250, 1
    26 do
    27 j = math.random()
    28 ?>
     13  <templates>
     14    <Template link=lodtemplate_default />
     15  </templates>
     16
     17  <Scene
     18    ambientlight = "0.5, 0.5, 0.5"
     19    skybox       = "Orxonox/Starbox"
     20  >
     21
     22    <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" />
     23
     24    <SpawnPoint position="-300,300,0" name="playerstart" direction="1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
     25
     26    <?lua
     27      for i = 1, 250, 1
     28      do
     29      j = math.random()
     30    ?>
    2931
    3032    <MovableEntity
    31      position="<?lua print(math.random()* 15000 - 1000) ?>,<?lua print(math.random() * 12000 - 4000) ?>,<?lua print(math.random() * 12000 - 4000) ?>"        collisionType=dynamic
    32      linearDamping=0.8
    33      angularDamping=0
    34      scale=<?lua print(j * 150)?>
    35      collisiondamage=1
    36      enablecollisiondamage=true>
     33      position = "<?lua print(math.random()* 15000 - 1000) ?>,<?lua print(math.random() * 12000 - 4000) ?>,<?lua print(math.random() * 12000 - 4000) ?>"
     34      collisionType = dynamic
     35      linearDamping = 0.8
     36      angularDamping = 0
     37      scale = <?lua print(j * 150)?>
     38      collisiondamage = 1
     39      enablecollisiondamage = true
     40    >
    3741      <attached>
    3842        <Model mass=<?lua print(j * 1000) ?> mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
     
    4246      </collisionShapes>
    4347    </MovableEntity>
    44 <?lua
    45 end
    46 ?>
     48
     49    <?lua
     50      end
     51    ?>
    4752
    4853<!--
    49 <MovableEntity position="0,0,0" collisionType=dynamic scale=5 linearDamping=0.8 angularDamping=0  collisiondamage=0.005 enablecollisiondamage=true>
    50   <attached>
    51     <Model mass=100 mesh="ast1.mesh" />
    52   </attached>
    53     <collisionShapes>
    54       <SphereCollisionShape radius=11.75 />
    55     </collisionShapes>
    56 </MovableEntity>
    57 
    58 
    59 <MovableEntity position="0,300,0" scale=10 collisionType=dynamic linearDamping=0.8 angularDamping=0  collisiondamage=0.005 enablecollisiondamage=true>
    60   <attached>
    61     <Model mass=100 mesh="ast1.mesh" />
    62   </attached>
    63     <collisionShapes>
    64       <SphereCollisionShape radius=22.5 />
    65     </collisionShapes>
    66 </MovableEntity>
    67 
    68 
    69 <MovableEntity position="0,600,0"  scale=34  collisionType=dynamic linearDamping=0.8 angularDamping=0 collisiondamage=0.005 enablecollisiondamage=true>
    70   <attached>
    71     <Model mass=100 mesh="ast1.mesh" />
    72   </attached>
    73     <collisionShapes>
    74       <SphereCollisionShape radius=76.5 />
    75     </collisionShapes>
    76 </MovableEntity>
    77 
    78 <MovableEntity position="0,1200,0" scale=80 collisionType=dynamic linearDamping=0.8 angularDamping=0  collisiondamage=0.005 enablecollisiondamage=true>
    79   <attached>
    80     <Model mass=100 mesh="ast1.mesh" />
    81   </attached>
    82     <collisionShapes>
    83       <SphereCollisionShape radius=200 />
    84     </collisionShapes>
    85 </MovableEntity>
     54    <MovableEntity position="0,0,0" collisionType=dynamic scale=5 linearDamping=0.8 angularDamping=0  collisiondamage=0.005 enablecollisiondamage=true>
     55      <attached>
     56        <Model mass=100 mesh="ast1.mesh" />
     57      </attached>
     58      <collisionShapes>
     59        <SphereCollisionShape radius=11.75 />
     60      </collisionShapes>
     61    </MovableEntity>
     62
     63
     64    <MovableEntity position="0,300,0" scale=10 collisionType=dynamic linearDamping=0.8 angularDamping=0  collisiondamage=0.005 enablecollisiondamage=true>
     65      <attached>
     66        <Model mass=100 mesh="ast1.mesh" />
     67      </attached>
     68      <collisionShapes>
     69        <SphereCollisionShape radius=22.5 />
     70      </collisionShapes>
     71    </MovableEntity>
     72
     73
     74    <MovableEntity position="0,600,0"  scale=34  collisionType=dynamic linearDamping=0.8 angularDamping=0 collisiondamage=0.005 enablecollisiondamage=true>
     75      <attached>
     76        <Model mass=100 mesh="ast1.mesh" />
     77      </attached>
     78      <collisionShapes>
     79        <SphereCollisionShape radius=76.5 />
     80      </collisionShapes>
     81    </MovableEntity>
     82
     83    <MovableEntity position="0,1200,0" scale=80 collisionType=dynamic linearDamping=0.8 angularDamping=0  collisiondamage=0.005 enablecollisiondamage=true>
     84      <attached>
     85        <Model mass=100 mesh="ast1.mesh" />
     86      </attached>
     87      <collisionShapes>
     88        <SphereCollisionShape radius=200 />
     89      </collisionShapes>
     90    </MovableEntity>
    8691-->
    8792
    88 <SpaceShip position="2000,200,0" lookat="0,0,0" >
    89   <templates>
    90     <Template link=spaceshipassff />
    91   </templates>
    92   <controller>
    93     <AIController />
    94   </controller>
    95 </SpaceShip>
    96 
    97 <SpaceShip position="8000,300,700" lookat="0,0,0" >
    98   <templates>
    99     <Template link=spaceshipassff />
    100   </templates>
    101   <controller>
    102     <AIController />
    103   </controller>
    104 </SpaceShip>
    105 
    106 <SpaceShip position="10200,400,-600" lookat="0,0,0" >
    107   <templates>
    108     <Template link=spaceshipassff />
    109   </templates>
    110   <controller>
    111     <AIController />
    112   </controller>
    113 </SpaceShip>
    114 
    115 <ForceField position="200,300,-500" direction="0,0,1" diameter=500 velocity=120>
    116   <attached>
    117     <ParticleEmitter source="Orxonox/ForceFieldPurpleSmall" startdelay=0 />
    118   </attached>
    119 </ForceField>
    120 
    121  <ForceField position="2200,-300,1200" direction="1,0.3,-0.7" diameter=800 velocity=200>
    122   <attached>
    123     <ParticleEmitter source="Orxonox/ForceFieldBlueBig" startdelay=0 />
    124   </attached>
    125 </ForceField>
    126 
    127  <ForceField position="8600,1400,500" direction="-1,-1,-1" diameter=500 velocity=400>
    128   <attached>
    129     <ParticleEmitter source="Orxonox/ForceFieldGreenSmall" startdelay=0 />
    130   </attached>
    131 </ForceField>
    132 
    133   <ForceField position="11800,500,-2600" direction="-1,0,1" diameter=900 velocity=300>
    134   <attached>
    135     <ParticleEmitter source="Orxonox/ForceFieldPurpleBig" startdelay=0 />
    136   </attached>
    137 </ForceField>
    138 
    139 
    140 <CheckPoint name=trigger1 position="-300,300,0" scale=1 isdestination=false isfirst=true stayactive=true distance=10 addtime=13 />
    141 
    142 
    143 <CheckPoint name=trigger2 position="2200,600,0" scale=3 isdestination=false stayactive=true distance=100 addtime=10>
    144   <events>
    145     <activity>
    146       <EventListener event=trigger1 />
    147     </activity>
    148   </events>
    149   <attached>
    150     <Billboard material="Flares/lensflare" colour="1,0,0">
     93    <SpaceShip position="2000,200,0" lookat="0,0,0" >
     94      <templates>
     95        <Template link=spaceshipassff />
     96      </templates>
     97      <controller>
     98        <AIController />
     99      </controller>
     100    </SpaceShip>
     101
     102    <SpaceShip position="8000,300,700" lookat="0,0,0" >
     103      <templates>
     104        <Template link=spaceshipassff />
     105      </templates>
     106      <controller>
     107        <AIController />
     108      </controller>
     109    </SpaceShip>
     110
     111    <SpaceShip position="10200,400,-600" lookat="0,0,0" >
     112      <templates>
     113        <Template link=spaceshipassff />
     114      </templates>
     115      <controller>
     116        <AIController />
     117      </controller>
     118    </SpaceShip>
     119
     120    <ForceField position="200,300,-500" direction="0,0,1" diameter=500 velocity=120>
     121      <attached>
     122        <ParticleEmitter source="Orxonox/ForceFieldPurpleSmall" startdelay=0 />
     123      </attached>
     124    </ForceField>
     125
     126    <ForceField position="2200,-300,1200" direction="1,0.3,-0.7" diameter=800 velocity=200>
     127      <attached>
     128        <ParticleEmitter source="Orxonox/ForceFieldBlueBig" startdelay=0 />
     129      </attached>
     130    </ForceField>
     131
     132    <ForceField position="8600,1400,500" direction="-1,-1,-1" diameter=500 velocity=400>
     133      <attached>
     134        <ParticleEmitter source="Orxonox/ForceFieldGreenSmall" startdelay=0 />
     135      </attached>
     136    </ForceField>
     137
     138    <ForceField position="11800,500,-2600" direction="-1,0,1" diameter=900 velocity=300>
     139      <attached>
     140        <ParticleEmitter source="Orxonox/ForceFieldPurpleBig" startdelay=0 />
     141      </attached>
     142    </ForceField>
     143
     144
     145    <CheckPoint name=trigger1 position="-300,300,0" scale=1 isdestination=false isfirst=true stayactive=true distance=10 addtime=26 />
     146
     147
     148    <CheckPoint name=trigger2 position="2200,600,0" scale=3 isdestination=false stayactive=true distance=100 addtime=20>
    151149      <events>
    152         <visibility>
    153           <EventTrigger invert=true>
    154             <events>
    155               <trigger>
    156                 <EventListener event=trigger1 />
    157               </trigger>
    158             </events>
    159           </EventTrigger>
    160         </visibility>
     150        <activity>
     151          <EventListener event=trigger1 />
     152        </activity>
    161153      </events>
    162     </Billboard>
    163     <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
     154      <attached>
     155        <Billboard material="Flares/lensflare" colour="1,0,0">
     156          <events>
     157            <visibility>
     158              <EventTrigger invert=true>
     159                <events>
     160                  <trigger>
     161                    <EventListener event=trigger1 />
     162                  </trigger>
     163                </events>
     164              </EventTrigger>
     165            </visibility>
     166          </events>
     167        </Billboard>
     168        <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
     169          <events>
     170            <visibility>
     171              <EventTrigger>
     172                <events>
     173                  <trigger>
     174                    <EventListener event=trigger1 />
     175                  </trigger>
     176                </events>
     177                <EventTrigger invert=true>
     178                  <events>
     179                    <trigger>
     180                      <EventListener event=trigger2 />
     181                    </trigger>
     182                  </events>
     183                </EventTrigger>
     184              </EventTrigger>
     185            </visibility>
     186          </events>
     187        </BlinkingBillboard>
     188        <Billboard material="Flares/lensflare" colour="0,1,0">
     189          <events>
     190            <visibility>
     191              <EventListener event=trigger2 />
     192            </visibility>
     193          </events>
     194        </Billboard>
     195      </attached>
     196    </CheckPoint>
     197
     198
     199    <CheckPoint name=trigger3 position="4100,0,400" scale=3 isdestination=false stayactive=true distance=100 addtime=18>
    164200      <events>
    165         <visibility>
    166           <EventTrigger>
    167             <events>
    168               <trigger>
    169                 <EventListener event=trigger1 />
    170               </trigger>
    171             </events>
    172             <EventTrigger invert=true>
     201        <activity>
     202          <EventListener event=trigger2 />
     203        </activity>
     204      </events>
     205      <attached>
     206        <Billboard material="Flares/lensflare" colour="1,0,0">
     207          <events>
     208            <visibility>
     209              <EventTrigger invert=true>
     210                <events>
     211                  <trigger>
     212                    <EventListener event=trigger2 />
     213                  </trigger>
     214                </events>
     215              </EventTrigger>
     216            </visibility>
     217          </events>
     218        </Billboard>
     219        <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
     220          <events>
     221            <visibility>
     222              <EventTrigger>
     223                <events>
     224                  <trigger>
     225                    <EventListener event=trigger2 />
     226                  </trigger>
     227                </events>
     228                <EventTrigger invert=true>
     229                  <events>
     230                    <trigger>
     231                      <EventListener event=trigger3 />
     232                    </trigger>
     233                  </events>
     234                </EventTrigger>
     235              </EventTrigger>
     236            </visibility>
     237          </events>
     238        </BlinkingBillboard>
     239        <Billboard material="Flares/lensflare" colour="0,1,0">
     240          <events>
     241            <visibility>
     242              <EventListener event=trigger3 />
     243            </visibility>
     244          </events>
     245        </Billboard>
     246      </attached>
     247    </CheckPoint>
     248
     249
     250    <CheckPoint name=trigger4 position="5600,400,0" scale=3 isdestination=false stayactive=true distance=100 addtime=18>
     251      <events>
     252        <activity>
     253          <EventListener event=trigger3 />
     254        </activity>
     255      </events>
     256      <attached>
     257        <Billboard material="Flares/lensflare" colour="1,0,0">
     258          <events>
     259            <visibility>
     260              <EventTrigger invert=true>
     261                <events>
     262                  <trigger>
     263                    <EventListener event=trigger3 />
     264                  </trigger>
     265                </events>
     266              </EventTrigger>
     267            </visibility>
     268          </events>
     269        </Billboard>
     270        <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
     271          <events>
     272            <visibility>
     273              <EventTrigger>
     274                <events>
     275                  <trigger>
     276                    <EventListener event=trigger3 />
     277                  </trigger>
     278                </events>
     279                <EventTrigger invert=true>
     280                  <events>
     281                    <trigger>
     282                      <EventListener event=trigger4 />
     283                    </trigger>
     284                  </events>
     285                </EventTrigger>
     286              </EventTrigger>
     287            </visibility>
     288          </events>
     289        </BlinkingBillboard>
     290        <Billboard material="Flares/lensflare" colour="0,1,0">
     291          <events>
     292            <visibility>
     293              <EventListener event=trigger4 />
     294            </visibility>
     295          </events>
     296        </Billboard>
     297      </attached>
     298    </CheckPoint>
     299
     300
     301    <CheckPoint name=trigger5 position="7200,600,-200" scale=3 isdestination=false stayactive=true distance=100 addtime=18>
     302      <events>
     303        <activity>
     304          <EventListener event=trigger4 />
     305        </activity>
     306      </events>
     307      <attached>
     308        <Billboard material="Flares/lensflare" colour="1,0,0">
     309          <events>
     310            <visibility>
     311              <EventTrigger invert=true>
     312                <events>
     313                  <trigger>
     314                    <EventListener event=trigger4 />
     315                  </trigger>
     316                </events>
     317              </EventTrigger>
     318            </visibility>
     319          </events>
     320        </Billboard>
     321        <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
     322          <events>
     323            <visibility>
     324              <EventTrigger>
     325                <events>
     326                  <trigger>
     327                    <EventListener event=trigger4 />
     328                  </trigger>
     329                </events>
     330                <EventTrigger invert=true>
     331                  <events>
     332                    <trigger>
     333                      <EventListener event=trigger5 />
     334                    </trigger>
     335                  </events>
     336                </EventTrigger>
     337              </EventTrigger>
     338            </visibility>
     339          </events>
     340        </BlinkingBillboard>
     341        <Billboard material="Flares/lensflare" colour="0,1,0">
     342          <events>
     343            <visibility>
     344              <EventListener event=trigger5 />
     345            </visibility>
     346          </events>
     347        </Billboard>
     348      </attached>
     349    </CheckPoint>
     350
     351
     352    <CheckPoint name=trigger6 position="9200, 800,-800" scale=3 isdestination=false stayactive=true distance=100 addtime=20>
     353      <events>
     354        <activity>
     355          <EventListener event=trigger5 />
     356        </activity>
     357      </events>
     358      <attached>
     359        <Billboard material="Flares/lensflare" colour="1,0,0">
     360          <events>
     361            <visibility>
     362              <EventTrigger invert=true>
     363                <events>
     364                  <trigger>
     365                    <EventListener event=trigger5 />
     366                  </trigger>
     367                </events>
     368              </EventTrigger>
     369            </visibility>
     370          </events>
     371        </Billboard>
     372        <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
     373          <events>
     374            <visibility>
     375              <EventTrigger>
     376                <events>
     377                  <trigger>
     378                    <EventListener event=trigger5 />
     379                  </trigger>
     380                </events>
     381                <EventTrigger invert=true>
     382                  <events>
     383                    <trigger>
     384                      <EventListener event=trigger6 />
     385                    </trigger>
     386                  </events>
     387                </EventTrigger>
     388              </EventTrigger>
     389            </visibility>
     390          </events>
     391        </BlinkingBillboard>
     392        <Billboard material="Flares/lensflare" colour="0,1,0">
     393          <events>
     394            <visibility>
     395              <EventListener event=trigger6 />
     396            </visibility>
     397          </events>
     398        </Billboard>
     399      </attached>
     400    </CheckPoint>
     401
     402
     403    <Model position="11200,400,-1800" scale=10 pitch=-90  mesh="Carrier.mesh">
     404      <attached>
     405        <CheckPoint position="-10,0,0" name=trigger7 scale=0.6 isdestination=true stayactive=true distance=100>
     406          <events>
     407            <activity>
     408              <EventListener event=trigger6 />
     409            </activity>
     410          </events>
     411          <attached>
     412            <Billboard material="Flares/lensflare" colour="1,0,0">
    173413              <events>
    174                 <trigger>
    175                   <EventListener event=trigger2 />
    176                 </trigger>
     414                <visibility>
     415                  <EventTrigger invert=true>
     416                    <events>
     417                      <trigger>
     418                        <EventListener event=trigger6 />
     419                      </trigger>
     420                    </events>
     421                  </EventTrigger>
     422                </visibility>
    177423              </events>
    178             </EventTrigger>
    179           </EventTrigger>
    180         </visibility>
    181       </events>
    182     </BlinkingBillboard>
    183     <Billboard material="Flares/lensflare" colour="0,1,0">
    184       <events>
    185         <visibility>
    186           <EventListener event=trigger2 />
    187         </visibility>
    188       </events>
    189     </Billboard>
    190   </attached>
    191 </CheckPoint>
    192 
    193 
    194 <CheckPoint name=trigger3 position="4100,0,400" scale=3 isdestination=false stayactive=true distance=100 addtime=9>
    195   <events>
    196     <activity>
    197       <EventListener event=trigger2 />
    198     </activity>
    199   </events>
    200   <attached>
    201     <Billboard material="Flares/lensflare" colour="1,0,0">
    202       <events>
    203         <visibility>
    204           <EventTrigger invert=true>
    205             <events>
    206               <trigger>
    207                 <EventListener event=trigger2 />
    208               </trigger>
    209             </events>
    210           </EventTrigger>
    211         </visibility>
    212       </events>
    213     </Billboard>
    214     <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
    215       <events>
    216         <visibility>
    217           <EventTrigger>
    218             <events>
    219               <trigger>
    220                 <EventListener event=trigger2 />
    221               </trigger>
    222             </events>
    223             <EventTrigger invert=true>
     424            </Billboard>
     425            <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
    224426              <events>
    225                 <trigger>
    226                   <EventListener event=trigger3 />
    227                 </trigger>
     427                <visibility>
     428                  <EventTrigger>
     429                    <events>
     430                      <trigger>
     431                        <EventListener event=trigger6 />
     432                      </trigger>
     433                    </events>
     434                    <EventTrigger invert=true>
     435                      <events>
     436                        <trigger>
     437                          <EventListener event=trigger7 />
     438                        </trigger>
     439                      </events>
     440                    </EventTrigger>
     441                  </EventTrigger>
     442                </visibility>
    228443              </events>
    229             </EventTrigger>
    230           </EventTrigger>
    231         </visibility>
    232       </events>
    233     </BlinkingBillboard>
    234     <Billboard material="Flares/lensflare" colour="0,1,0">
    235       <events>
    236         <visibility>
    237           <EventListener event=trigger3 />
    238         </visibility>
    239       </events>
    240     </Billboard>
    241   </attached>
    242 </CheckPoint>
    243 
    244 
    245 <CheckPoint name=trigger4 position="5600,400,0" scale=3 isdestination=false stayactive=true distance=100 addtime=9>
    246   <events>
    247     <activity>
    248       <EventListener event=trigger3 />
    249     </activity>
    250   </events>
    251   <attached>
    252     <Billboard material="Flares/lensflare" colour="1,0,0">
    253       <events>
    254         <visibility>
    255           <EventTrigger invert=true>
    256             <events>
    257               <trigger>
    258                 <EventListener event=trigger3 />
    259               </trigger>
    260             </events>
    261           </EventTrigger>
    262         </visibility>
    263       </events>
    264     </Billboard>
    265     <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
    266       <events>
    267         <visibility>
    268           <EventTrigger>
    269             <events>
    270               <trigger>
    271                 <EventListener event=trigger3 />
    272               </trigger>
    273             </events>
    274             <EventTrigger invert=true>
     444            </BlinkingBillboard>
     445            <Billboard material="Flares/lensflare" colour="0,1,0">
    275446              <events>
    276                 <trigger>
    277                   <EventListener event=trigger4 />
    278                 </trigger>
     447                <visibility>
     448                  <EventListener event=trigger7 />
     449                </visibility>
    279450              </events>
    280             </EventTrigger>
    281           </EventTrigger>
    282         </visibility>
    283       </events>
    284     </BlinkingBillboard>
    285     <Billboard material="Flares/lensflare" colour="0,1,0">
    286       <events>
    287         <visibility>
    288           <EventListener event=trigger4 />
    289         </visibility>
    290       </events>
    291     </Billboard>
    292   </attached>
    293 </CheckPoint>
    294 
    295 
    296 <CheckPoint name=trigger5 position="7200,600,-200" scale=3 isdestination=false stayactive=true distance=100 addtime=8>
    297   <events>
    298     <activity>
    299       <EventListener event=trigger4 />
    300     </activity>
    301   </events>
    302   <attached>
    303     <Billboard material="Flares/lensflare" colour="1,0,0">
    304       <events>
    305         <visibility>
    306           <EventTrigger invert=true>
    307             <events>
    308               <trigger>
    309                 <EventListener event=trigger4 />
    310               </trigger>
    311             </events>
    312           </EventTrigger>
    313         </visibility>
    314       </events>
    315     </Billboard>
    316     <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
    317       <events>
    318         <visibility>
    319           <EventTrigger>
    320             <events>
    321               <trigger>
    322                 <EventListener event=trigger4 />
    323               </trigger>
    324             </events>
    325             <EventTrigger invert=true>
    326               <events>
    327                 <trigger>
    328                   <EventListener event=trigger5 />
    329                 </trigger>
    330               </events>
    331             </EventTrigger>
    332           </EventTrigger>
    333         </visibility>
    334       </events>
    335     </BlinkingBillboard>
    336     <Billboard material="Flares/lensflare" colour="0,1,0">
    337       <events>
    338         <visibility>
    339           <EventListener event=trigger5 />
    340         </visibility>
    341       </events>
    342     </Billboard>
    343   </attached>
    344 </CheckPoint>
    345 
    346 
    347 <CheckPoint name=trigger6 position="9200, 800,-800" scale=3 isdestination=false stayactive=true distance=100 addtime=10>
    348   <events>
    349     <activity>
    350       <EventListener event=trigger5 />
    351     </activity>
    352   </events>
    353   <attached>
    354     <Billboard material="Flares/lensflare" colour="1,0,0">
    355       <events>
    356         <visibility>
    357           <EventTrigger invert=true>
    358             <events>
    359               <trigger>
    360                 <EventListener event=trigger5 />
    361               </trigger>
    362             </events>
    363           </EventTrigger>
    364         </visibility>
    365       </events>
    366     </Billboard>
    367     <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
    368       <events>
    369         <visibility>
    370           <EventTrigger>
    371             <events>
    372               <trigger>
    373                 <EventListener event=trigger5 />
    374               </trigger>
    375             </events>
    376             <EventTrigger invert=true>
    377               <events>
    378                 <trigger>
    379                   <EventListener event=trigger6 />
    380                 </trigger>
    381               </events>
    382             </EventTrigger>
    383           </EventTrigger>
    384         </visibility>
    385       </events>
    386     </BlinkingBillboard>
    387     <Billboard material="Flares/lensflare" colour="0,1,0">
    388       <events>
    389         <visibility>
    390           <EventListener event=trigger6 />
    391         </visibility>
    392       </events>
    393     </Billboard>
    394   </attached>
    395 </CheckPoint>
    396 
    397 
    398 <Model position="11200,400,-1800" scale=10 pitch=-90  mesh="Carrier.mesh">
    399   <attached>
    400     <CheckPoint position="-10,0,0" name=trigger7 scale=0.6 isdestination=true stayactive=true distance=100>
    401   <events>
    402     <activity>
    403       <EventListener event=trigger6 />
    404     </activity>
    405   </events>
    406   <attached>
    407     <Billboard material="Flares/lensflare" colour="1,0,0">
    408       <events>
    409         <visibility>
    410           <EventTrigger invert=true>
    411             <events>
    412               <trigger>
    413                 <EventListener event=trigger6 />
    414               </trigger>
    415             </events>
    416           </EventTrigger>
    417         </visibility>
    418       </events>
    419     </Billboard>
    420     <BlinkingBillboard frequency=0.2 amplitude=1 material="Flares/lensflare" colour="1,1,0">
    421       <events>
    422         <visibility>
    423           <EventTrigger>
    424             <events>
    425               <trigger>
    426                 <EventListener event=trigger6 />
    427               </trigger>
    428             </events>
    429             <EventTrigger invert=true>
    430               <events>
    431                 <trigger>
    432                   <EventListener event=trigger7 />
    433                 </trigger>
    434               </events>
    435             </EventTrigger>
    436           </EventTrigger>
    437         </visibility>
    438       </events>
    439     </BlinkingBillboard>
    440     <Billboard material="Flares/lensflare" colour="0,1,0">
    441       <events>
    442         <visibility>
    443           <EventListener event=trigger7 />
    444         </visibility>
    445       </events>
    446     </Billboard>
    447   </attached>
    448 </CheckPoint>
    449   </attached>
    450 </Model>
     451            </Billboard>
     452          </attached>
     453        </CheckPoint>
     454      </attached>
     455    </Model>
    451456
    452457  </Scene>
  • code/trunk/data/levels/gametype_underattack.oxw

    r5781 r7163  
    44  include("underattackhud.oxo")
    55  include("templates/spaceship_assff.oxt")
     6  include("templates/lodinformation.oxt")
    67?>
    78
     
    1112 gametype     = UnderAttack
    1213>
     14  <templates>
     15    <Template link=lodtemplate_default />
     16  </templates>
     17
    1318  <Scene
    1419   ambientlight = "0.5, 0.5, 0.5"
     
    1823
    1924    <?lua for i = 1, 30, 1 do ?>
    20         <MovableEntity
    21             position="<?lua print(math.random() * 10000 - 5000) ?>, <?lua print(math.random() * 10000 - 5000) ?>, <?lua print(math.random() * 10000 - 5000) ?>"
    22             velocity="<?lua print(math.random() * 500 - 250) ?>, <?lua print(math.random() * 500 - 250) ?>, <?lua print(math.random() * 500 - 250) ?>"
    23         >
    24             <attached>
    25                 <Model
    26                     <?lua x = math.random() * 150 + 30 ?>
    27                     scale="<?lua print(x) ?>"
    28                     mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh"
    29                     position="0,0,0"
    30                 />
    31             </attached>
    32             <collisionShapes>
    33                 <SphereCollisionShape radius=<?lua print(x) ?> position="0,0,0" />
    34             </collisionShapes>
    35         </MovableEntity>
     25      <MovableEntity
     26          position="<?lua print(math.random() * 10000 - 5000) ?>, <?lua print(math.random() * 10000 - 5000) ?>, <?lua print(math.random() * 10000 - 5000) ?>"
     27          velocity="<?lua print(math.random() * 500 - 250) ?>, <?lua print(math.random() * 500 - 250) ?>, <?lua print(math.random() * 500 - 250) ?>"
     28      >
     29        <attached>
     30          <Model
     31              <?lua x = math.random() * 150 + 30 ?>
     32              scale="<?lua print(x) ?>"
     33              mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh"
     34              position="0,0,0"
     35          />
     36        </attached>
     37          <collisionShapes>
     38            <SphereCollisionShape radius=<?lua print(x) ?> position="0,0,0" />
     39          </collisionShapes>
     40      </MovableEntity>
    3641    <?lua end ?>
    3742
    3843    <Destroyer
    39         position          = "100,150,0"
    40         collisionType     = dynamic
    41         mass              = 100000
    42         velocity          = "-35,0,0"
    43         angularDamping    = 0.9999999
    44         health            = 10000
    45         maxhealth         = 10000
    46         initialhealth     = 10000
     44      position          = "100,150,0"
     45      collisionType     = dynamic
     46      mass              = 100000
     47      velocity          = "-35,0,0"
     48      angularDamping    = 0.9999999
     49      health            = 10000
     50      maxhealth         = 10000
     51      initialhealth     = 10000
    4752    >
    4853
    49         <attached>
    50             <TeamSpawnPoint team=1 position="150,0,7" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
    51             <TeamSpawnPoint team=1 position="0,0,7" lookat="-1,0,0" roll="90"  yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
    52             <TeamSpawnPoint team=1 position="-50,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
    53             <TeamSpawnPoint team=1 position="100,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
    54             <TeamSpawnPoint team=1 position="50,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
    55             <?lua for i = 1, 100, 1 do ?>
    56                 <TeamSpawnPoint
    57                     team=0
    58                     position="<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>,<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>,<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>"
    59                     lookat="0,0,0"
    60                     spawnclass=SpaceShip
    61                     pawndesign=spaceshipassff
    62                 />
     54      <attached>
     55        <TeamSpawnPoint team=1 position="150,0,7" direction="-1,0,0" roll=90 yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
     56        <TeamSpawnPoint team=1 position="0,0,7" lookat="-1,0,0" roll="90"  yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
     57        <TeamSpawnPoint team=1 position="-50,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
     58        <TeamSpawnPoint team=1 position="100,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
     59        <TeamSpawnPoint team=1 position="50,0,7" lookat="-1,0,0" roll="90" yaw=0 spawnclass=SpaceShip pawndesign=spaceshipassff />
     60        <?lua for i = 1, 100, 1 do ?>
     61          <TeamSpawnPoint
     62            team=0
     63            position="<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>,<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>,<?lua print((math.random() * 500 + 500) * (math.floor(math.random() + 0.5) * 2 - 1)) ?>"
     64            lookat="0,0,0"
     65            spawnclass=SpaceShip
     66            pawndesign=spaceshipassff
     67          />
    6368
    64                 <!--more spawnpoints for team1-->
    65                 <!--
    66                 <TeamSpawnPoint
    67                     team=1 position="<?lua print((math.random() * 500 + 500)) ?>,<?lua print((math.random() * 500 + 500) ) ?>,<?lua print((math.random() * 500 + 500)) ?>"
    68                     lookat="0,0,0"
    69                     spawnclass=SpaceShip
    70                     pawndesign=spaceshipassff
    71                 />-->
    72             <?lua end ?>
     69          <!--more spawnpoints for team1-->
     70          <!--
     71          <TeamSpawnPoint
     72            team=1 position="<?lua print((math.random() * 500 + 500)) ?>,<?lua print((math.random() * 500 + 500) ) ?>,<?lua print((math.random() * 500 + 500)) ?>"
     73            lookat="0,0,0"
     74            spawnclass=SpaceShip
     75            pawndesign=spaceshipassff
     76          />-->
     77        <?lua end ?>
    7378
    74             <Model mesh="Carrier.mesh" scale="5" />
    75             <Backlight
    76                 mainstate=activity
    77                 active=false
    78                 scale=0.4
    79                 name=bltest
    80                 position=" 7.6, 0, 6"
    81                 colour="0.2, 0.65, 1.0, 1.0"
    82                 width=15
    83                 length=1500
    84                 lifetime=2
    85                 elements=50
    86                 trailmaterial="Trail/backlighttrail"
    87                 turnontime=1
    88                 turnofftime=1
    89                 material="Flares/ThrusterFlare1"
    90             />
    91             <?lua for i=0,8,1 do ?>
    92                 <BlinkingBillboard
    93                     position="<?lua print(200-270/8*i)?> ,15,2"
    94                     material="Examples/Flare"
    95                     colour="1.0, 0.5, 0.3"
    96                     phase=<?lua print(-360/8*i)?>
    97                     amplitude=0.1
    98                     frequency=0.5
    99                     quadratic=1
    100                 />
     79        <Model mesh="Carrier.mesh" scale="5" />
     80        <Backlight
     81          mainstate=activity
     82          active=false
     83          scale=0.4
     84          name=bltest
     85          position=" 7.6, 0, 6"
     86          colour="0.2, 0.65, 1.0, 1.0"
     87          width=15
     88          length=1500
     89          lifetime=2
     90          elements=50
     91          trailmaterial="Trail/backlighttrail"
     92          turnontime=1
     93          turnofftime=1
     94          material="Flares/ThrusterFlare1"
     95        />
     96        <?lua for i=0,8,1 do ?>
     97          <BlinkingBillboard
     98            position="<?lua print(200-270/8*i)?> ,15,2"
     99            material="Examples/Flare"
     100            colour="1.0, 0.5, 0.3"
     101            phase=<?lua print(-360/8*i)?>
     102            amplitude=0.1
     103            frequency=0.5
     104            quadratic=1
     105          />
    101106
    102                 <BlinkingBillboard
    103                     position="<?lua print(200-270/8*i)?>,-15,2"
    104                     material="Examples/Flare"
    105                     colour="1.0, 0.5, 0.3"
    106                     phase=<?lua print(-360/8*i)?>
    107                     amplitude=0.1
    108                     frequency=0.5
    109                     quadratic=1
    110                 />
    111             <?lua end ?>
     107          <BlinkingBillboard
     108            position="<?lua print(200-270/8*i)?>,-15,2"
     109            material="Examples/Flare"
     110            colour="1.0, 0.5, 0.3"
     111            phase=<?lua print(-360/8*i)?>
     112            amplitude=0.1
     113            frequency=0.5
     114            quadratic=1
     115          />
     116        <?lua end ?>
    112117
    113             <Backlight
    114                 scale=1
    115                 position=" 169, 75, -15"
    116                 colour="1, 0.85, 0.5, 0.5"
    117                 width=40
    118                 length=1000
    119                 lifetime=5
    120                 elements=15
    121                 trailmaterial="Trail/backlighttrail"
    122                 material="Examples/Flare"
    123             />
    124             <Backlight
    125                 scale=1
    126                 position=" 169, -75, -15"
    127                 colour="1, 0.85, 0.5, 0.5"
    128                 width=40
    129                 length=1000
    130                 lifetime=5
    131                 elements=15
    132                 trailmaterial="Trail/backlighttrail"
    133                 material="Examples/Flare" />
    134         </attached>
    135         <collisionShapes>
    136             <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
    137             <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
    138             <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
    139             <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
    140             <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
    141             <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
    142             <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
    143         </collisionShapes>
     118        <Backlight
     119          scale=1
     120          position=" 169, 75, -15"
     121          colour="1, 0.85, 0.5, 0.5"
     122          width=40
     123          length=1000
     124          lifetime=5
     125          elements=15
     126          trailmaterial="Trail/backlighttrail"
     127          material="Examples/Flare"
     128        />
     129        <Backlight
     130          scale=1
     131          position=" 169, -75, -15"
     132          colour="1, 0.85, 0.5, 0.5"
     133          width=40
     134          length=1000
     135          lifetime=5
     136          elements=15
     137          trailmaterial="Trail/backlighttrail"
     138          material="Examples/Flare" />
     139      </attached>
     140      <collisionShapes>
     141        <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
     142        <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
     143        <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
     144        <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
     145        <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
     146        <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
     147        <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
     148      </collisionShapes>
    144149    </Destroyer>
    145150
     
    158163      </collisionShapes>
    159164    </StaticEntity>
     165   
    160166  </Scene>
    161167</Level>
  • code/trunk/data/levels/includes/CuboidSpaceStation.lua

    r5781 r7163  
    329329-- Insert the SatelliteDish.
    330330topPartsIndex[2]=8
    331 bodyParts[topPartsIndex[2]][0][0][0][4]="SatelliteDish.mesh"
     331bodyParts[topPartsIndex[2]][0][0][0][4]="satellitedish.mesh"
    332332bodyParts[topPartsIndex[2]][0][0][0][5]="pitch=-90"
    333333bodyParts[topPartsIndex[2]][0][0][0][8]="rotationaxis=\"0,1,0\" rotationrate=5"
  • code/trunk/data/levels/includes/pickups.oxi

    • Property svn:eol-style set to native
    r6725 r7163  
     1
     2<!-- Shield pickups -->
     3
     4<PickupRepresentation
     5    pickupName = "Small Shield Pickup"
     6    pickupDescription = "Gives you a small-sized shield for 30 seconds."
     7    inventoryRepresentation = "SmallShield"
     8    spawnerTemplate = "smallshieldpickupRepresentation"
     9>
     10    <pickup>
     11        <ShieldPickup template=smallshieldpickup />
     12    </pickup>
     13</PickupRepresentation>
     14
     15<PickupRepresentation
     16    pickupName = "Medium Shield Pickup"
     17    pickupDescription = "Gives you a medium-sized shield for 30 seconds."
     18    inventoryRepresentation = "MediumShield"
     19    spawnerTemplate = "mediumshieldpickupRepresentation"
     20>
     21    <pickup>
     22        <ShieldPickup template=mediumshieldpickup />
     23    </pickup>
     24</PickupRepresentation>
     25
     26<PickupRepresentation
     27    pickupName = "Huge Shield Pickup"
     28    pickupDescription = "Gives you a big shield for 60 seconds."
     29    inventoryRepresentation = "HugeShield"
     30    spawnerTemplate = "hugeshieldpickupRepresentation"
     31>
     32    <pickup>
     33        <ShieldPickup template=hugeshieldpickup />
     34    </pickup>
     35</PickupRepresentation>
    136
    237<!-- Health pickups -->
     
    73108
    74109<PickupRepresentation
    75     name = "Small Speed Boost"
    76     description = "Multiplies Speed of the Ship by a small amount."
     110    pickupName = "Small Speed Boost"
     111    pickupDescription = "Multiplies Speed of the Ship by a small amount."
    77112    spawnerTemplate = "smallspeedpickupRepresentation"
     113    inventoryRepresentation = "SmallSpeed"
    78114>
    79115    <pickup>
     
    83119
    84120<PickupRepresentation
    85     name = "Medium Speed Boost"
    86     description = "Multiplies Speed of the Ship by a bigger amount."
     121    pickupName = "Medium Speed Boost"
     122    pickupDescription = "Multiplies Speed of the Ship by a bigger amount."
    87123    spawnerTemplate = "mediumspeedpickupRepresentation"
     124    inventoryRepresentation = "MediumSpeed"
    88125>
    89126    <pickup>
     
    93130
    94131<PickupRepresentation
    95     name = "Huge Speed Boost"
    96     description = "Multiplies Speed of the Ship by a huge amount."
     132    pickupName = "Huge Speed Boost"
     133    pickupDescription = "Multiplies Speed of the Ship by a huge amount."
    97134    spawnerTemplate = "hugespeedpickupRepresentation"
     135    inventoryRepresentation = "HugeSpeed"
    98136>
    99137    <pickup>
     
    103141
    104142<PickupRepresentation
    105     name = "Small Jump Boost"
    106     description = "Boosts the Ship with a massive amount for a very short time."
     143    pickupName = "Small Jump Boost"
     144    pickupDescription = "Boosts the Ship with a massive amount for a very short time."
    107145    spawnerTemplate = "smalljumppickupRepresentation"
     146    inventoryRepresentation = "SmallSpeed"
    108147>
    109148    <pickup>
     
    115154
    116155<PickupRepresentation
    117     name = "small Invisibility"
    118     description = "Makes you invisible for 5 seconds."
     156    pickupName = "Small Invisibility"
     157    pickupDescription = "Makes you invisible for 5 seconds."
    119158    spawnerTemplate = "smallinvisiblepickupRepresentation"
     159    inventoryRepresentation = "SmallInvisible"
    120160>
    121161    <pickup>
     
    125165
    126166<PickupRepresentation
    127     name = "medium Invisibility"
    128     description = "Makes you invisible for 10 seconds."
     167    pickupName = "Medium Invisibility"
     168    pickupDescription = "Makes you invisible for 10 seconds."
    129169    spawnerTemplate = "mediuminvisiblepickupRepresentation"
     170    inventoryRepresentation = "MediumInvisible"
    130171>
    131172    <pickup>
     
    135176
    136177<PickupRepresentation
    137     name = "hunge Invisibility"
    138     description = "Makes you invisible for 20 seconds."
     178    pickupName = "Huge Invisibility"
     179    pickupDescription = "Makes you invisible for 20 seconds."
    139180    spawnerTemplate = "hugeinvisiblepickupRepresentation"
     181    inventoryRepresentation = "HugeInvisible"
    140182>
    141183    <pickup>
     
    147189
    148190<PickupRepresentation
    149     pickupName = "Triple Pickup"
     191    pickupName = "Tri Pickup"
    150192    pickupDescription = "Adds health, speed and invisibility."
    151193    spawnerTemplate = "triplehealthspeedinvisibilitypickupRepresentation"
     
    156198</PickupRepresentation>
    157199
     200<!-- Drone Pickup -->
     201
     202<PickupRepresentation
     203    pickupName = "Drone Pickup"
     204    pickupDescription = "Adds a Drone to the Players Spaceship"
     205    spawnerTemplate = "dronepickupRepresentation"
     206>
     207    <pickup>
     208        <DronePickup template=dronepickup />
     209    </pickup>
     210</PickupRepresentation>
     211
  • code/trunk/data/levels/includes/weaponsettings3.oxi

    r6417 r7163  
    88      <WeaponSet firemode=1 />
    99      <WeaponSet firemode=2 />
     10      <WeaponSet firemode=3 />
    1011    </weaponsets>
    1112    <weapons>
     
    1516          <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
    1617          <DefaultWeaponmodeLink firemode=2 weaponmode=2 />
     18          <DefaultWeaponmodeLink firemode=3 weaponmode=3 />
    1719        </links>
    1820        <Weapon>
    1921          <attached>
    20             <Model mesh="LightningGun.mesh" pitch="78" roll="90" yaw="90" position="0,-1.3,0" />
     22            <Model mesh="LightningGun.mesh" pitch="100" roll="90" yaw="90" position="0,-1.3,0" />
    2123            <Model mesh="LightningGun-s.mesh" pitch="78" roll="90" yaw="90" position="0.2,-1.3,0" />
    22             <Model mesh="hs-w01.mesh" roll="195" position="0,1,0" scale=2 />
    23             <Model mesh="hs-w01s.mesh" roll="195" position="0.1,0.5,0" scale=2 />
     24            <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-76" yaw="-90" position="-1.5,1,0.3" scale=0.6 />
    2425          </attached>
    25           <HsW01 mode=0 munitionpershot=0 delay=0.125 material="Flares/point_lensflare" muzzleoffset=" 0.7, 1.5,-4" />
    26           <HsW01 mode=0 munitionpershot=0 delay=0     material="Flares/point_lensflare" muzzleoffset="-0.9, 1.1,-4" />
    27           <LightningGun mode=1 muzzleoffset="0,0,0" />
     26          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" />
     27          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-1.6, 1.3,-2" />
     28          <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
    2829        </Weapon>
    2930        <Weapon>
     
    3132            <Model mesh="LightningGun.mesh" pitch="103" roll="90" yaw="90" position="0,-1.35,0" />
    3233            <Model mesh="LightningGun-s.mesh" pitch="103" roll="90" yaw="90" position="0.2,-1.35,0" />
    33             <Model mesh="hs-w01.mesh" roll="165" position="0,1,0" scale=2 />
    34             <Model mesh="hs-w01s.mesh" roll="165" position="-0.1,0.5,0" scale=2 />
     34            <Model mesh="hs-w01_reduced.mesh" roll="90" pitch="-104" yaw="-90" position="0,1.3,0.3" scale=0.6 />
    3535          </attached>
    36           <HsW01 mode=0 munitionpershot=0 delay=0     material="Flares/point_lensflare" muzzleoffset=" 0.9, 1.1, -4.0" />
    37           <HsW01 mode=0 munitionpershot=0 delay=0.125 material="Flares/point_lensflare" muzzleoffset="-0.7, 1.5, -4.0" />
    38           <LightningGun mode=1 muzzleoffset="0,0,0" />
     36          <HsW01 mode=0 munitionpershot=0 delay=0     damage=3.14159 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" />
     37          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=3.14159 material="Flares/point_lensflare" muzzleoffset="-0.1, 1.6, -2.0" />
     38          <LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
    3939        </Weapon>
    4040        <Weapon>
    41           <RocketFire mode=2 muzzleoffset="0,0,0" />
     41          <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=50 />
     42          <RocketFire mode=3 muzzleoffset="0,0,0" damage=100 />
    4243        </Weapon>
    4344      </WeaponPack>
  • code/trunk/data/levels/includes/weaponsettings_H2.oxi

    r5781 r7163  
    1818            <Model mesh="hs-w01s.mesh" roll="180" position="0.1, 0.0, 0.0" scale=2 />
    1919          </attached>
    20           <HsW01 mode=0 munitionpershot=0 delay=0.125 material="Flares/point_lensflare" muzzleoffset=" 0.8, 0.9,-4" />
    21           <HsW01 mode=0 munitionpershot=0 delay=0     material="Flares/point_lensflare" muzzleoffset="-0.8, 0.9,-4" />
     20          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.8, 0.9,-4" />
     21          <HsW01 mode=0 munitionpershot=0 delay=0     damage=2.5 material="Flares/point_lensflare" muzzleoffset="-0.8, 0.9,-4" />
    2222        </Weapon>
    2323        <Weapon>
     
    2626            <Model mesh="hs-w01s.mesh" roll="180" position="-0.1, 0.0, 0.0" scale=2 />
    2727          </attached>
    28           <HsW01 mode=0 munitionpershot=0 delay=0     material="Flares/point_lensflare" muzzleoffset=" 0.8, 0.9, -4.0" />
    29           <HsW01 mode=0 munitionpershot=0 delay=0.125 material="Flares/point_lensflare" muzzleoffset="-0.8, 0.9, -4.0" />
     28          <HsW01 mode=0 munitionpershot=0 delay=0     damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.8, 0.9, -4.0" />
     29          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset="-0.8, 0.9, -4.0" />
    3030        </Weapon>
    3131      </WeaponPack>
  • code/trunk/data/levels/includes/weaponsettings_HXY.oxi

    r6417 r7163  
    1414        </links>
    1515        <Weapon>
    16           <HsW01 mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare" />
    17           <HsW01 mode=0 munitionpershot=0 delay=0.1 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
     16          <HsW01 mode=0 munitionpershot=0 damage=2.5 delay=0 material="Flares/point_lensflare" />
     17          <HsW01 mode=0 munitionpershot=0 damage=2.5 delay=0.1 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
    1818          <LightningGun mode=1 muzzleoffset="0,0,0" />
    1919        </Weapon>
    2020        <Weapon>
    21           <HsW01 mode=0 munitionpershot=0 delay=0  material="Flares/point_lensflare" />
    22           <HsW01 mode=0 munitionpershot=0 delay=0.1 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
     21          <HsW01 mode=0 munitionpershot=0 damage=2.5 delay=0  material="Flares/point_lensflare" />
     22          <HsW01 mode=0 munitionpershot=0 damage=2.5 delay=0.1 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
    2323          <LightningGun mode=1 muzzleoffset="0,0,0" />
    2424        </Weapon>
  • code/trunk/data/levels/includes/weaponsettings_ghost.oxi

    r6417 r7163  
    1414        </links>
    1515        <Weapon>
    16           <HsW01 mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare" />
    17           <HsW01 mode=0 munitionpershot=0 delay=0.125 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
     16          <HsW01 mode=0 munitionpershot=0 damage=2.5 delay=0 material="Flares/point_lensflare" />
     17          <HsW01 mode=0 munitionpershot=0 damage=2.5 delay=0.125 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
    1818          <LightningGun mode=1 muzzleoffset="0,0,0" />
    1919        </Weapon>
    2020        <Weapon>
    21           <HsW01 mode=0 munitionpershot=0 delay=0  material="Flares/point_lensflare" />
    22           <HsW01 mode=0 munitionpershot=0 delay=0.125 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
     21          <HsW01 mode=0 munitionpershot=0 damage=2.5 delay=0  material="Flares/point_lensflare" />
     22          <HsW01 mode=0 munitionpershot=0 damage=2.5 delay=0.125 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
    2323          <LightningGun mode=1 muzzleoffset="0,0,0" />
    2424        </Weapon>
  • code/trunk/data/levels/includes/weaponsettings_pirate.oxi

    r5781 r7163  
    1414        </links>
    1515        <Weapon>
    16           <HsW01 mode=0 munitionpershot=0 delay=0 material="Flares/point_lensflare" />
    17           <HsW01 mode=0 munitionpershot=0 delay=0.125 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
     16          <HsW01 mode=0 munitionpershot=0 delay=0     damage=2.5 material="Flares/point_lensflare" />
     17          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset=" 0.5,0.6,1.7" />
    1818        </Weapon>
    1919        <Weapon>
    20           <HsW01 mode=0 munitionpershot=0 delay=0  material="Flares/point_lensflare" />
    21           <HsW01 mode=0 munitionpershot=0 delay=0.125 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
     20          <HsW01 mode=0 munitionpershot=0 delay=0     damage=2.5 material="Flares/point_lensflare" />
     21          <HsW01 mode=0 munitionpershot=0 delay=0.125 damage=2.5 material="Flares/point_lensflare" muzzleoffset="-0.5,0.6,1.7" />
    2222        </Weapon>
    2323      </WeaponPack>
  • code/trunk/data/levels/presentation.oxw

    r6417 r7163  
    33  include("stats.oxo")
    44  include("templates/spaceship_assff.oxt")
     5  include("templates/lodinformation.oxt")
    56?>
    67
     
    910 description  = "Just a few tests"
    1011>
     12  <templates>
     13    <Template link=lodtemplate_default />
     14  </templates>
     15
    1116  <Scene
    1217   ambientlight = "0.3, 0.3, 0.3"
  • code/trunk/data/levels/presentation09.oxw

    r6417 r7163  
    44  include("templates/spaceship_assff.oxt")
    55  include("templates/spaceship_H2.oxt")
     6  include("templates/lodinformation.oxt")
    67?>
    78
     
    1112
    1213>
     14  <templates>
     15    <Template link=lodtemplate_default />
     16  </templates>
     17
    1318  <Scene
    1419   ambientlight = "0.5, 0.5, 0.5"
    1520   skybox       = "Orxonox/skypanoramagen1"
    1621  >
     22 
    1723    <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" />
    1824
    1925
    20 <SpawnPoint position="<?lua print(math.sin(1.5) *40000) ?>,<?lua print(math.cos(1.5) *40000) ?>,<?lua print(500) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
     26    <SpawnPoint position="<?lua print(math.sin(1.5) *40000) ?>,<?lua print(math.cos(1.5) *40000) ?>,<?lua print(500) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
    2127
    2228
    23 <?lua
    24 max = 20
    25 for i = 1, max, 1
    26 do
    27     x = math.sin(i/max*6)*40000
    28     y = math.cos(i/max*6)*40000
    29     z = i*100
     29    <?lua
     30      max = 20
     31      for i = 1, max, 1
     32      do
     33        x = math.sin(i/max*6)*40000
     34        y = math.cos(i/max*6)*40000
     35        z = i*100
    3036    ?>
    31 <?lua
    32 for k = 1, 25, 1
    33 do
    34 j = math.random()
    35 ?>
     37      <?lua
     38        for k = 1, 25, 1
     39        do
     40        j = math.random()
     41      ?>
    3642
    37     <MovableEntity position="<?lua print(x + math.random() * 10000-2500) ?>,<?lua print(y + math.random() * 5000-2500) ?>,<?lua print(z + math.random() * 1000-500) ?>" <?lua if i == 5 then ?> collisionType=dynamic linearDamping=0.8 angularDamping=0 mass=<?lua print(j * 50) ?> <?lua end ?> scale=<?lua print(j * 5) ?> rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    38       <attached>
    39         <Model position="0,0,0" scale=<?lua print(j * 10) ?> mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
    40       </attached>
    41       <?lua if i == 5 then ?><collisionShapes>
    42         <SphereCollisionShape radius="<?lua print(j * 70) ?>" />
    43       </collisionShapes> <?lua end ?>
    44     </MovableEntity>
    45 <?lua
    46 end
    47 ?>
    48 <?lua end ?>
     43      <MovableEntity position="<?lua print(x + math.random() * 10000-2500) ?>,<?lua print(y + math.random() * 5000-2500) ?>,<?lua print(z + math.random() * 1000-500) ?>" <?lua if i == 5 then ?> collisionType=dynamic linearDamping=0.8 angularDamping=0 mass=<?lua print(j * 50) ?> <?lua end ?> scale=<?lua print(j * 5) ?> rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
     44        <attached>
     45          <Model position="0,0,0" scale=<?lua print(j * 10) ?> mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
     46        </attached>
     47        <?lua if i == 5 then ?><collisionShapes>
     48          <SphereCollisionShape radius="<?lua print(j * 70) ?>" />
     49        </collisionShapes> <?lua end ?>
     50      </MovableEntity>
     51   
     52      <?lua end ?>
     53    <?lua end ?>
     54   
    4955    <Planet position="0,0,0" scale=10000 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="1,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
    5056
  • code/trunk/data/levels/presentation09b.oxw

    r6417 r7163  
    55  include("templates/spaceship_H2.oxt")
    66  include("templates/spaceship_pirate.oxt")
     7  include("templates/pickup_representation_templates.oxt")
     8  include("templates/lodinformation.oxt")
    79?>
    810
     
    1214 gametype     = TeamDeathmatch
    1315>
     16  <templates>
     17    <Template link=lodtemplate_default />
     18  </templates>
     19
    1420  <Scene
    1521   ambientlight = "0.5, 0.5, 0.5"
    1622   skybox       = "Orxonox/skypanoramagen2"
    1723  >
     24
     25    <?lua
     26      include("includes/pickups.oxi")
     27    ?>
     28   
    1829    <Light type=directional position="0,0,0" direction="0.683, 0.289, 0.670" diffuse="1.0, 1.0, 1.0, 1.0" specular="1.0, 1.0, 1.0, 1.0" />
    19 
    20     <Template name="JumpItem" baseclass="Jump">
    21         <Jump velocity="0,0,-1000" jumpsAvailable="4" guiImage="jumpturbinepickup.jpg" guiText="Jump" />
    22     </Template>
    23     <Template name="HealthImmediateItem" baseclass="HealthImmediate">
    24         <HealthImmediate recoveredHealth="100" guiImage="decal.jpg" guiText="Health" />
    25     </Template>
    26     <Template name="HealthUsableItem" baseclass="HealthUsable">
    27         <HealthImmediate recoveredHealth="80" guiImage="goldwrenchpickup.jpg" guiText="Health" />
    28     </Template>
    2930
    3031    <SpawnPoint position="-3800, 2500, 1500" direction="-0.683, -0.289, -0.670"  spawnclass=SpaceShip pawndesign=spaceshipassff />
     
    8788    </SpaceShip>
    8889
    89     <PickupSpawner item="JumpItem" triggerDistance="20" respawnTime="10000" position="-3800, 2500, 1500">
    90         <attached>
    91             <!--<Model mesh="jumpthrust.mesh" scale="1.0" />
    92             <Billboard material="Examples/Flare" colour="0.5, 1.0, 0.3" scale="0.5" />-->
    93         </attached>
     90    <PickupSpawner position="-3800, 2500, 1500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
     91      <pickup>
     92        <SpeedPickup template=smalljumppickup />
     93      </pickup>
    9494    </PickupSpawner>
    9595
    96     <PickupSpawner item="HealthUsableItem" triggerDistance="20" respawnTime="10000" position="-4150,2750,1550">
    97         <attached>
    98             <Model mesh="gwrench.mesh" scale="1.0" />
    99             <Billboard material="Examples/Flare" colour="0.3, 0.8, 1.0" scale="0.5" />
    100         </attached>
     96    <!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
     97    <PickupRepresentation
     98      pickupName = "Medium Health Pack"
     99      pickupDescription = "Once used adds a medium amout of health to the ship."
     100      spawnerTemplate = "mediumhealthpickupRepresentation"
     101      inventoryRepresentation = "MediumHealth"
     102    >
     103      <pickup>
     104        <HealthPickup health=100 activationType="onUse" durationType="once" />
     105      </pickup>
     106    </PickupRepresentation>
     107
     108    <PickupSpawner position="-4150,2750,1550" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
     109      <pickup>
     110        <HealthPickup health=100 activationType=onUse durationType=once />
     111      </pickup>
    101112    </PickupSpawner>
    102113
    103     <PickupSpawner item="HealthImmediateItem" triggerDistance="20" respawnTime="3" position="2300, 4300, 2400">
    104         <attached>
    105             <Model mesh="gwrench.mesh" scale="1.0" />
    106             <Billboard material="Examples/Flare" colour="0.9, 1.0, 0.1" scale="0.5" />
    107         </attached>
     114    <PickupSpawner position="2300, 4300, 2400" respawnTime="5" triggerDistance="20">
     115      <pickup>
     116        <HealthPickup template=mediumhealthpickup />
     117      </pickup>
    108118    </PickupSpawner>
    109119
     
    120130    </EventDispatcher>
    121131
    122 <?lua
    123 for i = 1, 10, 1
    124 do
    125 ?>
    126     <SpaceShip position="<?lua print(5000 + math.random() * 4000 - 2000) ?>,<?lua print(0 + math.random() * 2000 - 1000) ?>,<?lua print(math.random() * 2000 - 1000) ?>">
    127       <templates>
    128         <Template link=spaceshippirate />
    129       </templates>
    130       <controller>
    131         <WaypointPatrolController name=pirates alertnessradius=1000 team=1 active=false>
    132           <waypoints>
    133             <StaticEntity position="3100, 2000, 1500" />
    134           </waypoints>
    135         </WaypointPatrolController>
    136       </controller>
    137     </SpaceShip>
    138 <?lua
    139 end
    140 ?>
    141 
    142 <?lua
    143 for i = 1, 12, 1
    144 do
    145 ?>
    146     <SpaceShip position="<?lua print(2800 + math.random() * 2000 - 1000) ?>,<?lua print(2500+ math.random() * 1000 - 500) ?>,<?lua print(2500 + math.random() * 1000 - 500) ?>" >
    147       <templates>
    148         <Template link=spaceshipassff />
    149       </templates>
    150       <controller>
    151         <WaypointPatrolController alertnessradius=1000 team=0>
    152           <waypoints>
    153             <StaticEntity position="<?lua print(2800 + math.random() * 1000 - 500) ?>,<?lua print(2500 + math.random() * 1000 - 500) ?>,<?lua print(1500 + math.random() * 1000 - 500) ?>" />
    154           </waypoints>
    155         </WaypointPatrolController>
    156       </controller>
    157     </SpaceShip>
    158 <?lua
    159 end
    160 ?>
     132    <?lua
     133      for i = 1, 10, 1 do
     134    ?>
     135      <SpaceShip position="<?lua print(5000 + math.random() * 4000 - 2000) ?>,<?lua print(0 + math.random() * 2000 - 1000) ?>,<?lua print(math.random() * 2000 - 1000) ?>">
     136        <templates>
     137          <Template link=spaceshippirate />
     138        </templates>
     139        <controller>
     140          <WaypointPatrolController name=pirates alertnessradius=1000 team=1 active=false>
     141            <waypoints>
     142              <StaticEntity position="3100, 2000, 1500" />
     143            </waypoints>
     144          </WaypointPatrolController>
     145        </controller>
     146      </SpaceShip>
     147    <?lua end ?>
     148
     149    <?lua
     150      for i = 1, 12, 1 do
     151    ?>
     152      <SpaceShip position="<?lua print(2800 + math.random() * 2000 - 1000) ?>,<?lua print(2500+ math.random() * 1000 - 500) ?>,<?lua print(2500 + math.random() * 1000 - 500) ?>" >
     153        <templates>
     154          <Template link=spaceshipassff />
     155        </templates>
     156        <controller>
     157          <WaypointPatrolController alertnessradius=1000 team=0>
     158            <waypoints>
     159              <StaticEntity position="<?lua print(2800 + math.random() * 1000 - 500) ?>,<?lua print(2500 + math.random() * 1000 - 500) ?>,<?lua print(1500 + math.random() * 1000 - 500) ?>" />
     160            </waypoints>
     161          </WaypointPatrolController>
     162        </controller>
     163      </SpaceShip>
     164    <?lua end ?>
    161165
    162166    <Billboard position="2300, 4400, 2500" material="Examples/Flare" />
     
    172176    </EventDispatcher>
    173177
    174 <?lua
    175 for i = 1, 12, 1
    176 do
    177 ?>
    178     <SpaceShip position="<?lua print(2500 + math.random() * 500 - 250) ?>,<?lua print(4800 + math.random() * 500 - 250) ?>,<?lua print(2500 + math.random() * 500 - 250) ?>" >
    179       <templates>
    180         <Template link=spaceshipassff />
    181       </templates>
    182       <controller>
    183         <WaypointPatrolController name=attacker alertnessradius=1000 team=0 active=false>
    184           <waypoints>
    185             <StaticEntity position="<?lua print(2800 + math.random() * 500 - 250) ?>,<?lua print(2500 + math.random() * 500 - 250) ?>,<?lua print(1500 + math.random() * 500 - 250) ?>" />
    186             <StaticEntity position="<?lua print(5000 + math.random() * 500 - 250) ?>,<?lua print(0 + math.random() * 500 - 250) ?>,<?lua print(0 + math.random() * 500 - 250) ?>" />
    187             <StaticEntity position="<?lua print(7500 + math.random() * 500 - 250) ?>,<?lua print(-2500 + math.random() * 500 - 250) ?>,<?lua print(-1500 + math.random() * 500 - 250) ?>" />
    188           </waypoints>
    189         </WaypointPatrolController>
    190       </controller>
    191     </SpaceShip>
    192 <?lua
    193 end
    194 ?>
     178    <?lua
     179      for i = 1, 12, 1 do
     180    ?>
     181      <SpaceShip position="<?lua print(2500 + math.random() * 500 - 250) ?>,<?lua print(4800 + math.random() * 500 - 250) ?>,<?lua print(2500 + math.random() * 500 - 250) ?>" >
     182        <templates>
     183          <Template link=spaceshipassff />
     184        </templates>
     185        <controller>
     186          <WaypointPatrolController name=attacker alertnessradius=1000 team=0 active=false>
     187            <waypoints>
     188              <StaticEntity position="<?lua print(2800 + math.random() * 500 - 250) ?>,<?lua print(2500 + math.random() * 500 - 250) ?>,<?lua print(1500 + math.random() * 500 - 250) ?>" />
     189              <StaticEntity position="<?lua print(5000 + math.random() * 500 - 250) ?>,<?lua print(0 + math.random() * 500 - 250) ?>,<?lua print(0 + math.random() * 500 - 250) ?>" />
     190              <StaticEntity position="<?lua print(7500 + math.random() * 500 - 250) ?>,<?lua print(-2500 + math.random() * 500 - 250) ?>,<?lua print(-1500 + math.random() * 500 - 250) ?>" />
     191            </waypoints>
     192          </WaypointPatrolController>
     193        </controller>
     194      </SpaceShip>
     195    <?lua end ?>
    195196
    196197    <StaticEntity position="2800, 2500, 2500">
    197         <attached>
    198             <CheckPoint />
    199             <Model position="400, 0, 0" scale="40" mesh="DuBall2.mesh"/>
    200             <Model position="-400, 0, 0" scale="40" mesh="DuBall1.mesh"/>
    201         </attached>
     198      <attached>
     199        <CheckPoint />
     200        <Model position="400, 0, 0" scale="40" mesh="DuBall2.mesh"/>
     201        <Model position="-400, 0, 0" scale="40" mesh="DuBall1.mesh"/>
     202      </attached>
    202203    </StaticEntity>
     204
    203205<!--
    204206    <Destroyer position="6500, -2000, -1000" collisionType=dynamic linearDamping=0.8 angularDamping=0 mass=500>
    205         <attached>
    206             <CheckPoint />
    207             <Model position="0,0,0" scale="5" mesh="Carrier.mesh"/>
    208             <Backlight
    209                 mainstate=activity
    210                 active=false
    211                 scale=0.4
    212                 name=bltest
    213                 position=" 7.6, 0, 6"
    214                 colour="0.2, 0.65, 1.0, 1.0"
    215                 width=15
    216                 length=1500
    217                 lifetime=2
    218                 elements=50
    219                 trailmaterial="Trail/backlighttrail"
    220                 turnontime=1
    221                 turnofftime=1
    222                 material="Flares/ThrusterFlare1"
    223             />
    224         </attached>
    225         <collisionShapes>
    226             <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
    227             <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
    228             <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
    229             <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
    230             <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
    231             <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
    232             <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
    233         </collisionShapes>
     207      <attached>
     208        <CheckPoint />
     209        <Model position="0,0,0" scale="5" mesh="Carrier.mesh"/>
     210        <Backlight
     211          mainstate=activity
     212          active=false
     213          scale=0.4
     214          name=bltest
     215          position=" 7.6, 0, 6"
     216          colour="0.2, 0.65, 1.0, 1.0"
     217          width=15
     218          length=1500
     219          lifetime=2
     220          elements=50
     221          trailmaterial="Trail/backlighttrail"
     222          turnontime=1
     223          turnofftime=1
     224          material="Flares/ThrusterFlare1"
     225        />
     226      </attached>
     227      <collisionShapes>
     228        <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
     229        <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
     230        <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
     231        <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
     232        <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
     233        <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
     234        <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
     235      </collisionShapes>
    234236    </Destroyer>
    235237-->
     238
    236239    <Destroyer
    237         position          = "6500,-2000,-1000"
    238         collisionType     = dynamic
    239         mass              = 100000
    240         angularDamping    = 0.9999999
    241         health            = 1000
    242         maxhealth         = 1000
    243         initialhealth     = 1000
     240      position          = "6500,-2000,-1000"
     241      collisionType     = dynamic
     242      mass              = 100000
     243      angularDamping    = 0.9999999
     244      health            = 1000
     245      maxhealth         = 1000
     246      initialhealth     = 1000
    244247    >
     248      <controller>
     249        <WaypointPatrolController team=1 />
     250      </controller>
     251      <attached>
     252        <Model mesh="Carrier.mesh" scale="5" />
     253        <Backlight
     254          mainstate=activity
     255          active=false
     256          scale=0.4
     257          name=bltest
     258          position=" 7.6, 0, 6"
     259          colour="0.2, 0.65, 1.0, 1.0"
     260          width=15
     261          length=1500
     262          lifetime=2
     263          elements=50
     264          trailmaterial="Trail/backlighttrail"
     265          turnontime=1
     266          turnofftime=1
     267          material="Flares/ThrusterFlare1"
     268        />
     269
     270        <?lua
     271          for i=0,8,1 do
     272        ?>
     273          <BlinkingBillboard
     274            position="<?lua print(200-270/8*i)?> ,15,2"
     275            material="Examples/Flare"
     276            colour="1.0, 0.5, 0.3"
     277            phase=<?lua print(-360/8*i)?>
     278            amplitude=0.1
     279            frequency=0.5
     280            quadratic=1
     281          />
     282
     283          <BlinkingBillboard
     284            position="<?lua print(200-270/8*i)?>,-15,2"
     285            material="Examples/Flare"
     286            colour="1.0, 0.5, 0.3"
     287            phase=<?lua print(-360/8*i)?>
     288            amplitude=0.1
     289            frequency=0.5
     290            quadratic=1
     291          />
     292        <?lua end ?>
     293
     294        <Backlight
     295          scale=1
     296          position=" 169, 75, -15"
     297          colour="1, 0.85, 0.5, 0.5"
     298          width=40
     299          length=1000
     300          lifetime=5
     301          elements=15
     302          trailmaterial="Trail/backlighttrail"
     303          material="Examples/Flare"
     304        />
     305        <Backlight
     306          scale=1
     307          position=" 169, -75, -15"
     308          colour="1, 0.85, 0.5, 0.5"
     309          width=40
     310          length=1000
     311          lifetime=5
     312          elements=15
     313          trailmaterial="Trail/backlighttrail"
     314          material="Examples/Flare" />
     315      </attached>
     316      <collisionShapes>
     317        <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
     318        <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
     319        <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
     320        <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
     321        <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
     322        <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
     323        <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
     324      </collisionShapes>
     325    </Destroyer>
     326
     327    <?lua
     328      for i = 1, 10, 1 do
     329    ?>
     330      <SpaceShip position="<?lua print(6200 + math.random() * 2000 - 1000) ?>,<?lua print(-1500 + math.random() * 1000 - 500) ?>,<?lua print(-700 + math.random() * 1000 - 500) ?>" >
     331        <templates>
     332          <Template link=spaceshippirate />
     333        </templates>
    245334        <controller>
    246           <WaypointPatrolController team=1 />
     335          <WaypointPatrolController alertnessradius=1000 team=1>
     336            <waypoints>
     337              <StaticEntity position="<?lua print(6000 + math.random() * 1000 - 500) ?>,<?lua print(-2000 + math.random() * 1000 - 500) ?>,<?lua print(-1000 + math.random() * 1000 - 500) ?>" />
     338            </waypoints>
     339          </WaypointPatrolController>
    247340        </controller>
     341      </SpaceShip>
     342    <?lua end ?>
     343
     344    <?lua
     345      for i = 1, 200, 1 do
     346        x = math.random() * 100  + (i-70) * 100
     347        y = math.random() * 3000 - 1500
     348        z = math.random() * 3000 - 1500 + (i-100) * 10
     349        s = math.random() * 60 + 30
     350    ?>
     351      <MovableEntity position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 - 15) ?>">
    248352        <attached>
    249             <Model mesh="Carrier.mesh" scale="5" />
    250             <Backlight
    251                 mainstate=activity
    252                 active=false
    253                 scale=0.4
    254                 name=bltest
    255                 position=" 7.6, 0, 6"
    256                 colour="0.2, 0.65, 1.0, 1.0"
    257                 width=15
    258                 length=1500
    259                 lifetime=2
    260                 elements=50
    261                 trailmaterial="Trail/backlighttrail"
    262                 turnontime=1
    263                 turnofftime=1
    264                 material="Flares/ThrusterFlare1"
    265             />
    266             <?lua for i=0,8,1 do ?>
    267                 <BlinkingBillboard
    268                     position="<?lua print(200-270/8*i)?> ,15,2"
    269                     material="Examples/Flare"
    270                     colour="1.0, 0.5, 0.3"
    271                     phase=<?lua print(-360/8*i)?>
    272                     amplitude=0.1
    273                     frequency=0.5
    274                     quadratic=1
    275                 />
    276 
    277                 <BlinkingBillboard
    278                     position="<?lua print(200-270/8*i)?>,-15,2"
    279                     material="Examples/Flare"
    280                     colour="1.0, 0.5, 0.3"
    281                     phase=<?lua print(-360/8*i)?>
    282                     amplitude=0.1
    283                     frequency=0.5
    284                     quadratic=1
    285                 />
    286             <?lua end ?>
    287 
    288             <Backlight
    289                 scale=1
    290                 position=" 169, 75, -15"
    291                 colour="1, 0.85, 0.5, 0.5"
    292                 width=40
    293                 length=1000
    294                 lifetime=5
    295                 elements=15
    296                 trailmaterial="Trail/backlighttrail"
    297                 material="Examples/Flare"
    298             />
    299             <Backlight
    300                 scale=1
    301                 position=" 169, -75, -15"
    302                 colour="1, 0.85, 0.5, 0.5"
    303                 width=40
    304                 length=1000
    305                 lifetime=5
    306                 elements=15
    307                 trailmaterial="Trail/backlighttrail"
    308                 material="Examples/Flare" />
     353          <Model position="0,0,0" scale=<?lua print(s) ?> mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
    309354        </attached>
    310         <collisionShapes>
    311             <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
    312             <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
    313             <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
    314             <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
    315             <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
    316             <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
    317             <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
    318         </collisionShapes>
    319     </Destroyer>
    320 
    321 <?lua
    322 for i = 1, 10, 1
    323 do
    324 ?>
    325     <SpaceShip position="<?lua print(6200 + math.random() * 2000 - 1000) ?>,<?lua print(-1500 + math.random() * 1000 - 500) ?>,<?lua print(-700 + math.random() * 1000 - 500) ?>" >
    326       <templates>
    327         <Template link=spaceshippirate />
    328       </templates>
    329       <controller>
    330         <WaypointPatrolController alertnessradius=1000 team=1>
    331           <waypoints>
    332             <StaticEntity position="<?lua print(6000 + math.random() * 1000 - 500) ?>,<?lua print(-2000 + math.random() * 1000 - 500) ?>,<?lua print(-1000 + math.random() * 1000 - 500) ?>" />
    333           </waypoints>
    334         </WaypointPatrolController>
    335       </controller>
    336     </SpaceShip>
    337 <?lua
    338 end
    339 ?>
    340 
    341 <?lua
    342 for i = 1, 200, 1
    343 do
    344 x = math.random() * 100  + (i-70) * 100
    345 y = math.random() * 3000 - 1500
    346 z = math.random() * 3000 - 1500 + (i-100) * 10
    347 s = math.random() * 60 + 30
    348 ?>
    349 
    350     <MovableEntity position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 - 15) ?>">
    351       <attached>
    352         <Model position="0,0,0" scale=<?lua print(s) ?> mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
    353       </attached>
    354     </MovableEntity>
    355 <?lua
    356 end
    357 ?>
    358 
    359 <?lua
    360 elements = {"BodyDebris1.mesh", "CockpitDebris.mesh", "LightningGun.mesh", "WingDebris1.mesh", "WingDebris2.mesh", "satellitedish.mesh", "Thruster.mesh"}
    361 sizes = {4, 4, 4, 4, 4, 10, 20}
    362 elements.length = function()
    363     return table.getn(elements)
    364 end
    365 for i = 1, 150, 1
    366 do
    367 x = math.random() * 750 - 4500
    368 y = math.random() * 1000 + 2000
    369 z = math.random() * 500 + 1000
    370 e = math.floor(math.random()*elements.length()+1)
    371 ?>
    372 
    373     <MovableEntity position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 - 15) ?>">
    374       <attached>
    375         <Model position="0,0,0" scale="<?lua print(sizes[e]) ?>" mesh="<?lua print( elements[e]) ?>" />
    376       </attached>
    377     </MovableEntity>
    378 <?lua
    379 end
    380 ?>
     355      </MovableEntity>
     356    <?lua end ?>
     357
     358    <?lua
     359      elements = {"BodyDebris1.mesh", "CockpitDebris.mesh", "LightningGun.mesh", "WingDebris1.mesh", "WingDebris2.mesh", "satellitedish.mesh", "Thruster.mesh"}
     360      sizes = {4, 4, 4, 4, 4, 10, 20}
     361     
     362      elements.length = function()
     363        return table.getn(elements)
     364      end
     365     
     366      for i = 1, 150, 1 do
     367        x = math.random() * 750 - 4500
     368        y = math.random() * 1000 + 2000
     369        z = math.random() * 500 + 1000
     370        e = math.floor(math.random()*elements.length()+1)
     371    ?>
     372
     373      <MovableEntity position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 - 15) ?>">
     374        <attached>
     375          <Model position="0,0,0" scale="<?lua print(sizes[e]) ?>" mesh="<?lua print( elements[e]) ?>" />
     376        </attached>
     377      </MovableEntity>
     378    <?lua end ?>
    381379
    382380  </Scene>
  • code/trunk/data/levels/presentationHS09.oxw

    r6417 r7163  
    55  include("templates/spaceship_H2.oxt")
    66  include("templates/spaceship_pirate.oxt")
     7  include("templates/pickup_representation_templates.oxt")
     8  include("templates/lodinformation.oxt")
    79?>
    810
     
    1315 hasPhysics = true
    1416>
     17  <templates>
     18    <Template link=lodtemplate_default />
     19  </templates>
     20
    1521  <Scene
    1622   ambientlight = "0.6, 0.4, 0.4"
    1723   skybox       = "Orxonox/skypanoramagen2"
    1824  >
     25
     26    <?lua
     27      include("includes/pickups.oxi")
     28    ?>
     29
    1930    <Light type=directional position="0,0,0" direction="0.683, 0.289, 0.670" diffuse="0.8, 0.5, 0.5, 1.0" specular="0.8, 0.4, 0.4, 1.0" />
    2031
    21     <Template name="JumpItem" baseclass="Jump">
    22         <Jump velocity="0,0,-1000" jumpsAvailable="4" guiImage="jumpturbinepickup.jpg" guiText="Jump" />
    23     </Template>
    24     <Template name="HealthImmediateItem" baseclass="HealthImmediate">
    25         <HealthImmediate recoveredHealth="100" guiImage="decal.jpg" guiText="Health" />
    26     </Template>
    27     <Template name="HealthUsableItem" baseclass="HealthUsable">
    28         <HealthImmediate recoveredHealth="80" guiImage="goldwrenchpickup.jpg" guiText="Health" />
    29     </Template>
    30 
    3132    <SpawnPoint position="-3800, 2500, 1500" direction="-0.683, -0.289, -0.670"  spawnclass=SpaceShip pawndesign=spaceshipassff />
    32 
    33 
    3433
    3534    <SpaceShip position="-3900,3000,1000">
     
    9291    <Billboard material="Test/Fog" position="-3800, 2500, 1500" alpha="0.1" color="1, 1, 1, 0.1" scale="0.5" />
    9392
    94     <PickupSpawner item="JumpItem" triggerDistance="20" respawnTime="10000" position="-3800, 2500, 1500">
    95         <attached>
    96             <!--<Model mesh="jumpthrust.mesh" scale="1.0" />
    97             <Billboard material="Examples/Flare" colour="0.5, 1.0, 0.3" scale="0.5" />-->
    98         </attached>
     93    <PickupSpawner position="-3800, 2500, 1500" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
     94      <pickup>
     95        <SpeedPickup template=smalljumppickup />
     96      </pickup>
    9997    </PickupSpawner>
    10098
    101     <PickupSpawner item="HealthUsableItem" triggerDistance="20" respawnTime="10000" position="-4150,2750,1550">
    102         <attached>
    103             <Model mesh="gwrench.mesh" scale="1.0" />
    104             <Billboard material="Examples/Flare" colour="0.3, 0.8, 1.0" scale="0.5" />
    105         </attached>
     99    <!-- PickupRepresentation for the pickup below, since it is not a standard pickup provided by pickups.oxi -->
     100    <PickupRepresentation
     101      pickupName = "Medium Health Pack"
     102      pickupDescription = "Once used adds a medium amout of health to the ship."
     103      spawnerTemplate = "mediumhealthpickupRepresentation"
     104      inventoryRepresentation = "MediumHealth"
     105    >
     106      <pickup>
     107        <HealthPickup health=100 activationType="onUse" durationType="once" />
     108      </pickup>
     109    </PickupRepresentation>
     110
     111    <PickupSpawner position="-4150,2750,1550" respawnTime="60" triggerDistance="20" maxSpawnedItems="5">
     112      <pickup>
     113        <HealthPickup health=100 activationType=onUse durationType=once />
     114      </pickup>
    106115    </PickupSpawner>
    107116
    108     <PickupSpawner item="HealthImmediateItem" triggerDistance="20" respawnTime="3" position="2300, 4300, 2400">
    109         <attached>
    110             <Model mesh="gwrench.mesh" scale="1.0" />
    111             <Billboard material="Examples/Flare" colour="0.9, 1.0, 0.1" scale="0.5" />
    112         </attached>
     117    <PickupSpawner position="2300, 4300, 2400" respawnTime="5" triggerDistance="20">
     118      <pickup>
     119        <HealthPickup template=mediumhealthpickup />
     120      </pickup>
    113121    </PickupSpawner>
    114122
     
    125133    </EventDispatcher>
    126134
    127 <?lua
    128 for i = 1, 10, 1
    129 do
    130 ?>
    131     <SpaceShip position="<?lua print(5000 + math.random() * 4000 - 2000) ?>,<?lua print(0 + math.random() * 2000 - 1000) ?>,<?lua print(math.random() * 2000 - 1000) ?>">
    132       <templates>
    133         <Template link=spaceshippirate />
    134       </templates>
    135       <controller>
    136         <WaypointPatrolController name=pirates alertnessradius=1000 team=1 active=false>
    137           <waypoints>
    138             <StaticEntity position="3100, 2000, 1500" />
    139           </waypoints>
    140         </WaypointPatrolController>
    141       </controller>
    142     </SpaceShip>
    143 <?lua
    144 end
    145 ?>
    146 
    147 <?lua
    148 for i = 1, 12, 1
    149 do
    150 ?>
    151     <SpaceShip position="<?lua print(2800 + math.random() * 2000 - 1000) ?>,<?lua print(2500+ math.random() * 1000 - 500) ?>,<?lua print(2500 + math.random() * 1000 - 500) ?>" >
    152       <templates>
    153         <Template link=spaceshipassff />
    154       </templates>
    155       <controller>
    156         <WaypointPatrolController alertnessradius=1000 team=0>
    157           <waypoints>
    158             <StaticEntity position="<?lua print(2800 + math.random() * 1000 - 500) ?>,<?lua print(2500 + math.random() * 1000 - 500) ?>,<?lua print(1500 + math.random() * 1000 - 500) ?>" />
    159           </waypoints>
    160         </WaypointPatrolController>
    161       </controller>
    162     </SpaceShip>
    163 <?lua
    164 end
    165 ?>
     135    <?lua
     136      for i = 1, 10, 1 do
     137    ?>
     138      <SpaceShip position="<?lua print(5000 + math.random() * 4000 - 2000) ?>,<?lua print(0 + math.random() * 2000 - 1000) ?>,<?lua print(math.random() * 2000 - 1000) ?>">
     139        <templates>
     140          <Template link=spaceshippirate />
     141        </templates>
     142        <controller>
     143          <WaypointPatrolController name=pirates alertnessradius=1000 team=1 active=false>
     144            <waypoints>
     145              <StaticEntity position="3100, 2000, 1500" />
     146            </waypoints>
     147          </WaypointPatrolController>
     148        </controller>
     149      </SpaceShip>
     150    <?lua end ?>
     151
     152    <?lua
     153      for i = 1, 12, 1 do
     154    ?>
     155      <SpaceShip position="<?lua print(2800 + math.random() * 2000 - 1000) ?>,<?lua print(2500+ math.random() * 1000 - 500) ?>,<?lua print(2500 + math.random() * 1000 - 500) ?>" >
     156        <templates>
     157          <Template link=spaceshipassff />
     158        </templates>
     159        <controller>
     160          <WaypointPatrolController alertnessradius=1000 team=0>
     161            <waypoints>
     162              <StaticEntity position="<?lua print(2800 + math.random() * 1000 - 500) ?>,<?lua print(2500 + math.random() * 1000 - 500) ?>,<?lua print(1500 + math.random() * 1000 - 500) ?>" />
     163            </waypoints>
     164          </WaypointPatrolController>
     165        </controller>
     166      </SpaceShip>
     167    <?lua end ?>
    166168
    167169    <Billboard position="2300, 4400, 2500" material="Examples/Flare" />
     
    177179    </EventDispatcher>
    178180
    179 <?lua
    180 for i = 1, 12, 1
    181 do
    182 ?>
    183     <SpaceShip position="<?lua print(2500 + math.random() * 500 - 250) ?>,<?lua print(4800 + math.random() * 500 - 250) ?>,<?lua print(2500 + math.random() * 500 - 250) ?>" >
    184       <templates>
    185         <Template link=spaceshipassff />
    186       </templates>
    187       <controller>
    188         <WaypointPatrolController name=attacker alertnessradius=<?lua print(math.random() * 2000) ?> team=0 active=false>
    189           <waypoints>
    190             <StaticEntity position="<?lua print(2800 + math.random() * 500 - 250) ?>,<?lua print(2500 + math.random() * 500 - 250) ?>,<?lua print(1500 + math.random() * 500 - 250) ?>" />
    191             <StaticEntity position="<?lua print(5000 + math.random() * 500 - 250) ?>,<?lua print(0 + math.random() * 500 - 250) ?>,<?lua print(0 + math.random() * 500 - 250) ?>" />
    192             <StaticEntity position="<?lua print(7500 + math.random() * 500 - 250) ?>,<?lua print(-2500 + math.random() * 500 - 250) ?>,<?lua print(-1500 + math.random() * 500 - 250) ?>" />
    193           </waypoints>
    194         </WaypointPatrolController>
    195       </controller>
    196     </SpaceShip>
    197 <?lua
    198 end
    199 ?>
     181    <?lua
     182      for i = 1, 12, 1 do
     183    ?>
     184      <SpaceShip position="<?lua print(2500 + math.random() * 500 - 250) ?>,<?lua print(4800 + math.random() * 500 - 250) ?>,<?lua print(2500 + math.random() * 500 - 250) ?>" >
     185        <templates>
     186          <Template link=spaceshipassff />
     187        </templates>
     188        <controller>
     189          <WaypointPatrolController name=attacker alertnessradius=<?lua print(math.random() * 2000) ?> team=0 active=false>
     190            <waypoints>
     191              <StaticEntity position="<?lua print(2800 + math.random() * 500 - 250) ?>,<?lua print(2500 + math.random() * 500 - 250) ?>,<?lua print(1500 + math.random() * 500 - 250) ?>" />
     192              <StaticEntity position="<?lua print(5000 + math.random() * 500 - 250) ?>,<?lua print(0 + math.random() * 500 - 250) ?>,<?lua print(0 + math.random() * 500 - 250) ?>" />
     193              <StaticEntity position="<?lua print(7500 + math.random() * 500 - 250) ?>,<?lua print(-2500 + math.random() * 500 - 250) ?>,<?lua print(-1500 + math.random() * 500 - 250) ?>" />
     194            </waypoints>
     195          </WaypointPatrolController>
     196        </controller>
     197      </SpaceShip>
     198    <?lua end ?>
    200199
    201200    <StaticEntity position="2800, 2500, 2500">
    202         <attached>
    203             <CheckPoint />
    204             <Model position="400, 0, 0" scale="40" mesh="DuBall2.mesh"/>
    205             <Model position="-400, 0, 0" scale="40" mesh="DuBall1.mesh"/>
    206         </attached>
     201      <attached>
     202        <CheckPoint />
     203        <Model position="400, 0, 0" scale="40" mesh="DuBall2.mesh"/>
     204        <Model position="-400, 0, 0" scale="40" mesh="DuBall1.mesh"/>
     205      </attached>
    207206    </StaticEntity>
     207
    208208<!--
    209209    <Destroyer position="6500, -2000, -1000" collisionType=dynamic linearDamping=0.8 angularDamping=0 mass=500>
    210         <attached>
    211             <CheckPoint />
    212             <Model position="0,0,0" scale="5" mesh="Carrier.mesh"/>
    213             <Backlight
    214                 mainstate=activity
    215                 active=false
    216                 scale=0.4
    217                 name=bltest
    218                 position=" 7.6, 0, 6"
    219                 colour="0.2, 0.65, 1.0, 1.0"
    220                 width=15
    221                 length=1500
    222                 lifetime=2
    223                 elements=50
    224                 trailmaterial="Trail/backlighttrail"
    225                 turnontime=1
    226                 turnofftime=1
    227                 material="Flares/ThrusterFlare1"
    228             />
    229         </attached>
    230         <collisionShapes>
    231             <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
    232             <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
    233             <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
    234             <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
    235             <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
    236             <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
    237             <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
    238         </collisionShapes>
     210      <attached>
     211        <CheckPoint />
     212        <Model position="0,0,0" scale="5" mesh="Carrier.mesh"/>
     213        <Backlight
     214          mainstate=activity
     215          active=false
     216          scale=0.4
     217          name=bltest
     218          position=" 7.6, 0, 6"
     219          colour="0.2, 0.65, 1.0, 1.0"
     220          width=15
     221          length=1500
     222          lifetime=2
     223          elements=50
     224          trailmaterial="Trail/backlighttrail"
     225          turnontime=1
     226          turnofftime=1
     227          material="Flares/ThrusterFlare1"
     228        />
     229      </attached>
     230      <collisionShapes>
     231        <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
     232        <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
     233        <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
     234        <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
     235        <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
     236        <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
     237        <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
     238      </collisionShapes>
    239239    </Destroyer>
    240240-->
     241
    241242    <Destroyer
    242         position          = "6500,-2000,-1000"
    243         collisionType     = dynamic
    244         mass              = 100000
    245         angularDamping    = 0.9999999
    246         health            = 1000
    247         maxhealth         = 1000
    248         initialhealth     = 1000
     243      position          = "6500,-2000,-1000"
     244      collisionType     = dynamic
     245      mass              = 100000
     246      angularDamping    = 0.9999999
     247      health            = 1000
     248      maxhealth         = 1000
     249      initialhealth     = 1000
    249250    >
     251      <controller>
     252        <WaypointPatrolController team=1 />
     253      </controller>
     254      <attached>
     255        <Model mesh="Carrier.mesh" scale="5" />
     256        <Backlight
     257          mainstate=activity
     258          active=false
     259          scale=0.4
     260          name=bltest
     261          position=" 7.6, 0, 6"
     262          colour="0.2, 0.65, 1.0, 1.0"
     263          width=15
     264          length=1500
     265          lifetime=2
     266          elements=50
     267          trailmaterial="Trail/backlighttrail"
     268          turnontime=1
     269          turnofftime=1
     270          material="Flares/ThrusterFlare1"
     271        />
     272
     273        <?lua
     274          for i=0,8,1 do
     275        ?>
     276          <BlinkingBillboard
     277            position="<?lua print(200-270/8*i)?> ,15,2"
     278            material="Examples/Flare"
     279            colour="1.0, 0.5, 0.3"
     280            phase=<?lua print(-360/8*i)?>
     281            amplitude=0.1
     282            frequency=0.5
     283            quadratic=1
     284          />
     285
     286          <BlinkingBillboard
     287            position="<?lua print(200-270/8*i)?>,-15,2"
     288            material="Examples/Flare"
     289            colour="1.0, 0.5, 0.3"
     290            phase=<?lua print(-360/8*i)?>
     291            amplitude=0.1
     292            frequency=0.5
     293            quadratic=1
     294          />
     295        <?lua end ?>
     296
     297        <Backlight
     298          scale=1
     299          position=" 169, 75, -15"
     300          colour="1, 0.85, 0.5, 0.5"
     301          width=40
     302          length=1000
     303          lifetime=5
     304          elements=15
     305          trailmaterial="Trail/backlighttrail"
     306          material="Examples/Flare"
     307        />
     308        <Backlight
     309          scale=1
     310          position=" 169, -75, -15"
     311          colour="1, 0.85, 0.5, 0.5"
     312          width=40
     313          length=1000
     314          lifetime=5
     315          elements=15
     316          trailmaterial="Trail/backlighttrail"
     317          material="Examples/Flare"
     318        />
     319      </attached>
     320      <collisionShapes>
     321        <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
     322        <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
     323        <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
     324        <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
     325        <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
     326        <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
     327        <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
     328      </collisionShapes>
     329    </Destroyer>
     330
     331    <?lua
     332      for i = 1, 10, 1 do
     333    ?>
     334      <SpaceShip position="<?lua print(6200 + math.random() * 2000 - 1000) ?>,<?lua print(-1500 + math.random() * 1000 - 500) ?>,<?lua print(-700 + math.random() * 1000 - 500) ?>" >
     335        <templates>
     336          <Template link=spaceshippirate />
     337        </templates>
    250338        <controller>
    251           <WaypointPatrolController team=1 />
     339          <WaypointPatrolController alertnessradius=1000 team=1>
     340            <waypoints>
     341              <StaticEntity position="<?lua print(6000 + math.random() * 1000 - 500) ?>,<?lua print(-2000 + math.random() * 1000 - 500) ?>,<?lua print(-1000 + math.random() * 1000 - 500) ?>" />
     342            </waypoints>
     343          </WaypointPatrolController>
    252344        </controller>
     345      </SpaceShip>
     346    <?lua end ?>
     347
     348    <?lua
     349      elements = {"asteroid_ice.mesh", "asteroid_UV.mesh", "ast1.mesh", "ast2.mesh", "ast3.mesh", "ast4.mesh", "ast5.mesh", "ast6.mesh"}
     350
     351      elements.length = function()
     352        return table.getn(elements)
     353      end
     354
     355      for i = 1, 100, 1 do
     356        x = math.random() * 100  + (i) * 100
     357        y = math.random() * 3000 - 1500
     358        z = math.random() * 3000 - 1500 + (i-100) * 10
     359        s = math.random() * 60 + 30
     360        e = math.floor(math.random()*elements.length()+1)
     361    ?>
     362      <MovableEntity mass=90000 position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>">
    253363        <attached>
    254             <Model mesh="Carrier.mesh" scale="5" />
    255             <Backlight
    256                 mainstate=activity
    257                 active=false
    258                 scale=0.4
    259                 name=bltest
    260                 position=" 7.6, 0, 6"
    261                 colour="0.2, 0.65, 1.0, 1.0"
    262                 width=15
    263                 length=1500
    264                 lifetime=2
    265                 elements=50
    266                 trailmaterial="Trail/backlighttrail"
    267                 turnontime=1
    268                 turnofftime=1
    269                 material="Flares/ThrusterFlare1"
    270             />
    271             <?lua for i=0,8,1 do ?>
    272                 <BlinkingBillboard
    273                     position="<?lua print(200-270/8*i)?> ,15,2"
    274                     material="Examples/Flare"
    275                     colour="1.0, 0.5, 0.3"
    276                     phase=<?lua print(-360/8*i)?>
    277                     amplitude=0.1
    278                     frequency=0.5
    279                     quadratic=1
    280                 />
    281 
    282                 <BlinkingBillboard
    283                     position="<?lua print(200-270/8*i)?>,-15,2"
    284                     material="Examples/Flare"
    285                     colour="1.0, 0.5, 0.3"
    286                     phase=<?lua print(-360/8*i)?>
    287                     amplitude=0.1
    288                     frequency=0.5
    289                     quadratic=1
    290                 />
    291             <?lua end ?>
    292 
    293             <Backlight
    294                 scale=1
    295                 position=" 169, 75, -15"
    296                 colour="1, 0.85, 0.5, 0.5"
    297                 width=40
    298                 length=1000
    299                 lifetime=5
    300                 elements=15
    301                 trailmaterial="Trail/backlighttrail"
    302                 material="Examples/Flare"
    303             />
    304             <Backlight
    305                 scale=1
    306                 position=" 169, -75, -15"
    307                 colour="1, 0.85, 0.5, 0.5"
    308                 width=40
    309                 length=1000
    310                 lifetime=5
    311                 elements=15
    312                 trailmaterial="Trail/backlighttrail"
    313                 material="Examples/Flare" />
     364          <Model position="0,0,0" scale=<?lua print(s) ?> mesh="<?lua print(elements[e])?>" />
    314365        </attached>
    315         <collisionShapes>
    316             <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
    317             <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
    318             <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
    319             <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
    320             <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
    321             <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
    322             <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
    323         </collisionShapes>
    324     </Destroyer>
    325 
    326 <?lua
    327 for i = 1, 10, 1
    328 do
    329 ?>
    330     <SpaceShip position="<?lua print(6200 + math.random() * 2000 - 1000) ?>,<?lua print(-1500 + math.random() * 1000 - 500) ?>,<?lua print(-700 + math.random() * 1000 - 500) ?>" >
    331       <templates>
    332         <Template link=spaceshippirate />
    333       </templates>
    334       <controller>
    335         <WaypointPatrolController alertnessradius=1000 team=1>
    336           <waypoints>
    337             <StaticEntity position="<?lua print(6000 + math.random() * 1000 - 500) ?>,<?lua print(-2000 + math.random() * 1000 - 500) ?>,<?lua print(-1000 + math.random() * 1000 - 500) ?>" />
    338           </waypoints>
    339         </WaypointPatrolController>
    340       </controller>
    341     </SpaceShip>
    342 <?lua
    343 end
    344 ?>
    345 
    346 <?lua
    347 elements = {"asteroid_ice.mesh", "asteroid_UV.mesh", "ast1.mesh", "ast2.mesh", "ast3.mesh", "ast4.mesh", "ast5.mesh", "ast6.mesh"}
    348 elements.length = function()
    349     return table.getn(elements)
    350 end
    351 for i = 1, 100, 1
    352 do
    353 x = math.random() * 100  + (i) * 100
    354 y = math.random() * 3000 - 1500
    355 z = math.random() * 3000 - 1500 + (i-100) * 10
    356 s = math.random() * 60 + 30
    357 e = math.floor(math.random()*elements.length()+1)
    358 ?>
    359 
    360     <MovableEntity mass=90000 position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>">
    361       <attached>
    362         <Model position="0,0,0" scale=<?lua print(s) ?> mesh="<?lua print(elements[e])?>" />
    363       </attached>
    364     </MovableEntity>
    365 <?lua
    366 end
    367 ?>
    368 
    369 <?lua
    370 for i = 1, 100, 1
    371 do
    372 x = math.random() * 200 + i*200
    373 y = math.random() * 3000 - 1500
    374 z = math.random() * 3000 - 1500 + (i-100) * 10
    375 s = math.random() * 60 + 30
    376 ?>
    377   <ParticleSpawner position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" source="Orxonox/Steam" lifetime=3.0 loop=1 />
    378 <!-- <Billboard material="Test/Fog" position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>"  color="1, 1, 1, 0.01" scale="20" />
    379 -->
    380 <?lua
    381 end
    382 ?>
    383 
    384 <?lua
    385 elements = {"BodyDebris1.mesh", "CockpitDebris.mesh", "LightningGun.mesh", "WingDebris1.mesh", "WingDebris2.mesh", "satellitedish.mesh", "Thruster.mesh"}
    386 sizes = {4, 4, 4, 4, 4, 10, 20}
    387 elements.length = function()
    388     return table.getn(elements)
    389 end
    390 for i = 1, 150, 1
    391 do
    392 x = math.random() * 750 - 4500
    393 y = math.random() * 1000 + 2000
    394 z = math.random() * 500 + 1000
    395 e = math.floor(math.random()*elements.length()+1)
    396 ?>
    397 
    398     <MovableEntity mass=90000 position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30- 15) ?>">
    399       <attached>
    400         <Model position="0,0,0" scale="<?lua print(sizes[e]) ?>" mesh="<?lua print( elements[e]) ?>" />
    401       </attached>
    402     </MovableEntity>
    403 <?lua
    404 end
    405 ?>
     366      </MovableEntity>
     367    <?lua end ?>
     368
     369    <?lua
     370      for i = 1, 100, 1 do
     371        x = math.random() * 200 + i*200
     372        y = math.random() * 3000 - 1500
     373        z = math.random() * 3000 - 1500 + (i-100) * 10
     374        s = math.random() * 60 + 30
     375    ?>
     376      <ParticleSpawner position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" source="Orxonox/Steam" lifetime=3.0 loop=1 />
     377      <!-- Billboard material="Test/Fog" position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>"  color="1, 1, 1, 0.01" scale="20" /-->
     378    <?lua end ?>
     379
     380    <?lua
     381      elements = {"BodyDebris1.mesh", "CockpitDebris.mesh", "LightningGun.mesh", "WingDebris1.mesh", "WingDebris2.mesh", "satellitedish.mesh", "Thruster.mesh"}
     382      sizes = {4, 4, 4, 4, 4, 10, 20}
     383     
     384      elements.length = function()
     385        return table.getn(elements)
     386      end
     387     
     388      for i = 1, 150, 1 do
     389        x = math.random() * 750 - 4500
     390        y = math.random() * 1000 + 2000
     391        z = math.random() * 500 + 1000
     392        e = math.floor(math.random()*elements.length()+1)
     393    ?>
     394      <MovableEntity mass=90000 position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30- 15) ?>">
     395        <attached>
     396          <Model position="0,0,0" scale="<?lua print(sizes[e]) ?>" mesh="<?lua print( elements[e]) ?>" />
     397        </attached>
     398      </MovableEntity>
     399    <?lua end ?>
     400   
    406401<!--
    407402    <Planet position="1000,0,0" mass=900000 scale=1000 pitch=-90 mesh="iceplanet.mesh" atmosphere="atmosphere1" rotationaxis="1,1,0" rotationrate="1" atmospheresize=224.0f imagesize=1024.0f />
    408403-->
    409 </Scene>
     404
     405  </Scene>
    410406</Level>
  • code/trunk/data/levels/presentationHS09b.oxw

    r6417 r7163  
    22  include("stats.oxo")
    33  include("hudtemplates3.oxo")
     4  include("templates/lodinformation.oxt")
    45?>
    56
     
    1920 gametype     = TeamDeathmatch
    2021>
     22  <templates>
     23    <Template link=lodtemplate_default />
     24  </templates>
     25
    2126  <Scene
    2227    ambientlight = "0.8, 0.8, 0.8"
     
    2429  >
    2530
    26 
    27 <AmbientSound ambientSource="Mars.ogg" looping="true" playOnLoad="true" />
     31    <AmbientSound ambientSource="Mars.ogg" looping="true" playOnLoad="true" />
    2832
    2933   <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" />
    30 <?lua
    31    for i = 1, 50, 1
    32    do
    33    x = math.random() * 2000  + 4000
    34    y = math.random() * 4000 - 2000
    35    z = math.random() * 2000 - 1000
    36    s = math.random() * 100
    37    ?>
    38 
    39     <MovableEntity collisiontype=dynamic mass=<?lua print(s*10)?> position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.01 angularDamping=0 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>">
    40       <attached>
    41         <Model position="0,0,0" scale=<?lua print(s) ?> mesh="asteroid_UV.mesh" />
    42       </attached>
    43       <collisionShapes>
    44         <SphereCollisionShape radius="<?lua print(s*0.9) ?>" />
    45       </collisionShapes>
    46     </MovableEntity>
    47      <ParticleSpawner position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" source="Orxonox/Steam" lifetime=3.0 loop=1 />
    48 <?lua
    49 end
    50 ?>
    51 
    52 <?lua
    53 elements = {"BodyDebris1.mesh", "CockpitDebris.mesh", "LightningGun.mesh", "WingDebris1.mesh", "WingDebris2.mesh", "satellitedish.mesh", "Thruster.mesh"}
    54 sizes = {4, 4, 4, 4, 4, 10, 20}
    55 elements.length = function()
    56     return table.getn(elements)
    57 end
    58 for i = 1, 100, 1
    59 do
    60 x = math.random() * 750 - 4500
    61 y = math.random() * 1000 + 2000
    62 z = math.random() * 500 + 1000
    63 e = math.floor(math.random()*elements.length()+1)
    64 ?>
    65 
    66     <MovableEntity mass=90000 position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30- 15) ?>">
    67       <attached>
    68         <Model position="0,0,0" scale="<?lua print(sizes[e]) ?>" mesh="<?lua print( elements[e]) ?>" />
    69       </attached>
    70     </MovableEntity>
    71 <?lua
    72 end
    73 ?>
    74 <?lua
    75 for i = 1,12, 1
    76 do
    77 ?>
    78     <SpaceShip position="<?lua print(math.random()*500 + 4500) ?>,<?lua print(-(math.random()*500 -250)) ?>,<?lua print(i*50 - 150) ?>" >
    79       <templates>
    80         <Template link=spaceshipHXYSL />
    81       </templates>
    82       <controller>
    83         <WaypointPatrolController alertnessradius=4000 team=0 active=true>
    84           <waypoints>
    85             <StaticEntity position="5000,<?lua print(math.random()*50)?> ,<?lua print(i*50 -150) ?>" />
    86           </waypoints>
    87         </WaypointPatrolController>
    88       </controller>
    89     </SpaceShip>
    90 <?lua
    91 end
    92 ?>
    93 <SpaceShip position="5000,100,100" >
     34   
     35    <?lua
     36      for i = 1, 50, 1 do
     37        x = math.random() * 2000  + 4000
     38        y = math.random() * 4000 - 2000
     39        z = math.random() * 2000 - 1000
     40        s = math.random() * 100
     41    ?>
     42      <MovableEntity collisiontype=dynamic mass=<?lua print(s*10)?> position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.01 angularDamping=0 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>">
     43        <attached>
     44          <Model position="0,0,0" scale=<?lua print(s) ?> mesh="asteroid_UV.mesh" />
     45        </attached>
     46        <collisionShapes>
     47          <SphereCollisionShape radius="<?lua print(s*0.9) ?>" />
     48        </collisionShapes>
     49      </MovableEntity>
     50      <ParticleSpawner position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" source="Orxonox/Steam" lifetime=3.0 loop=1 />
     51    <?lua end ?>
     52
     53    <?lua
     54      elements = {"BodyDebris1.mesh", "CockpitDebris.mesh", "LightningGun.mesh", "WingDebris1.mesh", "WingDebris2.mesh", "satellitedish.mesh", "Thruster.mesh"}
     55      sizes = {4, 4, 4, 4, 4, 10, 20}
     56     
     57      elements.length = function()
     58        return table.getn(elements)
     59      end
     60     
     61      for i = 1, 100, 1 do
     62        x = math.random() * 750 - 4500
     63        y = math.random() * 1000 + 2000
     64        z = math.random() * 500 + 1000
     65        e = math.floor(math.random()*elements.length()+1)
     66    ?>
     67      <MovableEntity mass=90000 position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.8 angularDamping=0.8 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30- 15) ?>">
     68        <attached>
     69          <Model position="0,0,0" scale="<?lua print(sizes[e]) ?>" mesh="<?lua print( elements[e]) ?>" />
     70        </attached>
     71      </MovableEntity>
     72    <?lua end ?>
     73
     74    <?lua
     75      for i = 1,12, 1 do
     76    ?>
     77      <SpaceShip position="<?lua print(math.random()*500 + 4500) ?>,<?lua print(-(math.random()*500 -250)) ?>,<?lua print(i*50 - 150) ?>" >
     78        <templates>
     79          <Template link=spaceshipHXYSL />
     80        </templates>
     81        <controller>
     82          <WaypointPatrolController alertnessradius=4000 team=0 active=true>
     83            <waypoints>
     84              <StaticEntity position="5000,<?lua print(math.random()*50)?> ,<?lua print(i*50 -150) ?>" />
     85            </waypoints>
     86          </WaypointPatrolController>
     87        </controller>
     88      </SpaceShip>
     89    <?lua end ?>
     90
     91    <SpaceShip position="5000,100,100" >
    9492      <templates>
    9593        <Template link=spaceshipTransporterSL />
     
    102100        </WaypointPatrolController>
    103101      </controller>
    104 </SpaceShip>
     102    </SpaceShip>
     103
    105104    <Destroyer
    106         position          = "-5000,100 ,100"
    107         collisionType     = dynamic
    108         mass              = 100000
    109         angularDamping    = 0.9999999
    110         health            = 1000
    111         maxhealth         = 1000
    112         initialhealth     = 1000
     105      position          = "-5000,100 ,100"
     106      collisionType     = dynamic
     107      mass              = 100000
     108      angularDamping    = 0.9999999
     109      health            = 1000
     110      maxhealth         = 1000
     111      initialhealth     = 1000
    113112    >
    114         <controller>
    115           <WaypointPatrolController team=1 />
    116         </controller>
     113      <controller>
     114        <WaypointPatrolController team=1 />
     115      </controller>
     116      <attached>
     117        <Model mesh="Carrier.mesh" scale="5" />
     118        <Backlight
     119          mainstate=activity
     120          active=false
     121          scale=0.4
     122          name=bltest
     123          position=" 7.6, 0, 6"
     124          colour="0.2, 0.65, 1.0, 1.0"
     125          width=15
     126          length=1500
     127          lifetime=2
     128          elements=50
     129          trailmaterial="Trail/backlighttrail"
     130          turnontime=1
     131          turnofftime=1
     132          material="Flares/ThrusterFlare1"
     133        />
     134        <?lua
     135          for i=0,8,1 do
     136        ?>
     137          <BlinkingBillboard
     138            position="<?lua print(200-270/8*i)?> ,15,2"
     139            material="Examples/Flare"
     140            colour="1.0, 0.5, 0.3"
     141            phase=<?lua print(-360/8*i)?>
     142            amplitude=0.1
     143            frequency=0.5
     144            quadratic=1
     145          />
     146
     147          <BlinkingBillboard
     148            position="<?lua print(200-270/8*i)?>,-15,2"
     149            material="Examples/Flare"
     150            colour="1.0, 0.5, 0.3"
     151            phase=<?lua print(-360/8*i)?>
     152            amplitude=0.1
     153            frequency=0.5
     154            quadratic=1
     155          />
     156        <?lua end ?>
     157
     158        <Backlight
     159          scale=1
     160          position=" 169, 75, -15"
     161          colour="1, 0.85, 0.5, 0.5"
     162          width=40
     163          length=1000
     164          lifetime=5
     165          elements=15
     166          trailmaterial="Trail/backlighttrail"
     167          material="Examples/Flare"
     168        />
     169        <Backlight
     170          scale=1
     171          position=" 169, -75, -15"
     172          colour="1, 0.85, 0.5, 0.5"
     173          width=40
     174          length=1000
     175          lifetime=5
     176          elements=15
     177          trailmaterial="Trail/backlighttrail"
     178          material="Examples/Flare"
     179        />
     180      </attached>
     181      <collisionShapes>
     182        <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
     183        <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
     184        <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
     185        <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
     186        <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
     187        <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
     188        <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
     189      </collisionShapes>
     190    </Destroyer>
     191
     192    <?lua
     193      for i = 1, 50, 1 do
     194        x = -(math.random() * 2000  + 4000)
     195        y = math.random() * 4000 - 2000
     196        z = math.random() * 2000 - 1000
     197        s = math.random() * 100
     198    ?>
     199      <MovableEntity collisiontype=dynamic mass=<?lua print(s*10)?> position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.01 angularDamping=0 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>">
    117200        <attached>
    118             <Model mesh="Carrier.mesh" scale="5" />
    119             <Backlight
    120                 mainstate=activity
    121                 active=false
    122                 scale=0.4
    123                 name=bltest
    124                 position=" 7.6, 0, 6"
    125                 colour="0.2, 0.65, 1.0, 1.0"
    126                 width=15
    127                 length=1500
    128                 lifetime=2
    129                 elements=50
    130                 trailmaterial="Trail/backlighttrail"
    131                 turnontime=1
    132                 turnofftime=1
    133                 material="Flares/ThrusterFlare1"
    134             />
    135             <?lua for i=0,8,1 do ?>
    136                 <BlinkingBillboard
    137                     position="<?lua print(200-270/8*i)?> ,15,2"
    138                     material="Examples/Flare"
    139                     colour="1.0, 0.5, 0.3"
    140                     phase=<?lua print(-360/8*i)?>
    141                     amplitude=0.1
    142                     frequency=0.5
    143                     quadratic=1
    144                 />
    145 
    146                 <BlinkingBillboard
    147                     position="<?lua print(200-270/8*i)?>,-15,2"
    148                     material="Examples/Flare"
    149                     colour="1.0, 0.5, 0.3"
    150                     phase=<?lua print(-360/8*i)?>
    151                     amplitude=0.1
    152                     frequency=0.5
    153                     quadratic=1
    154                 />
    155             <?lua end ?>
    156 
    157             <Backlight
    158                 scale=1
    159                 position=" 169, 75, -15"
    160                 colour="1, 0.85, 0.5, 0.5"
    161                 width=40
    162                 length=1000
    163                 lifetime=5
    164                 elements=15
    165                 trailmaterial="Trail/backlighttrail"
    166                 material="Examples/Flare"
    167             />
    168             <Backlight
    169                 scale=1
    170                 position=" 169, -75, -15"
    171                 colour="1, 0.85, 0.5, 0.5"
    172                 width=40
    173                 length=1000
    174                 lifetime=5
    175                 elements=15
    176                 trailmaterial="Trail/backlighttrail"
    177                 material="Examples/Flare" />
     201          <Model position="0,0,0" scale=<?lua print(s) ?> mesh="asteroid_ice.mesh" />
    178202        </attached>
    179203        <collisionShapes>
    180             <BoxCollisionShape position="70,0,-25"      halfExtents="150, 50, 25" />
    181             <BoxCollisionShape position="95,75,-16"     halfExtents="70, 10, 12" />
    182             <BoxCollisionShape position="95,-75,-16"    halfExtents="70, 10, 12" />
    183             <BoxCollisionShape position="77,47,30"      halfExtents="110, 2, 30" />
    184             <BoxCollisionShape position="77,-47,30"     halfExtents="110, 2, 30" />
    185             <BoxCollisionShape position="77,0,50"       halfExtents="110, 45, 6" />
    186             <BoxCollisionShape position="167,0,70"      halfExtents="17, 20, 20" />
     204          <SphereCollisionShape radius="<?lua print(s*0.9)?>" />
    187205        </collisionShapes>
    188     </Destroyer>
    189 
    190    <?lua
    191    for i = 1, 50, 1
    192    do
    193    x = -(math.random() * 2000  + 4000)
    194    y = math.random() * 4000 - 2000
    195    z = math.random() * 2000 - 1000
    196    s = math.random() * 100
    197    ?>
    198 
    199     <MovableEntity collisiontype=dynamic mass=<?lua print(s*10)?> position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" linearDamping=0.01 angularDamping=0 rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 100 - 15) ?>">
    200       <attached>
    201         <Model position="0,0,0" scale=<?lua print(s) ?> mesh="asteroid_ice.mesh" />
    202       </attached>
    203       <collisionShapes>
    204         <SphereCollisionShape radius="<?lua print(s*0.9)?>" />
    205       </collisionShapes>
    206     </MovableEntity>
    207     <ParticleSpawner position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" source="Orxonox/Steam" lifetime=3.0 loop=1 />
    208 <?lua
    209 end
    210 ?>
    211 <!--<EventDispatcher>
     206      </MovableEntity>
     207      <ParticleSpawner position="<?lua print(x) ?>,<?lua print(y) ?>,<?lua print(z) ?>" source="Orxonox/Steam" lifetime=3.0 loop=1 />
     208    <?lua end ?>
     209
     210    <!-- EventDispatcher>
    212211      <targets>
    213212        <EventTarget target=attack />
     
    219218        </activity>
    220219      </events>
    221 </EventDispatcher>
    222 
    223 <EventDispatcher>
     220    </EventDispatcher>
     221
     222    <EventDispatcher>
    224223      <targets>
    225224        <EventTarget target=wait />
     
    230229        </activity>
    231230      </events>
    232 </EventDispatcher>-->
    233 
    234 <?lua
    235 for i = 1,25, 1
    236 do
    237 ?>
    238 <SpaceShip position="<?lua print(-(math.random()*500 + 4500)) ?>,<?lua print(-(math.random()*500 -250)) ?>,<?lua print(i*50 - 150) ?>" >
    239       <templates>
    240         <Template link=spaceshipghost />
    241       </templates>
    242       <controller>
    243 
     231    </EventDispatcher -->
     232
     233    <?lua
     234      for i = 1,25, 1 do
     235    ?>
     236      <SpaceShip position="<?lua print(-(math.random()*500 + 4500)) ?>,<?lua print(-(math.random()*500 -250)) ?>,<?lua print(i*50 - 150) ?>" >
     237        <templates>
     238          <Template link=spaceshipghost />
     239        </templates>
     240        <controller>
    244241          <WaypointPatrolController name=attack alertnessradius=15000 team=1 active=false>
    245           <events>
    246            <activity>
    247              <DistanceTrigger position="-5000, 100, 100" distance=2000 target="Camera" stayactive=true />
    248            </activity>
    249           </events>
     242            <events>
     243              <activity>
     244                <DistanceTrigger position="-5000, 100, 100" distance=2000 target="Camera" stayactive=true />
     245              </activity>
     246            </events>
    250247          </WaypointPatrolController>
    251 
    252       </controller>
    253     </SpaceShip>
    254 <?lua
    255 end
    256 ?>
    257 
    258 
     248        </controller>
     249      </SpaceShip>
     250    <?lua end ?>
    259251
    260252    <AmbientSound ambientSource="Earth.ogg" looping="true" playOnLoad="false">
     
    266258    </AmbientSound>
    267259
    268     <SpawnPoint position="5000,0,2000" spawnclass=SpaceShip pawndesign=spaceshipassff  team=0/>
     260    <SpawnPoint position="5000,0,2000" spawnclass=SpaceShip pawndesign=spaceshipassff  team=0 />
     261   
    269262  </Scene>
    270263</Level>
  • code/trunk/data/levels/presentation_dm.oxw

    r6417 r7163  
    44  include("templates/spaceship_assff.oxt")
    55  include("templates/spaceship_H2.oxt")
     6  include("templates/lodinformation.oxt")
    67?>
    78
     
    1011 description  = "A simple testlevel"
    1112>
     13  <templates>
     14    <Template link=lodtemplate_default />
     15  </templates>
     16
    1217  <Scene
    1318   ambientlight = "0.5, 0.5, 0.5"
     
    1722
    1823
    19 <?lua
    20 for i = 1, 10, 1
    21 do ?>
    22     <SpawnPoint position="<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
    23 <?lua
    24 end
    25 ?>
     24    <?lua
     25      for i = 1, 10, 1 do
     26    ?>
     27      <SpawnPoint position="<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>,<?lua print(math.random() * 1000 - 500) ?>" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
     28    <?lua end ?>
    2629
    2730    <GlobalShader compositor="Bloom" visible=false>
     
    3336    </GlobalShader>
    3437
    35 
    36 <?lua
    37 for i = 1, 100, 1
    38 do
    39 j = math.random()
    40 ?>
    41 
    42     <MovableEntity position="<?lua print(math.random() * 5000-2000) ?>,<?lua print(math.random() * 5000-2000) ?>,<?lua print(math.random() * 5000 - 2000) ?>" collisionType=dynamic linearDamping=0.8 angularDamping=0 mass=<?lua print(j * 50) ?> scale=<?lua print(j * 5) ?> rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    43       <attached>
    44         <Model position="0,0,0" scale=<?lua print(j * 10) ?> mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
    45       </attached>
    46       <collisionShapes>
    47         <SphereCollisionShape radius="<?lua print(j * 70) ?>" />
    48       </collisionShapes>
    49     </MovableEntity>
    50 <?lua
    51 end
    52 ?>
     38    <?lua
     39      for i = 1, 100, 1 do
     40        j = math.random()
     41    ?>
     42      <MovableEntity position="<?lua print(math.random() * 5000-2000) ?>,<?lua print(math.random() * 5000-2000) ?>,<?lua print(math.random() * 5000 - 2000) ?>" collisionType=dynamic linearDamping=0.8 angularDamping=0 mass=<?lua print(j * 50) ?> scale=<?lua print(j * 5) ?> rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
     43        <attached>
     44          <Model position="0,0,0" scale=<?lua print(j * 10) ?> mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" />
     45        </attached>
     46        <collisionShapes>
     47          <SphereCollisionShape radius="<?lua print(j * 70) ?>" />
     48        </collisionShapes>
     49      </MovableEntity>
     50    <?lua end ?>
    5351
    5452<!--
    55 <?lua
    56 for i = 1, 70, 1
    57 do ?>
    58   <MovableEntity position="<?lua print(math.random() * 6000 - 3000)?>, <?lua print(math.random() * 6000 - 3000) ?>, <?lua print(math.random() * 1000 + 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    59     <attached>
    60       <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
    61     </attached>
    62   </MovableEntity>
    63   <MovableEntity position="<?lua print(math.random() * 6000 - 3000)?>, <?lua print(math.random() * 6000 - 3000) ?>, <?lua print(math.random() * -1000 - 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    64     <attached>
    65       <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
    66     </attached>
    67   </MovableEntity>
     53    <?lua
     54      for i = 1, 70, 1 do
     55    ?>
     56      <MovableEntity position="<?lua print(math.random() * 6000 - 3000)?>, <?lua print(math.random() * 6000 - 3000) ?>, <?lua print(math.random() * 1000 + 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
     57        <attached>
     58          <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
     59        </attached>
     60      </MovableEntity>
     61      <MovableEntity position="<?lua print(math.random() * 6000 - 3000)?>, <?lua print(math.random() * 6000 - 3000) ?>, <?lua print(math.random() * -1000 - 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
     62        <attached>
     63          <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
     64        </attached>
     65      </MovableEntity>
    6866
    69   <MovableEntity position="<?lua print(math.random() * 6000 - 3000)?>, <?lua print(math.random() * 1000 + 3000) ?>, <?lua print(math.random() * 6000 - 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    70     <attached>
    71       <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
    72     </attached>
    73   </MovableEntity>
    74   <MovableEntity position="<?lua print(math.random() * 6000 - 3000)?>, <?lua print(math.random() * -1000 - 3000) ?>, <?lua print(math.random() * 6000 - 3000) ?>" rotationaxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationrate="<?lua print(math.random() * 30 + 5) ?>">
    75     <attached>
    76       <Model scale="<?lua print(math.random() * 30 + 10) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" shadow=false />
    77     </attached>
    78   </MovableEntity>
     67      <MovableEntity position="<?lua print(math.random() * 6000 - 3000)?>, <?lua print(math.random() * 1000