[Orxonox-commit 5343] r10006 - in code/branches/ScriptableController: data/levels src/modules/docking src/orxonox/controllers
mkronig at orxonox.net
mkronig at orxonox.net
Thu Mar 27 15:23:27 CET 2014
Author: mkronig
Date: 2014-03-27 15:23:27 +0100 (Thu, 27 Mar 2014)
New Revision: 10006
Added:
code/branches/ScriptableController/data/levels/levelTry.oxw
code/branches/ScriptableController/src/modules/docking/Unsaved Document 1
code/branches/ScriptableController/src/orxonox/controllers/ScriptController_00.cc
code/branches/ScriptableController/src/orxonox/controllers/ScriptController_00.h
Modified:
code/branches/ScriptableController/src/orxonox/controllers/CMakeLists.txt
Log:
first try with scriptable controller
Added: code/branches/ScriptableController/data/levels/levelTry.oxw
===================================================================
--- code/branches/ScriptableController/data/levels/levelTry.oxw (rev 0)
+++ code/branches/ScriptableController/data/levels/levelTry.oxw 2014-03-27 14:23:27 UTC (rev 10006)
@@ -0,0 +1,196 @@
+<!-- -->
+<LevelInfo
+ name = "Fancy orxout tests"
+ description = "Docking into a spacestation."
+ tags = "showcase"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+ include("stats.oxo")
+ include("HUDTemplates3.oxo")
+ include("templates/lodInformation.oxt")
+ include("templates/pickupRepresentationTemplates.oxt")
+?>
+
+<?lua
+ include("templates/spaceshipAssff.oxt")
+ include("templates/spaceshipPirate.oxt")
+ include("templates/spaceshipEscort.oxt")
+ include("templates/bigship.oxt")
+ include("templates/spaceshipTurret.oxt")
+ include("templates/spaceshipCollateralDamage.oxt")
+ include("templates/FPS.oxt")
+?>
+
+<Level
+ gametype = Deathmatch
+>
+ <templates>
+ <Template link=lodtemplate_default />
+ </templates>
+
+ <Scene
+ ambientlight = "0.5, 0.5, 0.5"
+ skybox = "Orxonox/Starbox"
+ negativeWorldRange = "-100000, -100000, -100000"
+ positiveWorldRange = " 100000, 100000, 100000"
+ gravity = "0,0,0"
+ hasPhysics = true
+ >
+
+ <?lua
+ include("includes/pickups.oxi")
+ ?>
+
+ <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0,1.0,1.0,0.5" specular="1.0, 0.9, 0.9, 1.0"/>
+ <SpawnPoint team=0 position="3200,0,0" lookat="2800,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+
+ <StaticEntity position = "2800,0,0" mass=10000 collisionType=static >
+ <attached>
+ <Model mesh="HydroHarvester.mesh" mass=10 position="0,0,0" scale=50 />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="-560,0,0" halfExtents="115,100,245" /><!-- Three lower boxes -->
+ <BoxCollisionShape position="290,0,-480" halfExtents="115,100,245" yaw=-120 />
+ <BoxCollisionShape position="290,0,480" halfExtents="115,100,245" yaw=-240 />
+ <BoxCollisionShape position="-280,0,0" halfExtents="163,50,50" /><!-- Three lower connections -->
+ <BoxCollisionShape position="140,0,-240" halfExtents="163,50,50" yaw=-120 />
+ <BoxCollisionShape position="140,0,240" halfExtents="163,50,50" yaw=-240 />
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" /><!-- Upper Tower -->
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-120 />
+ <BoxCollisionShape position="0,530,0" halfExtents="172,52,298" yaw=-240 />
+ <BoxCollisionShape position="0,400,0" halfExtents="43,110,26" yaw=-30 /><!-- Middle one-->
+ <BoxCollisionShape position="-200,100,0" halfExtents="26,50,43" /><!--Three lower legs -->
+ <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=-30 />
+ <BoxCollisionShape position="100,100,-173" halfExtents="43,50,26" yaw=30 />
+ <BoxCollisionShape position="-100,264,0" halfExtents="26,105,43" roll=-49 /><!--Three upper legs -->
+ <BoxCollisionShape position="50,264,-87" halfExtents="26,105,43" roll=-49 yaw=-120 />
+ <BoxCollisionShape position="50,264,87" halfExtents="26,105,43" roll=-49 yaw=-240 />
+ </collisionShapes>
+ </StaticEntity>
+
+<!-- Docking -->
+ <Dock position="2830,20,50" roll=0 yaw=0 >
+ <animations>
+ <MoveToDockingTarget target="destroyer" />
+ </animations>
+ <effects>
+ <DockToShip target="spaceShip" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockMe" />
+ </execute>
+
+ <undocking>
+ <EventListener event="undockMe" />
+ </undocking>
+
+ <activity>
+ <EventListener event=notGameEnd />
+ </activity>
+ </events>
+ <attached>
+ <!-- Trigger for docking with billboard -->
+
+ <!-- Trigger for undocking with billboard -->
+ <!-- <Billboard position="-2630,-19970,150" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 /> -->
+ <DistanceTrigger position="-2630,-19970,150" distance="50" target="Pawn"
+ beaconMode="identify" targetname="bcnDestroyer" name="undockMe"
+ />
+ </attached>
+ </Dock>
+
+ <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=100 />
+ <DistanceTrigger position="0,0,0" distance="200" target="Pawn"
+ beaconMode="exclude" targetname="bcnDestroyer" name="dockMe"
+ />
+
+
+
+ <ScriptController_00 position="0,0,0">
+ <events>
+ <party>
+ <EventListener event="dockMe" />
+ </party>
+
+ </events>
+
+ </ScriptController_00>
+
+
+<!-- FPS Player as destination of the dock -->
+<FpsPlayer template = "fps" radarname = "First Person Player" position = "0,-19900,0" >
+ <attached>
+ <DockingTarget name="spaceShip" />
+ <DistanceTriggerBeacon name="bcnDestroyer" />
+ <DockingTarget name="destroyer" />
+ </attached>
+</FpsPlayer>
+
+
+<!-- Cube as test SpaceStation
+
+The 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.
+Complex spacestations can be placed very far away from the spaceship so it is rendered at low resolution while the player uses the space ship.
+
+-->
+ <StaticEntity position="0,-20000,0" direction="0,-1,0" collisionType=static mass=100000 friction=0.01 >
+ <attached>
+ <Model position="0,0,0" mesh="crate.mesh" scale3D="80,80,5" />
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="0,0,0" halfExtents="400,400,25" />
+ </collisionShapes>
+ </StaticEntity>
+
+<!-- Homogenous gravitationfield to simulate local gravity (activating the normal gravity will affect the spaceship terribly) -->
+<ForceField position="0,-20000,0" mode="homogen" diameter="2000" forcedirection = "0,-500,0" />
+
+
+<!-- Some more stuff -->
+
+ <!-- triple large belt around the planet -->
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 7190, 7800, 250, 1)
+ ?>
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 10000, 11000, 300, 1)
+ ?>
+ <?lua
+ dofile("includes/asteroidField.lua")
+ asteroidBelt(15000, 0, 0, 30, 0, 30, 30, 50, 14000, 15000, 350, 1)
+ ?>
+
+ <Planet
+ position="15000,0,-1000"
+ scale="5000"
+ collisionType="dynamic"
+ linearDamping="0.8"
+ angularDamping="0"
+ mass="10000000"
+ pitch="0"
+ mesh="planets/ganymede.mesh"
+ atmosphere="atmosphere1"
+ rotationaxis="1,0,0"
+ rotationrate="1.0"
+ atmospheresize="80.0f"
+ imagesize="1024.0f"
+ collisiondamage = 2
+ enablecollisiondamage = true
+ >
+ <attached>
+ <ForceField position="5000,0,0" mode="sphere" diameter="10000" velocity="-50" />
+ </attached>
+ <collisionShapes>
+ <SphereCollisionShape radius="5000" position="0,0,0" />
+ </collisionShapes>
+ </Planet>
+
+ </Scene>
+
+</Level>
+
Added: code/branches/ScriptableController/src/modules/docking/Unsaved Document 1
===================================================================
--- code/branches/ScriptableController/src/modules/docking/Unsaved Document 1 (rev 0)
+++ code/branches/ScriptableController/src/modules/docking/Unsaved Document 1 2014-03-27 14:23:27 UTC (rev 10006)
@@ -0,0 +1,30 @@
+ <Dock position="2830,20,50" roll=0 yaw=0 >
+ <animations>
+ <MoveToDockingTarget target="destroyer" />
+ </animations>
+ <effects>
+ <DockToShip target="spaceShip" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockMe" />
+ </execute>
+
+ <undocking>
+ <EventListener event="undockMe" />
+ </undocking>
+
+ <activity>
+ <EventListener event=notGameEnd />
+ </activity>
+ </events>
+ <attached>
+ <!-- Trigger for docking with billboard -->
+
+ <!-- Trigger for undocking with billboard -->
+ <!-- <Billboard position="-2630,-19970,150" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 /> -->
+ <DistanceTrigger position="-2630,-19970,150" distance="50" target="Pawn"
+ beaconMode="identify" targetname="bcnDestroyer" name="undockMe"
+ />
+ </attached>
+ </Dock>
Modified: code/branches/ScriptableController/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/ScriptableController/src/orxonox/controllers/CMakeLists.txt 2014-03-27 13:10:12 UTC (rev 10005)
+++ code/branches/ScriptableController/src/orxonox/controllers/CMakeLists.txt 2014-03-27 14:23:27 UTC (rev 10006)
@@ -9,4 +9,5 @@
WaypointPatrolController.cc
DroneController.cc
FormationController.cc
+ ScriptController_00.cc
)
Added: code/branches/ScriptableController/src/orxonox/controllers/ScriptController_00.cc
===================================================================
--- code/branches/ScriptableController/src/orxonox/controllers/ScriptController_00.cc (rev 0)
+++ code/branches/ScriptableController/src/orxonox/controllers/ScriptController_00.cc 2014-03-27 14:23:27 UTC (rev 10006)
@@ -0,0 +1,59 @@
+/*
+ * 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:
+ * Fabian 'x3n' Landau
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "ScriptController_00.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+ RegisterClass(ScriptController_00);
+
+ ScriptController_00::ScriptController_00(Context* context) : ArtificialController(context)
+ {
+ RegisterObject(ScriptController_00);
+ orxout()<<"hello universe constructor"<< endl;
+ }
+
+ bool ScriptController_00::party(bool bTriggered, BaseObject* trigger)
+ {
+ orxout()<<"hello universe party"<< endl;
+ return true;
+ }
+
+
+ void ScriptController_00::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+ {
+ SUPER(ScriptController_00, XMLPort, xmlelement, mode);
+ XMLPortEventSink(ScriptController_00, BaseObject, "party", party, xmlelement, mode);
+ orxout()<<"hello universe xmlport"<< endl;
+ }
+
+
+
+
+}
Added: code/branches/ScriptableController/src/orxonox/controllers/ScriptController_00.h
===================================================================
--- code/branches/ScriptableController/src/orxonox/controllers/ScriptController_00.h (rev 0)
+++ code/branches/ScriptableController/src/orxonox/controllers/ScriptController_00.h 2014-03-27 14:23:27 UTC (rev 10006)
@@ -0,0 +1,55 @@
+/*
+ * 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:
+ * Fabian 'x3n' Landau
+ * Co-authors:
+ * ...
+ *
+ */
+
+#ifndef _ScriptController00_H__
+#define _ScriptController00_H__
+
+#include "OrxonoxPrereqs.h"
+#include "ArtificialController.h"
+#include "core/EventIncludes.h"
+
+
+namespace orxonox
+{
+ class _OrxonoxExport ScriptController_00 : public ArtificialController
+ {
+ public:
+ ScriptController_00(Context* context);
+ virtual ~ScriptController_00() { }
+
+ virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ bool party(bool bTriggered, BaseObject* trigger);
+
+
+ private:
+
+
+ };
+}
+
+#endif /* _ScriptController_H__ */
More information about the Orxonox-commit
mailing list