What's wrong with a large image scale?

Started by pawel345, January 30, 2014, 05:36:58 PM

Previous topic - Next topic

pawel345

I just made a map with a Fog of war. Because it can get laggy I use fewer cores with a large image scale so that the map will be covered but run smoothly. While editing everything works fine. But when I finalize the map suddenly the image scale goes back down to 2 on the first frame. It loooks as if the code was recompiled with the default variables?

knucracker

It looks like you have a "size" of 2 set in the editor Input Variables for each FOW core.  Take the upper left corner core as an example.
In the Once section of the Fow.crpl script you call this:
Self "main" <-Size 0.1 add <-Size 0.1 add SetImageScale

So that will set the core to a scale of 2.1,2.1 when the mission first loads (or after a compile).  This differs from the scale you have initially manually set each core to (which is 4.1).

The quickest way to fix this is the change "size" from being an input variable in Fox.crpl and just set it to 4 at the top of the Once section.  That will save you from having to manually edit all of those cores... not something I would want to do :)

Note that the other way you could handle this is with one core that manages N images that are spaced over the map.  That would save you from having all those cores and scripts and make the map run faster most likely.  Sticking that one core in the lower left or upper left hand corner would also simplify your calculation for placing all of the FOW images.  Note that you could use a list to keep track of which FOW cells should be visible, etc.  Or you could use the reflection operators and use unique variable names.  Variables in CRPL are all stored in a hashmap, so that works very efficiently as well.  If you don't want to fiddle with any of the last stuff I said, just ignore and carry on :)