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 object placement...

Author
Message
Sir Spaghetti Code
20
Years of Service
User Offline
Joined: 12th Jul 2004
Location: Just left of Hell
Posted: 15th Aug 2004 17:56
Hmmm, ok..I have an area loaded up in my little learning-experience-program, and I am trying to add a couple of loaded objects to it. Basically, I have an encircled area, lined with pillars. There is quite a large inner area made by the walls. I have tried several times to load up images within the walls, and for some reason, they keep appearing on the outside wall(?!?!). At no point in my code do define those objects to be outside the walls. As you will see by my subroutines at the end of the code, I have it set so that these objects will turn around after they reach a certain point, and I also added in a random factor to turn them on a 2 in 6 chance (provided they are "in-bounds").

The first object is actually stationed on the outside of the walls, and I have no issues with him. It is the second and third enemy that I am having problems with. I place them within the area inclosed in the walls (of which I have a little alley into), and set up "boundries" within the walls in the subroutine to dictate their movements and turns, but they keep showing up outside the walls!! I am at a loss...

For those that did not want to read my rant: CONDENSED VERSION
I keep trying to place enemies 2 and 3 within a closed in area of walls, and they keep appearing on the outside. Thanks for reading and helping! Code:


P.S.- I am using DBpro and Nuclear Glory Collision, but I do not think the NGC is interfering with the placement of the objects, but..hey...maybe I am wrong

"I attribute the quarrelsome nature of the Middle Ages young men entirely to the want of the soothing weed."
-Jerome K. Jerome(1859-1927),Writer
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 15th Aug 2004 18:27
try positioning the objects right after loading them like

before you assign them a collision. You may even have to deavtivate the collisions and place them then reactivate but I thiink that will work.

Sir Spaghetti Code
20
Years of Service
User Offline
Joined: 12th Jul 2004
Location: Just left of Hell
Posted: 16th Aug 2004 03:16
You're a genius! That worked. Strange though...not sure why that would matter. Oh well, Thanks a ton!

"I attribute the quarrelsome nature of the Middle Ages young men entirely to the want of the soothing weed."
-Jerome K. Jerome(1859-1927),Writer
lcfcfan
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 16th Aug 2004 04:17
cos you cant assign collision to an object that does not exist and it does not exist till you load it. You have to remember dbp processes information in the order it's coded in.
Lost in Thought
20
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 16th Aug 2004 05:18
Its because you are loading the objects, assigning collision to it (saving where it is), then moving it and when you run the RunCollisionPRO() it sees where it was and where you moved it to. It notices that there is a wall between the 2 points even though you created the wall after you moved the monster. Remember the NGC doesn't know anything untill you run RunCollisionPRO() only then does it check for collisions so its best to place all objects in their initial locations before you assign them to collision or deavtivate the collision, move them object, then reactivate the collision.

Login to post a reply

Server time is: 2024-11-27 06:43:45
Your offset time is: 2024-11-27 06:43:45