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 / Strange Error. . .

Author
Message
AndRaxius
User Offline
Joined: 16th Feb 2017
Location:
Posted: 20th Feb 2017 21:58
Hello Guys!

So, my math game is almost complete, but this one error message is keeping the game from compiling.

Here's the full game code:

+ Code Snippet

Whenever I compile this thing, I get the error message "Zero Length Parameter not allowed at Line 35".
I've checked and re-checked, and have tried multiple ways of fixing this.
Could someone help, please?

Thanks!
AndRaxius, Medium Class DBPro Skiddie
AndRaxius - still a piece of human garbage.
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 21st Feb 2017 05:43 Edited at: 21st Feb 2017 06:24
Replace the comma with a space after input on line 35.

Edit: Actually there are many issues with the way you have coded this. For this type of program you don't need to use the sync statements or worry about the backdrop. You have a series of subroutines without much of a main body. Getting late, I will try to post something for you in the morning.
AndRaxius
User Offline
Joined: 16th Feb 2017
Location:
Posted: 21st Feb 2017 17:31
Ok, so I've made a new version of the script, which fixed some of my issues...

However, I'm still having two problems happen

1 : Flickering Screen.
2 : An error code saying "Unable to load image at line 5."

I'm trying to figure out what is causing the image error, and I think it has to do with the id being "0". The way the images work, is that a rnd(2) picks a number, either 0, 1, or 2, and then pastes the corresponding image. Originally, it was an rnd of 3, making it generate four numbers instead of three.

I'm wondering if there is a way to constraint the lowest random number, so I don't have to give an image an id of 0. Is there any way to do that?

Thanks!

+ Code Snippet
AndRaxius - still a piece of human garbage.
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 22nd Feb 2017 01:48
Give this a shot. To keep things simply I retained as much of your code as I could.

+ Code Snippet
zero32
1
Years of Service
User Offline
Joined: 28th Jul 2016
Location:
Posted: 22nd Feb 2017 10:59
AndRaxius wrote: "An error code saying "Unable to load image at line 5."
I'm trying to figure out what is causing the image error, and I think it has to do with the id being "0"."

you are right. the ids of images, sprites, 3d objects all start with 1.
0 is an invalid id.

AndRaxius wrote: "I'm wondering if there is a way to constraint the lowest random number, so I don't have to give an image an id of 0. Is there any way to do that?"

short answer: 1+rnd(2) (just like WickedX did it)

sometimes, writing those things to paper might seem strange at first but can lead to the right answer. if you write down your result (0, 1, 2) and the wanted result (1, 2, 3) and then compare those values, it becomes obvious what you need to change. (add 1 to the result of rnd(2))
in school, my teacher gave me the task to make an array with 5 values. the first item would be a random number and the second should be the first value raised to the power of 2, the third value should be the first value raised to the power of 3 and so on. all of that only with for loops.
he told me that i would need 2 for loops to reach my goal. I had no idea how to do it, but after writing it down:
+ Code Snippet

i found that the next item is just the previous item times the first item and i could do it with only one for loop. my teacher was impressed.

+ Code Snippet
AndRaxius
User Offline
Joined: 16th Feb 2017
Location:
Posted: 22nd Feb 2017 14:12
Thank you guys SO much for the help! I can't express how grateful I am.

The code WickedX sent works fantasticly. Thanks mate!

However, the text and images are still flickering? Any easy way to fix this?

Thanks!
AndRaxius - still a piece of human garbage.
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 22nd Feb 2017 14:43
What version of DB are you using. If 9Ex you may need to update to newest release.
AndRaxius
User Offline
Joined: 16th Feb 2017
Location:
Posted: 22nd Feb 2017 15:02
Well, I'm using Indigo, but I'm not sure which version. How do I check?
AndRaxius - still a piece of human garbage.
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 22nd Feb 2017 15:17
Is the flicker in the IDE or the application. I don't use indigo, but you should find your DBPro version in help about.
AndRaxius
User Offline
Joined: 16th Feb 2017
Location:
Posted: 22nd Feb 2017 15:29
Its the application that is flickering, the IDE is fine.

This is all I could find in terms of versions...

AndRaxius - still a piece of human garbage.
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 22nd Feb 2017 15:48
In Editor folder in your DBPro installed path you will find the file "dbp_config.dll". If you can attach this file I can tell you your DBPro version.
AndRaxius
User Offline
Joined: 16th Feb 2017
Location:
Posted: 22nd Feb 2017 16:09
Found it!
AndRaxius - still a piece of human garbage.

Attachments

Login to view attachments
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 22nd Feb 2017 16:25
Ok, you are using update version 7.1. First make a backup of your DBPro folder in case something goes wrong. Next install update 7.62 over the original copy. Let me know how this turns out.

http://files.thegamecreators.com/darkbasicprofessional/upgrade/dbpro_upgrade_7_62.zip
AndRaxius
User Offline
Joined: 16th Feb 2017
Location:
Posted: 22nd Feb 2017 16:45
The installer doesn't seem to recognize that I have dbpro installed. Now that I look at my files, it says that I'm using something called "rapid game pro". I'm not sure what this entails...
AndRaxius - still a piece of human garbage.
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 22nd Feb 2017 17:04 Edited at: 22nd Feb 2017 17:15
"rapid game pro"; never heard of it. Where did you get that from? The attached zip file is extracted from the update 7.62 installer. Copy the file over your original DBPro folder.

Edit: Look like the file may be to large to attach. Boy, we will really have to do this the hard way. If you don't already have 7-zip installed on your system, download and install it now. After that's done, right click on the update installer and open the file in 7-zip. Now extract it to your desktop. Copy the files in the $_OUTDIR folder to your DBPro folder. Hopefully that will do it.
AndRaxius
User Offline
Joined: 16th Feb 2017
Location:
Posted: 22nd Feb 2017 17:23
Ok, so I think it worked. I basically just copied all the dbpro stuff into my rapid game pro folder, and just replaced any files with the same names. Is there a way to test if the installation worked?
AndRaxius - still a piece of human garbage.
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 22nd Feb 2017 17:27
Do you still get the flicker?
AndRaxius
User Offline
Joined: 16th Feb 2017
Location:
Posted: 22nd Feb 2017 17:52
Y A Y ! NO FLICKER!

Thank you SO much! Is there a way to give you something akin to a medal or favorite or something?
AndRaxius - still a piece of human garbage.
WickedX
8
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 22nd Feb 2017 21:29
Fantastic! Just knowing I could help is all the reward I need.
Ortu
9
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 24th Feb 2017 00:59
Quote: " A Y ! NO FLICKER!

Thank you SO much! Is there a way to give you something akin to a medal or favorite or something?"


Actually there is click his profile button at the bottom of one of his posts and you can nominate him for an appropriate badge.
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.

Login to post a reply

Server time is: 2017-08-24 09:46:24
Your offset time is: 2017-08-24 09:46:24