Jump to content
Sign in to follow this  
col_kurtz1979

Custom binoculars

Recommended Posts

Im new to creating my own config.cpp files and im having a couple of problems with this code:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgWeapons

{

class default {};

class tactical_binocular: Default

{

scopeWeapon=2;

scopeMagazine=1;

model="dalekohled_proxy";

modelOptics="optika_dalekohled";

weaponType=WeaponSlotBinocular;

magazineType=0;

ammo="";

displayName="Tactical binoculars";

reloadTime=0.000000;

sound[]={"",0,1};

canLock=0;

optics=1;

forceOptics=1;

primary=0;

opticsZoomMin=0.0085000;

opticsZoomMax=0.85000;

magazines[]={};

};

};

Firstly, the forceOptics=1; has no effect..... and secondly, when the player selects these binoculars from the action menu the unit just stands as if nothing has changed (ie. he doesnt put his gun away and pull out a pair of binoculars).

The optics for the binocular show when 'v' is pressed however, and the zoom function works fine.

Can anyone tell me where Im going wrong?

Share this post


Link to post
Share on other sites
Can anyone tell me where Im going wrong?

Yes, you're trying to replace something that's hard coded into the game.

Quote[/b] ]Im new to creating my own config.cpp files

But for this reason I'll let you off wink_o.gif

Sorry mate, its been tried, and tried, and tried again, but its just not possible to add new binoculars, nvg's or other slot 4069 objects into the game.

Share this post


Link to post
Share on other sites

The only way you may be able to do it is to replace original BIS Model...

As deadmeat said, impossible to replace those objects in game!

Share this post


Link to post
Share on other sites

My friend has a picture of his watch, he replaced the bis watch with his nice indiglo one. Then the binoculars he replaced too with these cool looking ones with tinted lens. But since he replaced them, he has to now copy the files he put them into, and then go and reinstall ofp or he can't install new patches!!!

Sucks crazy_o.gif

Share this post


Link to post
Share on other sites

Well, you could allways make a weapon addon like a pistol, that when you model it it looks like a set of bioculars, then make a scope for it like the binocular one, and change the animation with scripts so the unit handle the addon like the binoculars.

But in the gear will come like secon weapon instead of binocular or NVG.

Now days it should be posible, and if is posible to do, we could be able to have spoter scopes or monoculars, or whatever, something like that.

Yukonscout_b.jpg

Make it zoomable and you'll be in the go then. wink_o.gif

Only if is posible.

Do anybody tryed jet?

Share this post


Link to post
Share on other sites

That would work @cero, but then you wouldnt be able to carry a pistol and the new "binocs/scope"

Share this post


Link to post
Share on other sites
Quote[/b] ]

That would work @cero, but then you wouldnt be able to carry a pistol and the new "binocs/scope"

Hmm there comes an idea to my mind.

Isn't there a weaponchanging-script? Someone mentioned it with INQ's M24 which could be camoflaged due to a script which changed the weapon ingame. Couldn't there be a similar solution for the Binoc/secondary weapon preoblem?

Share this post


Link to post
Share on other sites
Isn't there a weaponchanging-script? Someone mentioned it with INQ's M24 which could be camoflaged due to a script which changed the weapon ingame. Couldn't there be a similar solution for the Binoc/secondary weapon preoblem?

Yep, that could do aswell, I supose biggrin_o.gif

two ideas in one go.

DeadMeat, I very rarelly use the hand guns, I wouldn't mind to sacrifice the hand gun for that.

Besides, it could work with the AT weapons slot, and a monocular would be better. So instead of a LAW you would pull a spoting scope.

That could be a secret idea for BAS?wink_o.gif

EDIT:

Quote[/b] ]"QUI VULT DARE PARVA NON DEBET MAGNA ROGARE" - HE WHO WISHES TO GIVE LITTLE SHOULD NOT ASK FOR MUCH."

wink_o.gif Nice one DM, I like that one mate.

Share this post


