How do I access the technical name from articy:expresso

Tue 16. Jul 2019, 09:37

Hi guys,

I've tried everything i can think of but nothing seems to resolve to the technical name:

Code: Select all
getProp(getObj("Insert Technical Name Here"), "TechnicalName"));

Code: Select all
getProp(getObj("Insert Technical Name Here"), "aTechnicalName"));

Code: Select all
getProp(getObj("Insert Technical Name Here"), "TechnicalID"));

etc etc

How do I access this property? Also is there a list of accessible properties somewhere?
Drowning Monkeys
 
Posts: 11
Joined: Wed 3. Apr 2019, 15:14

Re: How do I access the technical name from articy:expresso

Tue 16. Jul 2019, 09:41

Okay, you know what - that first one works, thats actually not my problem... this is:

My object has a template in it called ParentLocationProperties

And that template has an object in it, called District

So when I do this - it doesn't work
getProp(getObj("Loc_BlackRose"), "ParentLocationProperties.District"));

Thoughts?
Drowning Monkeys
 
Posts: 11
Joined: Wed 3. Apr 2019, 15:14

Re: How do I access the technical name from articy:expresso

Tue 16. Jul 2019, 11:58

Hi Drowning Monkeys,

Just to make sure, you have a template on "Loc_BlackRose", that template contains a feature called "ParentLocationProperties" (Make sure its the features technical name, not the display name!" and that feature has a property called "District" (again make sure its the technical name, not its displayname)?

If all that works, what exactly do you want to do with the property? What exactly isn't working? Just calling getProp does nothing, so it helps to know what you are doing with it.

Oh and btw. Depending on what you want to do with it, especially for unity:

If you need an object reference, just use
Code: Select all
getObj("Insert Technical Name Here")


instead of trying to read the technical name (which isn't 100% safe anyway, because of uniqueness and cloning). You can store getObj() into a string global variable for example. Or into a Reference Slot in a template.

Code: Select all
setProp(speaker, "Feature.Reference", getObj("SomeObject"))


Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Re: How do I access the technical name from articy:expresso

Wed 17. Jul 2019, 12:52

Hi Nico,

I’m talking about from inside Articy.

Basically we want to do something where the NPC reacts differently depending on which district he is in.

So, an entity NPC has a template of type ParentLocationProperties, which is a reference to the location the NPC wanders around in.
In a condition flow, i want the following condition:

Code: Select all
getProp(getObj("Loc_BlackRose"), "ParentLocationProperties.District.TechnicalName") == "Loc_District1";

but this returns garbage. If i do this for example:
Code: Select all
LocalConversationVariables.tempString1 = getProp(getObj("Loc_BlackRose"), "ParentLocationProperties.District.TechnicalName");

All we see is a '?'

However, If I do the following:
Code: Select all
LocalConversationVariables.tempString1 = getProp(getObj("Loc_BlackRose"), "ParentLocationProperties.District");
LocalConversationVariables.tempString2 = getProp(getObj(LocalConversationVariables.tempString1), "TechnicalName");


I do retrieve the object id into tempstring1, but that still doesnt help me get the technical name or any other name for tempstring2

Further experimentation shows that i could grab the obj using the Object ID stored in tempstring1, if it were in Hex. So I'm definitely at a dead end now
Drowning Monkeys
 
Posts: 11
Joined: Wed 3. Apr 2019, 15:14

Re: How do I access the technical name from articy:expresso

Wed 17. Jul 2019, 14:16

In your case you can do two things:

Create a global variable, something like Actor.CurrentLocation of type string. Assign this value inside instructions like this

Code: Select all
Actor.CurrentLocation = getObj("Loc_District1")


You can test the same way in conditions like this

Code: Select all
Actor.CurrentLocation == getObj(Loc_District1)


You can do the same via templates, but i encountered a crash when testing this solution just now. I already fixed it and it should be part of an upcoming release, so for this time only global variables are working.
For the sake of completion: This is how you would do it after the crash fix is live.
I have a template and feature with a ReferenceSlot Property. I can assign the property via setProp like this

Code: Select all
setProp(getObj("Bob"), "Actor.Location", getObj("Loc_Home"))


and inside a condition/input pin i can do this:

Code: Select all
getProp(speaker, "Actor.Location") == getObj("Loc_Home")


But to reiterate, the second argument into getProp/setProp needs to be exactly "<FeatureTechnicalName>.<PropertyTechnicalName>" not the TechnicalName of the template. For example
A template called Actor, with a [Feature called Attributes and a property Strength, is accessed like this

Code: Select all
getProp(speaker, "Attributes.Strength")


Hope that clears it up

Best regards

Nico
Nico Probst
Senior Software Engineer | Articy | LinkedIn
User avatar
[Articy] Nico Probst
Articy Staff
Articy Staff
 
Posts: 217
Joined: Wed 23. Nov 2011, 09:45
Location: Bochum

Return to Technical Discussion

Who is online

Users browsing this forum: No registered users and 9 guests

Who We Are
Contact Us
Social Links