Rocket-Ticket Questionthread (... haha)
Moderator: PPS-Leaders
Rocket-Ticket Questionthread (... haha)
didn't know how to name the thread because right now I have one specific problem after which the other questions might disappear.
Right now the Rocket (named SimpleRocket) is in the folder: modules\weapons\projectiles\
the RocketController "sits" in: \orxonox\controllers
while the weapon mode is in: \modules\weapons\weaponmodes\
In the RocketController-file I cannot include "weapons/projectiles/SimpleRocket.cc" but I need to do this because I make a new pointer to my rocket (similar to the DroneController) to control it.
In the case of the droneController this works, because the drone is in: /orxonox/worldentities
How can I include this file? is it not possible?
I hope you get what i mean ... for me it's quite confusing ...
Right now the Rocket (named SimpleRocket) is in the folder: modules\weapons\projectiles\
the RocketController "sits" in: \orxonox\controllers
while the weapon mode is in: \modules\weapons\weaponmodes\
In the RocketController-file I cannot include "weapons/projectiles/SimpleRocket.cc" but I need to do this because I make a new pointer to my rocket (similar to the DroneController) to control it.
In the case of the droneController this works, because the drone is in: /orxonox/worldentities
How can I include this file? is it not possible?
I hope you get what i mean ... for me it's quite confusing ...
Re: Rocket-Ticket Questionthread (... haha)
do you need RocketController in src/orxonox or is it only needed in modules/weapons? because if the controller is only used by the weapon, i suggest to move the controller to modules/weapons.
however if you have to access the controller from within src/orxonox, we probably need an interface (i can't tell you right now how this interface would look like, because i don't know the actual problem, but interfaces are a common way to solve dependency problems).
however if you have to access the controller from within src/orxonox, we probably need an interface (i can't tell you right now how this interface would look like, because i don't know the actual problem, but interfaces are a common way to solve dependency problems).
Fabian 'x3n' Landau, Orxonox developer
Re: Rocket-Ticket Questionthread (... haha)
ah. I think i only need it in modules/weapons ... I'll try that and put the controller there too. I'll post again after testing.
thanks for the suggestions
thanks for the suggestions

Re: Rocket-Ticket Questionthread (... haha)
ok ... now I was able to include all needed files but when compiling (after adjusting all includes and adding a function) there were ... strange errors.
it tells me I redefined tick as well as the initializerfunction. Once in the headerfile and once in the source file. This is wrong.
Somewhere something went wrong (inconsistent dll linkage) but I don't know what.
Thanks for helping
Code: Select all
18>..\..\..\..\src\modules\weapons\RocketController.cc(58) : warning C4273: 'orxonox::RocketController::tick' : inconsistent dll linkage
18> m:\orxonox\orxonox_vs\trunk\src\modules\weapons\RocketController.h(53) : see previous definition of 'tick'
Somewhere something went wrong (inconsistent dll linkage) but I don't know what.
Thanks for helping

Re: Rocket-Ticket Questionthread (... haha)
i'm not 100% sure, but i guess you have to change this:
Code: Select all
RocketController.h:32
-#include "OrxonoxPrereqs.h"
+#include "weapons/WeaponsPrereqs.h"
Code: Select all
RocketController.h:46
- class _OrxonoxExport RocketController : public Controller, public Tickable
+ class _WeaponsExport RocketController : public Controller, public Tickable
Fabian 'x3n' Landau, Orxonox developer
Re: Rocket-Ticket Questionthread (... haha)
oh thanks now it compiles 
okay now i struggle again with the problem that I'm not able to "spawn" a model of a rocket.
i get the following error:
Unhandled exception at 0x5ae8a4b4 (libweapons.dll) in orxonox.exe: 0xC0000005: Access violation reading location 0x00000000.
which originates in my RocketControllers call to one of the control-functions of the (I reckon not really existing) rocket.
I uploaded the newest files into the rocket branch.
What I'm trying to do right now is get a model of the rocket to spawn in "empty space" when trying to shoot a "SimpleRocket" (same button as rocket, T)

