What's the difference between d: and i:

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Hindsight2020
Posts: 261
Joined: Wed Mar 20, 2013 3:29 am
Location: Indiana, USA

What's the difference between d: and i:

Post by Hindsight2020 »

I don't really know how to look this up, but I'm lost on the difference between d: and i: when printing a message or using HudMessage. can anyone clarify?

HudMessage(s:"You must find ",
d:amount, s:" ", l:goals[goaltype],
s:"\nand destroy them.";
HUDMSG_TYPEON | HUDMSG_LOG, 0, CR_TAN, 1.5, 0.8, 5.0,
0.05, 2.0);

Thanks for any help.
User avatar
m8f
 
 
Posts: 1467
Joined: Fri Dec 29, 2017 4:15 am
Preferred Pronouns: He/Him
Location: Siberia (UTC+7)
Contact:

Re: What's the difference between d: and i:

Post by m8f »

As the wiki says, they are identical.
Code confirms that.
User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: What's the difference between d: and i:

Post by Nash »

To add - also, as the wiki says, we can assume "d" stands for "decimal" and "i" stands for "integer". Both are valid. :D
User avatar
Hindsight2020
Posts: 261
Joined: Wed Mar 20, 2013 3:29 am
Location: Indiana, USA

Re: What's the difference between d: and i:

Post by Hindsight2020 »

Thanks for the links and info! I don’t know why I couldn’t find it on the wiki!
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: What's the difference between d: and i:

Post by Graf Zahl »

It's the same in C with printf - probably where the cue was taken from.
User avatar
MartinHowe
Posts: 2095
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Location: East Suffolk (UK)

Re: What's the difference between d: and i:

Post by MartinHowe »

I imagine this is a case of giving the default representation of something its own flag: i defaults to decimal as that's what humans use, x for lowercase hexadecimal, X for uppercase hexadecimal, o for octal; etc.; I guess giving the default integer representation its own explicit flag is for consistency: don't break Principle of Least Surprise :)
Post Reply

Return to “Scripting”