Predefined camera position and angle

Post Reply
kronenblatt
General - Carrier
General - Carrier
Posts: 4691
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Predefined camera position and angle

Post by kronenblatt »

Is there a way to mod (maybe as shortcut key) the camera to change to a predefined position, zoom, and angle? (Unless there's already such a feature in vanilla?)

I'm thinking about using it for making exactly the same screenshots. (Maybe with different hotkeys for different map sizes.)
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28323
Joined: Sun Dec 04, 2005 6:25 pm

Re: Predefined camera position and angle

Post by rbodleyscott »

I think you could do this by modifying the parameters in the /DATA/MAPVIEW.TXT file. (But keep a backup of the original!)
Richard Bodley Scott

Image
Paul59
General - King Tiger
General - King Tiger
Posts: 3859
Joined: Tue Jul 21, 2015 11:26 pm

Re: Predefined camera position and angle

Post by Paul59 »

kronenblatt wrote: Fri Jul 03, 2020 4:32 pm Is there a way to mod (maybe as shortcut key) the camera to change to a predefined position, zoom, and angle? (Unless there's already such a feature in vanilla?)

I'm thinking about using it for making exactly the same screenshots. (Maybe with different hotkeys for different map sizes.)
This post discusses how to do it; modding the MAPVIEW.txt;

https://www.slitherine.com/forum/viewto ... 92&t=79690

But, as Richard said, make sure you make a copy of the original file first!
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
kronenblatt
General - Carrier
General - Carrier
Posts: 4691
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Predefined camera position and angle

Post by kronenblatt »

Paul59 wrote: Fri Jul 03, 2020 5:33 pm
kronenblatt wrote: Fri Jul 03, 2020 4:32 pm Is there a way to mod (maybe as shortcut key) the camera to change to a predefined position, zoom, and angle? (Unless there's already such a feature in vanilla?)

I'm thinking about using it for making exactly the same screenshots. (Maybe with different hotkeys for different map sizes.)
This post discusses how to do it; modding the MAPVIEW.txt;

https://www.slitherine.com/forum/viewto ... 92&t=79690

But, as Richard said, make sure you make a copy of the original file first!
I sure d-n will. Thanks Paul!
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
kronenblatt
General - Carrier
General - Carrier
Posts: 4691
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Predefined camera position and angle

Post by kronenblatt »

rbodleyscott wrote: Fri Jul 03, 2020 4:58 pm I think you could do this by modifying the parameters in the /DATA/MAPVIEW.TXT file. (But keep a backup of the original!)
Thanks to you as well, Richard! (Didn't see your post until now, sorry.)

This is a good post too:
Patrick Ward wrote: Sun Nov 26, 2017 4:28 pm Thought I'd repost this here.

Editing Data/Mapview.txt to change camera zoom and rotational limits.

PITCH - starting pitch? 90 is looking straight down.
PITCHLIMIT - a number of degrees you can rotate either side of the original starting pitch. Higher the number the great ther range you can move.
ZOOM - starting zoom level
ZOOMLIMIT - the value either side of the starting that you can zoom. works ame as pitch limit. (Confused .. seems redundant)
ZOOMINLIMIT - kind of speaks for itself. Smaller the number the closer you can zoom in . Speaking from the point of view of the artist .. if you can see pixels you're too close.
ROTATE - I think this is the starting heading of the camera (though it seems to be the opposite of what I'd expect)
FOV - Higher values give you a fish eye effect and can make you sick. Especially after strong coffee. 30-50 is ok Lower values can maybe, possibly, sometimes .. improve performance . . at least thats how it seems on my machine.

Your Mapview.txt might look something like this.
(Anything after // is ignored and we often use them to store values for later use so the values here might be of some use.)

PITCH 45
PITCHLIMIT 15 // 25
ZOOM 400
ZOOMLIMIT 1200 // 500
ZOOMINLIMIT 200 // 50
ROTATE 30
FOV 30
Where I'd then assume the three parameters to mess with are:

PITCH
ZOOM
ROTATE


But a question: in case I want to link a certain hotkey to this, don't I do that in the keys file instead? And how do I make a generic (global?) mod out of it: do I really need to change files in vanilla? Can't I instead make a separate mod folder that overwrite vanilla files when the game reads the mod?
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
Paul59
General - King Tiger
General - King Tiger
Posts: 3859
Joined: Tue Jul 21, 2015 11:26 pm

Re: Predefined camera position and angle

Post by Paul59 »

kronenblatt wrote: Fri Jul 03, 2020 6:58 pm
But a question: in case I want to link a certain hotkey to this, don't I do that in the keys file instead? And how do I make a generic (global?) mod out of it: do I really need to change files in vanilla? Can't I instead make a separate mod folder that overwrite vanilla files when the game reads the mod?
The Global Mod system is a bit hit and miss with the files it will work with. I have just tried setting up my modded MAPVIEW.txt as a Global Mod and it would not work. The only way I know is to edit the vanilla files MAPVIEW.txt, but I always keep the original file safe in case I have to go back to it.

I don't know anything about linking a hotkey, or if that is even possible.
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
kronenblatt
General - Carrier
General - Carrier
Posts: 4691
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Predefined camera position and angle

Post by kronenblatt »

Paul59 wrote: Fri Jul 03, 2020 8:25 pm
kronenblatt wrote: Fri Jul 03, 2020 6:58 pm
But a question: in case I want to link a certain hotkey to this, don't I do that in the keys file instead? And how do I make a generic (global?) mod out of it: do I really need to change files in vanilla? Can't I instead make a separate mod folder that overwrite vanilla files when the game reads the mod?
The Global Mod system is a bit hit and miss with the files it will work with. I have just tried setting up my modded MAPVIEW.txt as a Global Mod and it would not work. The only way I know is to edit the vanilla files MAPVIEW.txt, but I always keep the original file safe in case I have to go back to it.

I don't know anything about linking a hotkey, or if that is even possible.
There's a file, keys.bsf, in data/battle/scripts/ that is referred to in first post of this thread:

viewtopic.php?f=492&t=80109

That I set my hopes upon. But maybe it's not that simple?
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28323
Joined: Sun Dec 04, 2005 6:25 pm

Re: Predefined camera position and angle

Post by rbodleyscott »

kronenblatt wrote: Fri Jul 03, 2020 8:46 pm
Paul59 wrote: Fri Jul 03, 2020 8:25 pm
kronenblatt wrote: Fri Jul 03, 2020 6:58 pm
But a question: in case I want to link a certain hotkey to this, don't I do that in the keys file instead? And how do I make a generic (global?) mod out of it: do I really need to change files in vanilla? Can't I instead make a separate mod folder that overwrite vanilla files when the game reads the mod?
The Global Mod system is a bit hit and miss with the files it will work with. I have just tried setting up my modded MAPVIEW.txt as a Global Mod and it would not work. The only way I know is to edit the vanilla files MAPVIEW.txt, but I always keep the original file safe in case I have to go back to it.

I don't know anything about linking a hotkey, or if that is even possible.
There's a file, keys.bsf, in data/battle/scripts/ that is referred to in first post of this thread:

viewtopic.php?f=492&t=80109

That I set my hopes upon. But maybe it's not that simple?
That script is only polled when a unit is selected, which limits its usefulness for scripting hot keys.
Richard Bodley Scott

Image
kronenblatt
General - Carrier
General - Carrier
Posts: 4691
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Predefined camera position and angle

Post by kronenblatt »

rbodleyscott wrote: Fri Jul 03, 2020 8:49 pm
kronenblatt wrote: Fri Jul 03, 2020 8:46 pm
Paul59 wrote: Fri Jul 03, 2020 8:25 pm

The Global Mod system is a bit hit and miss with the files it will work with. I have just tried setting up my modded MAPVIEW.txt as a Global Mod and it would not work. The only way I know is to edit the vanilla files MAPVIEW.txt, but I always keep the original file safe in case I have to go back to it.

I don't know anything about linking a hotkey, or if that is even possible.
There's a file, keys.bsf, in data/battle/scripts/ that is referred to in first post of this thread:

viewtopic.php?f=492&t=80109

That I set my hopes upon. But maybe it's not that simple?
That script is only polled when a unit is selected, which limits its usefulness for scripting hot keys.
No probs that a unit needs to be selected. And could then that file be modded with an additional key (say 9) and using information from mapview.txt?

Code: Select all

if ( key == 58 )
{
PITCH 30
ZOOM 600
ROTATE 90
}
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
kronenblatt
General - Carrier
General - Carrier
Posts: 4691
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Predefined camera position and angle

Post by kronenblatt »

Actually I found this one, which is what precisely what I'm after, more or less.

the X hotkey, of course!
sIg3b wrote: Wed Nov 21, 2018 9:19 pm If you press X in the normal battlefield view, you get an extreme zoom-out, a strategic overview map of sorts...
But I'm still interested in the answer to my question since it gives me more flexibility. Not that I expect others to do the modding for me: it's just that maybe the overall hazzle of making this global mod for a slim chance of success will just take too long to find out... :)

Or maybe this X hotkey can be modded?
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28323
Joined: Sun Dec 04, 2005 6:25 pm

Re: Predefined camera position and angle

Post by rbodleyscott »

kronenblatt wrote: Fri Jul 03, 2020 9:20 pm Or maybe this X hotkey can be modded?
I think it is hard-coded in the engine, so probably not.
Richard Bodley Scott

Image
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28323
Joined: Sun Dec 04, 2005 6:25 pm

Re: Predefined camera position and angle

Post by rbodleyscott »

kronenblatt wrote: Fri Jul 03, 2020 9:09 pmAnd could then that file be modded with an additional key (say 9) and using information from mapview.txt?

Code: Select all

if ( key == 58 )
{
PITCH 30
ZOOM 600
ROTATE 90
}
No, that would not work. Those are not valid script commands.

There is a SetZoom(zoom) function, but I don't think there are script functions for camera pitch or rotation.
Richard Bodley Scott

Image
kronenblatt
General - Carrier
General - Carrier
Posts: 4691
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Predefined camera position and angle

Post by kronenblatt »

rbodleyscott wrote: Sat Jul 04, 2020 6:16 am
kronenblatt wrote: Fri Jul 03, 2020 9:09 pmAnd could then that file be modded with an additional key (say 9) and using information from mapview.txt?

Code: Select all

if ( key == 58 )
{
PITCH 30
ZOOM 600
ROTATE 90
}
No, that would not work. Those are not valid script commands.

There is a SetZoom(zoom) function, but I don't think there are script functions for camera pitch or rotation.
Ok, thanks for input Richard. Where could I find info about whether there are SetPitch and SetRotation functions as well?
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28323
Joined: Sun Dec 04, 2005 6:25 pm

Re: Predefined camera position and angle

Post by rbodleyscott »

kronenblatt wrote: Sat Jul 04, 2020 6:33 am Where could I find info about whether there are SetPitch and SetRotation functions as well?
There aren't.

See BattleScript.txt in /Documents/My Games/FEILDOFGLORY2/AUTODOCs for the full list of script functions.
Richard Bodley Scott

Image
kronenblatt
General - Carrier
General - Carrier
Posts: 4691
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Predefined camera position and angle

Post by kronenblatt »

rbodleyscott wrote: Sat Jul 04, 2020 7:25 am
kronenblatt wrote: Sat Jul 04, 2020 6:33 am Where could I find info about whether there are SetPitch and SetRotation functions as well?
There aren't.

See BattleScript.txt in /Documents/My Games/FEILDOFGLORY2/AUTODOCs for the full list of script functions.
Thanks Richard: then I know. The X key will work just fine then.
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
Post Reply

Return to “Field of Glory II: Modding”