Author Topic: MSFS Voice Attack Plugin - Question  (Read 3325 times)

craigt47

  • Newbie
  • *
  • Posts: 9
MSFS Voice Attack Plugin - Question
« on: January 06, 2024, 02:11:07 AM »
Hi All,

I am just starting out learning how to use this tool and how to integrate it with the MSFS plugin tool https://github.com/jamescl604/MSFSVoiceAttackPlugin. I have some very general questions to help me to get going as i am stuck right now.

Here is the situation i am trying to build:
I would like a helicopter to start on the ground at 0ft and then climb to 6ft, at 6ft i want an audio file to play.

Questions:
Is this possible in VA?

I have the following setup in VA

1.  debug boolean set (SS 125156)
2. Play intro sound - working
3. I am then calling the getplanestate (SS 125333): Which i should get the heli altitude from the ground = 0ft
4. I then have a Integer condition (SS 125751): which uses the MSAgent.PlaneState.Plane_Alt_Above_Ground command to fetch the heli Alt and would check to see if the heli is at 6ft or more= if yes = if should play sound.

However, what is happening:
1. Debug Starts
2. Sound plays
3. Then i get a error "MSFS Agent' command not found in this profile.  Agent standing down." (SS 130659)

What is causing this?

I am guessing that i need to do the following: but i am not sure how to do this in VA

1. Play sound
2. get plane state
3. Set condition:
a. if plane is 5ft or below - repeat check and keep checking until plane is at 6ft
4. At 6ft play sound


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4647
  • RTFM
Re: MSFS Voice Attack Plugin - Question
« Reply #1 on: January 06, 2024, 02:14:46 AM »
Have you read the documentation for the plugin you're attempting to use? It literally mentions that you need the command that doesn't exist in order for the plugin to work as the fourth step of the "Getting setup" section.

craigt47

  • Newbie
  • *
  • Posts: 9
Re: MSFS Voice Attack Plugin - Question
« Reply #2 on: January 06, 2024, 02:44:02 AM »
Hi,

Do you mean like this?

Edit: Doh! Ok i removed the "1" and it working now. But the command is not working at 6 feet, which i am guessing is a condition problem.

Thank you, i will have a play around and see how i get on!


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4647
  • RTFM
Re: MSFS Voice Attack Plugin - Question
« Reply #3 on: January 06, 2024, 02:46:44 AM »
As the documentation states, the command should be named
Code: [Select]
MSFS Agent
Not "MSFS Agent 1"

craigt47

  • Newbie
  • *
  • Posts: 9
Re: MSFS Voice Attack Plugin - Question
« Reply #4 on: January 06, 2024, 02:49:38 AM »
Yep, just did that - thank you

craigt47

  • Newbie
  • *
  • Posts: 9
Re: MSFS Voice Attack Plugin - Question
« Reply #5 on: January 06, 2024, 02:57:18 AM »
Hi,

it looks like the Plugin is working now as it is fetching the Plane state. But, it is sill not playing the sound at 6ft.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4647
  • RTFM
Re: MSFS Voice Attack Plugin - Question
« Reply #6 on: January 06, 2024, 03:00:14 AM »
Have you checked what the actual value of the variable you're checking is?

You can use the "Write a Value to the Event Log" action and the "{INT:}" token, to write that to the log.

craigt47

  • Newbie
  • *
  • Posts: 9
Re: MSFS Voice Attack Plugin - Question
« Reply #7 on: January 06, 2024, 03:07:59 AM »
Edit: i have worked out event log part.

I is an Int value looking at the table provided. see attached.

You can use the "Write a Value to the Event Log" action and the "{INT:}" token, to write that to the log - how would i do this?

I think what might be happening, is the following:

it is calling the plane state witch is at 0ft
the condition is set to 6ft
helicopter lifts to 6ft, but the condition data taken form the planestate is still showing 0ft - hence it will never fire the sound. Although saying that, i did try less than in the condition and it did not work

craigt47

  • Newbie
  • *
  • Posts: 9
Re: MSFS Voice Attack Plugin - Question
« Reply #8 on: January 06, 2024, 03:15:20 AM »
when you say log do you mean the VoiceAttack.dat file to check for the value being passed?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4647
  • RTFM
Re: MSFS Voice Attack Plugin - Question
« Reply #9 on: January 06, 2024, 03:23:15 AM »
"Event Log" refers to the list of notifications on VoiceAttack's main window.

What you've put into the "Value" field of the "Write a Value to the Event Log" action is not, in that context, a variable name. It's just a piece of text that has no other meaning.
That is exactly why you need to use the mentioned token.

craigt47

  • Newbie
  • *
  • Posts: 9
Re: MSFS Voice Attack Plugin - Question
« Reply #10 on: January 06, 2024, 03:37:17 AM »
Like this?

Current Altitude Above Ground: {MSFSAgent.PlaneState.Plane_Alt_Above_Ground}


Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4647
  • RTFM
Re: MSFS Voice Attack Plugin - Question
« Reply #11 on: January 06, 2024, 03:39:00 AM »
Putting brackets around something doesn't make it a valid token.

craigt47

  • Newbie
  • *
  • Posts: 9
Re: MSFS Voice Attack Plugin - Question
« Reply #12 on: January 06, 2024, 03:43:01 AM »
Sorry, i am out of my depth here! :) i am still learning.

How would you write this if the call command was MSFSAgent.PlaneState.Plane_Alt_Above_Ground

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4647
  • RTFM
Re: MSFS Voice Attack Plugin - Question
« Reply #13 on: January 06, 2024, 03:48:56 AM »
Have you read the documentation on tokens?

Purely throwing things at the wall and seeing what sticks is not an efficient manner of learning. You need at least a basic understanding of the building blocks you're trying to combine, in order to combine them correctly.


If you want to retrieve the value of the variable "MSFSAgent.PlaneState.Plane_Alt_Above_Ground" as text, you'd use the "{INT:}" token in this manner:
Code: [Select]
{INT:MSFSAgent.PlaneState.Plane_Alt_Above_Ground}

craigt47

  • Newbie
  • *
  • Posts: 9
Re: MSFS Voice Attack Plugin - Question
« Reply #14 on: January 06, 2024, 04:03:49 AM »
I have read the documents (as always). I guess i will have to re-read it.

However, i have fixed it! it is now working. I would seem there is a mis match in the data being presented in the helicopter and what is output via to the tool. MSAgent.PlaneState.Plane_Altitude seems to give a more accurate output than MSAgent.PlaneState.Plane_Alt_Above_Ground and it working as expected.

But, a big thank you for helping me.