| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

command_set_comms_button

Page history last edited by Dave Thaler 3 weeks, 4 days ago

The set_comms_button mission scripting command adds a button to all relevant Comms consoles.  (set_comms_button, clear_comms_button, and if_comms_button let you add special buttons to the Comms consoles, and trigger events based on the Comms clicking those buttons.)

 

Attribute

Valid Values

Optional?

Description

text

name of button

 

 

sideValue

0-,  0 = all sides, 1 = enemy (normally), 2+ = player side (normally)

Optional (Default = 0)

 

player_slot 0-7 Optional Only functional in 2.7.99, not before and not in 2.8

 

If a Comms console is connected after the scripting command adds a button, the button will not appear.  As a result, scripts should generally have a timer where the Comms button(s) are periodically refreshed by doing clear_comms_button and set_comms_button again.

 

The set_comms_button command allows you to specify a sideValue, but it doesn't let you set a Comms button for a specific player ship.  It is possible, however, to do so with some limitations.  Specifically, it is possible to use set_side_value to change the sideValue for a given ship to a unique value, add a Comms button for that side, and reset the ship's sideValue back to its original side while retaining the Comms button.  The limitations are:

 

  • The change of side value does not take place immediately. You need to wait at least one program main loop cycle. That means the fastest possible way to send out a single-ship button is to have the button deployed to side_value = (for example) 3 based on a variable. The variable and side_value =3 should be set later in the program stack. The variable should be detected, the button deployed, and side_value =2 should be set earlier in the program stack.
  • Even using the above procedure, in that split second with side_value =3 friendly AI ships and bases will try to fire at the ship receiving the button.
  • If you want several ships to have buttons that do the same thing, but you want to know which ship clicked the button, you need to give the buttons different names. For example, you could just include a different number of trailing spaces, so you might have 'Activate Cloak' on Artemis and 'Activate Cloak ' on Intrepid. Using trailing spaces make the strings be different to the script, but still look indistinguishable when displayed on Comms consoles.
 

Comments (1)

Ryan McMullan said

at 1:01 am on Mar 28, 2021

I tested it on my set-up and you can have 105 characters on the comms button before it starts going off the button. I'm not sure if this changes with different resolutions.

You don't have permission to comment on this page.