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 / control devise Q?

Author
Message
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 19th Apr 2009 02:06 Edited at: 19th Apr 2009 02:15
can you hook up a 360 controler and use it on db.And can you make it where if you push A then do somthing.

and to make this post not completely useless
for a text battle system how would i use the same varibles for every monster?

im new at this
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 19th Apr 2009 04:43
Question 1:

I know you can hook up a 360 controller to a pc in general because i've seen people do it(and it's made by microsoft lol). but you could probably find a dll to get the data from it (like the button pushes).

Question 2:

What do you mean. what would you be storing? (health, power, Type, ext...)

New Site! Check it out \/
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 19th Apr 2009 06:36 Edited at: 19th Apr 2009 06:39
@RazerX
2. By using DATA statements you can hard code any data you will need. You can create standards for reproduction throughout the game, ie monster classes with different traits.


can't read?
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 19th Apr 2009 16:05
Q1:

I know that there are libraries of functions (at least for C++) for both 360 controllers as well as WiiMotes. I'm not sure if they're totally legal, but I would try Googling it. There might be some functions in a .DLL form that you could use using LOAD DLL and CALL DLL in Dark Basic.

That's what they WANT you to think...
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 19th Apr 2009 18:36
ummmmmm, maybe i misheard wat u guys r talking about but it sounds like ur overcomplicating stuff.

u plug in the 360, set that to ur current input device, and im almost 100% sure that these commands will take input from all the joysticks and buttons on the controller, worth a try neway:

JOYSTICK X() will return the X axis value of the the default analogue joystick

JOYSTICK Y() will return the Y axis value of the the default analogue joystick

JOYSTICK Z() will return the Z axis value of the the default analogue joystick

JOYSTICK FIRE X() support to read upto 32 fire buttons

JOYSTICK FIRE A() will return a one if the default joystick fire button A is pressed

JOYSTICK FIRE B() will return a one if the default joystick fire button B is pressed

JOYSTICK FIRE C() will return a one if the default joystick fire button C is pressed

JOYSTICK FIRE D() will return a one if the default joystick fire button D is pressed

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Apr 2009 01:18
That would be really sad if we all said to use dll as and complocated stuff and he cud just use dbc commands hahaha

New Site! Check it out \/
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 20th Apr 2009 02:13
DBC commands will work, I believe I have done it before. I know for a fact that 360 wired guitar hero guitar work (I made an interpreter program for it a while back just to see if I could).

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 20th Apr 2009 07:02
hahaha sweet! you shouldmake a guitar hero remake

New Site! Check it out \/
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 20th Apr 2009 07:11
sort of did. The idea was I needed a test program for a modification I was working on. Wanted to convert the guitar to use 5 strings instead of the fret buttons and you would strum the strings instead of the button thing. The program could generate the button presses required and everything, I just never got around to actually modifying (or finish planning the modifications) of the guitar.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 21st Apr 2009 03:19 Edited at: 21st Apr 2009 23:15
thanks

@obese
that was what i needed,but after you push spacekey it does somthing weirdish is it first to do that,test it

