Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 14, 2017, 4:04:14 PM (7 years ago)
Author:
kohlia
Message:

The ScriptableController should work now. A demo level called scriptableControllerTest exists as well.

Location:
code/branches/ScriptableController_HS17/src/orxonox/infos
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ScriptableController_HS17/src/orxonox/infos/GametypeInfo.cc

    r11662 r11673  
    7878        this->spawned_ = false;
    7979        this->readyToSpawn_ = false;
     80        this->isFirstSpawn_ = true;
    8081
    8182        this->registerVariables();
     
    315316        }
    316317
    317         if(player->isHumanPlayer() && player->isLocalPlayer())
    318         {
     318        // TODO We might want to handle the subsequent spawns as well somehow
     319        if(player->isHumanPlayer() && player->isLocalPlayer() && this->isFirstSpawn_)
     320        {
     321            this->isFirstSpawn_ = false;
    319322            this->getLevel()->getScriptableController()->setPlayer(player);
    320323
     324            // This handles paths relative to the 'level' directory
    321325            std::string script = this->getLevel()->getScript();
    322326            if(script.at(0) != '/')
  • code/branches/ScriptableController_HS17/src/orxonox/infos/GametypeInfo.h

    r11358 r11673  
    8383            inline bool isStartCountdownRunning() const
    8484                { return this->bStartCountdownRunning_; }
    85            
     85
    8686            void changedStartCountdownRunning(void); // Is called when the start countdown has been either started or stopped.
    8787
     
    168168            bool spawned_; //!< Whether the local Player is currently spawned.
    169169            bool readyToSpawn_; //!< Whether the local Player is ready to spawn.
     170            bool isFirstSpawn_;
    170171    };
    171172}
Note: See TracChangeset for help on using the changeset viewer.