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 / I got one .X pbject, need it loaded 10 times.

Author
Message
cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 19th May 2003 03:05
I have a .X file that is a coin. I need it placed randomley over an area of 200x200. How do I load/place it 10 times using an array or something like that?

thanx all
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 19th May 2003 04:19
REM Load your object
for x=1 to 10
load object "coin.x",x
next x

Is how you load the object. For the next part you need to use RND(value) to position it.

RPGamer

Current Project: Eternal Destiny
Questions? Comments? Suggestions? Go to the Eternal Destiny Forum!
cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 19th May 2003 04:54
thanx RPGamer!

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 19th May 2003 05:52
Yea,,,no prob. Try this

for x=1 to 10
Load object "coin.x",x
next x

for x=1 to 10
position object x,rnd(200),0,rnd(200)
next x

Not tested but should work.

RPGamer

Current Project: Eternal Destiny
Questions? Comments? Suggestions? Go to the Eternal Destiny Forum!
cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 19th May 2003 05:59 Edited at: 19th May 2003 06:02
thanks again. Here's what I got;

Object 1 is my character. When I compile (DBPro w/Patch 4)I get an error that says "run time error 7008 - object does not exist line 110" which is the collision detection line.
I'm sure it does not like my syntax, but what am I doing wrong?


Do
....
......
rem check to see if I hit a gem
if object collision(x,1)>0 then score#=score#+1: play sound 8000: hide object x
......
....
Sync
Loop


Rem Level Load Sub
Rem Load/Place gems
for x= 8000 to 8010
load object "./objects/gem.x",x
gxa#=20+rnd(29)+1
gza#=100+rnd(29)+1
height#=51-intersect object(2,gxa#,50,gza#,gxa#,-50,gza#)
position object x,gxa#,height#+3,gza#
next x

cypher
21
Years of Service
User Offline
Joined: 27th Nov 2002
Location:
Posted: 19th May 2003 06:00
Forgot to mention. The code places my gems perfect in the X,Y,Z of where I wanted them. I just can't figure out what I need to do to get collision on them.

tx

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 19th May 2003 15:10
Why not use my collision code in code snippets? I was working with this yesterday and it works perfect. It would go like this

for x= 8000 to 8010
CollBox(x)
next x

do
....
`1 is main object
Slidecoll(1)
....
loop

and there is sliding collision all done!

RPGamer

Current Project: Eternal Destiny
Questions? Comments? Suggestions? Go to the Eternal Destiny Forum!
haXor
21
Years of Service
User Offline
Joined: 12th May 2003
Location: United States
Posted: 22nd May 2003 00:54
Hey, i was tryin to use this code above, the sliding collision, but it didnt work. I put the CollBox(x) inside the for thing, and all that(I already had a for-do going, so i know thats not the problem) and then put the Slidecoll(1)thing at the bottom b4 loop and it ddint work, it said "could not understand code at line 18" what am I doing wronge?

Sup Kids
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 22nd May 2003 02:35
Did you go get my function in the code snippets section? Try that

RPGamer

Current Project: Eternal Destiny
Questions? Comments? Suggestions? Go to the Eternal Destiny Forum!
haXor
21
Years of Service
User Offline
Joined: 12th May 2003
Location: United States
Posted: 22nd May 2003 02:54
aahhh that may help :-s lol, ill go get that, theennnnn try it out

Sup Kids

Login to post a reply

Server time is: 2024-09-20 09:50:28
Your offset time is: 2024-09-20 09:50:28