Can you export a formula for scriptable object (resource)?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DJ_Fail87

By scriptable objects I am referring to doing this:

And I am thinking about a system for creating spells/powers that uses scriptable objects for ease of editing skills as shown in the video above. What I want is something similar to what you have in RPG Maker where you can enter a damage formula for it to use into a box.
Is there anyway to do this with Godot? Or would I be better off making various functions to be called that have different formulas, and just have an export var with a list of the formulas?

:bust_in_silhouette: Reply From: ponponyaya

Someone already did this. Here’s his/her example video.

Looks cool! But I didn’t see any links to download or view it, and google didn’t turn it up.

DJ_Fail87 | 2022-02-27 15:37

Yes, that example is private, I can’t get that project neither. It just show that someone can do it in Godot.
If you want do it yourself, here are some tips:
1.Use node LineEdit to get user input.
2.Use class Expression to deal with the formula you got from user input. If you don’t know what is Expression, look at this page.

ponponyaya | 2022-02-27 23:35

I did not know about the .parse. I was thinking of using match and STRING.split() to break down a string function. Thank you very much!

DJ_Fail87 | 2022-03-04 15:47