Author Topic: Missile Lock/ Missile Fire T/F Boolean?  (Read 2663 times)

KuruptU4Fun

  • Guest
Missile Lock/ Missile Fire T/F Boolean?
« on: March 31, 2017, 07:25:49 PM »
I'm using Missile Lock and Fire as the Same button, which is the default in Star Citizen. (DIRECT JOYSTICK BUTTON)

With multiple responses would I use a Boolean True/ False to detect if the button has already been pressed for "missile lock" when it's pressed a second time to fire it? Would it make sense to use a jump marker here?

Begin Boolean Compare : [Missile Lock] Equals False
    Set Boolean [Missile Fire] to False
Play sound, '{VA_SOUNDS}\hcspack-ELI\Targeting\Missile lock.wav'
    Else
Set Boolean [Missile Fire] to True
Play sound, '{VA_SOUNDS}\hcspack-ELI\Weapons\Fire missile.wav'
End Condition
   
   
« Last Edit: March 31, 2017, 07:35:30 PM by Matthew Evans »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4780
  • RTFM
Re: Missile Lock/ Missile Fire T/F Boolean?
« Reply #1 on: April 01, 2017, 11:35:26 AM »
I'm not entirely clear on which sequence of events you need, but if the intent is for the first press to lock, then the second press fires and resets to requiring a lock:
Lock/Fire
Code: [Select]
Begin Boolean Compare : [MissileLock] Does Not Equal True
    Set Boolean [MissileLock] to True
    Play sound, '{VA_SOUNDS}\hcspack-ELI\Targeting\Missile lock.wav'
Else
    Set Boolean [MissileLock] to False
    Play sound, '{VA_SOUNDS}\hcspack-ELI\Weapons\Fire missile.wav'
End Condition

If you instead want the first press to lock, then each subsequent press to fire, with a separate command to reset to requiring a lock:
Lock/Fire
Code: [Select]
Begin Boolean Compare : [MissileLock] Does Not Equal True
    Set Boolean [MissileLock] to True
    Play sound, '{VA_SOUNDS}\hcspack-ELI\Targeting\Missile lock.wav'
Else
    Play sound, '{VA_SOUNDS}\hcspack-ELI\Weapons\Fire missile.wav'
End Condition

Reset lock
Code: [Select]
Set Boolean [MissileLock] to False

KuruptU4Fun

  • Guest
Re: Missile Lock/ Missile Fire T/F Boolean?
« Reply #2 on: April 02, 2017, 11:10:02 PM »
Press N key and hold for 0.05 seconds and release
Begin Boolean Compare : [Landing Mode] Does Not Equal True
    Set Boolean [Landing Mode] to True
    Set integer [Flightmodevariable] value as random from 1 to 2
    Begin Small Integer Compare : [Flightmodevariable] Equals 1
        Play sound, '{VA_SOUNDS}\hcspack-ASTRA\Take Off and Landing\Departure procedures.wav'
    End Condition - Exit when condition met
    Begin Small Integer Compare : [Flightmodevariable] Equals 2
        Play sound, '{VA_SOUNDS}\hcspack-ASTRA\Configuration Commands\Changing flight mode.wav'
    End Condition - Exit when condition met
Else
    Set Boolean [Landing Mode] to False
    Set integer [Landingmodevariable] value as random from 1 to 2
    Begin Small Integer Compare : [Landingmodevariable] Equals 1
        Play sound, '{VA_SOUNDS}\hcspack-ASTRA\Configuration Commands\Questions\Would you like me to lower the landing modules.wav'
    End Condition - Exit when condition met
    Begin Small Integer Compare : [Landingmodevariable] Equals 2
        Play sound, '{VA_SOUNDS}\hcspack-ASTRA\Take Off and Landing\Searching for landing platform.wav'
    End Condition - Exit when condition met   
End Condition

If I add multiple play sounds from different folders am I doing that correctly here?

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4780
  • RTFM
Re: Missile Lock/ Missile Fire T/F Boolean?
« Reply #3 on: April 03, 2017, 12:10:26 PM »
If I add multiple play sounds from different folders am I doing that correctly here?
I'd recommend using the built-in "Play a Random Sound" action instead:
Code: [Select]
Press N key and hold for 0.05 seconds and release
Begin Boolean Compare : [Landing Mode] Does Not Equal True
    Set Boolean [Landing Mode] to True
    Play random sound (2 items)
Else
    Set Boolean [Landing Mode] to False
    Play random sound (2 items)
End Condition
You can add sounds from multiple folders, and VoiceAttack will randomly choose one from the list.