Object.GetProperty()

Discussion about Mods for Prison Architect

Moderator: NBJeff

whiteland9992
level1
level1
Posts: 11
Joined: Wed Nov 07, 2012 10:00 pm
Location: Norge

Object.GetProperty()

Postby whiteland9992 » Fri Sep 12, 2014 8:34 pm

Does anyone got a list over the arguments in Object.GetProperty() and know what they are returning? maybe there exist a list that i can't find.
And is it possible to get prisoners id number?
mazetar
level2
level2
Posts: 141
Joined: Mon Feb 11, 2013 12:14 am

Re: Object.GetProperty()

Postby mazetar » Fri Sep 12, 2014 8:49 pm

whiteland9992
level1
level1
Posts: 11
Joined: Wed Nov 07, 2012 10:00 pm
Location: Norge

Re: Object.GetProperty()

Postby whiteland9992 » Fri Sep 12, 2014 9:05 pm

i was talking more about the lua part. example. Object.GetProperty("Pos.x")
RGeezy911
level5
level5
Posts: 1098
Joined: Fri Aug 09, 2013 7:21 pm

Re: Object.GetProperty()

Postby RGeezy911 » Fri Sep 12, 2014 9:27 pm

From the lua_function_list.txt file located in the main.dat file of the game:

Object.GetProperty( [ObjectName,] PropertyName )
Gets a property on an object's DataRegistry. If no object name is given, it defaults to the current object.
If the property can not be found in the DataRegistry, and no ObjectName is given, then look for the property in the
object's ScriptState blackboard.

ObjectName: Optional. Defaults to the object that the script is running on.
PropertyName: Required. Name of the property to set.

Returns: The value of the property on the named object, or nil

I'm going to assume the information found on the wiki article mazetar linked is going to help you further.
User avatar
Phraxas
level2
level2
Posts: 107
Joined: Sun Aug 31, 2014 12:10 am
Location: USA - PA

Re: Object.GetProperty()

Postby Phraxas » Sat Sep 13, 2014 6:53 pm

Poor guy. No one's really answering the question itself.

There is no official list as of yet, but you can open a .prison save file and look at some of the data in there to see some of the properties that exist.
mazetar
level2
level2
Posts: 141
Joined: Mon Feb 11, 2013 12:14 am

Re: Object.GetProperty()

Postby mazetar » Sat Sep 13, 2014 7:36 pm

Phraxas: Isn't the list on the wiki the list of all properties you can assign a object? It's the same as listed in the ModSchema so I assumed it was all the possible values you could set/get?
sirNoolas
level1
level1
Posts: 39
Joined: Sat Nov 30, 2013 12:41 pm

Re: Object.GetProperty()

Postby sirNoolas » Sun Sep 14, 2014 3:00 am

Phraxas wrote:Poor guy. No one's really answering the question itself.

There is no official list as of yet, but you can open a .prison save file and look at some of the data in there to see some of the properties that exist.



I think that would indeed be the best way to go. Unfortunatly you can only read al the variables in save files.. Writing goes into separate 'custom' variables
User avatar
St0l3n_ID
level1
level1
Posts: 16
Joined: Thu Jan 09, 2014 2:47 am

Re: Object.GetProperty()

Postby St0l3n_ID » Mon Sep 15, 2014 9:41 am

To add to this topic, you could ofc circuumvent some of the mechanics in the game fe. by simply adding properties to the prisoner that he might get from somewhere else, havent tested adding a property he already has, but i guess it will simply set to the given value.

I actually gonna try this later this week for my zen garden mod, and hope for the best^^
necrobard
level0
Posts: 3
Joined: Thu Mar 20, 2014 9:54 pm

Re: Object.GetProperty()

Postby necrobard » Mon Oct 06, 2014 8:01 pm

Almost all the base level properties in the save files seem to work with getproperty(). Has anyone had any luck getting the nested data like Bio ( Name, Traits or Sentence ) into a script?
elDiablo
level5
level5
Posts: 3111
Joined: Thu Mar 14, 2002 12:23 pm
Location: London, UK

Re: Object.GetProperty()

Postby elDiablo » Tue Oct 07, 2014 7:57 am

Nested properties are not yet implemented, but are being worked on.
bradinvancouver
level1
level1
Posts: 17
Joined: Thu Sep 27, 2012 3:56 am

Re: Object.GetProperty()

Postby bradinvancouver » Tue Nov 11, 2014 7:48 pm

elDiablo wrote:Nested properties are not yet implemented, but are being worked on.


Happen to know if it's still in the works?

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 2 guests