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 / how to insert notepad

Author
Message
BEAST
10
Years of Service
User Offline
Joined: 11th Jun 2012
Location: the gamecreators.com
Posted: 4th Oct 2013 20:27
how to insert a notepad into dark basic

BM
Ortu
DBPro Master
14
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 4th Oct 2013 22:10
if you mean work with a .txt file, you can open it to read or write using the file commands. you can see what file commands are available by pressing F1 in the editor .

Phaelax
DBPro Master
19
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Oct 2013 18:15
BEAST
10
Years of Service
User Offline
Joined: 11th Jun 2012
Location: the gamecreators.com
Posted: 5th Oct 2013 18:51
thanks

BM
BEAST
10
Years of Service
User Offline
Joined: 11th Jun 2012
Location: the gamecreators.com
Posted: 5th Oct 2013 21:34
caves(13).npc = NPC_Sage
caves(13).caption = "time.txt"
caves(13).noRepeat = TRUE
caves(13).itemCount = 1
caves(13).item_2_id = CAVE_ITEM_SWORD : caves(13).item_2_image = ITEM_IMAGE+ITEM_WOODEN_SWORD : caves(13).item_2_price = 0
i got an error

BM
Ortu
DBPro Master
14
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 5th Oct 2013 23:16
What is the error? You haven't given us enough information to help you.

Phaelax
DBPro Master
19
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Oct 2013 05:32
I recognize that code, its from my zelda game.

But yes, we need to know what your error is.

BEAST
10
Years of Service
User Offline
Joined: 11th Jun 2012
Location: the gamecreators.com
Posted: 6th Oct 2013 23:33
i want to create an if function so when my main character walk into the cave my program automatically access my txt file and write everything in darkbasic just like in the beginning of tour zelda

BM
Derek Darkly
10
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 7th Oct 2013 20:33
Can't you just use OPEN TO READ and READ STRING?

D.D.
Ortu
DBPro Master
14
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 7th Oct 2013 21:28
right, and you wont need a seperate if block, the code that changes from the overworld graphics to the cave graphics can trigger reading the text as well

Phaelax
DBPro Master
19
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 9th Oct 2013 01:12
The overworld map is contained in a map array. What's drawn to the screen is stored in a viewport array, which is only 16x11 tiles. When entering the cave, the viewport is loaded with data about drawing the cave rather than pulling data from the map array. In the function which updates this viewport during cave entrance, this is where you're wanting to put your file access.

If your text file is fairly small, I'd suggest loading it at the beginning of the cave rather than each and every time you enter a cave. That way you're not constantly reading from the harddrive.

Over the next several weeks, I will be writing an extensive tutorial about my zelda game. If you're planning to make a similar game based on my code, it might be a good idea to read it after it's released.

BEAST
10
Years of Service
User Offline
Joined: 11th Jun 2012
Location: the gamecreators.com
Posted: 10th Oct 2013 06:12
okay thanks

BM

Login to post a reply

Server time is: 2022-06-27 05:56:40
Your offset time is: 2022-06-27 05:56:40