Object property type

Discussion about Mods for Prison Architect

Moderator: NBJeff

Posts: 5
Joined: Sat Apr 19, 2014 10:41 am

Object property type

Postby DekanTrue » Fri Jan 23, 2015 10:00 pm

Hi All,

I am hoping that someone can answear me this.

When saving a property either with SetProperty('something') or this.something, is it possible store a property as a float or int?

From my testing, it seems that numbers are converted to string on setting.

local something = 2.5;
type(something) ==> number
this.something = something;
type(this.something) ==> string

User avatar
Posts: 94
Joined: Mon May 27, 2013 4:11 am

Re: Object property type

Postby Pruvan » Fri Jan 23, 2015 10:41 pm

Use tonumber() to convert the strings you get back into a number.

Return to “Modding”

Who is online

Users browsing this forum: No registered users and 2 guests