What does the sid attribute in the action element signify?

For developers using the Construct 2 Javascript SDK

Post » Mon Dec 15, 2014 6:01 pm

<action id="-7" name="Set size" sid="6097538613024559" type="waterfall2">

Is it actually referenced by anything later? If I generate xml for event sheets, can it be omitted or autogenerated as a unique next number? Thank you!
B
27
S
3
G
1
Posts: 48
Reputation: 1,661

Post » Mon Dec 15, 2014 6:43 pm

I think it's a unique id of sorts, best I can tell it's used by C2 only when loading the capx. I was making an event sheet generator one time and just used consecutive numbers. I don't recall if anything amiss happened if they where omitted.
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Mon Dec 15, 2014 7:14 pm

I definitely think you are right. My best guess so far is that the only thing that would cause an issue is if I reused one of the ones that already exists. When I search through all event sheets/layouts sheets in the xml the SID variable never occurs more than one time; so, unique ID definitely follows.

That said, I DID find it in the data.js file. So my guess is, have to make sure that it remains unique in the event sheets and then when the project is exported these are used to reference the function/event. Is that what you found in your event sheet compiler?

In summary, it does have to be there and must be unique, but it can be arbitrary (seemingly) since the connection to the event is created on export.
B
27
S
3
G
1
Posts: 48
Reputation: 1,661

Post » Mon Dec 15, 2014 8:32 pm

I didn't investigate it further but with my tests I was able to get away with using 1,2,3... for sid's.
B
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Mon Dec 15, 2014 11:47 pm

Ok, thanks!
B
27
S
3
G
1
Posts: 48
Reputation: 1,661


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 1 guest