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 Professional Discussion / Code not working.

Author
Message
TeknoCyber
12
Years of Service
User Offline
Joined: 8th Nov 2013
Location:
Posted: 4th Mar 2014 17:04
ARGHHHH Code not working -.-



Any idea on how I can make multiple objects like this and texture them too? I think its because I have it in 1 spot IDK But i need help

"It's not death I fear, I fear not being ready for it." -Tristan Green
Derek Darkly
14
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 4th Mar 2014 17:22 Edited at: 4th Mar 2014 17:25
Zero is not a valid object number. Try for c = 1 to 20.

Also, your thread title isn't descriptive at all. Everyone could say "code not working" when they need help. Then we'd have 50,000 threads that say 'code not working.'

666GO†O666
tiffer
20
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Scotland
Posted: 4th Mar 2014 18:56
Tip:


Get in the habit of trying to read and understand the error messages from the Parser and the Runtime. It will make Debugging a lot easier for you. Otherwise you're going to end up headbutting the screen by the time you finish your first big project. Try stepping through the code in your mind to see where things conflict .

Pay attention to the variables you use in for loops. The problem with your code as Derek said is on the first loop it tries to create an object with ID 0

Cwatson
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Mar 2014 22:54
I was going to endorse that last comment. Unfortunately, although the error message is quite clear as far as it goes it isn't obvious from the Help file why.

Any command using an object ID should warn the user that object IDs must be positive integers. Obvious or well-known to us old lags perhaps - but not to newcomers I guess.



Powered by Free Banners
tiffer
20
Years of Service
User Offline
Joined: 6th Apr 2006
Location: Scotland
Posted: 5th Mar 2014 03:58
Ah good point. Tbf they could do with improving the Help file as not all the commands are properly explained or exampled enough to make them easy to understand for newcomers.

Cwatson
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Mar 2014 08:20
Quote: "could do with improving the Help file "


Working on it

Also...



Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Mar 2014 14:12
Quote: "make them easy to understand for newcomers"


Not just newcomers - some of the less well-known commands or parameters need a lot of extra info to be comprehensible.

Quote: "Working on it"


It will be a lot of work - and just when you think you've mastered it all and hit the final "post message" button, Lee will suddenly spring a lot of new commands and enhancements on us.

Seriously though, good luck with that. I'll be looking out for it.



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Mar 2014 16:17
Quote: "Seriously though, good luck with that."

Cheers!

Quote: "I'll be looking out for it."

I do hope you have Windows 8.1 access

Quote: "It will be a lot of work - and just when you think you've mastered it all and hit the final "post message" button, Lee will suddenly spring a lot of new commands and enhancements on us."

I am adding code samples as I use them in my tutorials which should tackle some 30% of overall code at least, the emphasis is on operational functionality, no hard core optimisation, it has to be simple to read code but this has me thinking now... thanks again

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Mar 2014 19:08
Quote: "it has to be simple to read code"


Definitely.

Some of the existing example codes in the Help file contain loads of more or less irrelevant stuff and it's very hard to see which are the vital bits. Others have no code example at all and far too many say things like "such and such a parameter has to be an integer such as 0" with no explanation of what different possible choices do. A few are just wrong or hopelessly out of date or incomplete.

Quote: "I do hope you have Windows 8.1 access"


Why would I want that?



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Mar 2014 19:25
Quote: "Some of the existing example codes in the Help file contain loads of more or less irrelevant stuff and it's very hard to see which are the vital bits. Others have no code example at all and far too many say things like "such and such a parameter has to be an integer such as 0" with no explanation of what different possible choices do. A few are just wrong or hopelessly out of date or incomplete."


I plan on writing at least 3 scenarios of usage with colour identification and full plain English explanations...

Quote: "Why would I want that?"


Because it is the only way you will get Prototype: Primer with the Code Dictionary I thought about giving it a special name though...

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Mar 2014 23:03
That doesn't seem very helpful



Powered by Free Banners
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Mar 2014 23:55
You can always grab one of the cheap tablets coming out this year with RT on them

8.1 even I must admit is a vast improvement over 8.0!

Login to post a reply

Server time is: 2026-07-06 01:49:32
Your offset time is: 2026-07-06 01:49:32