Link to post
Share on other sites
Besides, it could work with the AT weapons slot, and a monocular would be better. So instead of a LAW you would pull a spoting scope.

That could be a secret idea for BAS?wink_o.gif

Probably not sad_o.gif

Quote[/b] ]EDIT:
Quote[/b] ]"QUI VULT DARE PARVA NON DEBET MAGNA ROGARE" - HE WHO WISHES TO GIVE LITTLE SHOULD NOT ASK FOR MUCH."

wink_o.gif Nice one DM, I like that one mate.

hehe, kudos should really go to Soul Assassin, he had it in his sig first, but its so true I thought I'd put it too smile_o.gif

Share this post


Link to post
Share on other sites

That's a nice set of NVG.

How do you managed to do that? Oh, that must be you'r standart NVG that you are using in replacement of the BIS ones, is it?

Share this post


Link to post
Share on other sites
class Default {};

class Binocular : Default{};

class tactical_binocular: Binocular

Try useing that. wink_o.gif

Wont work...

No matter how you try to config it, it will not work, as it is hard coded into the game. Its just NOT possible (even Suma has said that)

Share this post


Link to post
Share on other sites

I was thinking if someone would be up to the chalenge on trying to make an addon like we said above, by creating a binocular or monocular addon instead of a handgun.

Anybody feel adventurous enough? biggrin_o.gif

Share this post


Link to post
Share on other sites
Guest

Ya, been there tried that....

It's possible to get a model in configged up as binocs. The point that always hung for me was the animations and the optics. The optics I could probably get around, but the animations!  crazy_o.gif

Since this stuff is not going to be used, I can show you an earlier experiment. No idea about this config....I know I had one working up to a point for a while...but no animations/optics: EDIT: probably the force optics bit...just re-read it and it's a slightly dud config, but if it helps anyone...

Quote[/b] ]class CfgVehicles

{

class All{};

class AllVehicles:All{};

class Land:AllVehicles{};

class Man:Land{};

class Soldier:Man{};

class SoldierWB:Soldier{};

class SoldierWSniper:SoldierWB{};

class ds_canteen:SoldierWSniper

{

displayName="US WaterDude";

weapons[]={us_canteen};

nightVision=0;

camouflage=0.600000;

};

};

class CfgWeapons

{

class Default {};

class Binocular: Default {};

class canteen: Binocular

{

scopeMagazine=2;

valueWeapon=5;

weaponType=WeaponSlotBinocular;

picture="";

sound[]={"",0,1};

useAction=0;

useActionTitle="";

optics=0;

forceOptics=0;

scope=2;

canDrop=1;

};

class ir_canteen: canteen

{

model="\ds_canteen\canteen.p3d";

displayName="Iraqi Canteen";

};

class us_canteen: canteen

{

model="\ds_canteen\us_canteen.p3d";

displayName="US Canteen";

};

};

class CfgNonAIVehicles

{

class ProxyWeapon {};

class ProxyCanteen: ProxyWeapon {};

};

Share this post


Link to post
Share on other sites
Guest

Again, just in case it helps anyone....(this is 1.90 config stuff):

Quote[/b] ]#define MANACTBINOCOFF 54

#define MANPOSBINOCSTAND 13

#define MANPOSBINOCLYING 2

#define MANPOSBINOC 12

#define MANACTBINOCON 53

class CfgManActions

{

BinocOn="";

BinocOff="";

}

class CfgMovesMC

