Rocket-Ticket Questionthread (... haha)

Introduce your project and write about your work.

Moderator: PPS-Leaders

tyderion
Noxonian Brolghormeg
Posts: 36
Joined: Tue Mar 02, 2010 5:26 pm

Re: Rocket-Ticket Questionthread (... haha)

Post by tyderion » Fri May 14, 2010 10:01 am

sorry for not being there on monday, I didn't feel well.
Will be there next monday. Again sorry.

tyderion
Noxonian Brolghormeg
Posts: 36
Joined: Tue Mar 02, 2010 5:26 pm

Re: Rocket-Ticket Questionthread (... haha)

Post by tyderion » Fri May 14, 2010 10:41 am

Ok the rocket now explodes when colliding with an asteroid (or with a drone too) but it does not despawn afterwords. And the Controller doesn't control the rocket, I don't seem to get why.
Does the rocket need a specific tick-function to be able to do what the controller "tells it" to do?
at the moment the tickfunction does

Code: Select all

SUPER(SimpleRocket, tick, dt);
I'm a bit stumped because I thought it once controlled the Rocket but I may be mistaken.
I committed my current files.

User avatar
greenman
Baron Vladimir Harkonnen
Posts: 360
Joined: Wed Oct 03, 2007 2:53 pm
Contact:

Re: Rocket-Ticket Questionthread (... haha)

Post by greenman » Fri May 14, 2010 6:57 pm

what do you mean with despawn?

if you look at the original rocket, you see why you rocket doesn't move: you need to apply you steering commands in the tick
There are only 10 types of people in the world: Those who understand binary, and those who don't.

tyderion
Noxonian Brolghormeg
Posts: 36
Joined: Tue Mar 02, 2010 5:26 pm

Re: Rocket-Ticket Questionthread (... haha)

Post by tyderion » Fri May 14, 2010 9:35 pm

i want to apply the steering commands withing the controller, not the rocket.

with despawn i mean: disappear, so that the rockets aren't visible anymore :)

User avatar
greenman
Baron Vladimir Harkonnen
Posts: 360
Joined: Wed Oct 03, 2007 2:53 pm
Contact:

Re: Rocket-Ticket Questionthread (... haha)

Post by greenman » Sat May 15, 2010 8:04 am

still you need to manifest the steering commands that you receive from the rocketcontroller and tell bullet in the tick that it needs to do something. remember: this->localAngularVelocity_ (i.e.) is just a member variable that does nothing if you don't use it in the tick. also you need to do the same for the linearVelocity.

about the "despawning" aka destroying: you need to check bDestroy_ in the tick and if it's true then execute this->destroy()
There are only 10 types of people in the world: Those who understand binary, and those who don't.

tyderion
Noxonian Brolghormeg
Posts: 36
Joined: Tue Mar 02, 2010 5:26 pm

Re: Rocket-Ticket Questionthread (... haha)

Post by tyderion » Sat May 15, 2010 9:36 am

Aah ... it seems that at one time (I don't know when) I accidentally deleted the content of the tickfunction. *facepalm*
Well now that works, it spawns, gets controlled, uses those commands and get's destroyed.

tyderion
Noxonian Brolghormeg
Posts: 36
Joined: Tue Mar 02, 2010 5:26 pm

Re: Rocket-Ticket Questionthread (... haha)

Post by tyderion » Sat May 15, 2010 10:01 am

Okay now I'm trying to give the rocketcontroller a target (from within the NewHumanController to use the rayquery which needs the camera of the controller). But how can I access the Functions of the newHumanController from within the rocketcontroller (or other way round, it wouldn't matter) ?
any Idea?

User avatar
greenman
Baron Vladimir Harkonnen
Posts: 360
Joined: Wed Oct 03, 2007 2:53 pm
Contact:

Re: Rocket-Ticket Questionthread (... haha)

Post by greenman » Sat May 15, 2010 10:27 am

rockercontroller->setTarget(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getTarget())

but you need to implement SimpleRocketController::setTarget first

