How can I mod the binoculars ?

l00
Scavenger
Posts: 19
Joined: 27 Oct 2015, 05:21
Location: France
Contact:

How can I mod the binoculars ?

Postby l00 » 27 Oct 2015, 05:51

Hello,

I'm working on a project using Call of Chernobyl (Photographs of the zone)

Since few days, I found out that using the binoculars to take my screenshots is very much more convenient to me than doing all my usual console menu tricks;
It allows me to automatically hide the HUD and play with some focal length without using the fov command.
I have managed to removed the texture (by using an empty one) and increased the zoom factor in the binoc.ltx, but I would like to do more,
and I don't know how to proceed.

Basically, I want to change the binoculars in a 14-600 mm camera.
It means that I want to have 2 more steps of fov modifier: wide angle + normal (player fov view) and then, the regualr binocular small zoom - zoom - telezoom.

For now, all I've succeed to do is making the telezoom go further.
In fov equivalent, (I play in 55) it gives me something like : 45 - 20 - 5
And what I want is something like 85 - 55 - 45 - 20 - 5
But I don't know how to do this...I just hope it's possible.
Can someone help me ?

Also, I have something else in mind, which is certainly a lot more difficult to do.
I'd like to have a control over the "r2_tonemap" commands with the binoculars.
If possible, all of them, if not, at least, the tonemap_middlegray value.
But I don't hope too much on this.

So, if anyone is willing to help me, I would REALLY appreciate.
Thank you very much !

AxelDominatoR
Trespasser
Posts: 54
Joined: 19 Aug 2014, 20:14
Location: Glasgow
Contact:

Re: How can I mod the binoculars ?

Postby AxelDominatoR » 27 Oct 2015, 07:13

First of all let me say your pictures are awesome!

What have you modified on the binocular until now?
Do you need to change r2_tonemap while the binocular is active, or will a debug menu/command be ok for that?
I need to have a look at the code that manages changes to the tonemap, but if we already have functions to do that it should be as easy as calling those functions from a menu in the inventory, for example, or from a console command.
Axel DominatoR

l00
Scavenger
Posts: 19
Joined: 27 Oct 2015, 05:21
Location: France
Contact:

Re: How can I mod the binoculars ?

Postby l00 » 27 Oct 2015, 11:28

Thank you !

I have modified the texture of the "iron-sighted" binocular (wpn_crosshair_bino.dds). I have replaced it with a blank one.
The other thing that were modified is the "scope_zoom_factor" in the "w_binoc.ltx". (from 5 to 2.5), which gave me a better zoom.
There is other variables in this file, but I don't know how to use them, internet wasn't rich in information about the FOV settings.

The tonemap function are already in the console command, it is how I use them ingame to set my exposure ( like the fov). What could be nice is to have a shortcut to set them, with or without the binocular. If I can increase +1.0 or decrease -1.0 the middlegray with the "+" and "-" from the numpad for example, it would be quite enough. (actually, it would be fantastic)

