Strings as numbers

Started by planetfall, February 20, 2014, 08:26:56 PM

Previous topic - Next topic

planetfall

It turns out that the following works:

"64" "64" "1" SetCreeper

Is this a bug, or intentional? Because a script I plan on using relies on this, but I will create a workaround if it is likely to be patched.
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

Crimson King

Not exactly sure why you need to use strings as numbers with SetCreeper since there is no need to use a string with that command. It is probably a good idea to at least look into a workaround even if it doesn't get patched.

planetfall

I didn't intend it for SetCreeper specifically, it was just a simple example to show that it's a thing. The use I had in mind was my Mounted Runner Nest, which spawns runners with different crpl units "riding" them. Specifically, so that the spawned core's variables would be controlled by a single input variable to the nest for all ints, floats and strings.
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

knucracker

That is working as designed. When a command pops an item from the stack it coerces it into the type that it requires. So a string in the correct format will coerce to a non zero value.

Flabort

Wait... totally unrelated, but I just realized that I can script my ciphers super easy in crpl!
This just... reminded me. Yes.
My maps: Top scores: Sugarplum, Cryz Dal, Cryz Torri, Cryz Bohz (Click fetch scores, page courtesy of kwinse)

planetfall

Quote from: virgilw on February 20, 2014, 10:32:47 PM
That is working as designed. When a command pops an item from the stack it coerces it into the type that it requires. So a string in the correct format will coerce to a non zero value.

All right!
(goes on to destroy world)
Pretty sure I'm supposed to be banned, someone might want to get on that.

Quote from: GoodMorning on December 01, 2016, 05:58:30 PM"Build a ladder to the moon" is simple as a sentence, but actually doing it is not.

Annonymus

#6
@planetfall After you're done with all your maps/plans/scripts we will have a whole new game to play :P
If a topic started by me is in the wrong place feel free to move it at anytime.