CameraRotation

alpaca

King of Ungulates
Joined
Aug 3, 2006
Messages
2,322
Camera Rotation

This is a very small mod that adds hotkeys to the game that allow you to rotate the camera. This doesn't work superbly (you sometimes rotate into map borders for example), which is probably why the devs didn't add it by default, but it works.

At the moment this functions by holding down the Keypad divide and multiply buttons, or on holding shift and left/right arrow respectively.

Installation
Now available in the Mod Browser. Search for Improved Notifications and install as usual.

Compatibility
This mod changes UI/InGame/WorldView/WorldView.lua

Moderator Action: ATTENTION: Updated version for Vanilla G&K can be found in post 10 in this thread.
 

Attachments

Wow, you're a machine this week :goodjob:

Gameplay elements aside, this was one of my most missed features from IV (along with fully modeled trees). There's something about changing your perspective occasionally that livens up the slow spots in long games. It makes the map feel less static as well. Hmm... well, I guess that's sort of implicit :)

Nice discovery. Thanks again.

edit: Having some cheap fun flying around a huge Perfectworld map in helicopter fashion
 
Well I'm not working on PWM because I'm waiting for word from Firaxis when the saving will be fixed so I do some other things. This one was pretty quick, maybe half an hour. I just stumbled upon the functions in the event list and decided to try if they work, and they did. The rest was just copying some code from vanilla.

I like rotating the camera, too. I often spend time with it in RPGs ;)

There are pitch functions, too, but they don't seem to work.
 
does anyone know how to set maximum zoom out?

I looked for it some time ago but couldn't find anything. There's nothing in WorldView that suggests there should be a maximum zoom level so I guess it's hardcoded. You could try using Events.SerialEventCameraOut(vector2), maybe adding an argument to it will allow you to zoom further out, but that's the only idea I have.
 
Maybe i'm confusing the "issue" but isn't this also possible within the usual config.ini edit of zoom range under this section?
; How close you can get (11.0=default, 4.0=debug zoom)
Minimum Zoom Level = 5.000000
Haven't tried anything above 11 since i prefer 5 though.
Or are you really going for some code-base shortcut to control the max-zooming value?
 
Maybe i'm confusing the "issue" but isn't this also possible within the usual config.ini edit of zoom range under this section?
Haven't tried anything above 11 since i prefer 5 though.
Or are you really going for some code-base shortcut to control the max-zooming value?

He wants to increase the maximum zoom level, not the minimum zoom level. From the name, this value only determines how much you can zoom in but not how much you can zoom out.

In fact, I have a feeling that how far you can zoom out depends on how far away the border of your visible map is.
 
Yes, yes... we can also see this "effect" on the mini-map auto-re-scaling range when the explored territory increases from scouting, etc. Even on that, we simply can't zoom-in after the entire map is able to fit in the allocated popup default size of 320x190.
I thought strategic view was able to reach at some higher maximum(s) values though but i might be wrong.
Just imagine how small "everything" would have to be rendered for a huge map if one wanted the WHOLE thing displayed at maximum on screen. My monitor is 1680x1050 and even on that... the Units would need to be about only 4 pixels wide altogether at such maximal range!
Might as well just look at the right side bottom box for a similar "feeling".
 
This mod hasn't been updated for quite a long time, and Firaxis has since made a few small changes to WorldView.lua.

I recently updated it for my purposes, so I figured I'd share it here.

EDIT: I haven't heard back from alpaca, so you can now Subscribe on Steam [EDIT #2: CiVUP versions also available on Steam]
Or download here: (there are separate versions for G+K and for vanilla; see heinous_hat's post #12, below, for a replacement file for use with G+K with CiVUP):
 

Attachments

Thankyou very much, Nutty- Wonderful!
 
I've had this merged with the worldview.lua from civUP for a couple of months and it seems to be working without issue, so I thought I'd share for anyone interested. I'll post a code snippet (as soon as I find it again) in the event of future updates. Alpaca's edits are independent of other elements, so it should be a matter of simply pasting it in the right place, iirc.

In any case, this works with civUP 2.0.46. You need these merged or you lose either rotation or the shift-mouseover city effect (from civUP). This should also be based on the update that Nutty posted (need to double check).


This goes in ..\MODS\civ_v_unofficial_patch_v2_0_46__gk___v_46\Interface\Overrides\Misc\ (back up the original).
 

Attachments

Hey there. Does anyone know how to implement a "reset camera" rotation back to the original angle? Also, combat sounds cut out while rotating during combat animation...any way to disallow camera rotation during combat/fix this issue?
 
Unfortunately, there's no Reset event to hook, and AFAIK no variable to poll, and I'm pretty sure the DLL doesn't help with the graphics engine stuff.

Similarly as to fixing the audio issue. Your idea to prevent rotation during combat is probably possible, but is that really a big issue for you?

Re: the reset issue [or at least having visual feedback beyond the shape of the minimap rectangle] there's an interesting interaction between this mod and Simple Unit Icon Lowerer. Because I used the y coordinate instead of the z coordinate to lower unit icons, the icons will rotate with the world, giving you a visual reminder of which way is "up."

This gives me the idea that a compass of sorts (consisting of a dot that rotates around the inside edge of an ellipse with static cardinal points) could pop up near the selected unit while rotating.

Something like:
 
Unfortunately, there's no Reset event to hook, and AFAIK no variable to poll, and I'm pretty sure the DLL doesn't help with the graphics engine stuff.

Similarly as to fixing the audio issue. Your idea to prevent rotation during combat is probably possible, but is that really a big issue for you?

Admittedly, it is not a big issue for me.

I already looked through the Events API on modiki and I found nothing for Resetting the Camera. I was wondering if it was possible to keep track of angle change, and then upon "Reset" rotate the camera by -(anglechange). I guess I should have mentioned that in my first post.
 
Because the events are Camera[Start/Stop]Rotating[C/CW], I'm not sure how that kind of precision is possible.

Yeah. I was going to keep track of the time between events firing, but I realized that would end in disaster.

Oh well, I guess it's not very important. The compass idea is neat but you can tell the original orientation by the trapezoid on the minimap.
 
Here is an updated worldview.lua for BNW based on Nutty's version of Camera Rotation for G&K.

I've simply merged BNW's changes to the file... nothing new. Without this I believe there's some odd UI behavior concerning garrisons, ranged attacks, etc.

Thought I'd post since I already had it done and tested. Seems ok.
 

Attachments

Back
Top Bottom