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 / Using Plant Maps UPDATED QUESTION

Author
Message
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 17th Aug 2011 05:52 Edited at: 17th Aug 2011 05:55
Hello, I tried to use the demo off this thread :

http://forum.thegamecreators.com/?m=forum_view&t=85472&b=6

I even EMAILED him for an answer about the error in his code that he is showing on the thread above, and I got the "FAILED" and "EMAIL RETURNED" status on his email. So I have no way to ask him nor will this forum allow me to post on that thread since its so old now.

So here is my question :

I downloaded his media and followed his directions to get this demo working. I even am using his updated EDIT code where the wind makes the grass move.

But I get this error when I compile it :

Variable 'random' name is not valid at line 74.


And here is what is at Line 74 :

grass1Obj = freeObject() : Make Object Plain grass1Obj, grassSize, grassSize, 1


Now the problem is, he supplied all the media files in the download ZIP but not the actual code. You have to get his code off the thread itself and I had to manually take out all the \ that he says this forum put in his code.

So I have followed his directions carefully, but I still get that "random" error when I try to compile his code.

The thing is, its in the code snippets section of this forum. So I am trying to test it out and see what it does.

anyone have any idea ?

"If you can sing that high, you must have been kicked in the crotch a little too hard."
Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 17th Aug 2011 06:02
Try using the find function to find any instance of "random" and change it to a different variable name. (such as "myrando", because DBPro sometimes dislikes keywords inside variable names)


Why does blue text appear every time you are near?
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 17th Aug 2011 06:13 Edited at: 17th Aug 2011 06:13
@HF Hey there, thanks for the fast reply. Ok I changed it from Random to myrando in 2 different places. Those were the only two instances of random I could find.


Now I am seeing a new error..

The name 'wrapNumStraight' duplicated in the program at line 350.

Which then points to line 37:

Function wrapNumStraight(value As Float, valueInc As Float, minValue As Float, maxValue As Float)


And I looked in the code and I found no duplicates.


It points to that function in the program and there is no line 350 in the code. The code stops at line 313.

"If you can sing that high, you must have been kicked in the crotch a little too hard."
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 17th Aug 2011 06:23 Edited at: 17th Aug 2011 06:25
Ok, I took out ALL the functions that said it was duplicate. What I got left was a shell of a program :



And so now I get a new error :

Subscript must be Integer or DWORD when referencing an array at line 9.

Which points to this :

oTerrain = terrainCreate("1", 2.0, 0.0, 0.0, 0.0)


Is this why this code is no longer supported ? Is there something I am missing ? I just don't understand why this would show grass when most of the functions were removed because they were duplicated. Unless the Matrix1 Utils has something to do with this.

If that is the case, how can I make this work ? And if you notice, no media would load now, because there is no function to call it. I think this code is useless now since so many things were duplicated. This is why this is so frustrating to us noobs.

"If you can sing that high, you must have been kicked in the crotch a little too hard."
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 17th Aug 2011 12:15
This works, you had to replace the 2 random vars to something else.
I used randomValue.
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 17th Aug 2011 17:14
Yea, I did that too. And I get these errors :

The name 'vegetationUpdate' duplicated in the program at line 206.

and the IDE points to this on line 38 :

Exclude Object Off vegetation(i)


This is why its frustrating. I have all the Matrix1 Utils installed, I installed ALL the plugins that came with bananza except the DarkGDK stuff. I also have BlitzTerrain installed.

So is there a conflict somewhere because of it being a duplicate ?

"If you can sing that high, you must have been kicked in the crotch a little too hard."
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 17th Aug 2011 17:42
Try creating a new empty project with the code from my last post.
I had a problem with duplicated function names once, while there was only one function. Creating a new project helped for me.
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 17th Aug 2011 18:36 Edited at: 17th Aug 2011 18:40
You are forced to create a new project because the guy who made the demo in the first place never put the source code with the ZIP file. You have to copy and paste it every time. Which is what I did with yours. But I still get that error.

He only pasted his code to the forum. He never put it in the ZIP file with the pics / media.

EDIT : I attached the whole project to this post. Download it and see if I am missing something. ONLY if you have time. I understand how busy people are.

"If you can sing that high, you must have been kicked in the crotch a little too hard."
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 17th Aug 2011 18:46
I had the same problem when trying your code, but copying all the code and creating a new project fixed it.
See attachement. gr.dbpro doesnt work, gr2,dbpro does, exact same code.
JackDawson
14
Years of Service
User Offline
Joined: 12th Jul 2011
Location:
Posted: 17th Aug 2011 18:53
Holy cow. That works. I don't get it. I created a new project and it wont work. Something in my settings somehow bugs it out.

I'll work on trying to fix my bug. But thank you for the help bro. Your a genius.

"If you can sing that high, you must have been kicked in the crotch a little too hard."
Mugen Wizardry
User Banned
Posted: 17th Aug 2011 18:55
You want Plants and trees generated randomly? Help me fix my version of the LandScape Generator

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !

Login to post a reply

Server time is: 2026-07-10 17:19:40
Your offset time is: 2026-07-10 17:19:40