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.

Bug Reports / DBPRO 7.5 - "ink rgb" may break "disable escapekey"

Author
Message
Marco A G Pinto
17
Years of Service
User Offline
Joined: 26th May 2006
Location: Portugal
Posted: 8th Jan 2011 21:46
Hello!!!

I was coding and I believe I have found a bug in DBPRO 7.5:

disable escapekey
ink rgb(0,0,0),rgb(255,255,255)


works okay.

But if, instead, you use:
disable escapekey
ink rgb($00,$00,$00),rgb($ff,$ff,$ff)


if while playing the game you press the <ESC> key it exits to Windows.

Of course that my code is large but I have been able to narrow the behaviour to the INK RGB command.

Kind regards,
>Marco A.G.Pinto
---------------
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jan 2011 23:32
Should that second snippet even compile?
Marco A G Pinto
17
Years of Service
User Offline
Joined: 26th May 2006
Location: Portugal
Posted: 9th Jan 2011 16:58
yes, it compiles and it works (changes the colour of the text).

Except that it breaks the command to turn off the <ESC> key.


Kind regards,
>Marco A.G.Pinto
---------------
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jan 2011 12:29
What does $00 mean?

Quote: "(changes the colour of the text)"


Doesn't on my machines - I just get a black screen whatever numbers I use after the $s. Yes the esc key is not disabled but I suspect something else is wrong here.

Standard hex notation works fine:

Marco A G Pinto
17
Years of Service
User Offline
Joined: 26th May 2006
Location: Portugal
Posted: 10th Jan 2011 16:59
Hello Green Gandalf!

"$" also means hexadecimal, so $00=0x00=0 and $FF=0xFF=255



Kind regards from Marco
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Jan 2011 19:18
Who told you that?

Try this:

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 10th Jan 2011 20:06
It does compile, and it may work in your particular example but that's only because you're expecting $00 to be 0. $55 would return 0 as well.

0x is the prefix DB uses for hex.

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Jan 2011 11:36
Quote: "$55 would return 0 as well."


As my snippet shows.
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 12th Jan 2011 17:22 Edited at: 12th Jan 2011 17:23
and why would you use rgb() when you can just
ink 0x000000,0xFFFFFF or whatever values
instead of
ink rgb($00,$00,$00),rgb($ff,$ff,$ff)

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Jan 2011 21:21
Quote: "and why would you use rgb() when you can just
ink 0x000000,0xFFFFFF or whatever values
instead of
ink rgb($00,$00,$00),rgb($ff,$ff,$ff)"


That doesn't always work for me. I'll use the hex value once in awhile, but sometimes it won't work.

"Only the educated are free" ~Epictetus
"Imagination is more important than knowledge..." ~Einstein
Diggsey
18
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 5th Feb 2011 12:44
Hex values always work as long as you put an extra 0xFF at the start like this:


The reason being that the first byte of a colour is the alpha value, and so if it is set to zero any commands which accept alpha will not draw anythhing.

[b]
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 6th Feb 2011 22:44
Hey Diggsey, good tip, thanks! I'll remember that.

Login to post a reply

Server time is: 2024-04-25 01:29:31
Your offset time is: 2024-04-25 01:29:31