and is there a way to rnd the data a little bit?(it's not completely needed just would be cool.)
data "monster",22,rnd(2)+30,22
that does'nt work caleb

fasion sense?

im new at this
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 21st Apr 2009 20:25
Just use RND(). or do you mean loading the data then randomizing the data you already have?

New Site! Check it out \/
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 21st Apr 2009 23:53 Edited at: 22nd Apr 2009 00:22
useing rnd does'nt work in the data

also if i had 50 monsters and i only wanted to have 3 of those 50
to randomly apear in a certain area,like pokemon,how would i do it

I think i understand data now but can data be read into anthing else then varibles?

im new at this
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 22nd Apr 2009 00:46
What else would you want to load it into? By definition it is just data so technically it can be used for whatever you want. Granted, first you will have to load it into a variable with the READ command, but after that you can do whatever you want.

for the monsters thing, use rnd() in conjunction with adding so:

If monsters 25-50 can appear in area 1, you would use rnd(25)+25.

Now, if it is TOTALLY mixed up, the easiest way would probably be to create an array to store data for the different terrain areas and then have that array populated with monster numbers, which are referenced in the monster data array. Make sense?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 22nd Apr 2009 01:08 Edited at: 22nd Apr 2009 01:17

@bn2 i'm not sure what you mean do you mean to put a if statement before a data like
if a(1)=1 then data bla bla
if a(2)=1 then data bla bla
if a(3)=1 then data bla bla
then set varible at a certain area saying a(1)=1 a(2)=0 a(3)=1?

also what does "severe exception!" mean,i got it when i put
"read mon_str(n)+rnd(4)"
a +rnd(4) after it?

im new at this
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 22nd Apr 2009 02:04
The severe exception is because the +rnd(4). You should read your variable and then add the rnd(4) later.

For the dual array style, this is what I mean:


Then, for the battle itself


Did this help at all?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 22nd Apr 2009 03:09
also i dont think u can have a data statement after if, bcuz data statements are supposed to go at the bottom of ur code, meaning the computer never actually RUNS the command data, it just references it wen u use read

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 22nd Apr 2009 05:46 Edited at: 22nd Apr 2009 06:48
@bn2
so you mean if i wanted to get a random monster from a area i would
random_mon=monsterarea(1,rnd(4)+1)
monsterarea(1,1)=(mon)1
monsterarea(1,2)=5
monsterarea(1,3)=12
monsterarea(1,4)=2
monsterarea(1,5)=33
but how would i read the right data for monster 1 or monster33?

edit

i think i figured it out ,Is this what you was telling me,thanks @bn2 and every1 else.(i'll probally ask another Q later)


im new at this
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Apr 2009 22:33 Edited at: 22nd Apr 2009 22:37
@razer
extract from my code...

you seem to have misunderstood the purpose of the rnd(). Since (as far as I know) there is no way to reference data statements as you can with an array - i.e. array(n) references field n of the array - I made the program read through a random number of lines, each line read into the monster arrays overwrites the last. It keeps overwriting like this until the for loop reaches its random max, and we're left with whatever monster the cycle finished on.

@All
Is there a way to point to data statements by using calculations? i.e.

that doesn't work, does it?

can't read?
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 22nd Apr 2009 23:31 Edited at: 23rd Apr 2009 04:07
this seems to work @obese.Its's good because you can get random monster from monster 3,4,8,2,88,... and not from the others.



Q:
i'm trying to create a text map where if you press up you go one square up on the imaginary map and if you press down you go back where you were.
i'm doing it by createing an array
dim map(17,20)
and if your at 17,2 and you press upkey you are at 17,1 or if you press rightkey at 2,13 you are at 3,13.how do i do this?(or is there a easyer way to do it.)

im new at this
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 23rd Apr 2009 19:00
You should be able to do it with just increasing and decreasing certain variables by 1.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 23rd Apr 2009 23:20
wait ya, i could just do if you push up then y=y-1 or down y=y+1
and for where you are i could just say

if y=1 and x=1
bla bla
endif

thanks

im new at this
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 24th Apr 2009 01:30 Edited at: 24th Apr 2009 01:31
for a text adventure game how would you make a scrolling text area
that remembers the last 3 things texted to the screen
for example:
-----------------
you die
monster hits
monster attacks
-----------------

im new at this
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 24th Apr 2009 03:09
what id do is use an array



then wen u need to change them, so lets say u revive in town, then ud use this:



There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 24th Apr 2009 05:19
that works.

im new at this
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 24th Apr 2009 07:32 Edited at: 24th Apr 2009 07:33
Scrolling is just a matter of storing how many lines there are and what line your on then you just do it like this



Where MaxLines is the max amount of lines the box can hold or the height of the textbox/20(depending on text size but thats the default)


Edit:

Wait i just realized you don't want to keep all the information. so all you needed was thatonesmartguys Idea hahaha sorry.

New Site! Check it out \/
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 24th Apr 2009 07:40
this is it so far things i want to know is like doing the imaginary map am i'm doing it the best way?(don't try the code it has media
and is'nt set up yet.)so much code


im new at this
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 24th Apr 2009 09:26
I would say that all of those while statements with nothing in them is a big waste of space.

Even if they WILL have something, usually a bunch of repeated commands like that can be simplified into a single loop (or two).

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 25th Apr 2009 00:21
i have to use while(i think)because if you are at x3 and y5
like on a graph everything thats going to happen at that spot needs
to be in a mini loop.
i'm going to make where if you push left at x3 and y5 you are at x1 and y5 and if you push enter at any of those spots a event happens
depending where you are.

im new at this
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 25th Apr 2009 13:34
I would suggest loading everything into external files, saved in folders that correspond to their location. That way, with a single loop, you can simply read from the Description.txt file or whatever for the description.

The magic here is if all files within the folders are named the same (or at least core ones) then all you do is change the path and it will work out fine. I did it a while back for a text adventure competition I never finished (got bored and ran out of time as I recall)

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose

Login to post a reply

Server time is: 2025-06-08 05:39:08
Your offset time is: 2025-06-08 05:39:08