I have an extension I’m trying to make that will allow the user (me, for a specific project) to randomly generate a bunch of objects on top of a room object, based on external layouts that the user will create. I also want the ability to build new structures (flat-roofed buildings with each floor taken from an external layout), sort of like in a city-building-sim.
Theoretically, this would be done by assigning the external layout as a parameter, but I’ve figured out that parameters cannot be external layouts. Another problem is that you can’t create objects from an external layout at the theoretical position of an extension object (the room object).
I’ve actually figured it out: A random number will be generated between a customizable maximum number and 0, I assume, and that random number will be saved as another property of the room object type.
I have a condition unique to that object-type: checkLDecor, which checks whether or not lDRan(dom value) is equal to a customizable value, which will be used to link different values to different external layouts. However, the problem is that I don’t know how to do the events for that condition to request the value that lDRan might be,
If you’re talking about creating a condition for an extension then I’m a bit fuzzy. I haven’t created one in awhile.
I know you can create a condition with 2 parameters and then compare them inside the function and set the return value to true if the comparison is true.
It doesn’t create a condition but more of an expression like sin() or trunc(). You pass the function a value as a parameter then it returns the result. The comparator on the scene condition compares that value to the value in the value box.
You can add code with the function that modified the supplied value and then return the modified value. You then use the comparator to compare that new value to something.
I used to be able to do this, with getargumentasnumber, and the string variant, but I get the idea they actually removed that, and didn’t update the wiki. Or explain what the new way to do it was.
But then, their wiki for this has always sucked, and I’ve never done this in particular.
The wiki does say that GetArgumentAsNumber is now unecessary, but I think they misunderstood what GetArgumentAsNumber did and just removed it and replaced something else, maybe because that note is after their explanation of how to compare values regularly, like you’ve always been able to do, rather than prompting the user to enter a value.