Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Would it break the game if I stuck some commas/periods in the numbers?  (Read 1284 times)

LMeire

  • Bay Watcher
  • Likes Troglodytes for their horradorability.
    • View Profile

Simply put: I would like to know at least how to read the RAWs, but I suck at reading long numbers; anything past 4 digits is just too incomprehensibly high/low for me to get an accurate feel for what the number represents, and trying to do even a simple calculation with them is hopeless. Is "7890567034" good or bad? I haven't the slightest clue! But I'm okay with reading things like "7,890,567.034" because it's apparently broken up enough to seem like simple addition or whatever.

So basically, all I want to know is: How broken would the code get if I stuck some proper "math grammar"? And if the answer is "Too broken.", I suppose my next question would be: Is there a free program I can get that automatically takes those out so I can read one version and play with another?
Logged
"☼Perfection☼ in the job puts pleasure in the work." - Uristotle

Urist McCoder

  • Bay Watcher
    • View Profile

First of all there are no decimals in dwarf fortress raws, second I have no idea what would happen if you stuck commas in there. But for most coding languages commas really mess things up, so I suggest you do some !!science!! and tell us what happens.
Logged

Enemy post

  • Bay Watcher
  • Modder/GM
    • View Profile

What if OP just makes empty spaces instead of punctuation marks? I suspect it won't work though.
Logged
My mods and forum games.
Enemy post has claimed the title of Dragonsong the Harmonic of Melodious Exaltion!

LMeire

  • Bay Watcher
  • Likes Troglodytes for their horradorability.
    • View Profile

So apparently it does indeed break the game if you try to play with spaces in the RAW numbers for "punctuation". I added spaces in all the metals resulting in iron swords being slightly more effective than styrofoam and candy harmlessly boiling away in a weird red cloud. I'm guessing the game just ignores everything after the space, so a boiling point of 10,000,000 or so becomes a boiling point of 10.

Spoiler (click to show/hide)
Logged
"☼Perfection☼ in the job puts pleasure in the work." - Uristotle

Rydel

  • Bay Watcher
    • View Profile

In programming, commas have specific meaning, usually separating multiple pieces of data.  So, at best, a computer read 10,000,000 as 10, 0, and 0.  Spaces typically work in a similar way, much like the difference between "together" and "to get her."

Often, sticking a non-number in a number makes a computer view is as being text instead of a number.  So, you kind of lucked out on it just making everything weaker.  There was a good chance it just wouldn't launch at all.

Syntax is very important to computers, to the point where incorrect capitalization can prevent entire programs for compiling, because the computer isn't aware that "Stone" and "stone" are supposed to be the same thing.

Hugo_The_Dwarf

  • Bay Watcher
  • Modding Mentor
    • View Profile
    • Regeneration: Forced Evolution

If reading the numbers is too hard just put it next to the tag using it as a comment like:

[HEAT_DAM_POINT:25000000] 25,000,000
Logged

Urist McCoder

  • Bay Watcher
    • View Profile

What hugo said, wow it took four people to come up with the obvious solution.
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile

In programming, commas have specific meaning, usually separating multiple pieces of data.  So, at best, a computer read 10,000,000 as 10, 0, and 0.  Spaces typically work in a similar way, much like the difference between "together" and "to get her."

Often, sticking a non-number in a number makes a computer view is as being text instead of a number.  So, you kind of lucked out on it just making everything weaker.  There was a good chance it just wouldn't launch at all.

Syntax is very important to computers, to the point where incorrect capitalization can prevent entire programs for compiling, because the computer isn't aware that "Stone" and "stone" are supposed to be the same thing.

Dwarf Fortress's raws are very good at handling errors. It will not crash just because of a bad token argument.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile

No, it does something worse. It goes happily on without informing you that something is wrong so bug hunting is a pain.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile

I said very good at handling them, not very good at helping you fix them :P

Like Javascript!

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: Would it break the game if I stuck some commas/periods in the numbers?
« Reply #10 on: March 14, 2015, 11:28:14 pm »

...that explains why the screen spit magma at me last time I tried to play with tweaking some javascript.
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: Would it break the game if I stuck some commas/periods in the numbers?
« Reply #11 on: March 15, 2015, 03:17:58 am »

Even worse would be using : somewhere, because DF thinks that the argument is over. Never use it in descriptions, pref-strings, names, etc...
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Would it break the game if I stuck some commas/periods in the numbers?
« Reply #12 on: March 15, 2015, 03:26:06 am »

Yeah, [ ] and : are special characters in the raws. All of them will break things if misplaced, though only when matched (for []) and between brackets (for :)
« Last Edit: March 15, 2015, 02:44:10 pm by Putnam »
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: Would it break the game if I stuck some commas/periods in the numbers?
« Reply #13 on: March 15, 2015, 07:38:32 am »

It's kinda amazing having an example of a symbol which can screw things up when misplaced turn into a smiley.
Logged