Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10882


Ignore:
Timestamp:
Nov 28, 2015, 10:16:31 AM (8 years ago)
Author:
gania
Message:

fixed a bug in DivisionController, made action transitions smoother

Location:
code/branches/campaignHS15
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/campaignHS15/data/levels/AITest.oxw

    r10880 r10882  
    3535   
    3636<!-- HERE STARTS DEMO FOR THE "WAYPOINTS" -->
    37      <!--
     37     
    3838    <Model mesh="cube.mesh" scale=8 position="  0,2000,-600" />
    3939    <Model mesh="cube.mesh" scale=8 position="  0,2000,-800" />
     
    5757      </controller>
    5858    </SpaceShip>
    59     -->
     59   
    6060<!-- HERE ENDS DEMO FOR THE "WAYPOINTS" -->
    6161
    6262<!-- HERE STARTS DEMO FOR THE ACTIONPOINTS.
    6363P.S. Never set protectMe in the first actionpoint: if human didn't spawn, that actionpoint will be skipped -->
    64      <!-- 
     64       <!--
    6565    <Model mesh="cube.mesh" scale=8 position="0,0,0" />
    6666
     
    210210<!-- HERE ENDS DEMO FOR FIGHTING -->
    211211<!-- HERE STARTS DEMO FOR FORMATIONS -->
    212    
     212    <!--
    213213    <Model mesh="cube.mesh" scale=8 position="   0,2000,    0" />
    214214    <Model mesh="cube.mesh" scale=8 position="   0,2000,-2000" />
     
    259259      </controller>
    260260    </SpaceShip>
    261    
     261    -->
    262262<!-- HERE ENDS DEMO FOR FORMATIONS -->
    263263    <!--
  • code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc

    r10881 r10882  
    364364            (this->getProtect()->getWorldOrientation()* (targetRelativePosition)));
    365365        this->setTargetPosition(targetAbsolutePosition);
    366         this->actionCounter_ += this->actionCounter_ < 100000 ? 1 : -this->actionCounter_ ;
    367         if (this->actionConter_ % 3 == 0)
     366        if (this->actionCounter_ % 3 == 0)
    368367            this->setTargetOrientation(this->getProtect()->getWorldOrientation());
    369368    }
     
    387386        }
    388387        this->setAction(Action::NONE);
     388        this->bHasTargetPosition_ = false;
    389389    }
    390390    void ActionpointController::moveBackToTop()
     
    419419            return;
    420420        // orxout (internal_error) << "Size of actions is " << this->parsedActionpoints_.size() << endl;
    421         this->startAttackingEnemiesThatAreClose();
     421        if (this->actionCounter_ % 5 == 0)
     422            this->startAttackingEnemiesThatAreClose();
    422423        //No action -> pop one from stack
    423424        if (this->action_ == Action::NONE || this->bTakenOver_)
     
    427428                Point p = { Action::FIGHTALL, "", Vector3::ZERO, false };
    428429                this->parsedActionpoints_.push_back (p);
     430
    429431            }
    430432            this->executeActionpoint();
    431433            this->bTakenOver_ = false;
     434            this->action();
    432435        }
    433436        //Action fightall -> fight till nobody alive
     
    445448                {
    446449                    this->nextActionpoint();
    447                     return;
     450
     451                    if (!(this->parsedActionpoints_.empty() && this->loopActionpoints_.empty()))
     452                    {
     453                        this->action();
     454                    }
     455                   
    448456                }
    449457            }
     
    468476                {
    469477                    this->nextActionpoint();
    470                     return;
     478                    this->action();
    471479                }
    472480            }
     
    488496                    {
    489497                        this->nextActionpoint();
    490                         return;
     498                        this->action();
    491499                    }
    492500                }
     
    498506            {
    499507                this->nextActionpoint();   
    500                 return;
     508                this->action();
    501509            }
    502510        }
     
    505513            if (!this->getProtect())
    506514            {
    507                 this->nextActionpoint(); 
    508                 return;
     515                this->nextActionpoint();
     516                this->action();
    509517            }
    510518            this->stayNearProtect();
     
    515523            {
    516524                this->nextActionpoint();
    517                 return;
     525                this->action();
    518526            }
    519527        }
     
    525533            this->bShooting_ = this->canFire();               
    526534        }
     535        this->actionCounter_ += this->actionCounter_ < 100000 ? 1 : -this->actionCounter_ ;
     536
    527537    }
    528538    void ActionpointController::takeActionpoints (std::vector<Point > vector, std::vector<Point > loop, bool b)
  • code/branches/campaignHS15/src/orxonox/controllers/DivisionController.cc

    r10881 r10882  
    117117        {
    118118            this->myFollower_ = newFollower;
     119            if (this->hasWingman())
     120            {
     121                this->myWingman_->takeActionpoints (std::vector<Point>(), std::vector<Point>(), false);
     122            }
    119123            return true;
    120124        }
     
    135139        if (this->myFollower_)
    136140            return true;
    137         else
    138             return false;
     141       
     142        return false;
    139143    }
    140144}
  • code/branches/campaignHS15/src/orxonox/controllers/FlyingController.cc

    r10881 r10882  
    3939        this->rotationProgress_ = 0;
    4040        this->spread_ = 200;
    41         this->tolerance_ = 80;
     41        this->tolerance_ = 60;
    4242        RegisterObject( FlyingController );
    4343    }
Note: See TracChangeset for help on using the changeset viewer.