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.

Dark GDK / Newbie with a silly question

Author
Message
newbie help
16
Years of Service
User Offline
Joined: 19th Jan 2008
Location:
Posted: 19th Jan 2008 22:23
I know I know - its a really silly question, but im determind to give it a go.

I am trying to set some variables... ie

Soldiers = 100


dbprint("You have" ; Soldiers "Left")

help much appreciated
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 20th Jan 2008 00:20 Edited at: 20th Jan 2008 00:20


If that is what you were asking for, because there's no question in your post
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 20th Jan 2008 00:21
I have tried this and cannot get it to work either!

The Print statement in DBPro would work as follows:

Print "You have "; Soldiers; " left"

I'm not sure that the documentation for dbPrint can be quite right as it states that the print list can be seperated by a semi-colon or a comma. If you attempt to use a semi-colon then the C++ compiler will see this as a statement terminator! Seperating with a comma doesn't work and I could never see how it could!

The dbPrint function clearly only takes a single argument, although it can be one of four types. So I can't see how your syntax would ever work either.

It could be the documentation is misleading. It certainly wouldn't be the first time!

I personally would use the following:



Not the most elequent of code but it works. You could easily convert it into a function and then the call becomes a single line as follows:

PrintLine(StartText, Value, EndText, XPos, YPos).

If anyone knows how the dbPrint statement is supposed to work I'd be interested. My guess is it just takes a single argument and no longer supports a list of values and TGC have just not bothered to update the documentation.

No matter how good your code is, someone will improve on it
Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 20th Jan 2008 00:36
Just saw Tempicek's suggestion which is more concise.

Interestingly, I just looked through the DarkSDKCore.h header file and found an undocumented version dbPrintC which appears not to append a CR/LF pair to the string.

So the following would probably work too:



Personally, I'd go with tempicek's suggestion.

No matter how good your code is, someone will improve on it

Login to post a reply

Server time is: 2024-09-29 09:26:09
Your offset time is: 2024-09-29 09:26:09