Author Topic: How to get the Trigger-Data of a Timer event ? (C# script)  (Read 8475 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13251
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to get the Trigger-Data of a Timer event ? (C# script)
« Reply #15 on: November 13, 2018, 12:20:56 am »
You have to look into the correct t_xref records.

They are related to your Action based on the t_xref.Client = t_object.ea_guid

In your case there will be two t_xref records. One that indicates the type of Action, and the other that specifies the GUID of the trigger element.

So based upon that trigger element you will again need to query t_xref. One record specifies the kind of trigger (Time) and the other specifies the specification (0.5s)
On my test model they look like this:

Code: [Select]
XrefID Name Type Visibility Namespace Requirement Constraint Behavior Partition Description Client Supplier Link
{6FD0BC82-87EA-43dd-83B1-02EF301AB86B} MOFProps element property Public NULL NULL NULL event 0 RefGUID={89807AC7-D452-48eb-85EC-844975D3497B};RefName=0.5s; {F0E65A7D-D49C-47e1-B198-50B0F2D6C091} <none> NULL
{829EF67E-BDB8-444b-95C4-581AD0CEA054} CustomProperties element property Public NULL NULL NULL NULL 0 @PROP=@NAME=kind@ENDNAME;@TYPE=TriggerKind@ENDTYPE;@VALU=Time@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP; {F0E65A7D-D49C-47e1-B198-50B0F2D6C091} <none> NULL

I'm not sure how much of this info can be read using the API objects purely.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: How to get the Trigger-Data of a Timer event ? (C# script)
« Reply #16 on: November 13, 2018, 12:39:04 am »
The API doesn't offer that (at least until 13.5; did not catch up with V14 but would not expect it anyway) so that way my advice to go to t_xref.

q.

bd

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: How to get the Trigger-Data of a Timer event ? (C# script)
« Reply #17 on: November 13, 2018, 09:25:01 pm »
Ok thank you. I will try it out :)

wahidovic123

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: How to get the Trigger-Data of a Timer event ? (C# script)
« Reply #18 on: November 14, 2018, 08:06:16 am »
You have to look into the correct t_xref records.

They are related to your Action based on the t_xref.Client = t_object.ea_guid

In your case there will be two t_xref records. One that indicates the type of Action, and the other that specifies the GUID of the trigger element.

So based upon that trigger element you will again need to query t_xref. One record specifies the kind of trigger (Time) and the other specifies the specification (0.5s)
On my test model they look like this:

Code: [Select]
XrefID Name Type Visibility Namespace Requirement Constraint Behavior Partition Description Client Supplier Link
{6FD0BC82-87EA-43dd-83B1-02EF301AB86B} MOFProps element property Public NULL NULL NULL event 0 RefGUID={89807AC7-D452-48eb-85EC-844975D3497B};RefName=0.5s; {F0E65A7D-D49C-47e1-B198-50B0F2D6C091} <none> NULL
{829EF67E-BDB8-444b-95C4-581AD0CEA054} CustomProperties element property Public NULL NULL NULL NULL 0 @PROP=@NAME=kind@ENDNAME;@TYPE=TriggerKind@ENDTYPE;@VALU=Time@ENDVALU;@PRMT=@ENDPRMT;@ENDPROP; {F0E65A7D-D49C-47e1-B198-50B0F2D6C091} <none> NULL

I'm not sure how much of this info can be read using the API objects purely

Geert
Subway Surfers Psiphon Hill Climb Racing
ok thank you for your reply
_________________
« Last Edit: November 14, 2018, 09:07:11 pm by wahidovic123 »

bd

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: How to get the Trigger-Data of a Timer event ? (C# script)
« Reply #19 on: December 04, 2018, 02:11:09 am »
How can I get the values "0.5" & "Time" from the description. With parsing ?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: How to get the Trigger-Data of a Timer event ? (C# script)
« Reply #20 on: December 04, 2018, 03:01:03 am »
Uhm, what?

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13251
  • Karma: +554/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to get the Trigger-Data of a Timer event ? (C# script)
« Reply #21 on: December 04, 2018, 03:30:56 am »
How can I get the values "0.5" & "Time" from the description. With parsing ?
Yes, you'll have to parse the contents of the xref records to get these values out.
(if indeed there is no way to get to it from the API objects. Since I haven't tested it myself I'm not 100% sure these values aren't available somewhere from the API)

Geert

bd

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: How to get the Trigger-Data of a Timer event ? (C# script)
« Reply #22 on: December 04, 2018, 09:20:39 pm »
Ok, thank you.

bd