{

access=1;

vehicleActions="CfgVehicleActions";

class Actions

{

class StandActions: NoActions

{

binocOn="BinocStand";

binocOff="Stand";

}

class CombatActions: NoActions

{

binocOn="Binoc";

binocOff="Combat";

}

class CrouchActions: CombatActions

{

binocOn="BinocCrouch";

binocOff="Crouch";

}

class LyingActions: NoActions

{

binocOn="BinocLying";

binocOff="Lying";

}

class BinocActions: CombatNoMoveActions

{

stop="Binoc";

default="Binoc";

binocOff="Combat";

upDegree=MANPOSBINOC;

};

class BinocLyingActions: LyingActions

{

stop="BinocLying";

default="BinocLying";

binocOff="Lying";

walkF="";

walkLF="";

walkRF="";

walkL="";

walkR="";

walkLB="";

walkRB="";

walkB="";

slowF="";

slowLF="";

slowRF="";

slowL="";

slowR="";

slowLB="";

slowRB="";

slowB="";

fastF="";

fastLF="";

fastRF="";

fastL="";

fastR="";

fastLB="";

fastRB="";

fastB="";

turnL="";

turnR="";

turnLRelaxed="";

turnRRelaxed="";

upDegree=MANPOSBINOCLYING;

turnSpeed=1;

};

class BinocStandActions: StandActions

{

stop="BinocStand";

default="BinocStand";

binocOff="Stand";

walkF="";

walkLF="";

walkRF="";

walkL="";

walkR="";

walkLB="";

walkRB="";

walkB="";

slowF="";

slowLF="";

slowRF="";

slowL="";

slowR="";

slowLB="";

slowRB="";

slowB="";

fastF="";

fastLF="";

fastRF="";

fastL="";

fastR="";

fastLB="";

fastRB="";

fastB="";

turnL="";

turnR="";

turnLRelaxed="";

turnRRelaxed="";

upDegree=MANPOSBINOCSTAND;

turnSpeed=2;

};

class BinocCrouchActions: CrouchActions

{

stop="BinocCrouch";

default="BinocCrouch";

binocOff="Crouch";

walkF="";

walkLF="";

walkRF="";

walkL="";

walkR="";

walkLB="";

walkRB="";

walkB="";

slowF="";

slowLF="";

slowRF="";

slowL="";

slowR="";

slowLB="";

slowRB="";

slowB="";

fastF="";

fastLF="";

fastRF="";

fastL="";

fastR="";

fastLB="";

fastRB="";

fastB="";

turnL="";

turnR="";

turnLRelaxed="";

turnRRelaxed="";

upDegree=MANPOSBINOC;

turnSpeed=2;

};

};

class Default

{

enableBinocular=0;

}

class States

{

class CombatToBinoc: Default

{

actions="CombatActions";

file="sdalek.rtm";

speed=-1.000000;

looped=0;

disableWeapons=1;

showItemInHand=1;

soundEnabled=0;

};

class Binoc: Default

{

actions="BinocActions";

file="sdalekstat.rtm";

speed=10000000000.000000;

looped=1;

disableWeapons=0;

showItemInHand=1;

soundEnabled=0;

enableBinocular=1;

head="headNo";

};

class BinocToCombat: Default

{

actions="CombatActions";

file="sdalek2.rtm";

speed=-1.000000;

looped=0;

disableWeapons=1;

showItemInHand=1;

soundEnabled=0;

};

class LyingToBinocLying: Default

{

actions="LyingActions";

file="plazenidalek.rtm";

speed=-2.000000;

looped=0;

disableWeapons=1;

soundEnabled=0;

showItemInHand=1;

onLandBeg=1;

onLandEnd=1;

};

class BinocLying: Default

{

actions="BinocLyingActions";

file="plazenidalekstat.rtm";

speed=10000000000.000000;

looped=1;

disableWeapons=0;

showItemInHand=1;

soundEnabled=0;

enableBinocular=1;

onLandBeg=1;

onLandEnd=1;

duty=-1;

};

class BinocLyingToLying: Default

{

actions="LyingActions";

file="plazenidalek2.rtm";

speed=-2.000000;

looped=0;

disableWeapons=1;

showItemInHand=1;

soundEnabled=0;

onLandBeg=1;

onLandEnd=1;

};

class StandToBinocStand: Default

{

actions="StandActions";

file="bezdalek.rtm";

speed=-1.000000;

looped=0;

disableWeapons=1;

showItemInHand=1;

soundEnabled=0;

connectFrom[]={"Stand",2};

};

class BinocStand: Default

{

actions="BinocStandActions";

file="bezdalekstat.rtm";

speed=10000000000.000000;

looped=1;

disableWeapons=0;

showItemInHand=1;

soundEnabled=0;

enableBinocular=1;

connectFrom[]={"StandToBinocStand",1};

connectTo[]={"BinocStandToStand",1};

};

class BinocStandToStand: Default

{

actions="StandActions";

file="bezdalek2.rtm";

speed=-1.000000;

looped=0;

disableWeapons=1;

showItemInHand=1;

soundEnabled=0;

connectTo[]={"Stand",2};

};

class CrouchToBinocCrouch: Default

{

actions="CrouchActions";

file="klekdalekstart.rtm";

speed=-1.000000;

looped=0;

disableWeapons=1;

showItemInHand=1;

soundEnabled=0;

connectFrom[]={"Crouch",2};

};

class BinocCrouch: Default

{

actions="BinocCrouchActions";

file="klekdalekstat.rtm";

speed=10000000000.000000;

looped=1;

disableWeapons=0;

showItemInHand=1;

soundEnabled=0;

enableBinocular=1;

connectFrom[]={"CrouchToBinocCrouch",1};

connectTo[]={"BinocCrouchToCrouch",1};

};

class BinocCrouchToCrouch: Default

{

actions="CrouchActions";

file="klekdalekend.rtm";

speed=-1.000000;

looped=0;

disableWeapons=1;

showItemInHand=1;

soundEnabled=0;

connectTo[]={"Crouch",2};

};

class Interpolations

{

};

transitionsInterpolated[]={};

transitionsSimple[]={"CombatToBinoc",2,"CombatToBinoc","Binoc",2,"Binoc&quo

t;,"BinocToCombat",2,"BinocToCombat","LyingToBinocLying",2,&

quot;LyingToBinocLying","BinocLying",2,"BinocLying","BinocLy

ingToLying",2,"BinocLyingToLying"};

transitionsDisabled[]={};

};

class CfgWeapons

{

access=1;

class Binocular: Default

{

scopeWeapon=2;

scopeMagazine=1;

model="dalekohled_proxy";

modelOptics="optika_dalekohled";

valueWeapon=5;

weaponType=4096;

magazineType=0;

ammo="";

displayName="$STR_DN_BINOCULAR";

reloadTime=0.000000;

sound[]={"",0,1};

canLock=0;

optics=1;

forceOptics=1;

primary=0;

opticsZoomMin=0.085000;

opticsZoomMax=0.085000;

magazines[]={};

};

class NVGoggles: Binocular

{

displayName="$STR_DN_NV_GOGGLES";

showEmpty=0;

valueWeapon=5;

opticsZoomMin=1.000000;

opticsZoomMax=1.000000;

modelOptics="optika_night";

model="nvg_proxy";

};

class Phone: Binocular

{

scopeWeapon=1;

displayName="$STR_DN_PHONE";

showEmpty=0;

opticsZoomMin=1.000000;

opticsZoomMax=1.000000;

model="sluchatko_proxy";

modelOptics="";

};

}

Share this post


Link to post
Share on other sites

You can change the animations slightly to allow you to use your own binoculars with scripts.

One of the problem is you cant use the keyboard to switch between binocs and weapons, you would have to define user actions to activate and deactivate the binocs.

Place this addon in the editor and call playmove "FOBinoc" using a radio trigger.

http://www.ofpec.com/yabbse....d=13099

And select Iron sights to actually look through them, which highlights another problem.

At the moment when you do, it will switch to the ironsights of the weapon you placed on the floor as part of the FOBinoc anim, and the view looks like you are spinning around. Which is a major obstical AFAIK?

There is a video camera addon kicking around somewhere, with different anims and model, you might have the basics for your own optics?

Share this post


Link to post
Share on other sites

So, the problems so far, sighting, animations, the way to call the addon into action( wiil have to be the action menu), conflict with another weapons sight???

This is just my sugestions, or what I (as a player, one more from the thousends in the comunity) would be happy with.

I'm allso saying that I'm not an addon maker or anything, and all my sugestions or ideas are based on things that I read or I think that they are common sense.

So here we go.

The binocular or monocular or spoting scope, could be made like that.

-Make a pistol that looks like a set of binoculars.

-Don't create any kind of amunition for it and don't create any sound files for firing, dry, or change magazine, because is not a weapon biggrin_o.gif

-create a sight picture like if you were going to use a scope for the weapon. Make it as a monocular or a binocular shape. As far as I know, it can be on any shape color and form, so a binocular shape should be possible.

-you can add a mil-relation formula reticle to it and make it really something worth and speciall.

Like the one in this pic.

fig4-1.gif

-For the animation. Well, I think that it shouldn't be a problem, it have to be a way to script it so that the unit uses the binocular animation when this addon is used, or even better, create a whole new animation, and find or create or get someone to create a script that call this animation when the addon is selected.

-The way to call the addon into action (make the unit use it). I would be happy if it was the same way you would call what it really is, a secondary weapon, but it wouldn't be a weapon

wink_o.gif

Last problem I can think so far?

Quote[/b] ]And select Iron sights to actually look through them, which highlights another problem.

At the moment when you do, it will switch to the ironsights of the weapon you placed on the floor as part of the FOBinoc anim, and the view looks like you are spinning around. Which is a major obstical AFAIK?

You wouldn't use iron sights(field sights) You would be using the scope. and the binocular, or whatever it will be, is a contained peace of gear on its selfe, so you don't have to drop a weapon, just swich from assault rifle to secodary, the binocular addon in this case.

I think an addon like that would be ideal for multiplayer in particular, to have to players, one the sniper and the other the spoter, for example, and don't have them grouped togueder for whatever reason the mission editor decided no to group them.

Live reall information of the target's distance, and anything that can be ovtained throught the binoculars, monoculars, etc, etc.

Like I said above, I'm not a addon creator, not a scripter, so you masters of addon creation will probably prove me wrong in all the sugestions I presented here. After all, they are just sugestions, or should I say hopes. smile_o.gif

Thanks for the attention.

@CERO.

Share this post


Link to post
Share on other sites

This is a great idea if someone could pull it off. I like the idea of having it in the pistol slot so a quick "Y" would switch to it.

If you realy need a pistol you can chuck it in your back pack (the fantastic one released) along with other "tools for the job".

Share this post


Link to post
Share on other sites

I just looked at the back pack addon, and I think it could go very well with a binocular addon.

Maybe Neon would like to add this things to his FIA mod. hint hint biggrin_o.gif

Share this post


Link to post
Share on other sites

I would hate if this topic dies off. I think is alot of potenciall in here.

No one has come with a prove that this won't work, and it don't look like if anybody is trying to experiment on it.

Or at list no body said so.

If this could work it can open alot of dors for other addons.

Now days, nothing is impossible.

Share this post


Link to post
Share on other sites

Is somebody having at list a look to that?

Any worth news? rock.gif

Share this post


Link to post
Share on other sites
Can anyone tell me where Im going wrong?

Yes, you're trying to replace something that's hard coded into the game.

Quote[/b] ]Im new to creating my own config.cpp files

But for this reason I'll let you off wink_o.gif

Sorry mate, its been tried, and tried, and tried again, but its just not possible to add new binoculars, nvg's or other slot 4069 objects into the game.

Inquisitor made a custom nvg!

Share this post


Link to post
Share on other sites
Can anyone tell me where Im going wrong?

Yes, you're trying to replace something that's hard coded into the game.

Quote[/b] ]Im new to creating my own config.cpp files

But for this reason I'll let you off wink_o.gif

Sorry mate, its been tried, and tried, and tried again, but its just not possible to add new binoculars, nvg's or other slot 4069 objects into the game.

Inquisitor made a custom nvg!

Yawn...

Inquisitors "custom" NVG's simply replaced the BIS ones ingame, by overwriting the BIS files for the NVG's...

Hence they fall under the: "the only way you can do it is to replace the files in Data.pbo and Data2D.pbo" category...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×