Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 12, 2011, 7:50:43 PM (13 years ago)
Author:
jo
Message:

Ai and tutorial improvements merged back to the trunk. AI features: all weapons are used, the ai-firestrength is configurable, bots are able to collect pickups . I've set the tutorial level as default level.

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/modules/overlays/hud/HUDNavigation.cc

    r8858 r8891  
    6363{
    6464  SetConfigValue(markerLimit_, 3);
     65
    6566}
    6667
     
    7778    setTextSize ( 0.05f );
    7879    setNavMarkerSize ( 0.05f );
     80    setDetectionLimit( 10000.0f );
    7981}
    8082
     
    9597    SUPER ( HUDNavigation, XMLPort, xmlelement, mode );
    9698
    97     XMLPortParam ( HUDNavigation, "font",          setFont,          getFont,          xmlelement, mode );
    98     XMLPortParam ( HUDNavigation, "textSize",      setTextSize,      getTextSize,      xmlelement, mode );
    99     XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode );
     99    XMLPortParam ( HUDNavigation, "font",           setFont,           getFont,           xmlelement, mode );
     100    XMLPortParam ( HUDNavigation, "textSize",       setTextSize,       getTextSize,       xmlelement, mode );
     101    XMLPortParam ( HUDNavigation, "navMarkerSize",  setNavMarkerSize,  getNavMarkerSize,  xmlelement, mode );
     102    XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode );
    100103}
    101104
     
    161164
    162165    unsigned int markerCount_ = 0;
    163 
     166    bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player
    164167//         for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it)
    165168    for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt )
    166169    {
    167170        ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
    168 
    169         if ( markerCount_ < markerLimit_ )
     171        closeEnough_ = listIt->second < detectionLimit_ ;
     172        if ( markerCount_ < markerLimit_ && (closeEnough_ ||  detectionLimit_ < 0) ) // display on HUD if the statement is true
    170173        {
    171174
     
    277280            it->second.text_->show();
    278281        }
    279         else
     282        else // do not display on HUD
    280283        {
    281284            it->second.panel_->hide();
     
    309312void HUDNavigation::addObject ( RadarViewable* object )
    310313{
    311     if( showObject(object)==false )
     314    if( showObject(object) == false )
    312315        return;
    313316
     
    396399        return false;
    397400    assert( rv->getWorldEntity() );
    398     if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false )
     401    if ( rv->getWorldEntity()->isVisible() == false || rv->getRadarVisibility() == false )
    399402        return false;
    400403    return true;
Note: See TracChangeset for help on using the changeset viewer.