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 Discussion / Help with a Myst style engine

Author
Message
Ocean Runner
22
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 18th May 2005 09:47
Hello,

I am coding a myst-stylr engine for adventure games (point and click slideshow), but am having some problems. With multiple hotspots, some of them go really slowly, or don't work at all, and I was wondering if anyone had any ideas as to how I could fix it. The code and all media is attached. In the attached folder, the file "txt sample.txt" shows the format of the data files for each image. Read the planned part instead of the current part, the current is out of date. Also, ignore the bottom two lines. Anyway, every file has a data file with hotspot data accompying it. The program reads the image and it's file and then checks to see if a hotspot is pressed, but sometimes instead of going directly to the pressed slide, it will pause for a second or two or not go to the other slide at all.

Any help would be appreciated.

-Logan

"Computers in the future may weigh no more then
1.5 tons. - Popular Mechanics, 1949

Attachments

Login to view attachments
zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 18th May 2005 10:17 Edited at: 18th May 2005 10:35
I tried looking at your code and I possibly see a few things off.


As far as coding, I think there is a problem with the 2 do loops. I would stay away from this. Have code before your loop to initialize. Have one do loop. If you need to load the init code again, put it in a subroutine that can be called from the main loop.

More importantly, It seems that in your code if your over a hotspot and click the mouse you skip over the sync command in the loop by using a goto to the label Begin:. I don't think that this is a good idea.

I can try to recode it a little and see if it works.

~zen

edit:
Ok I made some changes, and added a realease of the mouseclick routine. The reason. The loop runs pretty fast so If you don't check for a release the images were switching back and forth on a single click. I also added a sync rate 60. Seems to work pretty good



hope that helps

~zen


Ocean Runner
22
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 18th May 2005 11:00
Thank you so much! As for the text files, darkbasic can read them fine - darkbasic wrote them as words (not strings, still numerical) with the write word command, but you can't read them outside of darkBAsic. I was thinking about converting them all to strings, just so I could edit them easier.

"Computers in the future may weigh no more then
1.5 tons. - Popular Mechanics, 1949
zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 18th May 2005 11:17 Edited at: 18th May 2005 11:18
@Ocean Runner,
Quote: "As for the text files, darkbasic can read them fine - darkbasic wrote them as words (not strings, still numerical) with the write word command, but you can't read them outside of darkBAsic."


Yeah, I realized that after I posted and then edited my post before your response.

Good luck with your game. It looks like a good start.

~zen


Ocean Runner
22
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 19th May 2005 12:00
Alright, I have modified the create2.dba file that was there was earlier, so now it is a functional editor. You can load a .med file, and then edit it's hot spots.

Instructions:
To start creating a hotspot: right click
To finish creating a hotspot: left click
for destination and cursor, just enter in 0 and 0
to save press "s"

When I edit the 2.med file (i am not sure whether it does this on the 1.med file), and the save function closes the currently open file, deletes the physical file, then attempts to actually create the file with the "open to write" command, it always generates the error: cannot open file to write. I have no idea why it is doing this. Does anybody have any idea why it is doing this? It is bothering me. Please find the data and code attached.

"Computers in the future may weigh no more then
1.5 tons. - Popular Mechanics, 1949

Attachments

Login to view attachments
zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 20th May 2005 07:27
Ocean Runner,

I'll have a look at it tonight; if noone has posted by then. I think I understand what you are saying, but I'm not sure. I'll look it over and see what I can come up with.

~zen


Ocean Runner
22
Years of Service
User Offline
Joined: 18th May 2003
Location: United States
Posted: 20th May 2005 09:07
Nevermind, I figured it out - the problem was that I was trying to access a local variable inside a function.

"Computers in the future may weigh no more then
1.5 tons. - Popular Mechanics, 1949
zenassem
22
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 20th May 2005 10:40
Quote: " Nevermind, I figured it out - the problem was that I was trying to access a local variable inside a function."


I can't tell you the number of hours I have spent ripping apart code, only to find myself making that very same mistake.

I'm glad you found what it was. Keep up the good work Ocean Runner.

~zen


Login to post a reply

Server time is: 2025-05-23 04:20:26
Your offset time is: 2025-05-23 04:20:26