Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9885 for code/branches


Ignore:
Timestamp:
Dec 9, 2013, 3:57:28 PM (11 years ago)
Author:
agermann
Message:

The level EntryTest.oxw can be deleted. Finally a nice and working solution.

Location:
code/branches/spacestationentry
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/spacestationentry/data/levels/dockingToASpaceStation.oxw

    r9857 r9885  
    9393        </events>
    9494        <attached>
     95        <!-- Trigger for docking with billboard -->
    9596            <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 />
    9697            <DistanceTrigger position="0,0,0" distance="200" target="Pawn"
    9798                beaconMode="exclude" targetname="bcnDestroyer" name="dockMe"
    9899            />
    99 
    100             <Billboard position="-2730,-19970,50" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 />
    101             <DistanceTrigger position="-2730,-19970,50" distance="50" target="Pawn"
     100        <!-- Trigger for undocking with billboard -->
     101            <Billboard position="-2630,-19970,150" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 />
     102            <DistanceTrigger position="-2630,-19970,150" distance="50" target="Pawn"
    102103                beaconMode="identify" targetname="bcnDestroyer" name="undockMe"
    103104            />
     
    105106
    106107    </Dock>
    107    
     108
     109<!-- FPS Player as destination of the dock -->
    108110<FpsPlayer template = "fps" radarname = "First Person Player" position = "0,-19900,0" >
    109111      <attached>
     
    114116</FpsPlayer>
    115117
    116 <!-- Wuerfel -->
    117118
     119<!-- Cube as test SpaceStation
     120
     121The station can either be hidden outside of the skybox, within the hull of the space station if it is big enough or within a planet.
     122Complex spacestations can be placed very far away from the spaceship so it is rendered at low resolution while the player uses the space ship.
     123
     124-->
    118125  <StaticEntity position="0,-20000,0" direction="0,-1,0" collisionType=static mass=100000 friction=0.01 >
    119126      <attached>
     
    125132  </StaticEntity>
    126133
    127 <!-- Schwerkraftfeld -->
     134<!-- Homogenous gravitationfield to simulate local gravity (activating the normal gravity will affect the spaceship terribly) -->
     135<ForceField position="0,-20000,0" mode="homogen" diameter="2000" forcedirection = "0,-500,0" />
    128136
    129 <ForceField position="0,-20000,0" mode="homogen" diameter="2000" forcedirection = "0,-400,0" />
    130137
    131 <!-- Rest -->
     138<!-- Some more stuff -->
    132139
    133140    <!-- triple large belt around the planet  -->
  • code/branches/spacestationentry/src/modules/docking/Dock.cc

    r9857 r9885  
    8585    bool Dock::undocking(bool bTriggered, BaseObject* trigger)
    8686    {
    87         // Noch lange nicht fertig (leich veraenderte Kopie von execute())
     87
    8888        PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger);
    89                 PlayerInfo* player = NULL;
    90 
    91                 // Check whether it is a player trigger and extract pawn from it
    92                 if(pTrigger != NULL)
    93                 {
    94                     if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
    95                         orxout(verbose, context::docking) << "Docking:execute PlayerTrigger was not triggered by a player.." << endl;
    96                         return false;
    97                     }
    98                     player = pTrigger->getTriggeringPlayer();
    99                 }
    100                 else
    101                 {
    102                     orxout(verbose, context::docking) << "Docking::execute Not a player trigger, can't extract pawn from it.." << endl;
    103                     return false;
    104                 }
    105                 if(player == NULL)
    106                 {
    107                     orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl;
    108                     return false;
    109                 }
    110 
    111                 if(bTriggered)
    112                 {
    113                     cmdUndock();
    114                 }
    115                 else
    116                 {
    117                     // Remove player from candidates list
    118                     candidates_.erase(player);
    119                 }
    120 
    121                 return true;
     89        PlayerInfo* player = NULL;
     90
     91        // Check whether it is a player trigger and extract pawn from it
     92        if(pTrigger != NULL)
     93        {
     94              if(!pTrigger->isForPlayer()) {  // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one.
     95              orxout(verbose, context::docking) << "Docking:execute PlayerTrigger was not triggered by a player.." << endl;
     96              return false;
     97              }
     98              player = pTrigger->getTriggeringPlayer();
     99        }
     100        else
     101        {
     102              orxout(verbose, context::docking) << "Docking::execute Not a player trigger, can't extract pawn from it.." << endl;
     103              return false;
     104        }
     105        if(player == NULL)
     106        {
     107              orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl;
     108              return false;
     109        }
     110
     111            if(bTriggered)
     112        {
     113              // Add player to this Docks candidates
     114              candidates_.insert(player);
     115
     116              // Show docking dialog
     117              this->showUndockingDialogHelper(player);
     118        }
     119        else
     120        {
     121              // Remove player from candidates list
     122              candidates_.erase(player);
     123        }
     124
     125        return true;
    122126    }
    123127
     
    166170    }
    167171
     172
     173    void Dock::showUndockingDialogHelper(PlayerInfo* player)
     174        {
     175            assert(player);
     176
     177            if(!player->isHumanPlayer())
     178                return;
     179
     180            if(GameMode::isMaster())
     181            {
     182                if(GameMode::showsGraphics())
     183                    GUIManager::showGUI("UndockingDialog");
     184            }
     185            else
     186                callStaticNetworkFunction(Dock::showDockingDialog, player->getClientID());
     187
     188        }
    168189
    169190    void Dock::showDockingDialogHelper(PlayerInfo* player)
  • code/branches/spacestationentry/src/modules/docking/Dock.h

    r9857 r9885  
    8686            void dock()
    8787                { this->dock(HumanController::getLocalControllerSingleton()->getPlayer()); }
     88            void undock()
     89                { this->undock(HumanController::getLocalControllerSingleton()->getPlayer()); }
    8890            static unsigned int getNumberOfActiveDocks();
    8991            static Dock* getActiveDockAtIndex(unsigned int index);
     
    9698            // Network functions
    9799            void showDockingDialogHelper(PlayerInfo* player);
     100            void showUndockingDialogHelper(PlayerInfo* player);
    98101            static void showDockingDialog();
    99102
  • code/branches/spacestationentry/src/modules/docking/MoveToDockingTarget.cc

    r9667 r9885  
    6666    {
    6767        //TODO: Investigate strange things...
    68         this->parent_->detach((WorldEntity*)player->getControllableEntity());
     68        //this->parent_->detach((WorldEntity*)player->getControllableEntity());
    6969
     70        //TODO: Check the issue with this detach call.
     71        //I have removed the line because the detach call only caused a warning and terminated. And because I didn't find a attach call either.
     72        //Didn't find the need for the line.
    7073        this->parent_->undockingAnimationFinished(player);
    7174        return true;
Note: See TracChangeset for help on using the changeset viewer.