okay now i struggle again with the problem that I'm not able to "spawn" a model of a rocket.
i get the following error:
Unhandled exception at 0x5ae8a4b4 (libweapons.dll) in orxonox.exe: 0xC0000005: Access violation reading location 0x00000000.
which originates in my RocketControllers call to one of the control-functions of the (I reckon not really existing) rocket.
I uploaded the newest files into the rocket branch.
What I'm trying to do right now is get a model of the rocket to spawn in "empty space" when trying to shoot a "SimpleRocket" (same button as rocket, T)
Re: Rocket-Ticket Questionthread (... haha)
do you tell the RocketController which ControllableEntity it has to controll?
you probably have to call this->getController()->setControllableEntity(this); in SimpleRocket.cc after you created a controller.
you probably have to call this->getController()->setControllableEntity(this); in SimpleRocket.cc after you created a controller.
Code: Select all
61 RocketController* myRController = new RocketController(this);
62 this->setController(myRController);
+ this->getController()->setControllableEntity(this);
or
+ myRController->setControllableEntity(this);
Fabian 'x3n' Landau, Orxonox developer
Re: Rocket-Ticket Questionthread (... haha)
this tells me no access
leads to
and this
leads to this
... i could add Simplerocket as a friendclass to the Controller ... but somehow that seems extremely ... "hack-ish" as well as unnecessary
Code: Select all
+ this->getController()->setControllableEntity(this);
Code: Select all
1>SimpleRocket.cc
1>..\..\..\..\src\modules\weapons\projectiles\SimpleRocket.cc(65) : error C2248: 'orxonox::Controller::setControllableEntity' : cannot access protected member declared in class 'orxonox::Controller'
1> M:\Orxonox\orxonox_VS\trunk\src\orxonox\controllers/Controller.h(63) : see declaration of 'orxonox::Controller::setControllableEntity'
1> M:\Orxonox\orxonox_VS\trunk\src\orxonox\controllers/Controller.h(37) : see declaration of 'orxonox::Controller'
and this
Code: Select all
myRController->setControllableEntity(this);
Code: Select all
1>SimpleRocket.cc
1>..\..\..\..\src\modules\weapons\projectiles\SimpleRocket.cc(66) : error C2065: 'myController' : undeclared identifier
1>..\..\..\..\src\modules\weapons\projectiles\SimpleRocket.cc(66) : error C2227: left of '->setControllableEntity' must point to class/struct/union/generic type
Re: Rocket-Ticket Questionthread (... haha)
ah yeah you're right. i'm a little unsure how this was intended to be handled (even though it was coded by me, but quite some time ago).
one option is, instead of creating a new SimpleRocket (and then create a controller within the constructor of SimpleRocket), create a new RocketController and then create a rocket in it's constructor. that way "setControllableEntity" would be called in the context of the controller and thus works with the "protected" keyword.
one option is, instead of creating a new SimpleRocket (and then create a controller within the constructor of SimpleRocket), create a new RocketController and then create a rocket in it's constructor. that way "setControllableEntity" would be called in the context of the controller and thus works with the "protected" keyword.
Fabian 'x3n' Landau, Orxonox developer
Re: Rocket-Ticket Questionthread (... haha)
ah yes doing it in this file resolves the access problems.
It now compiles without errors, but when invoking the "Rocketfire" (which creates a new rocketcontroller) nothing happens ingame.
It now compiles without errors, but when invoking the "Rocketfire" (which creates a new rocketcontroller) nothing happens ingame.
Re: Rocket-Ticket Questionthread (... haha)
i'm not sure, but i think the way you programmed it, rocketfire should create a new rocket and the rocket itself should create it's own controller, or am i wrong?
There are only 10 types of people in the world: Those who understand binary, and those who don't.
Re: Rocket-Ticket Questionthread (... haha)
no i changed that. the rocket does nothing but initialize some default values.
the rocketfire should create a controller and the controller should create the rocket...
the rocketfire should create a controller and the controller should create the rocket...
Re: Rocket-Ticket Questionthread (... haha)
then i would rather create rocket and controller both in rocketfire and tell them about the other.
like that you can easily select different controllers depending on the firemode or whatever and they don't need to create the rocket themself
edit: seems like that's not possible at the moment ^^
like that you can easily select different controllers depending on the firemode or whatever and they don't need to create the rocket themself
edit: seems like that's not possible at the moment ^^
There are only 10 types of people in the world: Those who understand binary, and those who don't.
Re: Rocket-Ticket Questionthread (... haha)
i guess it spawns, but you don't see it, because it spawns in the middle of the level. you have to set position and orientation according to your weapon.tyderion wrote:ah yes doing it in this file resolves the access problems.
It now compiles without errors, but when invoking the "Rocketfire" (which creates a new rocketcontroller) nothing happens ingame.
you already have this code in SimpleRocketFire.cc:
Code: Select all
68 rocket->setOrientation(this->getMuzzleOrientation());
69 rocket->setPosition(this->getMuzzlePosition());
Fabian 'x3n' Landau, Orxonox developer
Re: Rocket-Ticket Questionthread (... haha)
i changed that but still no rocked is visible.
I just tried to go back to the main menu for the first time after trying the "rocket" and orxonox crashes while trying to destroy the RocketController.
I attached a screenshot of the commandline output.
I just tried to go back to the main menu for the first time after trying the "rocket" and orxonox crashes while trying to destroy the RocketController.
I attached a screenshot of the commandline output.
- Attachments
-
- orxonox_fail_001.JPG (55.02 KiB) Viewed 24203 times
Who is online
Users browsing this forum: No registered users and 3 guests