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 / Randomized box creation

Author
Message
dark basic code
14
Years of Service
User Offline
Joined: 26th Jan 2010
Location: US
Posted: 30th Apr 2012 16:02
for a project in school i am working on, i want to have a "stack" of boxes that you jump onto to reach a goal, everything else is working, i just cant make the boxes co-operate.



and heres the box spesicicaions (if it has any impact on why it wont work)




any help is apreicated.

YO
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 30th Apr 2012 21:39
Matrix is a reserved keyword and even though matrix# is different, in that it is a float, I would suggest using a different variable name. Do you really need a dimensioned array that requires float precision?

Next, you listed makeranplatforms: as a label, which is typically done with subroutines. If you are jumping to a subroutine and then call a function, it is going to mess up, because you have no RETURN command for the subroutine.

This code:


does nothing at all. What is your intent here? I take it you want to create seven boxes, but maybe you want to create 49 boxes.

You really need to give object numbers for the boxes you want to create. Since it was not listed, I added it to the function/call.

Anyway, I wrote some code that creates 7 boxes and makes a small stack out of them. Take a look and see if this is anything close to what you are interested in.




So many games to code.......so little time.

nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 30th Apr 2012 22:53
Quote: "

"

Um... OP... I'll assume that was a copy-paste accident...

dark basic code
14
Years of Service
User Offline
Joined: 26th Jan 2010
Location: US
Posted: 1st May 2012 16:38
LBFN,

I imported the code into my project, and modified it to work, however it is interfering with my predesgined movcement code, in that movement is locked out...

YO
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 1st May 2012 19:06
dark basic code,

Can you post up your movement code?

So many games to code.......so little time.

dark basic code
14
Years of Service
User Offline
Joined: 26th Jan 2010
Location: US
Posted: 2nd May 2012 15:32
yeah, no problem.



and the running code i built...



YO
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 2nd May 2012 18:00
Quote: "I imported the code into my project, and modified it to work, however it is interfering with my predesgined movcement code, in that movement is locked out"


So I assume that it worked before. Really, all I did was give you a way to create some boxes and place them. They are not setup for Sparky's collision, which needs to be done if you haven't already (they should be placed into group 1).

You might want to look at using NewXvalue and NewZvalue for movement.

It seems odd to me to have two collision checks, one with SphereCast (using old values) and one with SphereSlide. Can't you just use SphereSlide?

This code:


sets your movement to 0, as you forgot the # sign after playermovespeed. It might be your problem. Really, even with that, the code does not alter playermovespeed#, but at least it won't set it to 0.

So many games to code.......so little time.

dark basic code
14
Years of Service
User Offline
Joined: 26th Jan 2010
Location: US
Posted: 3rd May 2012 15:31
yeah, my teacher pointed that out to me.

thanks LBFN, your code was a big help in my project.

Call me Agon...

cant change my name... >_<

Login to post a reply

Server time is: 2024-11-23 20:57:25
Your offset time is: 2024-11-23 20:57:25