Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Coordinates & Objects

Author
Message
DevilSolution
13
Years of Service
User Offline
Joined: 26th Aug 2011
Location:
Posted: 26th Aug 2011 16:05
Hi guys before i get into my post is probably best to give myself a little introduction, ive been software developing for a few years now and have used dark gdk once before about 2 1/2 years ago so my memory has faded greatly and thats probably because i was young and didnt get too far with this software. Now im back and alot more preped than last time, im first and foremost trying to get to the level i was before, before expanding on that knowledge.

Okay so before i had a few things going for my game that i need again or more importantly i need to understand.
The first was on screen co-ordinates for both object (character) and camera, this is for debugging purposes (putting objects in the right place, setting camera to follow from the right point etc)
Next i'd like to know how you render objects correctly, for example ive loaded both character object and the texture object, now what i need to know is, is there a specific order for loading the objects?

once i got them two i should be able to the rest on my own, last time i had my co-ords, the camera fixed on character(which could be moved by mouse or keys) and i had him walking and running with the set animation scrolling through, them bits i should be able to do again without much hastle, but right now im loading into the map and not seeing my character at all.

REMIX
AncientGamer
14
Years of Service
User Offline
Joined: 10th Jan 2010
Location: United States
Posted: 28th Aug 2011 00:43
When I installed Dark GDK there were nine tutorials that helped me immensley with questions I had that were like those you have now. they can be found in the Dark GDK directory, which by defauly is C:\Program Files (x86)\The Game Creators\Dark GDK\Tutorials (on a 64 bit system).
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 28th Aug 2011 12:18 Edited at: 28th Aug 2011 12:19
Quote: " right now im loading into the map and not seeing my character at all."


Are you sure your character model is in the right directory? Does the program find the file at all? (You can check with dbFileExist, or after loading, dbObjectExist.) Are you sure the camera looks at the object and it's not too small and not too large to be seen?

If you can't get it working, then post some code, otherwise we don't know what the problem is.
DevilSolution
13
Years of Service
User Offline
Joined: 26th Aug 2011
Location:
Posted: 28th Aug 2011 13:33
Wow, now i feel stupid, yes it was simply the .x file location, also now the object is loading the co-ords work fine using the method i had already built. CHEERS GUYS

REMIX
DevilSolution
13
Years of Service
User Offline
Joined: 26th Aug 2011
Location:
Posted: 28th Aug 2011 17:15
okay now i have another issue, i have my character set up he can run on top of the map fine i can turn him around and do all the basics but now im trying to make it so he uses the run animation which to most extents works fine but seems to be caught in a constant loop ill show you the code snippet.



as you may be able to see i only have him to set to use the run animation when both up & left key are true and try to make it stop the continuous loop wit ha while but i think...again im missing something rather obvious. cheers in advance guys

REMIX
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 29th Aug 2011 08:21
Once you issue dbLoopObject, the animation loops forever. You have to use dbStopObject to stop it. Or, if you want to start playing another sequence, then dbSetObjectFrame + dbLoopObject with different frame numbers.

Also, in this solution you execute dbLoopObject repeatedly (every loop), as long as both keys are pressed. The result is that the animation will restart always from the beginning, so if you keep the keys pressed, the animation will get stuck at or near the beginning frame. Introduce status variables (e.g. the direction the character is facing) and detect when the direction changes, and execute dbLoopObject only at that moment.
Fleep
14
Years of Service
User Offline
Joined: 1st Oct 2010
Location:
Posted: 29th Aug 2011 11:28
Yh Mireben is right, i recommend you do something like this




Havent tested it but it should be pretty straight forward.

If your looking for some code for many different situations, e.g. walking, running, jumping you should know that these animations will probably require different speeds which you will be forced to tweak.

So to avoid that i wrote a fairly simple function a while back in which you can replace your 3 lines there for 1 every time you use it.
Heres the function
just make sure you create a global "int animTimer"

This is how you would use it in your code.




Hope that helped
DevilSolution
13
Years of Service
User Offline
Joined: 26th Aug 2011
Location:
Posted: 29th Aug 2011 13:02
@Mireben, Thanks alot the dbStopObject works great.

my next question is about camera's, currently i have mine following the object but only ever at one angle regardless of the objects position. I'd like to know how to make the camera dynamic in so much as the camera will always be behind the person, like in most conventional MMO's such as warcraft or guild wars.

thanks again for your help its much appreciated

REMIX
DevilSolution
13
Years of Service
User Offline
Joined: 26th Aug 2011
Location:
Posted: 29th Aug 2011 14:47
Cheers fleep, ill have to take a look into your code a bit more closely, it looks like what i need so your help is greatly appreciated. Thx

REMIX

Login to post a reply

Server time is: 2024-10-02 19:22:14
Your offset time is: 2024-10-02 19:22:14