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 / No Object Masking?

Author
Message
lil marioman
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: Canada
Posted: 5th Aug 2009 06:25
I'm porting some of my FPS code from DBPro to DarkGDK, but I've encountered a minor inconvenience.

There's no "Set Object Mask" command, which is used for hiding objects on certain cameras.

Is there any workaround to this?

I'm scared of bugs. I mean that in more ways than one.
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
lil marioman
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: Canada
Posted: 5th Aug 2009 23:04
Thanks, but I keep getting Link Errors when I compile my project

I'm scared of bugs. I mean that in more ways than one.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 6th Aug 2009 02:54
I suggest using the simple single function that is a couple of posts down from the top of that page dark coder linked for you.

The class that I posted has a slightly hosed implementation(lol understatement, slightly) of a singleton class that I havent gotten around to removing yet. It doesnt affect the working of the class or the functions in it, but its not the best way to have things.

If you can post the specifi errors that you are getting someone may be able to help you a little more.

If it ain't broke.... DONT FIX IT !!!
lil marioman
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: Canada
Posted: 6th Aug 2009 03:35
I found out it wasn't the Object Masking that was causing the problem.

It's either my computer or the compiler itself:

"Unhandled exception at 0x0040a325 in Game.exe: 0xC0000005: Access violation reading location 0x00000000."

I click continue, same thing appears again, I click break, everything stops

I'm scared of bugs. I mean that in more ways than one.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 6th Aug 2009 04:54 Edited at: 6th Aug 2009 04:58
its because you are trying to address a piece of memory that isnt what your program thinks it should be.

Its hard to tell you what the exact cause is though without the code the check.

All I can suggest without code is to debug the program, set breakpoints around the places wherever the variable that caused the exception is used and, place watches on the variable so you can check its values.

Does your program throw the exception when you dont include anything from the masking stuff ? (if so then the problem will be somewhere in your code, if it happens only when the masking stuff is included it could be the way you are using it, or it could be my code, but either way, ill need to see how you are using it to determine that)

EDIT : To be a little less subtle lol, if you could please post your code, ill have a look through and see if I can find what the problem is, either my code or your own (if you really dont want to post your entire code publicly thats ok it is your choice, but you will only get generalized help without specifics, which isnt really much help at all usually)

If it ain't broke.... DONT FIX IT !!!
lil marioman
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: Canada
Posted: 6th Aug 2009 05:13 Edited at: 6th Aug 2009 19:33
It's attached to this post in .rar format

Before you judge my coding expertise (nearly 0 ) realize that it works fine in DBPro and I just started learning the process of DarkGDK yesterday, with no previous experience of C++.

So if the error is EXTREMELY obvious, I'm sorry.

And, it doesn't work even if I take out the object masking...
so the source attached is without it

I'm scared of bugs. I mean that in more ways than one.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 6th Aug 2009 05:24
no worries, ill have a look through now and post bak soon with my finding...

And dont worry about coding style or obvious errors or anything like that, everybody has to start somewhere and learn stuff, and mistakes have to be made to learn from or we dont get anywhere lol

If it ain't broke.... DONT FIX IT !!!
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 6th Aug 2009 08:53
Ok (sorry for the double post, attaching download to this one)

I have gone through your code and changed and altered it to get it running as best I could without spending too much time(im a little strapped for that lately lol)..

I have included in the download the media that I used, as it is kind of position dependant, as you have gravity, you need to make sure you spawn the player in just above the ground or he falls through it. (its about 7mb with media in a zip-FPSC level which is what you were using I think - i removed some of the textures to make it smaller lol)

Its working, you can run around the level and jump, you can fire the gun, but only 1 clip as your reload code is a little broken.

I have gone through and added comments through your code in all the places where I changed something, to explain why I changed it and to what.

Basically, your minimap isnt working(camera usage related), reloading isnt working(variable usage related, couldnt trace it in time i had), the rest seems to be working.

Your code wasnt really messy at all, and it was quite easy for me to undersatnd what was doing what.

Ill also post the actual 2 code files in code tags here to save the download if you dont want to(I recomend you do though as the media I used will demonstrate how it works, as I said, using different media will mean that you need to alter the spawn in position of your player.)

Attachment contains : Compiled .EXE file, media, main.cpp and variables.h.

Main.cpp :


Variables.h :


Hope this helps you. If something I have done to your code doesnt make sense, please ask, I only changed code logic where it was needed to get it running, the rest is left how you wrote it, some of it is ok, and some will need to be redone, ive commented about that too.

If it ain't broke.... DONT FIX IT !!!

Attachments

Login to view attachments
lil marioman
16
Years of Service
User Offline
Joined: 21st Apr 2008
Location: Canada
Posted: 6th Aug 2009 19:37 Edited at: 7th Aug 2009 04:11
Thanks. It works fine.

I don't understand why the reload/Minimap isn't working though.
In DBP it works just fine. I'm pretty sure all I did was change variable names in DGDK..

DBP source is attached for whatever reason.

I'm scared of bugs. I mean that in more ways than one.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 7th Aug 2009 03:46
The camera wasnt working because in GDK, when you make a camera, you set it to be the "current camera" and that is what was happening.

Its not too hard to get around, and I think it was just some simple logic that was the problem, I didnt have the time to fix that though im sorry, i am glad its running for you though..

Best of luck getting everything else working too

If it ain't broke.... DONT FIX IT !!!

Login to post a reply

Server time is: 2024-10-01 10:29:08
Your offset time is: 2024-10-01 10:29:08