Zoom control: Another "work ≠ reward" feature request

Started by Clean0nion, March 01, 2014, 01:32:37 PM

Previous topic - Next topic

Clean0nion

Another simple feature request - this time, zoom control.
We already have SetCameraPosition... I'd like to request SetCameraZoom, or SetCameraLevel, or even SetZoom. Or something along those lines.

Unlike my previous suggestion, to which you answered with the following:
Quote from: virgilw on February 03, 2014, 01:32:57 PM
The work and effort it would take on my part and the potential rewards for map makers seems a little out of balance, which is why I've not added them.
as this feature is technically already in-game, it SHOULD be easy to implement. Of course, I could be horribly wrong.

It would work like this.
|  i --  |
A number from 0-12 followed by the command, as such:
4 SetCameraZoom
Where 0 is maximum zoom and 12 is minimum zoom. (seems odd there are 13 zoom levels)
I guess there's really not much else to say about this... except possibly
Spoiler

12 0 do
 I SetCameraZoom
loop
[close]

EDIT: I forgot to say what the command actually does... it changes the zoom.

stewbasic

To support the uesfulness of this: I wanted to automatically set maximum zoom in my platformer map, because having the camera follow the player doesn't work so well when the camera contains the whole map. I have a similar map idea for which this would be useful too.

Clean0nion

Quote from: stewbasic on March 03, 2014, 10:16:36 AM
To support the uesfulness of this: I wanted to automatically set maximum zoom in my platformer map, because having the camera follow the player doesn't work so well when the camera contains the whole map. I have a similar map idea for which this would be useful too.
That's really why I requested it... for platformers. There's not really any other use that I can think of, except perhaps maybe making the camera show something that you've just done, eg opening the dam in MadMag's The Settlers. But I've chosen the wrong time, what with the recent Greenlighting!

knucracker

I've added a couple apis [GetCamera and SetCameraZoom(0-12)].  Of course I now have to add a way to turn off player scolling (with the mouse wheel or the slider in the control panel)...  Everything always comes with a side effect :)


Clean0nion

Quote from: virgilw on March 05, 2014, 09:56:35 AM
I've added a couple apis [GetCamera and SetCameraZoom(0-12)].  Of course I now have to add a way to turn off player scolling (with the mouse wheel or the slider in the control panel)...  Everything always comes with a side effect :)
Thank you very much! I honestly didn't expect you to add this so soon... if at all. Thanks very much.
And in some sort of solution to your problem (if only rudimentary):
Spoiler
# blockPlayerManualZoom.crpl

$zoom:4    #this is changed externally by other scripts
$control:1    #so does this

<-control if
    <-zoom SetCameraZoom
endif
[close]

I've also added both commands to the wiki. Or apis - whatever they're called.

knucracker

There still has to be a way to turn off user controlled zooming, since user input is processed after cores and things update.  If it isn't turned off then you get fighting where the zoom toggles between the value the player is setting it to and where a script is setting it to.  The same thing happens with the camera position, but that map panning can already be turned off as part of the "alternate" control mode.

I basically just added this command:
EnableNormalZoomControl(bool)

Note that turning off user controlled zooming, setting the camera zoom, setting the camera position... these are APIs best left to situations that really, really, need them.  General use would be discouraged as it could be very frustrating to players.

Clean0nion

Quote from: virgilw on March 05, 2014, 02:45:28 PM
There still has to be a way to turn off user controlled zooming, since user input is processed after cores and things update.  If it isn't turned off then you get fighting where the zoom toggles between the value the player is setting it to and where a script is setting it to.  The same thing happens with the camera position, but that map panning can already be turned off as part of the "alternate" control mode.

I basically just added this command:
EnableNormalZoomControl(bool)

Note that turning off user controlled zooming, setting the camera zoom, setting the camera position... these are APIs best left to situations that really, really, need them.  General use would be discouraged as it could be very frustrating to players.
Thanks very much for that too! Also wiki'd.

http://knucklecracker.com/wiki/doku.php?id=crpl:docs:getcamera
http://knucklecracker.com/wiki/doku.php?id=crpl:docs:setcamerazoom
http://knucklecracker.com/wiki/doku.php?id=crpl:docs:enablenormalzoomcontrol

knucracker

It's GetCameraZoom and SetCameraZoom.  I wasn't clear about that in an earlier post.