About Store Forum Documentation Contact



Post Reply 
Character skills and position marker
Author Message
Kiekos Offline
Member

Post: #1
Character skills and position marker
Hey there!

We're moving on with our project and some stuff on our ToDo list are not completely clear. I guess these two things are connected so I'll post them together.

1) How to achieve something like what's in this video: http://www.youtube.com/watch?v=qMPQbdp0NcE
I mean the little dragon (or whatever it is) that shows the spot your character is heading to on the map when you click on it. It looks like an animated model but it's not really a model... I don't know, I have no clue where to start.

2) Creating character skills. Let's say I want to have a skill in which my character swings his sword violently and smashed into ground. I will of course make the animation for it but there also needs to be the visual effect of the skill. Some kind of smudged light behind the swinging sword. How to proceed in this case? Are there any particular tools in order to create such thing?

I checked the forums for similiar threads but still didn't get the answer I wanted. Any help would be much appreciated.

Thanks!
Kiekos
(This post was last modified: 06-10-2013 08:12 PM by Kiekos.)
06-05-2013 08:01 PM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #2
RE: Character skills and one question
Anyone?
06-07-2013 10:08 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #3
RE: Character skills and one question
1) For a ground marker, check out the GetWorldObjectUnderCursor() function from the Main file of the Game Basics\21 - Inventory tutorial. Check against the terrain instead of an item, then drop a marker there.

2) You can check out Rendering\15 - Swing Trail Effect for this one. This is a very simple example, but it can easily be modified to look cool. Or you could create another object with animation that is the special effect and play it at the same time. Or you could use another technique-it's all very subjective and there are a lot of ways to go about it.

I'd recommend just programming what you can do. You won't run out of things to program, that's for sure. As you gain experience programming a game, you will find these to be rather simple tasks.
06-07-2013 10:39 PM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #4
RE: Character skills and one question
Thanks for the tips Rubeus. I followed the animating tutorial and managed to do the marker, however... I have no idea how to change its position from 0,0 (center of the world) to any other I want (desired is the clicked point on the map).

I was going through the header files of the structures' definitions and I couldn't find anything to change CSkeleton's position. Not even talking about checking against the terrain...
(This post was last modified: 06-10-2013 08:02 PM by Kiekos.)
06-10-2013 08:01 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #5
RE: Character skills and position marker
Draw it using the objects matrix instead of the identity matrix.
06-11-2013 01:51 AM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #6
RE: Character skills and position marker
Which is...? I've tried using .matrix().setPos( Vec pos ) but no result... As for now, it looks like this:

Code:
CSkeleton mark_skel;

mark_skel.create(Skeletons("obj/marker/marker.skel"), 0.5f);

mark_skel.clear();
mark_skel.animate(L"obj/marker/marker.anim", Time.time()*2);
mark_skel.updateMatrix    (MatrixIdentity);
mark_skel.updateVelocities(              );

Meshes("obj/marker/marker.mesh") -> draw(mark_skel);
06-11-2013 06:42 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #7
RE: Character skills and position marker
I'm not sure what the best practice is here--I haven't gotten to animated meshes yet. My assumption would be that instead of updating the matrix with MatrixIdentity, you have a custom matrix that you update with the Orn and Pos of your marker.

Can someone confirm this?
06-11-2013 07:01 PM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #8
RE: Character skills and position marker
Custom matrix update did the trick. Thanks!
(This post was last modified: 06-11-2013 09:51 PM by Kiekos.)
06-11-2013 09:22 PM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #9
RE: Character skills and position marker
And I'm back in this thread... I didn't know why the marker was not transparent even though the material's opacity was set to about 50%.

It turns out the drawing call was probably in wrong place in code which was void Render() instead of void Draw(). Now that I moved it to void Draw() it's opacity is low (as it should be) but the marker tends to disappear at certain angles (angle range when marker is invisible changes sometimes).

Code:
Memc<Vec> &path=Players[0].path;
if( path.elms() ) Meshes("obj/other/marker/marker.mesh") -> draw(mark_skel);

EDIT: That problem didn't occur when drawing call was in void Render(), but the marker was not transparent.
(This post was last modified: 12-03-2013 08:39 PM by Kiekos.)
12-03-2013 02:41 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #10
RE: Character skills and position marker
If I'm not mistaken, you should be drawing in Render(); try some of the other draw modes like RM_BLEND.
12-03-2013 08:14 PM
Find all posts by this user Quote this message in a reply
Kiekos Offline
Member

Post: #11
RE: Character skills and position marker
Oh so it was correct? Well, then it doesn't disappear but it's not transparent, material opacity doesn't seem to work.

EDIT: Thank you, Rubeus smile RM_BLEND worked!
(This post was last modified: 12-03-2013 09:16 PM by Kiekos.)
12-03-2013 08:29 PM
Find all posts by this user Quote this message in a reply
Post Reply