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.

DarkBASIC Discussion / aritificial intelligence :)

Author
Message
James Bond
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location:
Posted: 15th Aug 2004 00:55
I WaNT fEw cUBeS tO mOve rAndOmLy ............ PLZ GIVE ME THE CODES FOR THIS SO THAT I CAN READ AND UNDERSTAND OR GIVE ME ANY TUTORIAL ...........................
Kohaku
21
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 15th Aug 2004 01:04


Infra-Dark
Bring the 20 liners back!
#coding, like coding, but with a #
scout
20
Years of Service
User Offline
Joined: 27th Jul 2004
Location:
Posted: 15th Aug 2004 01:15
ok here are the codes:
1st: FDKSS-66423-QWE89
2nd: BMM2S-SDF12-XXWYK

remember... both must
be used at the same
time, or the self-
destruction will be
initiated.

good luck

scout
BCRICH WARLOCK
20
Years of Service
User Offline
Joined: 10th Aug 2004
Location:
Posted: 15th Aug 2004 03:49
hmmm Are You Sure The Secend One Isnt The Deactivate Code?.. Doesnt Look Like The "Make Cubes Move Around Randomly Input Em At The Same Time Or Self Destruct Code"
Kohaku
21
Years of Service
User Offline
Joined: 3rd May 2004
Location: The not very United Kingdom
Posted: 15th Aug 2004 10:15
James Bond, be a tad more descriptive dude. In what way do you want the cubes to move randomly?

Infra-Dark
Bring the 20 liners back!
#coding, like coding, but with a #
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 15th Aug 2004 11:54
Be more descriptive..............and learn some basic grammar/English.

Try instead:

"Hi, I'm experimenting with AI techniques. Could anybody help me get started with some ways of having cubes move around in random directions?"

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 15th Aug 2004 12:41 Edited at: 15th Aug 2004 16:10
sync on
randomize timer()
make object cube 1,10
do
position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)
sync
loop

And the cube moves around randomily.

EDIT

A few cubes:

sync on
randomize timer()
make object cube 1,10
make object cube 2,10
make object cube 3,10
make object cube 4,10
do
position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)
position object 2,(object position x(2)-0.1)+(rnd(10)/10),(object position y(2)-0.1)+(rnd(10)/10),(object position z(2)-0.1)+(rnd(10)/10)
position object 3,(object position x(3)-0.1)+(rnd(10)/10),(object position y(3)-0.1)+(rnd(10)/10),(object position z(3)-0.1)+(rnd(10)/10)
position object 4,(object position x(4)-0.1)+(rnd(10)/10),(object position y(4)-0.1)+(rnd(10)/10),(object position z(4)-0.1)+(rnd(10)/10)
sync
loop

/EDIT

EDIT2

And so you can see them better:

sync on
randomize timer()
make object cube 1,10
make object cube 2,10
make object cube 3,10
make object cube 4,10
move camera -25
do
position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)
position object 2,(object position x(2)-0.1)+(rnd(10)/10),(object position y(2)-0.1)+(rnd(10)/10),(object position z(2)-0.1)+(rnd(10)/10)
position object 3,(object position x(3)-0.1)+(rnd(10)/10),(object position y(3)-0.1)+(rnd(10)/10),(object position z(3)-0.1)+(rnd(10)/10)
position object 4,(object position x(4)-0.1)+(rnd(10)/10),(object position y(4)-0.1)+(rnd(10)/10),(object position z(4)-0.1)+(rnd(10)/10)
sync
loop

/EDIT2

EDIT3

Now you always see them and they're colored randomily!

sync on
randomize timer()
make object cube 1,10
make object cube 2,10
make object cube 3,10
make object cube 4,10
color object 1,rgb(rnd(255),rnd(255),rnd(255))
color object 2,rgb(rnd(255),rnd(255),rnd(255))
color object 3,rgb(rnd(255),rnd(255),rnd(255))
color object 4,rgb(rnd(255),rnd(255),rnd(255))
move camera -25
do
point camera object position x(1),object position y(1),object position z(1)
position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)
position object 2,(object position x(2)-0.1)+(rnd(10)/10),(object position y(2)-0.1)+(rnd(10)/10),(object position z(2)-0.1)+(rnd(10)/10)
position object 3,(object position x(3)-0.1)+(rnd(10)/10),(object position y(3)-0.1)+(rnd(10)/10),(object position z(3)-0.1)+(rnd(10)/10)
position object 4,(object position x(4)-0.1)+(rnd(10)/10),(object position y(4)-0.1)+(rnd(10)/10),(object position z(4)-0.1)+(rnd(10)/10)
sync
loop

/EDIT3

EDIT4

I'm using DBPro but these should work on DBC.

/EDIT4

Now to explain the commands I used:

`Make sure the screen only refreshes when the sync command is read to make the app go faster
sync on
`Make the app produce diffrent resaults every run
randomize timer()
`Make the cube
make object cube 1,10
`Start a loop
do
`Position the cubes randomily(i'll explain how this works)
position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)
`Update the screen
sync
`End the loop
loop

-----------------------------------------------------------------------

position object 1,(object position x(1)-0.1)+(rnd(10)/10),(object position y(1)-0.1)+(rnd(10)/10),(object position z(1)-0.1)+(rnd(10)/10)

Can be broken up into parts.

position object 1, - position the cube

(object position x(1)-0.1) - the cubes x position minus 0.1

+(rnd(10)/10), - plus a random number up to ten and divided by ten

(object position y(1)-0.1)+(rnd(10)/10), - same except with the y position

(object position z(1)-0.1)+(rnd(10)/10) - the z position

-----------------------------------------------------------------------

More commands I used:

move camera -25 - move the camera back 25 units


color object 2,rgb(rnd(255),rnd(255),rnd(255))

can also be broken into parts:

color object 2, - color the second cube

rgb( - convert rgb to db color code

rnd(255), - random number from 0 to 255

rnd(255),rnd(255) - same and same

) - tell db to close the command

-Ilya

Login to post a reply

Server time is: 2025-05-25 10:26:01
Your offset time is: 2025-05-25 10:26:01