Author Topic: VA tokens issue with plugins  (Read 2218 times)

TheThingIs

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 278
    • HCS Voicepacks
VA tokens issue with plugins
« on: January 18, 2018, 03:17:25 AM »
Hey G,

So, I've started messing with writing plugins....oh dear :D :D

when I set a variable with

vaProxy.SetText("soundsPath", "{VA_SOUNDS}\hcspack-alix\")

it seems that VA doesn't parse the token and resolve it. I can't properly tell as writing the var to log obviously resolves the token but when I use that var in a DIRECTORYEXISTS or others it doesn't work. If I save the var to profile and read it in again then it works fine.

Am I correct? Obviously I can work around this but wasn't sure if this is a bug or intended.

Lee

edit: same for things like %USERPROFILE% as well
« Last Edit: January 18, 2018, 05:48:26 AM by TheThingIs »
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: VA tokens issue with plugins
« Reply #1 on: January 18, 2018, 07:35:13 AM »
Quote
So, I've started messing with writing plugins....oh dear

May God have mercy on us all.



That's working as intended.  It's not doing anything other than setting the variable's value.  You have the flexibility to determine what is parsed and what is not before you set the value to your variable with the proxy object.  Do this instead (shooting from the hip):


vaProxy.SetText("soundsPath", vaProxy.ParseTokens("{VA_SOUNDS}\hcspack-alix\"));

Look up the, 'ParseTokens(value)' function in the help document.


Good luck, Commander!

TheThingIs

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 278
    • HCS Voicepacks
Re: VA tokens issue with plugins
« Reply #2 on: January 18, 2018, 09:46:34 AM »
and boy do I need all the luck I can get!
The Singularity profile - One profile to rule them all and at HCS we bound them ;)

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