Search found 49 matches

by Medu_Salem
Fri Aug 26, 2016 6:06 pm
Forum: Modding
Topic: Object.GetNearbyObjects() returns objects in a radius
Replies: 23
Views: 5206

Re: Object.GetNearbyObjects() returns objects in a radius

Well now you can also play around with the dev tools :mrgreen: Yeah, but I probably won't because the new update basically f'd up all of my prisons somehow and that's what has been bumming me out for the last 2-3 hours already, which is why I will leave the game be for a while because if I'm mad no...
by Medu_Salem
Thu Aug 25, 2016 9:55 pm
Forum: Modding
Topic: Object.GetNearbyObjects() returns objects in a radius
Replies: 23
Views: 5206

Re: Object.GetNearbyObjects() returns objects in a radius

Since the cpu has become so fast nowadays it really doesn't matter for such small things as our mods. Perhaps in a big data warehouse they would have sleepless nights about things like this, but we shouldn't :D. Well I'd say microcontroller programming is where it would be the most important to squ...
by Medu_Salem
Wed Aug 24, 2016 12:32 pm
Forum: Modding
Topic: Object.GetNearbyObjects() returns objects in a radius
Replies: 23
Views: 5206

Re: Object.GetNearbyObjects() returns objects in a radius

No, it's better with the empty if branch since there are more sprinklers inside the square than being abandoned. So the way the if structure works now would be faster in theory. But thinking of it I'm not sure any more hehehhe. I don't mind. For universal usage it's good, never know what can be ins...
by Medu_Salem
Tue Aug 23, 2016 6:15 pm
Forum: Modding
Topic: Object.GetNearbyObjects() returns objects in a radius
Replies: 23
Views: 5206

Re: Object.GetNearbyObjects() returns objects in a radius

No, I don't have any clue about it... I asked myself about formating code already... like Size, Bold/Italic etc, but I would say that Lua manuals won't help here since it probably depends on how the game actually treats the Tooltips internally for display. We at least know that some escape codes lik...
by Medu_Salem
Mon Aug 22, 2016 10:43 pm
Forum: Modding
Topic: Object.GetNearbyObjects() returns objects in a radius
Replies: 23
Views: 5206

Re: Object.GetNearbyObjects() returns objects in a radius

Yeah, Prison Architect doesn't fully support everything that would hypothetically be possible with Lua 5.1 And the other part being that some stuff before Lua 5.1 is being deprecated in 5.1, like for example getn()/setn() for tables (it's funny though that the functions are still listed as valid tab...
by Medu_Salem
Mon Aug 22, 2016 5:33 pm
Forum: Modding
Topic: Object.GetNearbyObjects() returns objects in a radius
Replies: 23
Views: 5206

Re: Object.GetNearbyObjects() returns objects in a radius

Same with the 'If next(thisstuff) then' constructions before using a for loop, I noticed the script would bug out with errors if it's not present now and then. Weird... that really shouldn't happen... at least not within the for-loop... because the pairs(table) function of Lua basically has a built...
by Medu_Salem
Mon Aug 22, 2016 12:53 pm
Forum: Modding
Topic: Object.GetNearbyObjects() returns objects in a radius
Replies: 23
Views: 5206

Re: Object.GetNearbyObjects() returns objects in a radius

Looks neat ^^ Is the "If" branch empty? Because if so then you could restructure/invert the Condition in a way that the if branch is taken only if the sprinkler is out of bound, and skip the else part. Something like so: function GetObjectsInSquare(theObject,theRange) if this.Or.x==-1 then...
by Medu_Salem
Sun Aug 21, 2016 4:45 pm
Forum: Modding
Topic: Object.GetNearbyObjects() returns objects in a radius
Replies: 23
Views: 5206

Re: Object.GetNearbyObjects() returns objects in a radius

For now I've worked around it with this: [...] Scanning twice the range probably isn't the proper math to do it, but at least it will cover the area of the square. I forgot how to calculate it properly lol, school time is loong ago and I'm not good at maths. Any suggestions to make this more effici...
by Medu_Salem
Sun Aug 21, 2016 1:50 pm
Forum: Modding
Topic: Object.GetNearbyObjects() returns objects in a radius
Replies: 23
Views: 5206

Re: Object.GetNearbyObjects() returns objects in a radius

I have another crazy method... You could require the sprinklers to be placed in a certain distance from each other... and then starting from one sprinkler you get the next nearby sprinklers and then the next nearby of them and so on... until you populated a table that's basically like a graph, listi...
by Medu_Salem
Sun Aug 21, 2016 12:58 pm
Forum: Modding
Topic: Object.GetNearbyObjects() returns objects in a radius
Replies: 23
Views: 5206

Re: Object.GetNearbyObjects() returns objects in a radius

How? The lua_functions.txt mentions 'the distance to search within', it doesn't say radius (which would be clearer). Nah, it isn't explicitely stated anywhere (and yeah I basically looked everywhere too)... so I found out about it by trial and error myself, though I expected it to work in a radius ...
by Medu_Salem
Sun Aug 21, 2016 4:16 am
Forum: Modding
Topic: Object.GetNearbyObjects() returns objects in a radius
Replies: 23
Views: 5206

Re: Object.GetNearbyObjects() returns objects in a radius

Well I already knew that it works in a radius instead of a square or "Manhatten distance"... and I thought this was common knowledge around modders. But I don't know why this should make things less reliable... except if you don't want duplicate results from using GetNearbyObjects on multi...
by Medu_Salem
Thu Aug 11, 2016 7:05 pm
Forum: Modding
Topic: Can I change prisoners security based on reform grade?
Replies: 21
Views: 13383

Re: Can I change prisoners security based on reform grade?

For an update, have a look at this bug . tl;dr, I've added World.NumPrisoners and World.Capacity, both of which return tables listing the current prisoners in each category, and the number of cells in each security zone. Both tables link names to numbers. Be warned that the numbers will probably be...
by Medu_Salem
Tue Aug 09, 2016 3:27 pm
Forum: Modding
Topic: Can I change prisoners security based on reform grade?
Replies: 21
Views: 13383

Re: Can I change prisoners security based on reform grade?

Just a quick reply to a few things in this post: - In regards to the reoffending rate, it is calculated per prisoner using a pretty complex formula based on their experience in the prison and a lot more. I could add a (read-only) value to the prisoner's table to return this calculated value if peop...
by Medu_Salem
Mon Aug 08, 2016 4:36 pm
Forum: Modding
Topic: Can I change prisoners security based on reform grade?
Replies: 21
Views: 13383

Re: Can I change prisoners security based on reform grade?

All of these things are such big features....it's so awful they aren't mapped yet. I think they mentioned working on hooks so HOPEFULLY they're going to get that done. As for my Prison it's 20% cutoff (IIRC, I started a new one ha ha) but there's over 1k prisoners, which makes a queue. I have notic...
by Medu_Salem
Sun Aug 07, 2016 6:41 pm
Forum: Modding
Topic: Can I change prisoners security based on reform grade?
Replies: 21
Views: 13383

Re: Can I change prisoners security based on reform grade?

If the grade is calculated could that mean it's assigned a variable or placed somewhere we can grab at some point? It seems silly to have a grade assigned to each prisoner if it's not going to be grab-able if you understand my drift. The thing with people with good reform values is they have to wai...

Go to advanced search