Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8875


Ignore:
Timestamp:
Sep 4, 2011, 10:27:17 PM (13 years ago)
Author:
jo
Message:

Radar fix: pawns were not displayed when their visibility/activity changed from 'invisible' to 'visible'.

Location:
code/branches/ai2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ai2/data/levels/missionOne.oxw

    r8874 r8875  
    4949  <WorldAmbientSound source="Mars.ogg" looping="true" playOnLoad="true" /> <!-- AlphaCentauri.ogg-->
    5050
    51 
    5251    <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"/>
    53     <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
    54     <!-- Script code="artificialcontroller setbotlevel 0.1" /-->
     52    <SpawnPoint team=0 position="800,700,600" direction="-1,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
     53
    5554
    5655<!-- END OF INCLUDES & NECESSARITIES -->
    5756
    58 <!-- QUESTS: TODO! STORY!!
    59     <LocalQuest id="orxonox-weaponsystem-check">
    60         <QuestDescription title="Tutorial" description=" " /> //The description of the quest.
    61         <subquests>
     57    <LocalQuest id="missionOne.basicFlying">
     58        <QuestDescription title="Flying" description="INSERT STORY HERE. The first thing you have to learn is flying. Use 'W' to accelerate and steer with your mouse. In order to know where to fly there are two detection systems. The navigation markers highlite important objects directly in the level. If you can't directly see those objects, there are arrows which indicate how you have to steer. The second device is the radar. There you get an overview of all objects near you. In order to find an object that you spotted on radar, you have to steer in a way that the corresponding dot is in the center of the radar. Now you can find the corresponding object straight ahead. Your goal is to fly to the first waypoint. It's that orange dot on the radar." failmessage="" completeMessage="Well done." />
     59        <!--subquests>
    6260            <Quest id ="questId1" />
    6361            <Quest id="questIdn" />
     
    7775            ...
    7876            <QuestEffect />
    79         </complete-effects>
    80     </LocalQuest-->
    81 
    82 
    83 
    84 
    85 
    86 
    87 
    88 
    89 
    90 
    91 
    92 
    93 
    94 
    95 
    96 
    97 
    98 
     77        </complete-effects-->
     78    </LocalQuest>
     79
     80    <LocalQuest id="missionOne.weaponsystemI">
     81        <QuestDescription title="Weaponsystem I" description="INSERT STORY HERE. Test your four different weapons on the four boxes. The four weapons are laser (left click), plasma (right click), self targeting rockets (middle click) and manual rockets (press 'T'). Attention if you use manual rockets: Press 'T' only once to start the rocket. If you miss your target you can get out of the rocket, by clicking or pressing 'T' once more." failmessage="" completeMessage="All right." />
     82        <!--subquests>
     83            <Quest id ="questId1" />
     84            <Quest id="questIdn" />
     85        </subquests>
     86        <hints>
     87            <QuestHint id="hintId1" />
     88           
     89"The laser is a standard weapon. It is fast and precise but does not deal much damage."
     90"That was the lightning gun. Its plasma munition is quite slow, but a normal spaceship can't take more than three hits of such a strong weapon. That could be your favourite weapon for close range combat or if you want to hit a really slow enemy."
     91"The target seeking rockets follow slow targets on their own."
     92"Task complete. Manual rockets are your most powerful weapon. But since you have to steer it to your target yourself, you will leave your spaceship unprotected for a while. The total amount of both manual and target seeking rockets is limited to 10."
     93
     94
     95            <QuestHint id="hintIdn" />
     96        </hints>
     97        <fail-effects>
     98            <QuestEffect />
     99            ...
     100            <QuestEffect />
     101        </fail-effects>
     102        <complete-effects>
     103            <QuestEffect />
     104            ...
     105            <QuestEffect />
     106        </complete-effects-->
     107    </LocalQuest>
     108
     109
     110
     111
     112
     113        <QuestEffectBeacon position="800,700,600" times="1">
     114            <effects>
     115                <AddQuest questId="missionOne.basicFlying" />
     116            </effects>
     117            <events>
     118                <execute>
     119                    <EventListener event="questStart"/>
     120                </execute>
     121            </events>
     122            <attached>
     123                <DistanceTrigger name="questStart" position="0,0,0" distance="50" target="Pawn" beaconMode="identify" targetname="PlayerDistanceTrigger" delay="2" />
     124            </attached>
     125        </QuestEffectBeacon>
    99126
    100127
    101128<!-- TUTORIAL-TODO: -->
    102 
    103 <!-- 1. Aiming & Weapons (static targets, moving targets, dangerous targets)--> <!-- 3 Mouse buttons + "T"-->
    104 <!-- 2. Flying & manoeuvring (basic flying, using pickups, forcefields, docks & portals) --> <!-- "W","S","SPACE"-->
     129<!-- 1. Flying & manoeuvring (basic flying, using pickups, forcefields, docks & portals) --> <!-- "W","S","SPACE"-->
     130<!-- 2. Aiming & Weapons (static targets, moving targets, dangerous targets)--> <!-- 3 Mouse buttons + "T"-->
    105131<!-- 3. Game handling (quests, knowing when a game is over :-), pausing, chat, ... ) --> <!--"F3", "F2", "ESC" -->
    106132<!-- 4. Extras (other things to discover) --> <!-- "Q","E","A","D","C", "CTRL", "", ... -->
    107133
    108134<!--
    109 Four boxes for aiming
    110 
    111 TODO: display text: "Destroy those four boxes. Aim the a the box and shoot by using the left mouse button."
    112 "The laser is a standard weapon. It is fast and precise but does not deal much damage. Now do the same with the next target, but right click instead."
    113 "That was the lightning gun. Its plasma munition is quite slow, but a normal spaceship can't take more than three hits of such a strong weapon. That should be your favourite in close range combat or if you want to hit a really slow enemy. Try to destroy the next box by right clicking at it."
    114 "The target seeking rockets follow their target on their own and the explosive load shouldn't be underestimated. Now its time to hit the last target with the hand guided rocket. You can release one by pressing T once. Note: If you miss the target, you can get out of the rocket by clicking or pressing T once more."
    115 
    116 "Task complete. Manual rockets are your most powerful weapon. But since you have to steer it to your target yourself, you will leave your spaceship unprotected for a while. Now lets move to a slightly more difficult target. Take a look at your radar. The red dot is an enemy's ship. Try to turn your ship towards it, such that the red dot is in the radar's centre. You should be able to see it then directly. Your task is to destroy it."
     135
     136
    117137
    118138"Lets start flying. Use W to accelerate and S to brake. The goal is to reach the spacestation which is displayed on the radar. If you want to be faster you can temporarily boost by hitting additionally the space button. If you use too much boost your engine heats up and you won't be able to use boost for a while. By the way boost could be useful during combat .."
     
    120140-->
    121141
    122     <DistanceTrigger name="spawndelaytrigger0" position="-200,0,0" target="Pawn" distance=10 stayActive="true" />
     142    <DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true"/>
    123143    <SimpleNotification message="Welcome to the Orxonox Tutorial.">
    124144        <events>
     
    129149    </SimpleNotification>
    130150<!-------------------------------------- PART ZERO: How to fly --------------------------------------->
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
    131161
    132162<!-------------------------------------- PART ONE : Destroy boxes --------------------------------------->
     
    716746
    717747<!-- TODO:
    718      - better performance: 4-8 Transporters from different directions heading towards duball's station
    719      - attached with triggers: - if all bots died, then display end message
    720                                - do a count down: 'x enemies left'
    721748     - update spaceshipTransporter
    722749     - bots do friendly fire (is drone function reusable?)
     
    11521179        </events>
    11531180    </Script-->
    1154 
     1181    <!-- Script code="artificialcontroller setbotlevel 0.1" /-->
    11551182  </Scene>
    11561183</Level>
  • code/branches/ai2/src/modules/overlays/hud/HUDNavigation.cc

    r8874 r8875  
    164164
    165165    unsigned int markerCount_ = 0;
    166     bool closeEnough_ = false; //inly display objects that are close enough to be relevant for the player
     166    bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player
    167167//         for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it)
    168168    for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt )
    169169    {
    170170        ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
    171         if( detectionLimit_ < 0 )
    172             closeEnough_ = true ;
    173         else
    174             closeEnough_ = listIt->second < detectionLimit_ ;
    175         if ( markerCount_ < markerLimit_ && closeEnough_ ) // display on HUD íf statement is true
     171        closeEnough_ = listIt->second < detectionLimit_ ;
     172        if ( markerCount_ < markerLimit_ && (closeEnough_ ||  detectionLimit_ < 0) ) // display on HUD if the statement is true
    176173        {
    177174
  • code/branches/ai2/src/modules/overlays/hud/HUDRadar.cc

    r8874 r8875  
    124124
    125125    void HUDRadar::objectChanged( RadarViewable* rv )
    126     {
    127         if(rv == dynamic_cast<RadarViewable*>(this->owner_)) //case: player changed
    128             return;
    129         if( showObject(rv) == false ) //case: (radar) invisible object changed
    130             return;
    131         if( this->radarObjects_.find(rv) == this->radarObjects_.end() ) // if (radar) invisibility becomes (radar) visible
    132             this->addObject(rv);
    133         assert( this->radarObjects_.find(rv) != this->radarObjects_.end() );
    134         Ogre::PanelOverlayElement* panel = this->radarObjects_[rv];
    135         panel->setMaterialName(TextureGenerator::getMaterialName(
    136             shapeMaterials_[rv->getRadarObjectShape()], rv->getRadarObjectColour()));
     126    {// The new implementation behaves more precisely, since inactive RadarViewables are not displayed anymore.
     127        this->removeObject(rv);
     128        this->addObject(rv);
    137129    }
    138130
  • code/branches/ai2/src/orxonox/LevelManager.cc

    r8706 r8875  
    8787    void LevelManager::setConfigValues()
    8888    {
    89         SetConfigValue(defaultLevelName_, "presentationDM.oxw")
     89        SetConfigValue(defaultLevelName_, "missionOne.oxw")
    9090            .description("Sets the pre selection of the level in the main menu.");
    9191    }
     
    158158        if (this->levels_.size() > 0)
    159159        {
    160             // Activate the level that is the first in the list of levels whose activity has been requested. 
     160            // Activate the level that is the first in the list of levels whose activity has been requested.
    161161            this->levels_.front()->setActive(true);
    162162            // Make every player enter the newly activated level.
     
    272272                Loader::unload(&file);
    273273
    274                 if(info == NULL) 
     274                if(info == NULL)
    275275                {
    276276                    // Create a default LevelInfoItem object that merely contains the name
  • code/branches/ai2/src/orxonox/interfaces/RadarViewable.h

    r7163 r8875  
    3838#include "core/OrxonoxClass.h"
    3939#include "core/SmartPtr.h"
    40 
     40//TODO: if a RadarViewable changes visibility or activity, the event is not correctly working
    4141namespace orxonox
    4242{
  • code/branches/ai2/src/orxonox/worldentities/pawns/Pawn.cc

    r8758 r8875  
    452452        this->isHumanShip_ = true;
    453453    }
     454
     455    void Pawn::changedActivity(void)
     456    {
     457        SUPER(Pawn, changedActivity);
     458
     459        this->setRadarVisibility(this->isActive());
     460    }
     461
     462    void Pawn::changedVisibility(void)
     463    {
     464        SUPER(Pawn, changedVisibility);
     465        //this->setVisible(this->isVisible());
     466        this->setRadarVisibility(this->isVisible());
     467    }
     468
    454469}
  • code/branches/ai2/src/orxonox/worldentities/pawns/Pawn.h

    r8852 r8875  
    170170            virtual const Vector3& getCarrierPosition(void) const
    171171                { return this->getWorldPosition(); };
     172            virtual void changedActivity(void); //!< To enable radarviewability when the activity is changed
     173            virtual void changedVisibility(void); //!< To enable proper radarviewability when the visibility is changed
    172174
    173175        protected:
Note: See TracChangeset for help on using the changeset viewer.