Child Node

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
NightCrawler
Posts: 20
Joined: Thu Nov 05, 2009 11:36 am

Child Node

Post by NightCrawler »

Hi,
on a 3rd person game, how to make the main character child of a car, and than get the car control (pressing the use key). Like we see in vice city :D .
plz help
thnks
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: Child Node

Post by randomMesh »

Do you really expect people will code that for you?

Code: Select all

player->useItem(car);
is very complex. ;)

The Irrlicht part is

Code: Select all

ISceneNode::addChild(ISceneNode *child)
or

Code: Select all

ISceneNode::setParent(ISceneNode *newParent)
"Whoops..."
NightCrawler
Posts: 20
Joined: Thu Nov 05, 2009 11:36 am

Post by NightCrawler »

Well m hope so :lol: , i understood the Irrlicht par, but what is;
Player->useItem(car);
can u show me a little more lines :D .
thnks
Jookia
Posts: 170
Joined: Wed Nov 19, 2008 1:11 am

Post by Jookia »

This is game logic that you need to code.
NightCrawler
Posts: 20
Joined: Thu Nov 05, 2009 11:36 am

Post by NightCrawler »

can someone tell me a little more about useItem function. m a little bit confused :roll:
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post by randomMesh »

NightCrawler wrote:can someone tell me a little more about useItem function. m a little bit confused :roll:
There is no such a method in Irrlicht. You have to make one on your own.
How this methods is supposed to look, heavily depends on your requirements.
"Whoops..."
NightCrawler
Posts: 20
Joined: Thu Nov 05, 2009 11:36 am

Post by NightCrawler »

But I already told u my requirement :o . i just want my node to make child of a car when pressing use key, thats it. and the control of camera will change from a human character to car. :roll:
I Hate Those, Who Like To Sleep.
squisher
Competition winner
Posts: 91
Joined: Sat May 17, 2008 2:23 am
Contact:

Post by squisher »

you have some code for a camera right? it should depend on a target ISceneNode, which is initially your player. So when the player "uses" the car, you change the camera's target to the car. And in your event handler, you figure out whether the player's in a car, and move the appropriate node, either the car or the player.

If that plus the other replies aren't enough to help you, you probably need to get your hands dirty and write some code, then come back here when you have a more specific, technical question. We won't write your game for you.
NightCrawler
Posts: 20
Joined: Thu Nov 05, 2009 11:36 am

Post by NightCrawler »

Srry, I already solved that problem before posting the above reply. my head just got meshed up, i was almost forgot that this problem was solved :P . i m designing a building for my game (1st level) and u know how dirty it is to design a building with interior decoration in a 3d modeler.
srry again :lol: .
I Hate Those, Who Like To Sleep.
Post Reply