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 / Help ...with sparky collision......

Author
Message
technotdc
13
Years of Service
User Offline
Joined: 13th Apr 2011
Location:
Posted: 1st Sep 2011 17:22
Hi..

I'm trying this collide (enemy /level) with Sparky's collision (¿faster collision ??? )

I'm noob.




and this function of enemy :



the enemy follow player (camera) but cross the wall....

can you help me ,please?????

(sorry bad english)
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 2nd Sep 2011 17:28
First, I would set up your level as a complex object (i.e. SC_setupComplexObject objNum , GroupNum , FacesPerNode). Set it as group 1.

Second, I would use sc_SphereSlideGroup:
collide = sc_SphereSlideGroup(1,oldx#,oldy#,oldz#,x#,y#,z#,radius#,0)

I revised the old demo code for Sparky's and made it so you can see how it can work by example:



Hope this is helpful.

technotdc
13
Years of Service
User Offline
Joined: 13th Apr 2011
Location:
Posted: 3rd Sep 2011 06:07
Hi....

Thanks for you code LBFN....

well...I'm trying this now..




and the enemy don't move now (then , it collide with level ,true???)

I put line this to verify the collsision :


if SC_ObjectCollision(5,99)=1 then end

and the program end after compile (because the enemy collide with the floor of level...)

too much problems with my room created if FPS Creator......

















LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 3rd Sep 2011 16:37
You need to move the



code to where it is right after the point object command.

The sc_ObjectCollision command will not return sliding x, y and z values. Use sc_SphereSlideGroup instead.



Please note: You need to define object 99 (your level) as group 1 when you set it up (you need to set it up as a complex object, if you haven't already). You also need to make the float variable, radius#, a global variable at the start of your program and assign a value to it that is half the Y size of the zombie. i.e.:


Since I do not have your models, I cannot test this, but it seems like it should work.

technotdc
13
Years of Service
User Offline
Joined: 13th Apr 2011
Location:
Posted: 4th Sep 2011 04:24 Edited at: 5th Sep 2011 15:11
hi......

I can't do ???????


here the code:




And here the enemy function :









Of course..thank for your help ...(sorry for your loser time)
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 4th Sep 2011 04:38 Edited at: 4th Sep 2011 22:14
okay, I won't be at my comp until tomorrow, but looking at the code I see a glaring error that might be the problem.

In the zombie1() function, you point and move object 5 before you store the old x,y and z coordinates. You have to store oldzomx#, etc. before you point and move object #5.

If that doesn't work, I plan to look at it tomorrow and test it to figure it out. Don't despair, we'll figure this out.

EDIT:

There is a handy tool you can use with Sparky's called sc_drawobjectbounds. Use this command right after the zombie (object 5) is created to show you what Sparky's sees as the bounds for your object. It would show you this:



You can see the collision sphere is way low for what it should be. There is a problem with the zombie model itself. It needs to be moved inside a 3D modeling program so that it is centered on the Y axis.

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 5th Sep 2011 04:43 Edited at: 5th Sep 2011 04:46
technotdc:

I just got to thinking, do you have permission to post these models? They are very professional-looking and I don't want you to get into trouble if you do not have permission to share them. If you don't, you should remove the link immediately.

Anyway, I took the zombie model and altered it so that it is correctly centered on the Y axis (I didn't rig and re-animate it) and here is what I see:



One other change I needed to make was the zombie's initial Y position. You had it at 10 on the Y, I moved it to 15.

Attachments

Login to view attachments
technotdc
13
Years of Service
User Offline
Joined: 13th Apr 2011
Location:
Posted: 5th Sep 2011 16:26 Edited at: 6th Sep 2011 16:52
ahhhhhh.......

ok LBFN.....thanks.....

Yes ,I edited the animation of model ,true.....I fix now ,and collide with wall good



Thanks for your great help

Login to post a reply

Server time is: 2024-11-22 16:55:30
Your offset time is: 2024-11-22 16:55:30