ren.heatDisplayLimits(low, high), where low/high are either numbers or the string
"auto", which translates appropriately to the min/max heat being drawn. There's also
ren.heatDisplayAutoArea(x, y, w, h)to configure the area in pixel coordinates that the min/max is applied to.
Hello!
a) Thanks, I thought the idea was to code it the same but without using the brushes that are only available in the UI. So that last parameter for the shape can only be set to ellipse, is that it? Are there plans to implement rectangle and triangle shapes in the future like the original createParts did?
b) Ah, great! That's fantastic, thank you!
I was considering creating a small script to show my problems but I noticed all errors came from createParts creating boxes, and as you suggested with createBox it's fixed now, thanks.
Yes, I understand the wiki is not updated until release, I just checked there before bothering you.
About dynamic heat display, that mode is VERY useful, thankyou. I don't know if many people is using the original mode with the full range.
By the way, why "Reduce gravity effects on ambient heat"? Does ambient heat change gravity??
Ok with the shapes, please notice I was just suggesting, never complaining, you're doing a great job.
EXACTLY, we can do it with sim.createBox(), and yes, I've never used triangle brush, I only mentioned it because it was available in original createParts. I didn't use createBox() before because with createParts I only had to change the last parameter to select ellipse or rectangle so I always used the same function.
Since we have createBox for rectangles/squares and now createParts is only going to create circle (ellipse) shapes maybe it would be a good time to change its name to createCircle or CreateEllipse (or whatever you think is suitable), now that we are in a stage of some LUA changes and maybe we have to update some scripts anyway.
For those interested, the change from createParts to createBox is as follows. Notice that createParts uses center and radius and createBox corner coordinates. For instance creating a rectangle of embers centered in x,y it changes from:
sim.createParts(x, y, radiusX, radiusY, elem.DEFAULT_PT_EMBR, 1) -- 0=circle, 1=box, 2=triangle
to
sim.createBox(x-radiusX, y-radiusY, x+radiusX, y+radiusY, elem.DEFAULT_PT_EMBR)
For circles/ellipses is the same as before, just ignore last parameter in createParts()
It seems like the lua api changes have broken Alloy Brushes. sim.partKill() seems to not be working the same way it used to bee working. I see no reason why it won't work and it's just saying "particle management is restricted to ID [part count].
Logs:
Press CTRL+. to view buttons added through libactivation
In create func: scripts\downloaded\232 Maticzpl-Alloy Brushes.lua:609: particle management is restricted to ID 0
In create func: scripts\downloaded\232 Maticzpl-Alloy Brushes.lua:609: particle management is restricted to ID 1
... 50,481 more lines
Okay so sim.partKill() seems to not work at all.
Found why: Commit 3adf6ef
I see no reason why that commit was made.
elem.property(1, "Create", function(i, x, y)
print("Changing to watr")
sim.partKill(i)
sim.partCreate(-1, x, y, 2)
end)
elem.property(2, "Create", function(i, x, y)
print("Changing to dust")
sim.partKill(i)
sim.partCreate(-1, x, y, 1)
end)
I'd like to further highlight the last point about scripts: I've been adding stuff to the api 1) to replace common hacks (like creating custom elements to implement tools) and 2) to potentially enable performance improvements (like maybe somehow running lua on the render thread, which could enable custom graphics combined with srt)
I think trying to make it impossible to hang the game with a script is futile because it will render the API unusable. There is always a way for a malevolent scripter to generate infinite loops in a language powerful enough to accomplish anything meaningful.
Here are some more examples of infinite loops (or better infinite recursion) using the Create callback:elem.property(1, "Create", function(i, x, y)
sim.partCreate(i, x, y, 1)
end)
elem.property(2, "Create", function(i, x, y)
sim.partCreate(-3, math.random(4, 607), math.random(4, 379), 2)
end)
Or even the most basic infinite loop anywhere in any callback function:
while true do end