Scripting

A forum for discussing map making ideas and problems for the Myth series.
Post Reply
Deqlyn
Posts: 387
Joined: Thu Dec 13, 2007 6:27 pm

Scripting

Post 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
Myrd
Site Admin
Posts: 4031
Joined: Fri Mar 19, 2004 10:17 pm

Post 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.
Deqlyn
Posts: 387
Joined: Thu Dec 13, 2007 6:27 pm

Post by Deqlyn »

Thanks Myrd I signed off before you could answer.
gugusm
Posts: 487
Joined: Mon Aug 22, 2005 1:16 pm
Location: Klucze, Poland
Contact:

Post 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.
vinylrake
Posts: 3591
Joined: Wed Apr 07, 2004 12:52 pm
Location: here
Contact:

Post 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.
Graydon
Posts: 1605
Joined: Sun Mar 21, 2004 5:10 pm

Post 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.
Image
vinylrake
Posts: 3591
Joined: Wed Apr 07, 2004 12:52 pm
Location: here
Contact:

Post 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.
gugusm
Posts: 487
Joined: Mon Aug 22, 2005 1:16 pm
Location: Klucze, Poland
Contact:

Post 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.
Deqlyn
Posts: 387
Joined: Thu Dec 13, 2007 6:27 pm

Post 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.
User avatar
Pyro
Bug Finder Extraordinaire
Posts: 4751
Joined: Sun Mar 21, 2004 2:14 pm
Location: Texas

Post 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.
gugusm
Posts: 487
Joined: Mon Aug 22, 2005 1:16 pm
Location: Klucze, Poland
Contact:

Post 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.
Graydon
Posts: 1605
Joined: Sun Mar 21, 2004 5:10 pm

Post 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.

:)
Image
User avatar
Pyro
Bug Finder Extraordinaire
Posts: 4751
Joined: Sun Mar 21, 2004 2:14 pm
Location: Texas

Post by Pyro »

Nice! I must have overlooked it. But why triangles and not cells?
Post Reply