[Orxonox-commit 4280] r8951 - in code/branches/gamecontent: data/levels src/orxonox/controllers src/orxonox/gametypes src/orxonox/interfaces src/orxonox/worldentities src/orxonox/worldentities/pawns
jo at orxonox.net
jo at orxonox.net
Sat Nov 26 10:06:09 CET 2011
Author: jo
Date: 2011-11-26 10:06:08 +0100 (Sat, 26 Nov 2011)
New Revision: 8951
Removed:
code/branches/gamecontent/src/orxonox/interfaces/PartyMember.cc
code/branches/gamecontent/src/orxonox/interfaces/PartyMember.h
Modified:
code/branches/gamecontent/data/levels/missionOne.oxw
code/branches/gamecontent/src/orxonox/controllers/ArtificialController.h
code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc
code/branches/gamecontent/src/orxonox/interfaces/CMakeLists.txt
code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.cc
code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.h
code/branches/gamecontent/src/orxonox/worldentities/pawns/Pawn.cc
code/branches/gamecontent/src/orxonox/worldentities/pawns/Pawn.h
Log:
Removing interface - no actual need for it, since only two classes are necessary to have a teamnumber. Prepared tutorial level for new HUD feature.
Modified: code/branches/gamecontent/data/levels/missionOne.oxw
===================================================================
--- code/branches/gamecontent/data/levels/missionOne.oxw 2011-11-25 14:09:17 UTC (rev 8950)
+++ code/branches/gamecontent/data/levels/missionOne.oxw 2011-11-26 09:06:08 UTC (rev 8951)
@@ -431,7 +431,7 @@
</DistanceTrigger>
- <SimpleNotification message="Three red arrows just appeared.">
+ <SimpleNotification message="Three arrows just appeared.">
<events>
<trigger>
<EventListener event="flying4" />
@@ -440,7 +440,7 @@
</SimpleNotification>
<DistanceTrigger name="flying5" position="-900,640,600" target="Pawn" distance=60 stayActive="true" delay=5/>
- <SimpleNotification message="Follow those red arrows.">
+ <SimpleNotification message="Follow those arrows.">
<events>
<trigger>
<EventListener event="flying5" />
@@ -509,60 +509,62 @@
</SimpleNotification>
<!-- @Objects: 4 boxes (uncontrolled pawns) -->
- <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box >
- <events>
- <visibility>
- <EventListener event="flying4" />
- </visibility>
- </events>
- <attached>
- <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
- </collisionShapes>
- </Pawn>
+ <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 1" >
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
- <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box visible="true">
- <events>
- <visibility>
- <EventListener event="flying4" />
- </visibility>
- </events>
- <attached>
- <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
- </collisionShapes>
- </Pawn>
- <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1>
- <events>
- <visibility>
- <EventListener event="flying4" />
- </visibility>
- </events>
- <attached>
- <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
- </collisionShapes>
- </Pawn>
- <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1>
- <events>
- <visibility>
- <EventListener event="flying4" />
- </visibility>
- </events>
- <attached>
- <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
- </collisionShapes>
- </Pawn>
+ <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 2">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+ <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 3">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+
+ <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 4">
+ <events>
+ <visibility>
+ <EventListener event="flying4" />
+ </visibility>
+ </events>
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="3,3,3" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="15,15,15" />
+ </collisionShapes>
+ </Pawn>
+
<!-- @Triggers: boxtrigger1 <-> one box destroyed
boxtrigger2 <-> two boxes destroyed
boxtrigger3 <-> three boxes destroyed
@@ -633,7 +635,7 @@
<!--------------------------------------PART TWO: Moving targets --------------------------------------->
<!-- @Objects: 2 pirates moving in squares, nonlethal -->
- <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" >
+ <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" RVName="Pirate">
<events>
<visibility>
<EventListener event="boxtrigger4" />
@@ -654,7 +656,7 @@
</controller>
</SpaceShip>
- <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget">
+ <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget" RVName="Pirate">
<events>
<visibility>
<EventListener event="boxtrigger4" />
@@ -923,7 +925,7 @@
<!-- PORTALS END-->
- <SimpleNotification message="Dock to the Hydrogen Farmer.">
+ <SimpleNotification message="Dock to the Hydrogen Farmer." broadcast="true">
<events>
<trigger>
<EventListener event=toHydroFarmer />
@@ -955,7 +957,7 @@
</EventTrigger>
</Trigger>
- <SimpleNotification message="We just received a message from DuBall.">
+ <SimpleNotification message="We just received a message from DuBall." broadcast="true">
<events>
<trigger>
<EventListener event=famer1 />
@@ -964,7 +966,7 @@
</SimpleNotification>
- <SimpleNotification message="We will lend you our strongest ship.">
+ <SimpleNotification message="We will lend you our strongest ship." broadcast="true">
<events>
<trigger>
<EventListener event=famer2 />
@@ -975,12 +977,13 @@
<!-- @Objects: HYDROGEN FARMER & DOCKING -->
<SpaceShip
- team=0
- position="-48900,100,0"
- roll=90 yaw=0 pitch=20
- mass=10000
- health=100000 initialhealth=100000 maxhealth="100000"
- name="HydroFarmer">
+ team = 0
+ position = "-48900,100,0"
+ roll = 90 yaw=0 pitch=20
+ mass = 10000
+ health = 100000 initialhealth=100000 maxhealth="100000"
+ name = "HydroFarmer"
+ RVName = "Hydrogen Farmer" >
<attached>
<!-- Docking -->
<DistanceTriggerBeacon name="bcnDestroyer" />
@@ -1062,7 +1065,8 @@
shieldabsorption = "0.8"
reloadrate = "1"
reloadwaittime = "1"
- name = "cruiser" >
+ name = "cruiser"
+ RVName = "Spacecruiser" >
<attached>
<DockingTarget name="spaceShip" />
</attached>
Modified: code/branches/gamecontent/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/gamecontent/src/orxonox/controllers/ArtificialController.h 2011-11-25 14:09:17 UTC (rev 8950)
+++ code/branches/gamecontent/src/orxonox/controllers/ArtificialController.h 2011-11-26 09:06:08 UTC (rev 8951)
@@ -50,7 +50,7 @@
void abandonTarget(Pawn* target);
- inline void setTeam(int team)
+ inline void setTeam(int team) //TODO: write through to controllable entity.
{ this->team_ = team; }
inline int getTeam() const
{ return this->team_; }
Modified: code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc
===================================================================
--- code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc 2011-11-25 14:09:17 UTC (rev 8950)
+++ code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc 2011-11-26 09:06:08 UTC (rev 8951)
@@ -58,10 +58,14 @@
static ColourValue colours[] =
{
- ColourValue(1.0f, 0.3f, 0.3f),
- ColourValue(0.3f, 0.3f, 1.0f),
+ ColourValue(0.2f, 0.2f, 1.0f),
+ ColourValue(1.0f, 0.1f, 0.1f),
ColourValue(0.3f, 1.0f, 0.3f),
- ColourValue(1.0f, 1.0f, 0.0f)
+ ColourValue(1.0f, 1.0f, 0.0f),
+ ColourValue(0.0f, 1.0f, 1.0f),
+ ColourValue(1.0f, 0.0f, 1.0f),
+ ColourValue(7.0f, 7.0f, 7.0f),
+ ColourValue(2.0f, 2.0f, 2.0f)
};
static std::vector<ColourValue> defaultcolours(colours, colours + sizeof(colours) / sizeof(ColourValue));
Modified: code/branches/gamecontent/src/orxonox/interfaces/CMakeLists.txt
===================================================================
--- code/branches/gamecontent/src/orxonox/interfaces/CMakeLists.txt 2011-11-25 14:09:17 UTC (rev 8950)
+++ code/branches/gamecontent/src/orxonox/interfaces/CMakeLists.txt 2011-11-26 09:06:08 UTC (rev 8951)
@@ -5,5 +5,4 @@
PickupCarrier.cc
PickupListener.cc
RadarViewable.cc
- PartyMember.cc
)
Deleted: code/branches/gamecontent/src/orxonox/interfaces/PartyMember.cc
===================================================================
--- code/branches/gamecontent/src/orxonox/interfaces/PartyMember.cc 2011-11-25 14:09:17 UTC (rev 8950)
+++ code/branches/gamecontent/src/orxonox/interfaces/PartyMember.cc 2011-11-26 09:06:08 UTC (rev 8951)
@@ -1,72 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Damian 'Mozork' Frick
- * Co-authors:
- * ...
- *
-*/
-
-/**
- @file PartyMember.cc
- @brief Implementation of the PartyMember class.
-*/
-
-#include "OrxonoxPrereqs.h"
-
-#include "core/CoreIncludes.h"
-
-#include "PartyMember.h"
-
-namespace orxonox
-{
-
- /**
- @brief
- Constructor. Registers the object.
- */
- PartyMember::PartyMember()
- {
- RegisterRootObject(PartyMember);
- this->team_ = -1;
- }
-
- /**
- @brief
- Destructor.
- */
- PartyMember::~PartyMember()
- {
-
- }
-
- /**
- @brief
- Static method that is used to notify the PartyMember itself of the change in the used status of a Pickupable.
- This is called in Pickupable.
- @param pickup
- The Pickupable that has changed its used status.
- @param used
- Thse value the status has changed to.
- */
-
-}
Deleted: code/branches/gamecontent/src/orxonox/interfaces/PartyMember.h
===================================================================
--- code/branches/gamecontent/src/orxonox/interfaces/PartyMember.h 2011-11-25 14:09:17 UTC (rev 8950)
+++ code/branches/gamecontent/src/orxonox/interfaces/PartyMember.h 2011-11-26 09:06:08 UTC (rev 8951)
@@ -1,81 +0,0 @@
-/*
- * ORXONOX - the hottest 3D action shooter ever to exist
- * > www.orxonox.net <
- *
- *
- * License notice:
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Author:
- * Damian 'Mozork' Frick
- * Co-authors:
- * ...
- *
- */
-
-/**
- @file
- @brief Definition of the PartyMember class.
-*/
-
-#ifndef _PartyMember_H__
-#define _PartyMember_H__
-
-#include "OrxonoxPrereqs.h"
-#include "core/OrxonoxClass.h"
-
-namespace orxonox
-{
- /**
- @brief
- PartyMember is an Interface, that can be implemented by any object to enable it to belong to a certain group. (friend, foe, neutral, ...)
-
- It just needs to inherit form PartyMember, and implement the methods.
- @author
- Damian 'Mozork' Frick
- */
- class _OrxonoxExport PartyMember : virtual public OrxonoxClass
- {
- public:
- PartyMember();
- virtual ~PartyMember();
-
-
-
- /**
- @brief
- Method to set the objects teamnumber.
- Must be implemented by every class inheriting from PartyMember. It is virtual in order to allow to implement a hirarchy.
- Hirarchy: PlayerInfo > Controller > Pawn. When the level is set in the controller it should be also set in the controlled pawn.
- @param team The teamnumber to which a PartyMember belongs to. Value '-1' means no team is set. 0,1,2, ... are legal team numbers.
-
- @return
-
- */
- virtual inline void setTeam(int team) =0;
-
- inline int getTeam() const
- { return this->team_; }
-
- protected:
- int team_; //<! Teamnumber: to identify to which group a PartyMember belongs to
- //<! Default value: -1 : neutral the meaning of other values is defined in the context
-
-
- };
-}
-
-#endif /* _PartyMember_H__ */
Modified: code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.cc
===================================================================
--- code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.cc 2011-11-25 14:09:17 UTC (rev 8950)
+++ code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.cc 2011-11-26 09:06:08 UTC (rev 8951)
@@ -86,6 +86,7 @@
this->setConfigValues();
this->setPriority( Priority::VeryHigh );
this->registerVariables();
+ this->team_ = -1;
}
ControllableEntity::~ControllableEntity()
@@ -118,6 +119,7 @@
{
SUPER(ControllableEntity, XMLPort, xmlelement, mode);
+ XMLPortParam(ControllableEntity, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1);
XMLPortParam(ControllableEntity, "hudtemplate", setHudTemplate, getHudTemplate, xmlelement, mode);
XMLPortParam(ControllableEntity, "camerapositiontemplate", setCameraPositionTemplate, getCameraPositionTemplate, xmlelement, mode);
Modified: code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.h
===================================================================
--- code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.h 2011-11-25 14:09:17 UTC (rev 8950)
+++ code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.h 2011-11-26 09:06:08 UTC (rev 8951)
@@ -163,6 +163,11 @@
{ return this->target_.get(); }
void setTargetInternal( uint32_t targetID );
+ inline void setTeam(int team)
+ { this->team_ = team; }
+ inline float getTeam() const
+ { return this->team_; }
+
protected:
virtual void preDestroy();
@@ -236,6 +241,8 @@
WeakPtr<Controller> controller_;
CameraPosition* reverseCamera_;
WeakPtr<WorldEntity> target_;
+
+ int team_ ; //<! teamnumber
};
}
Modified: code/branches/gamecontent/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/gamecontent/src/orxonox/worldentities/pawns/Pawn.cc 2011-11-25 14:09:17 UTC (rev 8950)
+++ code/branches/gamecontent/src/orxonox/worldentities/pawns/Pawn.cc 2011-11-26 09:06:08 UTC (rev 8951)
@@ -59,7 +59,6 @@
this->bAlive_ = true;
this->bReload_ = false;
- this->team_ = -1;
this->health_ = 0;
this->maxHealth_ = 0;
this->initialHealth_ = 0;
@@ -110,8 +109,6 @@
{
SUPER(Pawn, XMLPort, xmlelement, mode);
- XMLPortParam(Pawn, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1);
-
XMLPortParam(Pawn, "health", setHealth, getHealth, xmlelement, mode).defaultValues(100);
XMLPortParam(Pawn, "maxhealth", setMaxHealth, getMaxHealth, xmlelement, mode).defaultValues(200);
XMLPortParam(Pawn, "initialhealth", setInitialHealth, getInitialHealth, xmlelement, mode).defaultValues(100);
Modified: code/branches/gamecontent/src/orxonox/worldentities/pawns/Pawn.h
===================================================================
--- code/branches/gamecontent/src/orxonox/worldentities/pawns/Pawn.h 2011-11-25 14:09:17 UTC (rev 8950)
+++ code/branches/gamecontent/src/orxonox/worldentities/pawns/Pawn.h 2011-11-26 09:06:08 UTC (rev 8951)
@@ -34,13 +34,12 @@
#include <string>
#include "interfaces/PickupCarrier.h"
#include "interfaces/RadarViewable.h"
-#include "interfaces/PartyMember.h"
#include "worldentities/ControllableEntity.h"
namespace orxonox // tolua_export
{ // tolua_export
class _OrxonoxExport Pawn // tolua_export
- : public ControllableEntity, public RadarViewable, public PickupCarrier//, public PartyMember
+ : public ControllableEntity, public RadarViewable, public PickupCarrier
{ // tolua_export
friend class WeaponSystem;
@@ -54,10 +53,6 @@
inline bool isAlive() const
{ return this->bAlive_; }
- inline void setTeam(int team)
- { this->team_ = team; }
- inline float getTeam() const
- { return this->team_; }
virtual void setHealth(float health);
inline void addHealth(float health)
@@ -199,7 +194,6 @@
virtual PickupCarrier* getCarrierParent(void) const
{ return NULL; }
- int team_;
float health_;
float maxHealth_;
More information about the Orxonox-commit
mailing list