- Timestamp:
- Apr 10, 2014, 3:18:32 PM (11 years ago)
- Location:
- code/branches/ScriptableController
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ScriptableController/data/levels/levelTry.oxw
r10024 r10026 71 71 </StaticEntity> 72 72 73 <!-- Docking -->74 <Dock position="2830,20,50" roll=0 yaw=0 >75 <animations>76 <MoveToDockingTarget target="destroyer" />77 </animations>78 <effects>79 <DockToShip target="spaceShip" />80 </effects>81 <events>82 <execute>83 <EventListener event="dockMe" />84 </execute>85 86 <undocking>87 <EventListener event="undockMe" />88 </undocking>89 90 <activity>91 <EventListener event=notGameEnd />92 </activity>93 </events>94 <attached>95 <!-- Trigger for docking with billboard -->96 97 <!-- removed -->98 99 <!-- Trigger for undocking with billboard -->100 <!-- <Billboard position="-2630,-19970,150" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=1 /> -->101 <DistanceTrigger position="-2630,-19970,150" distance="50" target="Pawn"102 beaconMode="identify" targetname="bcnDestroyer" name="undockMe"103 />104 </attached>105 </Dock>106 73 107 74 <Billboard position="0,0,0" material="Flares/ringflare2" colour="0.2,0.4,0.8" scale=100 /> 108 75 <DistanceTrigger position="0,0,0" distance="200" target="Pawn" 109 beaconMode="exclude" targetname="bcnDestroyer" name=" dockMe"76 beaconMode="exclude" targetname="bcnDestroyer" name="takeControl" 110 77 /> 111 78 112 79 113 <!-- Object, which orxouts the message "hello Universe!". EVENT NOT WORKING-->80 <!-- ControllerDirector waits for the event takeControl to attach a new Controller --> 114 81 <ControllerDirector position="0,0,0"> 115 82 <events> 116 83 <party> 117 <EventListener event=" dockMe" />84 <EventListener event="takeControl" /> 118 85 </party> 119 86 -
code/branches/ScriptableController/src/orxonox/controllers/ControllerDirector.cc
r10024 r10026 11 11 #include "interfaces/PlayerTrigger.h" 12 12 #include "worldentities/pawns/Pawn.h" 13 #include "LuaState.h" 14 13 15 14 16 namespace orxonox … … 27 29 } 28 30 29 bool ControllerDirector::party(bool bTriggered, BaseObject* trigger)30 {31 //XMLPortEventSink seems not to execute the party function32 orxout()<<"hello universe party"<< endl;33 return true;34 }35 36 31 37 32 void ControllerDirector::XMLPort(Element& xmlelement, XMLPort::Mode mode) … … 40 35 41 36 42 orxout()<<" hello universe xmlport"<< endl;37 orxout()<<"ControllerDriector::XMLPort An instance of ControllerDirector has been created."<< endl; 43 38 } 44 39 … … 47 42 SUPER(ControllerDirector, XMLEventPort, xmlelement, mode); 48 43 49 XMLPortEventSink(ControllerDirector, BaseObject, " party", party, xmlelement, mode);44 XMLPortEventSink(ControllerDirector, BaseObject, "takeControl", takeControl, xmlelement, mode); 50 45 51 46 } … … 53 48 54 49 55 /* void ControllerDirector::tick(float dt)56 {57 58 //Get controllable entity which is attached to this controller in the XML file.59 ControllableEntity* entity = this->getControllableEntity();60 if (!entity)61 orxout()<<"No controllable entity found"<<endl;62 return;63 64 65 66 SUPER(ControllerDirector, tick, dt);67 }68 69 */70 50 71 51 void ControllerDirector::takeControl(Controller * controller, BaseObject * trigger) { … … 73 53 preparationToTakeControl(trigger); 74 54 setNewController(controller); 75 55 LuaState test = new Luastate(); 56 test.doFile("/tmp/myluahelloworld.lua"); 57 76 58 } 77 59 … … 113 95 this->setControllableEntity(this->entity_); 114 96 97 98 115 99 } 116 100 … … 119 103 } 120 104 121 /* Detaillierte Planung122 Director nimmt event auf und hängt dann einen controller (momentan als erstellt zu betrachten) an objekt, welches event ausgelöst hat.123 105 124 106 125 107 126 Klassenvariablen127 128 ...? brauchts überhaupt?129 130 Variablen (in Funktionen auftretend):131 132 Playerinfo * player enthält infos über objekt, welches event ausgelöst hat.Relevant für Inputseite des Directors133 134 Funktion:135 136 Auf Seite des Inputs des Directors:137 138 preparationForControlTakeOver(...) Vorbereitende Massnahmen um neuen Controller anzuhängen, z.B. player = pTrigger->getTriggeringPlayer();139 Orientierung an execute Funktion von Dock.cc140 141 Auf Outputseite des Directors:142 143 takeControl(...) Orientierung an DockingController.cc144 145 tick() Soll von Event ausgelöst werden, wenn z.B. Kamera an Endposition angelangt ist. Danach soll wieder ein146 menschlicher Spieler die Kontrolle übernehmen (wie? new human controller? Klasse noch angucken!).147 */148 149 150
Note: See TracChangeset
for help on using the changeset viewer.