Help needed using OpenDevice and OpenDevicePos from a dialog

Discussion in 'Questions, Discussions & Feedback' started by imlarry425, Feb 18, 2024.

  1. imlarry425

    imlarry425 Captain

    Joined:
    Jan 10, 2019
    Messages:
    465
    Likes Received:
    340
    I'm using the following modified BlocksConfig.ecf entry to add an ExecuteOnActivate property. The change does trigger the execution of the script but I am not getting what I would expect from either OpenDevice or OpenDevicePos. This is the modified block defn...
    Code:
    { +Block Id: 1282, Name: Level4Prop2, Ref: DecoTemplate
      TemplateRoot: DecoBlocks2
      Class: Container
      IndexName: Container
      DropInventoryEntity: DropContainer
      LootList: 57   
      Model: @models2/Entities/Decorations/LaboratoryPack/Level4Prop2Prefab
      EnergyIn: 1, type: int, display: true, formatter: Watt
      ShowUser: Yes
      VolumeCapacity: 500, type: float, display: true, formatter: Liter
      ExecuteOnActivate: Level4Prop2     
    }
    ...where "Level4Prop2" is defined in Dialogues.ecf as...
    Code:
    { +Dialogue Name: Level4Prop2
      Execute: "
      UnityEngine.Debug.Log('Level4Prop2 Activated');
      var x = OpenDevicePos;
      string output = '>' + x.ToString() + '<';
      UnityEngine.Debug.Log(output);"
    }
    When I open the box (see attached screenshot & "di" window below) and check the console I see "Level4Prop2 Activated" followed by ">VectorInt3 0/0/0<"

    A similar call to OpenDevice returns a null and in this case OpenDevicePos returns 0/0/0 which isn't the actual location of the container ... do these helper functions work with ExecuteOnActivate property blocks? Do I need to add anything else to the block defn? Appreciate any help, thanks!

    [​IMG]
     
    #1

Share This Page