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.

Code Snippets / [DBC] Mystical Magic - A puzzle programme. Extensively re-written

Author
Message
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 18th Oct 2007 09:53 Edited at: 28th Oct 2007 10:53
Hi everybody! This is a fun programme. It's Puzzle Number 1 from my Merlin's Wide and Wonderful World of Mystical Magic series but without the media.

It was first Posted: 28th Dec 2006 01:28 (now locked) but has been extensively re-written, putting to use some of the things I have learned over this time.

Here though, I’ve used the sync commands for the first time in any of my programmes and I’d be interested to know if they have been used correctly and if the rem statements describe them properly. They appear to be doing what I want.

Whilst gosub with no return works, a reply from TDK_Man to something I submitted on the TGPF forum says:

Quote: "Yes, that code snippet works, but it corrupts the stack - that's why it should never be used.

The stack is very limited in size and any values placed on it, eventually fill it up if not removed.

Return is the command which removes items from the stack and any program which uses Gosub with no Return uses stack space which cannot be recovered. OK, that example may not cause a program to grind to a halt, but it does lessen the amount of stack space available for other parts of your program which may need it."


Any suggestions then on how my gosub start could be re-written would be appreciated.





****************************** EDIT ************************

The programme above will not work properly with DB Classic V1.2 due to the altering of the text sizes in the upgrade.

Latch has written a text conversion function that corrects the text problem. See his posting 22nd Oct 2007 10:52 below, where he has reproduced the programme with the implementation of the function.

Unfortunately, a straight conversion produces a somewhat smaller sized text and I find that where I was using, for example, size 21 with earlier versions of DB Classic, I now have to use size 24 to get a comparable result.

So, for the FINAL TIME, here is the programme, yet again rewritten.

Whilst TDK_Man pointed out in

http://www.computechtenerife.com/forum/index.php/topic,186.0.html

Quote: ""DB Classic is very 'iffy' with Syncs and Text - especially when using different sized text on the same screen. It often requires a double-sync or the text flashes or doesn't appear. It can get quite messy!”"


the programme, as written, works fine on my computer system:

OS is Microsoft Windows ME 4.90.3000
Processor is Authentic AMD AMD.K6(tm) 48.0MB RAM

My thanks to TDK_Man and Latch for your information.

Latch, I have taken the liberty of modifying your function to use when I require to change fonts. Hope you don’t mind.



gearce
(GRC)

LANG MEY YER LUM REEK
That's ODD ...... In 1911, 3 men were hung for the murder of Sir Edmund Berry at Greenbury Hill, their last names were Green, Berry, and Hill.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st Oct 2007 20:03 Edited at: 21st Oct 2007 20:12
you need to sort the text out, it's too big and positioned badly.
I'll check it out later.

[edit]
No it's not sorry, it's just I've downloaded the new version of DBC 1.2 and text sizes are a bit different.

gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 22nd Oct 2007 04:25 Edited at: 22nd Oct 2007 04:30
Thanks OBese87.

Quote: "No it's not sorry, it's just I've downloaded the new version of DBC 1.2 and text sizes are a bit different."


I haven't downloaded the new version of DBC 1.2 yet but I have been made aware of the fact concerning different text sizes on the same screen.

Quote: "DB Classic is very 'iffy' with Syncs and Text - especially when using different sized text on the same screen. It often requires a double-sync or the text flashes or doesn't appear. It can get quite messy!

Oh yes - and it doesn't work properly with DB Classic V1.2 due to the altering of the text sizes in the upgrade. It's worth mentioning this as many people have upgraded to the new version (it is well worth it) and your program won't work for them."


http://www.computechtenerife.com/forum/index.php/topic,186.0.html

gearce
(GRC)

LANG MEY YER LUM REEK
That's ODD ...... In 1911, 3 men were hung for the murder of Sir Edmund Berry at Greenbury Hill, their last names were Green, Berry, and Hill.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Oct 2007 18:52
@gearce

I had written a text conversion function that corrects the text problem in 1.2 (for the most part it seems) and it doesn't interfere with 1.13. Here's is your program with my function implementation. The function is at the end and I replaced occurrences of Set Text Size with the function set_text_size():



Enjoy your day.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 23rd Oct 2007 03:42 Edited at: 26th Oct 2007 07:17
Thanks Latch. Much appreciated.

Just going to run it now.


gearce
(GRC)

LANG MEY YER LUM REEK
That's ODD ...... In 1911, 3 men were hung for the murder of Sir Edmund Berry at Greenbury Hill, their last names were Green, Berry, and Hill.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 28th Oct 2007 10:51
My original posting 18th Oct 2007 01:53 has been updated.

Thanks!

gearce
(GRC)

LANG MEY YER LUM REEK
That's ODD ...... In 1911, 3 men were hung for the murder of Sir Edmund Berry at Greenbury Hill, their last names were Green, Berry, and Hill.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 1st Nov 2007 06:35
is there a way of checking which version the user is running?

"You must be someone's friend to make comments about them." - MySpace lied.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 2nd Nov 2007 02:52
Hey gearce,

I think I figured out the font problem. I know, I know... after the works arounds and updated code!

It seems that this new version of DBC requires the character set code when the font type is changed. I was doing a series of tests and I couldn't figure out why the DBC fonts weren't matching my installed fonts or not changing or sizing correctly except in a few situations... to make a longer story shorter - It seemed to be the character sets.

So if you want to do away with my workaround function, try
SET TEXT FONT "name",1 (name is the name of the font and one is the english character set) where ever you are changing the typeface.

Enjoy your day.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 2nd Nov 2007 08:25
Latch

Quote: "SET TEXT FONT "name",1"


Thanks for that.

This worked under DB Classic v1.12 as well.

Was it known? If so, anyone programming in this way wouldn't have any problems in a changeover to v1.2.

It's my opinion but, for what it's worth, I don't think DB Classic was or is really well documented.

gearce
(GRC)

LANG MEY YER LUM REEK
That's ODD ...... In 1911, 3 men were hung for the murder of Sir Edmund Berry at Greenbury Hill, their last names were Green, Berry, and Hill.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 2nd Nov 2007 19:21
Quote: "Was it known?"


I don't think the reason for the font size change in 1.20 was known (check out Newsletter 57) but the command
SET TEXT FONT "name",character_set
is documented in the DBC text. The character_set is optional so most people don't bother adding it. Version 1.20 probably defaults to 0 instead of whatever your system default is.

I posted the fix in the thread about the 1.2 release:
http://forum.thegamecreators.com/?m=forum_view&t=116008&b=10

Enjoy your day.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 3rd Nov 2007 02:12
Thanks Latch.

I should have taken the time to search and read up on the subject.

gearce
(GRC)

LANG MEY YER LUM REEK
That's ODD ...... In 1911, 3 men were hung for the murder of Sir Edmund Berry at Greenbury Hill, their last names were Green, Berry, and Hill.

Login to post a reply

Server time is: 2024-11-22 13:19:46
Your offset time is: 2024-11-22 13:19:46