Author Topic: Adding (VArs/token) to keypress command/dialogbox and pause cmd/dialbox  (Read 3481 times)

megs

  • Guest
Hi,

It will be usefull to dynamically change time wait value for some commands. ( interfaces commands/ delayed command / timed command )

it that way, we could: (if {CMDSEGMENT:x} work in prefix suffix commands ) change by a "When i say" command a variable content ( text or integer ).

After that this value can be used in say method, to parameter à pressdown and release timer ( when in a game more ship profiles exist, it will be helpfull to have different presskey timer profiles ( big ship/little ship). it is the direct consequence of maniability of them.

Maybe if we can execute an internal command with a token construction, i need help to do it.

in may way i want to do this ( for exemple)

command initializing ship profile
Code: [Select]
#spoken CMD:fullcmd:when i say:# load profile [ship1;ship2]
-------------------------------------------------------
Set texBegin text compare : [{CMDSEGEMENT:2}] Equals 'ship1'
        Set decimal [VStrafeHoldSlow] value to 1,675
Set decimal [VStrafeHoldFull] value to 10,675
End condition
Set texBegin text compare : [{CMDSEGEMENT:2}] Equals 'ship2'
       
End condition

prefix command initiazlizing verb command
Code: [Select]
#spoken CMD:prefix:when i say:# [strafe;glisse]
-------------------------------------------------------
Set text [VarActionVerb] value to 'strafe'

#spoken CMD:prefix:when i say:# [roll;rotate]
-------------------------------------------------------
Set text [VarActionVerb] value to 'roll'

suffix command initializing action procedure in function of prefix verb command
Code: [Select]
#spoken CMD:suffix:when i say:# [babord;left;lateral left] [engines;motors;] [slow;full]
------------------------------------------------------------------------------------------------------------------
Begin text compare : [VarActionVerb] Equals 'strafe'
   Begin text compare : [{CMDSEGEMENT:3] Equals 'slow'
        Press Left key and hold for [VStrafeHoldSlow] seconds and release
   End condition
   Begin text compare : [{CMDSEGEMENT:3] Equals 'full'
        Press Left key and hold for [VStrafeHoldFull] seconds and release
   End condition
End condition
Begin text compare : [VarActionVerb] Equals 'roll'
   
End condition
If you have somme idea


EDIT by Pfeil: The variable pause action is already available.
« Last Edit: April 18, 2020, 09:21:09 AM by Pfeil »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4759
  • RTFM
If you want a variable key hold time, you can split the keypress up into individual press and release actions, and combine that with a variable pause:
Code: [Select]
Press down Left key
Pause a variable number of seconds [VStrafeHoldFull]
Release Left key

If all your segments are unique values, you don't need "{CMDSEGMENT:}" either, as you can use "Contains" rather than "Equals". In addition, you don't have to set a variable to get the spoken prefix if you use "{CMD}", as that will contain both:
Code: [Select]
Begin Text Compare : [{CMD}] Contains 'strafe'
    Begin Text Compare : [{CMD}] Contains 'slow'
        Press down Left key
        Pause a variable number of seconds [VStrafeHoldSlow]
        Release Left key
    Else If Text Compare : [{CMD}] Contains 'full'
        Press down Left key
        Pause a variable number of seconds [VStrafeHoldFull]
        Release Left key
    End Condition
Else If Text Compare : [{CMD}] Contains 'roll'
End Condition

megs

  • Guest
thanks! that is good for me.

may i use {suffix} with contains to do a conditional test
« Last Edit: July 27, 2017, 05:07:45 AM by megs »