Predefined camera position and angle
-
kronenblatt
- General - Carrier

- Posts: 4691
- Joined: Mon Jun 03, 2019 4:17 pm
- Location: Stockholm, SWEDEN
Predefined camera position and angle
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.)
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
https://www.slitherine.com/forum/viewtopic.php?t=108643
-
rbodleyscott
- Field of Glory 2

- Posts: 28323
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Predefined camera position and angle
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


Re: Predefined camera position and angle
This post discusses how to do it; modding the MAPVIEW.txt;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.)
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.
Field of Glory II Medieval Scenario Designer.
FOGII TT Mod Creator
Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
-
kronenblatt
- General - Carrier

- Posts: 4691
- Joined: Mon Jun 03, 2019 4:17 pm
- Location: Stockholm, SWEDEN
Re: Predefined camera position and angle
I sure d-n will. Thanks Paul!Paul59 wrote: ↑Fri Jul 03, 2020 5:33 pmThis post discusses how to do it; modding the MAPVIEW.txt;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.)
https://www.slitherine.com/forum/viewto ... 92&t=79690
But, as Richard said, make sure you make a copy of the original file first!
kronenblatt's campaign and tournament thread hub:
https://www.slitherine.com/forum/viewtopic.php?t=108643
https://www.slitherine.com/forum/viewtopic.php?t=108643
-
kronenblatt
- General - Carrier

- Posts: 4691
- Joined: Mon Jun 03, 2019 4:17 pm
- Location: Stockholm, SWEDEN
Re: Predefined camera position and angle
Thanks to you as well, Richard! (Didn't see your post until now, sorry.)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!)
This is a good post too:
Where I'd then assume the three parameters to mess with are: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
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
https://www.slitherine.com/forum/viewtopic.php?t=108643
Re: Predefined camera position and angle
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.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?
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.
Field of Glory II Medieval Scenario Designer.
FOGII TT Mod Creator
Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
-
kronenblatt
- General - Carrier

- Posts: 4691
- Joined: Mon Jun 03, 2019 4:17 pm
- Location: Stockholm, SWEDEN
Re: Predefined camera position and angle
There's a file, keys.bsf, in data/battle/scripts/ that is referred to in first post of this thread:Paul59 wrote: ↑Fri Jul 03, 2020 8:25 pmThe 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.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?
I don't know anything about linking a hotkey, or if that is even possible.
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
https://www.slitherine.com/forum/viewtopic.php?t=108643
-
rbodleyscott
- Field of Glory 2

- Posts: 28323
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Predefined camera position and angle
That script is only polled when a unit is selected, which limits its usefulness for scripting hot keys.kronenblatt wrote: ↑Fri Jul 03, 2020 8:46 pmThere's a file, keys.bsf, in data/battle/scripts/ that is referred to in first post of this thread:Paul59 wrote: ↑Fri Jul 03, 2020 8:25 pmThe 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.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?
I don't know anything about linking a hotkey, or if that is even possible.
viewtopic.php?f=492&t=80109
That I set my hopes upon. But maybe it's not that simple?
Richard Bodley Scott


-
kronenblatt
- General - Carrier

- Posts: 4691
- Joined: Mon Jun 03, 2019 4:17 pm
- Location: Stockholm, SWEDEN
Re: Predefined camera position and angle
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?rbodleyscott wrote: ↑Fri Jul 03, 2020 8:49 pmThat script is only polled when a unit is selected, which limits its usefulness for scripting hot keys.kronenblatt wrote: ↑Fri Jul 03, 2020 8:46 pmThere's a file, keys.bsf, in data/battle/scripts/ that is referred to in first post of this thread: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.
viewtopic.php?f=492&t=80109
That I set my hopes upon. But maybe it's not that simple?
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
https://www.slitherine.com/forum/viewtopic.php?t=108643
-
kronenblatt
- General - Carrier

- Posts: 4691
- Joined: Mon Jun 03, 2019 4:17 pm
- Location: Stockholm, SWEDEN
Re: Predefined camera position and angle
Actually I found this one, which is what precisely what I'm after, more or less.
the X hotkey, of course!

Or maybe this X hotkey can be modded?
the X hotkey, of course!
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
https://www.slitherine.com/forum/viewtopic.php?t=108643
-
rbodleyscott
- Field of Glory 2

- Posts: 28323
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Predefined camera position and angle
I think it is hard-coded in the engine, so probably not.
Richard Bodley Scott


-
rbodleyscott
- Field of Glory 2

- Posts: 28323
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Predefined camera position and angle
No, that would not work. Those are not valid script commands.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 }
There is a SetZoom(zoom) function, but I don't think there are script functions for camera pitch or rotation.
Richard Bodley Scott


-
kronenblatt
- General - Carrier

- Posts: 4691
- Joined: Mon Jun 03, 2019 4:17 pm
- Location: Stockholm, SWEDEN
Re: Predefined camera position and angle
Ok, thanks for input Richard. Where could I find info about whether there are SetPitch and SetRotation functions as well?rbodleyscott wrote: ↑Sat Jul 04, 2020 6:16 amNo, that would not work. Those are not valid script commands.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 }
There is a SetZoom(zoom) function, but I don't think there are script functions for camera pitch or rotation.
kronenblatt's campaign and tournament thread hub:
https://www.slitherine.com/forum/viewtopic.php?t=108643
https://www.slitherine.com/forum/viewtopic.php?t=108643
-
rbodleyscott
- Field of Glory 2

- Posts: 28323
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Predefined camera position and angle
There aren't.kronenblatt wrote: ↑Sat Jul 04, 2020 6:33 am Where could I find info about whether there are SetPitch and SetRotation functions as well?
See BattleScript.txt in /Documents/My Games/FEILDOFGLORY2/AUTODOCs for the full list of script functions.
Richard Bodley Scott


-
kronenblatt
- General - Carrier

- Posts: 4691
- Joined: Mon Jun 03, 2019 4:17 pm
- Location: Stockholm, SWEDEN
Re: Predefined camera position and angle
Thanks Richard: then I know. The X key will work just fine then.rbodleyscott wrote: ↑Sat Jul 04, 2020 7:25 amThere aren't.kronenblatt wrote: ↑Sat Jul 04, 2020 6:33 am Where could I find info about whether there are SetPitch and SetRotation functions as well?
See BattleScript.txt in /Documents/My Games/FEILDOFGLORY2/AUTODOCs for the full list of script functions.
kronenblatt's campaign and tournament thread hub:
https://www.slitherine.com/forum/viewtopic.php?t=108643
https://www.slitherine.com/forum/viewtopic.php?t=108643
