Hi,
I am new to Irrlicht and i hope y'all can help me out. my animation character moves and do the walk animation if you press the (up, down, side) keys. but i want to do it so that it follows certain path. like if you press 1, it should turn, walk 10 steps or something like that. the char should move its position as well as do the walk animation.
any ideas?
thanks!!!
walk animation and move
Take a look at the Movement tutorial in the examples folder
this should give you a good starting point.
this should give you a good starting point.
If you're not making GREAT games
you belong in an institute!
The Game Institute.
www.gameinstitute.com
you belong in an institute!
The Game Institute.
www.gameinstitute.com
If your looking for something like that, as in I'm not mentioning the actual way to do with rendering in Irrlicht, but its in fact called pattern behaviour, give the character an array of patterns which it can do associate them with the character. Then run the patterns, this can be done by compiling a simple set of instructions from enums, then switch each enum in an array and that should give you a set behaviour, or rather a pattern, primitive but it works. As for the rendering the movement tutorial gives you a good start, then theres loads of posts on the board about making a character move to a certain position, rotating it etc....
Now wheres that mod!!! [Done] or [Solved] or [Surprise me]
Now wheres that mod!!! [Done] or [Solved] or [Surprise me]
thanks for the replies.
i did look at the movement tutorial. the thing is my char does the walking animation by detecting if the user is pressing the key. if no key press, it stands still. but i want to do in certain way so that the char does the walking animation without the key press. i hope what i am trying to ask is clear. below is my current code.
//walk
if( event.KeyInput.PressedDown)
{
bob->frameLowerBound = 0;
bob->frameUpperBound = 60;
setNodeAnimation(bob->frameLowerBound, bob->frameUpperBound, 30);
}
//stand
if( !event.KeyInput.PressedDown )
{
bob->frameLowerBound = 0;
bob->frameUpperBound = 0;
setNodeAnimation(bob->frameLowerBound, bob->frameUpperBound, 30);
}
thank you!
really appreciate it.
i did look at the movement tutorial. the thing is my char does the walking animation by detecting if the user is pressing the key. if no key press, it stands still. but i want to do in certain way so that the char does the walking animation without the key press. i hope what i am trying to ask is clear. below is my current code.
//walk
if( event.KeyInput.PressedDown)
{
bob->frameLowerBound = 0;
bob->frameUpperBound = 60;
setNodeAnimation(bob->frameLowerBound, bob->frameUpperBound, 30);
}
//stand
if( !event.KeyInput.PressedDown )
{
bob->frameLowerBound = 0;
bob->frameUpperBound = 0;
setNodeAnimation(bob->frameLowerBound, bob->frameUpperBound, 30);
}
thank you!
really appreciate it.
Hello;
Maybe some ideas for you. You have system time,timers,or
other events occuring in your game or application. Example:
Player 1 is les than X distance from BOT 5, "trigger" mechanism
starts BOT5 sequence of animations from list of animations,or
even random selection of animations from list. Other occuring
events such as time or distance or other BOT or Player actions
can all be used as "trigger" mechanisms to do what you
desire to do. You are only limited by your imagination and the
events occuring in your game or application. The Internet is a very
good source for behavior and event related actions in games and
applications. Try making a list with 2 columns, one column is the
tasks that you want your characters to do, the other column is the
"trigger events" that you could use to accomplish this.
It is also recommended that you do some research into
game character behaviors and control to give you more ideas as
to what you can and cannot do. Sites like Gammasutra,GameDev,3D Buzz,
Unreal Developer Network, Source Forge, AI Depot, all have information
that can help you learn and develop ideas that help you attain
your goals. Even if a site is specific to a particular game, you can
usually take the knowledge gained and apply it to your own situation.
edit:
http://ocw.mit.edu/OcwWeb/Electrical-En ... /index.htm
check these courses for some very good info.
6.034
6.035
6.046J
6.825
These are free to the public and contain a wealth of information
and knowledge.
Maybe some ideas for you. You have system time,timers,or
other events occuring in your game or application. Example:
Player 1 is les than X distance from BOT 5, "trigger" mechanism
starts BOT5 sequence of animations from list of animations,or
even random selection of animations from list. Other occuring
events such as time or distance or other BOT or Player actions
can all be used as "trigger" mechanisms to do what you
desire to do. You are only limited by your imagination and the
events occuring in your game or application. The Internet is a very
good source for behavior and event related actions in games and
applications. Try making a list with 2 columns, one column is the
tasks that you want your characters to do, the other column is the
"trigger events" that you could use to accomplish this.
It is also recommended that you do some research into
game character behaviors and control to give you more ideas as
to what you can and cannot do. Sites like Gammasutra,GameDev,3D Buzz,
Unreal Developer Network, Source Forge, AI Depot, all have information
that can help you learn and develop ideas that help you attain
your goals. Even if a site is specific to a particular game, you can
usually take the knowledge gained and apply it to your own situation.
edit:
http://ocw.mit.edu/OcwWeb/Electrical-En ... /index.htm
check these courses for some very good info.
6.034
6.035
6.046J
6.825
These are free to the public and contain a wealth of information
and knowledge.
If you're not making GREAT games
you belong in an institute!
The Game Institute.
www.gameinstitute.com
you belong in an institute!
The Game Institute.
www.gameinstitute.com
Thanks for reply.
I tried as you said to trigger events. Here is what i tried
the walking animation frames are from 0 to 60.
so i did in a way like
while ( x is not 160)
then
set frame loop(0,60) // walk
end while
set frameloop(0,0) // stop
but it does not work. it will not walk and instead just do the second animation!
i tired with time. I tried to do the walk animation and then wait 5 seconds and then maybe do another animation like picking up. It will wait for 5 second and then do the pick up animation.
i dont know how to proceed. it will be great if you can give me some advice.
thank you!
I tried as you said to trigger events. Here is what i tried
the walking animation frames are from 0 to 60.
so i did in a way like
while ( x is not 160)
then
set frame loop(0,60) // walk
end while
set frameloop(0,0) // stop
but it does not work. it will not walk and instead just do the second animation!
i tired with time. I tried to do the walk animation and then wait 5 seconds and then maybe do another animation like picking up. It will wait for 5 second and then do the pick up animation.
i dont know how to proceed. it will be great if you can give me some advice.
thank you!
Hello;
What type of Animator are you using?
In the movement example you see that a createFlyStraightAnimator
is being used. There is also a createFollowSplineAnimator that can be
used. From the vague description you have given about your attempts
it seems to be that you have not provided a path for the object to
follow. A more concise description as to what you are doing and what
you are hoping to accomplish would be in your interest. Ie...
Object 1 moves 10 units along the X axis
Turns positive 90 degrees
moves 47 units along the Z axis
Pauses for 15 seconds
rotates by 180 degrees around the Y axis
moves 32 units along the Z axis
Stops
Perform reverse loop
Just an example of describing what you are hoping to accomplish.
Better description can yield better response from the community, and
help you reach your goal faster, and frustration is reduced for you and
anyone trying to guess what you are about. For example in your last post
you mention "while ( x is not 160)". What is x? What is 160?
It is very difficult to guess at these things, and it promotes excessive
posts that do not yield a good answer for you and can add to any
frustration you may have. It would be like going to the doctor and telling
them " I hurt". " What should I do?" The doctor will begin to ask you
a series of long drawn out questions, in an attempt to isolate the problem
to area, cause, and specifics of your malady. Only after they have a
good description of all the items of concern, will they be able to start
to provide a remedy.
What type of Animator are you using?
In the movement example you see that a createFlyStraightAnimator
is being used. There is also a createFollowSplineAnimator that can be
used. From the vague description you have given about your attempts
it seems to be that you have not provided a path for the object to
follow. A more concise description as to what you are doing and what
you are hoping to accomplish would be in your interest. Ie...
Object 1 moves 10 units along the X axis
Turns positive 90 degrees
moves 47 units along the Z axis
Pauses for 15 seconds
rotates by 180 degrees around the Y axis
moves 32 units along the Z axis
Stops
Perform reverse loop
Just an example of describing what you are hoping to accomplish.
Better description can yield better response from the community, and
help you reach your goal faster, and frustration is reduced for you and
anyone trying to guess what you are about. For example in your last post
you mention "while ( x is not 160)". What is x? What is 160?
It is very difficult to guess at these things, and it promotes excessive
posts that do not yield a good answer for you and can add to any
frustration you may have. It would be like going to the doctor and telling
them " I hurt". " What should I do?" The doctor will begin to ask you
a series of long drawn out questions, in an attempt to isolate the problem
to area, cause, and specifics of your malady. Only after they have a
good description of all the items of concern, will they be able to start
to provide a remedy.
If you're not making GREAT games
you belong in an institute!
The Game Institute.
www.gameinstitute.com
you belong in an institute!
The Game Institute.
www.gameinstitute.com
Sorry If i am not clear with what I try to describe. It has been furstrating.
Let me see if i can try to explain.
Basically, I have frames from 0 to 60 which does a character walk.
right now it walks if there is a key press but if there is not key press, it wouldnt walk because I would set the frameloop from 0 to 0. Like this...
if( event.KeyInput.PressedDown) {
headNode->setFrameLoop(0, 60);
}
else
headNode->setFrameLoop(0, 0);
How would it do it so that, for example, for 5 second, it will do the walk frame loop and then do the stop frame loop, WITHOUT the key press?
I have tired with createFlyStraightAnimator and createFollowSplineAnimator. Its not the moving the position or rotating that is throwing me off. I am having problems with running the right animation. Hope this is clear and you can help.
thank you so much!
Let me see if i can try to explain.
Basically, I have frames from 0 to 60 which does a character walk.
right now it walks if there is a key press but if there is not key press, it wouldnt walk because I would set the frameloop from 0 to 0. Like this...
if( event.KeyInput.PressedDown) {
headNode->setFrameLoop(0, 60);
}
else
headNode->setFrameLoop(0, 0);
How would it do it so that, for example, for 5 second, it will do the walk frame loop and then do the stop frame loop, WITHOUT the key press?
I have tired with createFlyStraightAnimator and createFollowSplineAnimator. Its not the moving the position or rotating that is throwing me off. I am having problems with running the right animation. Hope this is clear and you can help.
thank you so much!
Hello;
You can try something like this:
float TimeLimit = 5000.0f;
float time = device->getTimer()->getTime();
headNode->setFrameLoop(0, 60);
// place in loop just before call to drawAll()
if( device->getTimer()->getTime() - time >= TimeLimit)
{
headNode->setFrameLoop(0,0);
}
You can try something like this:
float TimeLimit = 5000.0f;
float time = device->getTimer()->getTime();
headNode->setFrameLoop(0, 60);
// place in loop just before call to drawAll()
if( device->getTimer()->getTime() - time >= TimeLimit)
{
headNode->setFrameLoop(0,0);
}
If you're not making GREAT games
you belong in an institute!
The Game Institute.
www.gameinstitute.com
you belong in an institute!
The Game Institute.
www.gameinstitute.com