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 / Types and Arrays. tut's and searched, still confused

Author
Message
Anti Human
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Good ol\' West Virginia
Posted: 17th Jul 2008 05:50
sorry for asking people to go over things they already explained repeatedly; i'v read TDK's and Zotoaster's tut's, searched and read the posts; i'm still not getting types and arrays.

maybe i'm trying to use the wrong commands. what i'm trying to do is create different weapons in different weapons types each weapon having different damage, weight, etc.

(this code is the only complete one i'v made with types so far)



now, if i understand correctly, to save this outside the main sorce code i'd have to place it in an array. as arrays can't be created in types, how do i get the data from type to array? and load it?

again, i am sorry for asking. thank you for your time and (i hope) patience.

Today is a good day, at least compared to tomorrow.
And every day is a good day to die, becuase then, there is no tomorrow
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Jul 2008 10:13
It's another tutorial, but it might just have the little bit of information you need to put it all together...

http://www.thegamecreators.com/data/newsletter/newsletter_issue_29.html#9

Anti Human
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Good ol\' West Virginia
Posted: 17th Jul 2008 11:20
it was a good start. looked over the tut and then downloaded it. looked at the complete code. went to run it and it kicked over like it was gonna then "Runtime Error 118- Array does not exist or array subscript out of bounds at line 194" funny thing, there's nothing at line 194.

tried the tut from the month before earlier, the first 'type' command threw an error, well, not that command, but 'endtype' was 'command out of place at line 21' high lights line 22 though.

i'm starting to think maybe i need to reinstall...

but your effort did do some good, i actually saw the links between 'type' and 'array' in that one.

thank you.

Today is a good day, at least compared to tomorrow.
And every day is a good day to die, because then, there is no tomorrow
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 17th Jul 2008 11:36
I'm not sure if this is what you wondered, but you can just use
dim arrayName(indices) as typeName.

Then store it like


"I kören hörs de brummande busarna Björnligan och Gondolen"
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 17th Jul 2008 17:55 Edited at: 17th Jul 2008 17:55
The errors can be explained, I know that you are using the default DB Pro editor. In my comments, I used to use "...". In the default editor, this is the indicator for a line continuation. If you remove the dots, it will compile.

There was another strange quirk I just noticed, at the second waypoint they all start spinning and never move on. Not sure what that problem is, but it doesn't stop you seeing what the tutorial is about. Maybe U6.9 is doing something different, that tut is from about U6.4

Anti Human
19
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Good ol\' West Virginia
Posted: 21st Jul 2008 01:51
Thanks Batvink and Rudolpho, your efforts are apprecated. unforturitly they are also in vain.

I'v watched the program run . I'v read the coding . I'v stared at the coding . I think I even understand what the coding is doing . I still have no clue how to make them work together .

some where somethings not clicking, I just don't know what I'm missing.

I know what I need. I need some one to print off every piece of tutorial and every post about types and arrays, put them in one book, fly over, and then hit me in the head with it till somethings gives. I know it sounds crazy but it's how I learned long division.

Dad "What do you mean you don't know long division? Let me see that math book."

BAM

oh yeah, five minutes later I knew long division.

ok, I know this is going to take alot of effort, but would some one write (in real code) the type and array deal, Making and using them. It can be short, doesn't have to be more then one entry for either. but if some one would be willing to do this, could they include ALOT of comments, mostly saying what it does and where it ties in to anything else.

I'm down to that or mailing someone a fully loaded printer and a round trip plane ticket.

oh, I just had an idea. is there a BASIC or DarkBASIC "for Idiots" book? I'v got the Beginners Guide to DarkBASIC Game Programing, I just can't make any sense out of what little bit it explains on arrays and the "type" command is not listed in the index that I could find.

sorry this got some long, imma go now. thanks again.

Today is a good day, at least compared to tomorrow.
And every day is a good day to die, because then, there is no tomorrow

Login to post a reply

Server time is: 2024-11-25 02:13:29
Your offset time is: 2024-11-25 02:13:29