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 / Can't get the bullets to appear

Author
Message
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 1st Jul 2009 14:58
I created a Shooting_Bullet class to work with my main:



Shooting.h:




Shooting.cpp :






main.cpp:





The bullets appear, but disappear on the second without moving or going anywhere, is something stopping them?
Bran flakes91093
16
Years of Service
User Offline
Joined: 13th Sep 2008
Location: Crazy Land
Posted: 1st Jul 2009 17:20


You're missing a period between `Bullet[runner]` and `Run();`

Your_Health = (My_Mood == HAPPY) ? 100 : NULL;
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 1st Jul 2009 23:13 Edited at: 1st Jul 2009 23:13
naahh, that would have given me an error, I think I just forgot to fix that wil copy pasting it.


I found the fource of the problem and don't understand why it wont work.




For some reason, if I change the HitObjects to like:

"if (Collide > 0) Kill();" it would shoot the bullets, but doesn't collide with anything, of course I don't want to go manually do an "if" command for every single object I got in my game :s, the HitObjects suppose to make the bullter coillde with anything above 20, but its not -_-?
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 2nd Jul 2009 00:37
I'm not sure if dbObjectCollision(someNumber, 0) even works.

If I was you I would write a simple test program and check if it works. I have a feeling it works to check any particular object but does not work with "0" any object.

If it does fail then use Sparkys collision, in fact use Sparkys anyway as people say it is alot faster.
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 2nd Jul 2009 01:37
Even if I increase the number, it doeasn't show anything difference.

As for Sparkys collision it didn't work, me using "SC_ObjectCollision()" gives erro at the start up..."object 1000 has no setup" with the "#define BulletObjects 1000".

The code works fine alone, I got it from the fourm and changed what I needed, also I had to make it into a class so I can use it as I want for my game.
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 3rd Jul 2009 00:22
SC_SetupObject(objectId);

and at the top: SC_Start();


Your signature has been erased by a mod
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 3rd Jul 2009 02:05 Edited at: 3rd Jul 2009 03:07
ya it works now and everything , thanx.

But......when I shoot then walk with the character for a bit, it gives me a error message"object(1000) does not exsit" the hell is that?I think the "HitObjects" disappear then coz a error, but how can I stop this :S ?

here is hte code now
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 3rd Jul 2009 03:58
if you are getting : "object(1000) does not exsit" error after everything was running fine, it means that you are deleting the object that is numbered 1000 somewhere and sparky's cant find it anymore.

Once you setup an object with sparky's, you cant delete it without telling sparky's that you did.

If it ain't broke.... DONT FIX IT !!!
heyufool1
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location: My quiet place
Posted: 3rd Jul 2009 04:35 Edited at: 3rd Jul 2009 04:37
Just curious, why do you have so many variables? you have:

when it could just be:


You might also want to try ray casting rather then using dbObjectCollision(...)


Use Google first... it's not rocket surgery!
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 3rd Jul 2009 11:36
Ya but the only thing that I have is 1000 is the "#define BulletObjects 1000", how can I stop it form getting deleted, since thats the one that gives that error after shooting a bullet.



And I am using ray casting already as another class, but coldn't shoot the bullets using the ray casting method, only casting the white square thing, then I found this, which is much more simple for me t understand.

Beisdes I don't have time redoing it with the ray casting method, since I need to finish this dman project by the end of next wensday or I don't graduate from collage :S.

Thissucks, since am like 97% done, but small things like me killing the zombies, replace the spheres with bullet objects or small errors like this are stopping me for finishing it T_T.
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 3rd Jul 2009 14:20
OK I think this is hte reason it gets deleted;





And it should, since I don't want the bullet going to a never ending time space, so how can I tell sparky's collision that iuts deleted?
prasoc
15
Years of Service
User Offline
Joined: 8th Oct 2008
Location:
Posted: 3rd Jul 2009 17:59
when the player shoots, just move it and move it back to the player position where he can't see it, instead of deleting it.


Your signature has been erased by a mod
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 3rd Jul 2009 21:08
I don't think that would help, the memroy will give me a an error later on.


Besides I need to know how to delete stuff with sparky's for solving futuer porblems who give me the same error when I delete them, an I tried sparky's SC_RemoveObject, doesn't help (although it should of:S)
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 4th Jul 2009 02:29
no one knows how I can delete an object using sparky's??
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 4th Jul 2009 04:30


Using that MAY help, if you are 100% sure that what you are doing to the objcet isnt illegal, the above will suppress the error warnings I believe....

I've looked through the Header for Sparky's, which I also use, and I SC_RemoveObject() I think, does work... the problem might be that you are still trying to reference the collision object once you have deleted it.

If it ain't broke.... DONT FIX IT !!!
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 4th Jul 2009 12:33
What do you mean objcet isnt illegal? and how does "SC_ErrorMode( int mode );" work sould I just replace the "int mode" with the object that gives the error or the number of the bjoect that pops out in in the error message?
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 4th Jul 2009 12:46
the SC_Errormode command is global.... read the comment after it.... 0 = Ignore errors, 1 = display errors, 2 = display errors and quit app. Calling it will affect all of sparky's not just one object.

Quote: "What do you mean objcet isnt illegal?"


I didnt say the object was illegal or not illegal, I said that "If you are 100% sure that WHAT YOU ARE DOING TO THE OBJECT IS NOT ILLEGAL, the above command will suppress error warning".

That means that if you are completely absolutely 100% sure that you arent doing anything wrong with the object. Doing something wrong to the object(or illegal as the term is) would include trying to reference the object in any way after its been deleted or removed from the scene.

If it ain't broke.... DONT FIX IT !!!
Hayer
18
Years of Service
User Offline
Joined: 4th Nov 2005
Location: Norway
Posted: 5th Jul 2009 00:38
well, bullets now a day fly so fast that u can't see them..
So why not use dbIntersectObject or whatever the command was again?

Keep it simple.
Questions? Mail me
yahya
15
Years of Service
User Offline
Joined: 16th Oct 2008
Location:
Posted: 8th Jul 2009 21:09
Ok I might seem annoying with this topic, but can how can I like someone saidbefore, rest the postion of the bullet if it didn't get deleted?

Login to post a reply

Server time is: 2024-10-01 05:46:36
Your offset time is: 2024-10-01 05:46:36