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.

Newcomers DBPro Corner / Problems with blocks and sparky's

Author
Message
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 5th Jun 2014 07:33
Ok this is a really odd situation i find myself in. I had a piece of code for blocks to be activated and explode after a while when another object touches it, all well and good and it works lovely, then i put Sparkys collision onto it, again worked lovely BUT then i tried adding my own textures to it... and now it doesn't work properly, either SOME blocks activate or none activate... BUT if i use a 10x10 box made in 3DS max(pointless i know, but i had to test it)... it works but the textures don't.


I know my coding is badly laid out and a right mess... but if anyone can see what's wrong i love to know... it just confuses me as to why it worked fine until i wanted to add my own texture.

I can see from your smile, you're not here for the sunset

Windows 7 64 bit, AMD Phenom II x4 Black edition, 7 GB Ram, Radeon HD 4650, 3.6 TB HDD
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 5th Jun 2014 18:43
You are using Sparky's, but you also use DBP's collision in the 'Blow up Blocks' part. There is no need to check it twice like this anyway. Use the info supplied by your SphereCastGroup check to set the BoxTriggered(#) variable to 1, like this:



The sc_spherecastgroup call will return the object number in the collide variable if a collision has taken place. You just use that info to get the clock ticking (so to speak) on the box texture.

You then need to eliminate the extra check in your 'Blow up Blocks' part (your code really should be indented):



It should work fine if you do this.

LB

So many games to code.....so little time.
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 9th Jun 2014 19:35
Ok, what you said helped greatly thank you, now i have a slightly different one... i'm using this bit of code to explode the blocks right...

and it works perfect, now how would one adjust it so that you'd have to pass over the block TWICE before triggering it off?
I managed to figure it out once before years ago before i lost all of the coding but that was using regular DBPRO collision detection and i can't for the life of me remember or figure it out... i've been fiddling with it for near on 2 hours now and my brain is dying...

I can see from your smile, you're not here for the sunset

Windows 7 64 bit, AMD Phenom II x4 Black edition, 7 GB Ram, Radeon HD 4650, 3.6 TB HDD
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 9th Jun 2014 21:52
Never mind, i got it... a cup of coffee a smoke and an hour later and i figured it out... maybe i should rest my brain...

I can see from your smile, you're not here for the sunset

Windows 7 64 bit, AMD Phenom II x4 Black edition, 7 GB Ram, Radeon HD 4650, 3.6 TB HDD

Login to post a reply

Server time is: 2024-04-23 22:04:32
Your offset time is: 2024-04-23 22:04:32