edit: i will shortly move this thread to the developper's journals because imo that's the forum it should be in ;)
There are only 10 types of people in the world: Those who understand binary, and those who don't.

tyderion
Noxonian Brolghormeg
Posts: 36
Joined: Tue Mar 02, 2010 5:26 pm

Re: Rocket-Ticket Questionthread (... haha)

Post by tyderion » Sat May 15, 2010 12:19 pm

ok I'll try it like this.
I also have to implement setTarget() or "setRocketTarget()" or something like this within the NewHumanController don't I ?
What is this target that I get with this "getTarget()" function you proposed?

and I'd say yes, this thread should be in the developper's journals...

User avatar
greenman
Baron Vladimir Harkonnen
Posts: 360
Joined: Wed Oct 03, 2007 2:53 pm
Contact:

Re: Rocket-Ticket Questionthread (... haha)

Post by greenman » Sat May 15, 2010 12:51 pm

no you don't have to. all this is done in NHC::updateTarget.

you probably get a controlleableentity or a pawn pointer with getTarget. you should have a look at ControllableEntity::getTarget. it's the target the player is aiming at (if he is aiming at something)
There are only 10 types of people in the world: Those who understand binary, and those who don't.

tyderion
Noxonian Brolghormeg
Posts: 36
Joined: Tue Mar 02, 2010 5:26 pm

Re: Rocket-Ticket Questionthread (... haha)

Post by tyderion » Sat May 15, 2010 12:57 pm

Ok I will look at that.
Right Now I'm trying to do a "setTarget(Pawn* target)" function (similar to the "setOwner(Pawn* owner)" function of the rocket).
I have a WeakPtr<Pawn> target_ in the rocketcontroller and I try to assign the Pawn*target to this pointer:

Code: Select all

this->target_=target
(in setOwner it is done like this) but I get the following compile error(s):

Code: Select all

error C2440: 'initializing' : cannot convert from 'orxonox::Pawn *' to 'orxonox::OrxonoxClass *'
18>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
The only difference in the assignment is the name of the variables.

User avatar
greenman
Baron Vladimir Harkonnen
Posts: 360
Joined: Wed Oct 03, 2007 2:53 pm
Contact:

Re: Rocket-Ticket Questionthread (... haha)

Post by greenman » Sat May 15, 2010 1:24 pm

the problem was a missing include (you need to include Pawn.h if you use it)
committed the change
There are only 10 types of people in the world: Those who understand binary, and those who don't.

tyderion
Noxonian Brolghormeg
Posts: 36
Joined: Tue Mar 02, 2010 5:26 pm

Re: Rocket-Ticket Questionthread (... haha)

Post by tyderion » Sat May 15, 2010 4:13 pm

Ok thanks a lot now it get's a target (even though now it is a WorldEntity*, doesn't matter) and tries to move to the position of the target (or the projected position).
This doesn't work as of now (I used the AI-moveToPosition-funciton) but the rocket just moves in circles :)

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Re: Rocket-Ticket Questionthread (... haha)

Post by x3n » Tue May 18, 2010 10:00 am

Code: Select all

this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->getVelocity().length() );
looks like your rocket uses the current velocity to adjust the speed - but if it just spawned, getVelocity probably returns 0,0,0, so the rocket won't move. you probably need something like this:

Code: Select all

this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->speed_ );
Fabian 'x3n' Landau, Orxonox developer

User avatar
greenman
Baron Vladimir Harkonnen
Posts: 360
Joined: Wed Oct 03, 2007 2:53 pm
Contact:

Re: Rocket-Ticket Questionthread (... haha)

Post by greenman » Thu May 20, 2010 6:39 pm

what is the current state of development?
this monday there's no pps, and because the presentation is just 2 weeks away you should speed up and maybe look for other (faster) ways to communicate with us if you have problems. i would esp. suggest our irc channel (reachable either over http://irc.orxonox.net or with an irc client irc.orxonox.net #orxonox )
There are only 10 types of people in the world: Those who understand binary, and those who don't.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests