So we don’t have to create random values and have formulations to activate event based on the result.
I used to create temp and than random die values so when dice rolled it will act on the result like tabletop board games logic.
The arrays are like in js arrays
So bracket numbers act as index.numbers.
Also can we have array.length logic to optimize even further?
Edit: I am asking for array.length because authors can use it like thia,
Awesome! When will this version of Choice Script be included with CSIDE? Also, are these featured usable in production now or should wip games refrain from using them at the time?
Truly ecstatic to finally see this land. I hope it can help simplify many a startup.txt file!
Thank you for being open to (and tidying up) this contribution @dfabulich!
Sadly not. You can use create/temp_array to extend an existing array into two dimensions:
But unfortunately there is still some repetition (much less than before though!).
*delete my_variable
*delete_array my_array
Trying to refer to those same variables after such a command is used will cause a ‘non existent array/variable’ error. As Dan mentions above, there probably isn’t very often a practical use for them.
Awesome! When will this version of Choice Script be included with CSIDE? Also, are these featured usable in production now or should wip games refrain from using them at the time?
No. *create commands can only use strings and numbers, because if the player starts playing your game, pauses for a while, and then upgrades to a newer version with a new stat, the newer version must provide a static value for the stat.
So *create constitution 50 is fine, because if we have to create constitution in the middle of the game, we know what to set it to: 50. *create constitution ((strength + dexterity) / 2) isn’t allowed, because it’s not clear whether we’re supposed to use the player’s current strength and dexterity values, or the original values, or the new starting values (if they’re different).
I think it might make sense to allow *temp_array to have a dynamic length, but it doesn’t do that right now.
That’s a nett reduction of 164 lines of code, without losing any functionality!
I personally think the readability improves a lot as well, in most cases at least.
The only thing I thought when writing that is that perhaps I should have included a *set_array as well …, oh well, next time, maybe