Author Topic: Dynamic variables issue  (Read 4224 times)

TheThingIs

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 278
    • HCS Voicepacks
Dynamic variables issue
« on: December 28, 2016, 02:53:30 AM »
so I can do this:
Set integer [{TXT:EDDI commodity ejected commodity}] to [{TXT:EDDI commodity ejected commodity}] minus [{INT:EDDI commodity ejected amount}] (save value to profile)

but I can't do this:
Begin Integer Compare : [{TXT:EDDI commodity ejected commodity}] Is Less Than 0

it complains that I can't have colons in the variable name
The Singularity profile - One profile to rule them all and at HCS we bound them ;)

You see, TheThingIs, eventually you'll be allright.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Dynamic variables issue
« Reply #1 on: December 28, 2016, 07:35:04 AM »
Only the "Text" data type allows token input at the moment.

You can use the "{EXP:}" token to do your evaluation:
Code: [Select]
Begin Text Compare : [{EXP: {INT:{TXT:EDDI commodity ejected commodity}} < 0}] Equals '1'
    Write '[Purple] True' to log
End Condition

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Dynamic variables issue
« Reply #2 on: December 28, 2016, 09:25:02 AM »
I'll take a look at it.  Thanks for the heads-up!

TheThingIs

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 278
    • HCS Voicepacks
Re: Dynamic variables issue
« Reply #3 on: December 28, 2016, 04:01:55 PM »
Cheers Gary.

Pfeil, setting an integer with a token works fine, it's the compare which doesn't. Good work around though, thanks for that.
The Singularity profile - One profile to rule them all and at HCS we bound them ;)

You see, TheThingIs, eventually you'll be allright.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Dynamic variables issue
« Reply #4 on: December 28, 2016, 08:32:23 PM »
setting an integer with a token works fine, it's the compare which doesn't.
I was actually speaking in the context of "Begin X Compare" action, but I can see that could've been phrased better on my part.

TheThingIs

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 278
    • HCS Voicepacks
Re: Dynamic variables issue
« Reply #5 on: December 29, 2016, 06:34:55 PM »
someday we must teach Pfeil that there are other commands in VA not just EXP:

:p
The Singularity profile - One profile to rule them all and at HCS we bound them ;)

You see, TheThingIs, eventually you'll be allright.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Dynamic variables issue
« Reply #6 on: December 29, 2016, 09:00:16 PM »
EXP covers a multitude of sins ;)

Ok, so I've looked into this.  The reason that the text type works is because since it is text, it is doing a direct compare.  The resolved value of the token is used instead of the value of a variable.  It's a shorthand way of not having to resolve the value of a token ahead of time to do a text compare (saves a step).  Seems kind of out of place, but I recall somebody asking for it (I can't remember half the crap this thing does any more).  It doesn't resolve to a variable name, which is what you are trying to do with it.  You'll need to resolve the variable name ahead of time (sorry!).

TheThingIs

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 278
    • HCS Voicepacks
Re: Dynamic variables issue
« Reply #7 on: December 30, 2016, 06:29:26 AM »
That's fine, I can do what I need to do and that's all that matters :)
The Singularity profile - One profile to rule them all and at HCS we bound them ;)

You see, TheThingIs, eventually you'll be allright.