Page 1 of 1

Scripting

Posted: Thu Oct 02, 2008 2:34 pm
by Deqlyn
Any limit as to how many lines of scripting are allowed per map? I couldnt find it on the mesh limits but I could have overlooked it.

Thanks

Posted: Thu Oct 02, 2008 2:55 pm
by Myrd
There's a "hard limit" of 1024 lines. However, most of the time you end up reaching the "MA param" limit before ever reaching 1024 lines of script. I hear, in general, around 700 is the practical limit.

Posted: Thu Oct 02, 2008 3:43 pm
by Deqlyn
Thanks Myrd I signed off before you could answer.

Posted: Thu Oct 02, 2008 7:01 pm
by gugusm
Yep, Myrd is right. The most "MA parameters size" consuming actions are the ones where you define some points on a mesh. I, for example, hit that limit once while messing with mesh cell modifiers (you know, you can change cell's type of terrain). Anyway, when you script wisely, you won't ever need to pass that limit.

Posted: Thu Oct 02, 2008 9:24 pm
by vinylrake
gugusm wrote:...I, for example, hit that limit once while messing with mesh cell modifiers (you know, you can change cell's type of terrain).
Granted I don't keep up all that well with mapmaking features, but I never knew you could do that... raises interesting possibilities.

Posted: Fri Oct 03, 2008 12:08 am
by Graydon
vinylrake wrote:Granted I don't keep up all that well with mapmaking features, but I never knew you could do that... raises interesting possibilities.
This was a feature that was available when Myth 2 shipped as well. I recently started work on a mesh and decided I wanted to use the fort models from Chimera.. you know the ones that have the 'stairs' up to the ramparts through the gatehouse?

Well by default when that model is placed, the terrain cells that incorporate the 'stairs' are painted as flying impassable. Badlands used the Mesh Cells Modifier script to change the world units in question to a passable terrain type rather than the default of the model. The reason you can't just edit the terrain in loathing is because every time the mesh is loaded up, those cells get re-painted as flying impassable; the models default. So using the script, one edits the mesh _after_ the default has loaded up, allowing you to customize what you want to do.

Posted: Fri Oct 03, 2008 8:40 am
by vinylrake
Graydon wrote:Well by default when that model is placed, the terrain cells that incorporate the 'stairs' are painted as flying impassable. Badlands used the Mesh Cells Modifier script to change the world units in question to a passable terrain type rather than the default of the model. ...
I _think_ I have heard of mapmakers getting the same effect (changing passability of terrain ingame) by putting invisible scenery/model on a map and then to open up the cells so units can pass promoting the object to something that's tiny or has a lifespan of zero (sorry, I know that's not the exact terminology) .Modifying the Mesh Cells themselves seems much more straightforward. Just curious: Do you know of any particular downside to using Mesh Cell Modifiers in a script? and/or anything one should be careful/watch out for when using them?

thanks again for the info.

Posted: Fri Oct 03, 2008 9:21 am
by gugusm
Well, the only problem with them is that they really consume a lot of map actions parameters (or whatever should I call it). Especially when you edit A LOT of cells. In my case, there were of course tons of other actions, but these ones were the main reason I hit the limit.

However, I didn't have any other problems with MECE actions, they're quite simple and always work fine.

Posted: Fri Oct 03, 2008 11:39 am
by Deqlyn
Anyway, when you script wisely, you won't ever need to pass that limit.
I wouldn't call what I do scripting wisely. Or scripting at all, lol.

Posted: Fri Oct 03, 2008 12:09 pm
by Pyro
VR, what you describe gives you the same effect. Different ways to do the same thing. A downside to the mesh modifier map action, in my opinion, is that you don't always know exactly which cells you selected. You know that pink marker you see in Loathing when you are clicking on a location for a polygon you wish to do testing for, or a location where units/camera will move? Well imagine those little pink "x"s. You could have accidently skipped a cell or even chose the same cell more than once. If only Loathing could mark them like it does for terrain types.

Posted: Fri Oct 03, 2008 12:52 pm
by gugusm
Well, you can see which cells you have already selected (in one specific action of course). But yeah, that's a little bit messy, though there aren't any technical problems with MECEs.

Posted: Fri Oct 03, 2008 3:03 pm
by Graydon
Pyro wrote:VR, what you describe gives you the same effect. Different ways to do the same thing. A downside to the mesh modifier map action, in my opinion, is that you don't always know exactly which cells you selected. You know that pink marker you see in Loathing when you are clicking on a location for a polygon you wish to do testing for, or a location where units/camera will move? Well imagine those little pink "x"s. You could have accidently skipped a cell or even chose the same cell more than once. If only Loathing could mark them like it does for terrain types.
Actually, I was going to post about this for VR, but you questioned it first.

There is an excellent and easy way around this. I utitlize this menu feature for many other loathing tools as well (displacement tool comes to mind), but if you're in the scripting window, go under Edit---> View Preferences.

A little box comes up specifying things that Loathing sets up by default. You can then change them. In the drop down menu, choose 'Show Triangles' and then when you're placing your little pink X marks, you can see exactly which cell you've clicked.

:)

Posted: Fri Oct 03, 2008 3:19 pm
by Pyro
Nice! I must have overlooked it. But why triangles and not cells?