Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Help Needed Understanding inter-grid communication

Discussion in 'Programming (In-game)' started by NPMproductions13, Apr 14, 2019 at 02:47.

  1. NPMproductions13 Trainee Engineer

    Messages:
    14
    So I made a simple script last night that runs as intended and isn't nothing special.
    PHP:
    void Main(string argument)
    {
         List<
    IMyWarheadwarheads = new List<IMyWarhead>();
         
    GridTerminalSystem.GetBlocksOfType(warheads);
         foreach (var 
    warhead in warheads)
         {
            
    warhead.IsArmed true;
            
    warhead.DetonationTime 3f;
            
    warhead.ApplyAction("StartCountdown");
         }

         List<
    IMyRadioAntennaantennas = new List<IMyRadioAntenna>();
         
    GridTerminalSystem.GetBlocksOfType(antennas);
         foreach (var 
    antenna in antennas)
         {
            
    antenna.CustomName "BANG";
            var 
    broadcasting antenna.IsBroadcasting;
            
    antenna.Radius 50000f;
            return;
         }
      }
    The thing I want to know now is how Id use the inter-grid communication system almost like a trigger/detonator. As an example if I wanted to send a certain string value via antenna to the script above (with edits) to trigger it. How would I implement this?
    I've looked over the documentation https://github.com/malware-dev/MDK-SE/wiki/Sandbox.ModAPI.Ingame.IMyIntergridCommunicationSystem but still can't get a grasp on the values sent via the inter-grid communication system and how they'd be used once sent.

    Any clarification or even a basic example on this would be appreciated.
     
  2. sepen_ Trainee Engineer

    Messages:
    51