(I'm sorry for my bad english, it's not my native language and I don't practice much.)

l00
Scavenger
Posts: 19
Joined: 27 Oct 2015, 05:21
Location: France
Contact:

Re: How can I mod the binoculars ?

Postby l00 » 27 Oct 2015, 12:34

Oh, by the way, if any dev from Call of Cherno is around : Your mod is a blast to me. The best (there is no match, really), and you have no idea how happy I am to get back in the zone in this conditions, after so many years without touching a Stalker.
You did an amazing job, and if you want to use one, some or all of my screenshots ; feel free to do it, you don"t even have to ask.
I have this project in mind for years now, but it's your mod that have made it possible to realize.

AxelDominatoR
Trespasser
Posts: 54
Joined: 19 Aug 2014, 20:14
Location: Glasgow
Contact:

Re: How can I mod the binoculars ?

Postby AxelDominatoR » 27 Oct 2015, 12:41

As for the binocular zoom, I'm still looking in the code as there's some weird stuff going on.
Good news is: you can likely add the keybindings easily.
If you open "scripts/axr_keybind.script" you will have an array named "keybinds" at the beginning.
Simply add two entries to it, like for example:

Code: Select all

["photo_increase_middlegrey"] = "DIK_ADD",
["photo_decrease_middlegrey"] = "DIK_SUBTRACT"


You should check those keys as I don't remember if DIK_ADD and DIK_SUBTRACT are the correct ones.
then you add two functions below, like:

Code: Select all

function action.photo_increase_middlegrey(p)
   if (p==1) then
      get_console():execute("console_command_to_increase_middlegrey")
   end
end

function action.photo_decrease_middlegrey(p)
   if (p==1) then
      get_console():execute("console_command_to_decrease_middlegrey")
   end
end


and... that should be it! You should be able to execute any command you want while in game.
Axel DominatoR

l00
Scavenger
Posts: 19
Joined: 27 Oct 2015, 05:21
Location: France
Contact:

Re: How can I mod the binoculars ?

Postby l00 » 27 Oct 2015, 12:56

I am sorry, I don't find the file you mention. I assume I have to download something like a db extractor ? Which .db should I open to find the script file ?

AxelDominatoR
Trespasser
Posts: 54
Joined: 19 Aug 2014, 20:14
Location: Glasgow
Contact:

Re: How can I mod the binoculars ?

Postby AxelDominatoR » 27 Oct 2015, 13:01

Yes, you need to extract the files. The file *should* be in config\config.db.
The extracted file should be placed in gamedata\scripts\
Axel DominatoR

l00
Scavenger
Posts: 19
Joined: 27 Oct 2015, 05:21
Location: France
Contact:

Re: How can I mod the binoculars ?

Postby l00 » 27 Oct 2015, 13:38

Doesn't work. I don't know if it is because of the keys or what.
I tried by using the real command line "r2_tonemap_middlegray" instead of ""console_command_to_increase_middlegrey", but no success neither.
The way I understand the code, it seems like you think that this command line is a sort of boolean.
But in truth, it's a command which need a variable. Like this : r2_tonemap_middlegray 1.1
What the code should do is add or remove a "0.1". So if my middlegray is 1.0 and I press the add +, the middlegray become 1.1.
Do you see ? (sorry if a talk nonsens, I don't know much about coding )

AxelDominatoR
Trespasser
Posts: 54
Joined: 19 Aug 2014, 20:14
Location: Glasgow
Contact:

Re: How can I mod the binoculars ?

Postby AxelDominatoR » 27 Oct 2015, 16:31

Try this:

http://pastebin.com/rTN7qXfG

Simply replace the entire contents of "axr_keybind.script". I used numpad's + and - to increase and decrease the values.
Don't worry if you see on screen values like 1.299999999999, it's a rounding imperfection and I was too lazy to fix it :P

Make sure axr_keybind is in gamedata/scripts and not any other scripts folder.Hope it will work, I tested it and it works for me.
Axel DominatoR

l00
Scavenger
Posts: 19
Joined: 27 Oct 2015, 05:21
Location: France
Contact:

Re: How can I mod the binoculars ?

Postby l00 » 27 Oct 2015, 17:46

Thank you very much, but it didn't work for me :/. I don't know why since I did everything you said.
I'll try with different keys, maybe.
About the binocular fov, did you find something ?

AxelDominatoR
Trespasser
Posts: 54
Joined: 19 Aug 2014, 20:14
Location: Glasgow
Contact:

Re: How can I mod the binoculars ?

Postby AxelDominatoR » 28 Oct 2015, 02:24

If you want to try different keys, here's a complete list:
http://www.flint.jp/misc/?q=dik&lang=en

you can replace DIK_ADD and DIK_SUBTRACT with other keys and see if they work.
If it still doesn't work, that means the script is not recognized. Can you please tell me in detail if you are playing with the normal, uncompressed Call of Chernobyl and you added the axr_keybind.script after uncompressing it? Or are you playing with the fully uncompressed DB files? Can you tell me what you did step by step?

About the FOV: it seems like it's tied up to the screen FOV, so I'm still trying to figure out if there's a way to achieve that range of zoom without modifying the game code or not. We have the source code of the engine anyway so if that's the case I should be able to insert a custom function to allow you to do that. Hopefully I'll have some time to look at it later on today.
Axel DominatoR

l00
Scavenger
Posts: 19
Joined: 27 Oct 2015, 05:21
Location: France
Contact:

Re: How can I mod the binoculars ?

Postby l00 » 28 Oct 2015, 02:34

Just a quick message to say that I have to leave for a few days and I won't have internet.
I'll check everything out this week end. Thank you very much again for all of your effort Axel.

l00
Scavenger
Posts: 19
Joined: 27 Oct 2015, 05:21
Location: France
Contact:

Re: How can I mod the binoculars ?

Postby l00 » 30 Oct 2015, 13:38

I'm back!

So, I tried to change the keys, but no success neither.
I play with a regular updated Coc with absolute Nature/concrete + OWR3
I uncompressed the config.db in a "extracted" folder, (inside the config folder of Cop) took the axr_keybind file to put it in my gamedata/scripts folder. (and then deleted the newly "extracted" folder)
I copied/paste the paste bin and then launched the game.
The thing is that i am still able to use the buddy system with the numpad (go there, wait here, be agressive etc etc), but not the exposition function you worked on. It's odd.

But don"t loose too much of your time on this please. If it's can"t be done (or hard to be done), then so be it. It's ok, I'll do this in the old fashion way, no problem :)
Thanks anyway.

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

Re: How can I mod the binoculars ?

Postby Alundaio » 30 Oct 2015, 15:12

You say COP folder, did you install CoC on top of CoP? It sounds like the script is not loaded, are you certain it is in call of chernobyl\gamedata\scripts\

If you used the installer without changing the install directory it will put coc inside a directory of COP. So it will look like this: call of pripyat\call of chernobyl\gamedata\scripts\
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

l00
Scavenger
Posts: 19
Joined: 27 Oct 2015, 05:21
Location: France
Contact:

Re: How can I mod the binoculars ?

Postby l00 » 30 Oct 2015, 15:55

My Coc is "remplacing" Cop. I didn't touch anything during the installation from the installer and he put all the files directly in my Cop folder, without creating a Coc one. (call of pripyat\\gamedata\scripts\)
I don"t understand why the game still load the script for the team system, and not the one that Alex wrote, since they all are in the same file ?
But whatever the answer is, I'll desinstall/reinstall everything clean towmorow, and try having a Coc folder inside my Cop folder like you said.

User avatar
Alundaio
S.T.A.L.K.E.R.
Posts: 1368
Joined: 26 May 2012, 22:26

Re: How can I mod the binoculars ?

Postby Alundaio » 30 Oct 2015, 16:10

no install CoC in it's own directory, it's standalone.
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

AxelDominatoR
Trespasser
Posts: 54
Joined: 19 Aug 2014, 20:14
Location: Glasgow
Contact:

Re: How can I mod the binoculars ?

Postby AxelDominatoR » 30 Oct 2015, 17:51

l00 wrote:I don"t understand why the game still load the script for the team system, and not the one that Alex wrote, since they all are in the same file ?


The file I gave you is present in the compressed archive "configs.db" as well. Maybe your CoC is able to read the axr_keybindings.script inside the config.db (as it has the follower commands, but not obviously my modifications), but is not able to load the modified one from gamedata/scripts.

Try following Alundaio's advice first (install CoC in an empty, separate folder) and see if that solves the issue.
Axel DominatoR

l00
Scavenger
Posts: 19
Joined: 27 Oct 2015, 05:21
Location: France
Contact:

Re: How can I mod the binoculars ?

Postby l00 » 31 Oct 2015, 04:46

Yes, the clean install did the job ; It's working ! And it's working pretty good.
How can I thank you guys ?

l00
Scavenger
Posts: 19
Joined: 27 Oct 2015, 05:21
Location: France
Contact:

Re: How can I mod the binoculars ?

Postby l00 » 31 Oct 2015, 15:04

Just a quick post to tell you guys to stop worrying about the binocular fov.
I mess a little bit with some of your codes in the keybind script and now I can show/hide the hud and use a wide angle or a normal fov very easily by pressing a simple key.
So it's perfect, I can finally stop using the ingame console to get the right shot ! :dualie:
Thanks again !

AxelDominatoR
Trespasser
Posts: 54
Joined: 19 Aug 2014, 20:14
Location: Glasgow
Contact:

Re: How can I mod the binoculars ?

Postby AxelDominatoR » 31 Oct 2015, 18:16

I'm glad to hear you made it work with the keybindings :)

As to what you can do to thank us... please keep on taking awesome pictures of the Zone :D
Axel DominatoR


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests