The CreatorCon Call for Content is officially open! Get started here.

Script - how to set a constant value for a var script? also some equation questions too.

alberttagle
Tera Contributor

Hi,

I'm not entirely sure where to look on why this script is not working.  I have very limited knowledge on scripting, but will get some education very soon, yet I have a deadline coming up for this.  Hope someone can help.

find_real_file.png

RED BOX: I'm trying to set a constant value for each VAR I created.  Is this done correctly? or it needs some other scripting?

GREEN BOX: The value which will be input manually in a single text field, will always be divided by 1024, so I'm trying to come up with a VAR for it. Can I script it like this?

BLUE BOX: here, I placed the "equation" in the script, so the output will be in the 'price' variable.

Maybe I'm doing the entire script too simple, and apparently wrong.

Please help.

 

Thanks!

19 REPLIES 19

Archana Reddy2
Tera Guru

Hi Albert,

You might be facing this issue because of the following line of your code.

if(env==dev&&crit==l .....)

I believe it should be as follows.

if(env=='dev'&&crit=='l' .....)

 

Hope this helps!

Thanks,

Archana

Hi Archana

I tried removing the substitutes and used all values as they originally are, but still not working:

find_real_file.png

May I know what you meant by sustitutes?

Also, what all are the outputs of env?

Are they dev, prod, ---?

If yes, use the following as suggested earlier.

if(env=='dev'&&crit=='l' .....)

 

Thanks

Hi Archana.

Sorry for the non-developer description.  Substitutes - I was referring to var dev = 'Development' ,etc.

To take one more step further on your suggestion, I completely deleted those var dev, var test, var pp and var prod from the script, and used the original values (Development, Test, Pre-production and Production) directly in the if statement like I posted in my prior reply.

Yet the script still didn't work.

Please let me know the field types of the following fields.

whatenvironmentforpricing

criticalitytypeforpricing