7thbeatgames / rd

This repository is to track player feedback for a rhythm game 'Rhythm Doctor'.
https://7thbe.at
9 stars 0 forks source link

RDCode typecasting #37

Open 9thCore opened 1 year ago

9thCore commented 1 year ago

Please Check

What problem motivated you to submit the suggestion?

It is currently impossible to cast a variable into another type without using an intermediary variable, which would be helpful in cases like using the % operator on floats, floor-ing a float, or casting into a char to have variable text (currently impossible without one event+conditional per value).

Suggestion / Solution

By doing (type)variable, variable would be casted into the type type.

Alternatives & Workarounds

f0 = (int)23.1 % 10 throws the error ERROR decoding (int)23.1 % 10 in custom method f0 = (int)23.1 % 10: System.NullReferenceException. f0 = {(int)23.1} % 10 throws NullReferenceException and the level doesn't load. Using an intermediary variable i0 = f0, f0 = i0 % 10 works but uses up one of the 12 integers we have.

Demo & Mockup

image

Note

No response