Jump to content
Sign in to follow this  
Meatball0311

proxy question....

Recommended Posts

I made a proxy of my modeled PVS-14 (NVG), which replaces the modeled BI PVS-7 that is shown in game when using NVG's. What I would like to do is have the PVS-14 in the up position during the day, but when I use the NVG at night, the PVS-14 is in the down position.

Is there any way I can do this by creating a proxy that is only visible during the day and is hidden at night?(Just like how it is set up now but reversed) Here is a picture to help with what I am trying to accomplish. And if I cant do it by proxy.. is there any other way?? Thanks

arma2OA2011-07-1007-54-15-09-1.jpg

Edited by Meatball0311

Share this post


Link to post
Share on other sites

Actually, I did not have it working properly, as the proxy was showing all the time, even during the day. I want my model to act like the BIS PVS-7, and only be visible when using NVG's. I made a model of PVS-14 and made a proxy with the path to the model I also added this in my config:

class CfgNonAIVehicles {
class ProxyGoggles;	// External class reference
class ProxyNVG_Proxy;
class pvs14_proxy : ProxyNVG_Proxy {
 model = "\mar_inf_marines\data\msot\gear\pvs_14\pvs14_proxy.p3d";
};
};

class CfgWeapons {
class Default;
class Binocular;
class NVGoggles;

class PVS14: NVGoggles {
 		displayName = "PVS-14";
 		nameSound = "nvgoggles";
 		simulation = "NVGoggles";
 		showEmpty = 0;
 		muzzlePos = "usti hlavne";
 		muzzleEnd = "konec hlavne";
 		value = 5;
 		opticsZoomMin = 1.0;
 		opticsZoomMax = 1.0;
 		modelOptics = "\ca\weapons\optika_night";
 		model = "\mar_inf_marines\data\msot\gear\pvs_14\pvs14_proxy";
 		picture = "\mar_inf_marines\data\msot\gear\pvs_14\mar_pvs14_ca.paa";
 		class Library  {
  			libTextDesc="Night vision goggles are intended for observation and terrain orientation at night. They work by intensifying the already available light in conditions of low illumination using, for instance, light from the moon or the stars.";
      };
 			descriptionShort = "Night Vision Goggles";
	};
};

The proxy is not acting like the BIS NVG proxy, as it shows all the time (even during the day) Any suggestions???

Edited by Meatball0311

Share this post


Link to post
Share on other sites

Ok... I got it working. However, I still would like to know how you can make a proxy only visible when NOT using NVG's.

This is what you need to do to get a new (YOUR) modeled NVG into game, and for it to work properly and appear ingame when you are using NVG's.

This is for adding custom NVG to your modeled Units

1. In your addon folder create a file named "proxies"

2. In the folder "proxies", create another folder named "nvg"

3. In the "nvg" folder place your "yourNVG.p3d" and create a file named "data"

4. In "data" folder I placed my texture, picture file, and rvmat.

5. Now move onto the config stage

6. Add this (this is my example) THIS IS VERY IMPORTANT:

class CfgNonAIVehicles {
class ProxyGoggles;  // External class reference
class ProxyBysta;
	class proxy[color="SeaGreen"][b]PVS14[/b][/color] (this class name MUST be the name of the proxy in the model example proxy[color="seagreen"][b]NAMEOFPROXY[/b][/color]): ProxyGoggles {
 	model = "\mar_inf_marines\proxies\nvg\[color="seagreen"][b]pvs14[/b][/color].p3d";
 };
};
//If you made you own NVG model, you must make it a weapon to assign it to your units.
class CfgWeapons {
class Default;
class Binocular;
class NVGoggles;

class PVS14: NVGoggles {
 		displayName = "PVS-14";
 		model = "\mar_inf_marines\proxies\nvg\pvs14.p3d";
 		picture = "\mar_inf_marines\proxies\nvg\data\mar_pvs14_ca.paa";
 		class Library  {
  			libTextDesc="Night vision goggles are intended for observation and terrain orientation at night. They work by intensifying the already available light in conditions of low illumination using, for instance, light from the moon or the stars.";
      };
 			descriptionShort = "Night Vision Goggles";
	};
};

** of course some of the class names will be dependant on what your p3d name is (green)

7. IMPORTANT you must rename your "NVG_proxy" not to the file path of your NVG model, but to its p3d name example: it should look like this when you are done proxy: pvs14

YourNVG.p3d should show in game when you are using your NVG.

Share this post


Link to post
Share on other sites
Ok... I got it working. However, I still would like to know how you can make a proxy only visible when NOT using NVG's

You could make the item you want to hide into a CfgGlasses-type headgear item, applied to your units with with IdentityTypes.

Glasses etc get swapped out by the NVG proxy when you turn NVGs on, so you could create your desired effect by this work-around.

It would require players to add it through their player profile options or setidentity in the editor/description.ext like sunglasses, but AI units can be configured to wear them by default.

Share this post


Link to post
Share on other sites
You could make the item you want to hide into a CfgGlasses-type headgear item, applied to your units with with IdentityTypes.

Glasses etc get swapped out by the NVG proxy when you turn NVGs on, so you could create your desired effect by this work-around.

It would require players to add it through their player profile options or setidentity in the editor/description.ext like sunglasses, but AI units can be configured to wear them by default.

Hmmmm... thanks! I am not familiar with CfgGlasses. Can you explain a little more..

I understand what you mean, just dont know how to configure Glasses. The effect that I would like, is for the NVG to be in the up position during the day (or whenever you are not using them) and then hidden when you are using NVG.

Share this post


Link to post
Share on other sites

Glasses occupy the same proxy position as NVGs when worn by a model, so whenever you turn on NVGs the glasses model is removed from the proxy and the NVG model is loaded instead. Then when you turn NVGs off, you get your glasses back. So if you model the NVG in the 'up' position and make your units wear them as 'glasses', they will be swapped with the NVG model you've modeled in the 'down' position when NVGs are turned on; giving the effect of the NVGs folding away when not in use.

I'm not 100% on how to configure them as unit models aren't really my thing, but I've seen examples of it in Schnapdropsel's and SJB/TF86's addons.

From what I can determine you need to make a model to act as a proxy in the same way you have done for the PVS-14 model in the down position; only this time you want it modeled in the up/folded position.

Then in your config you need an entry along the lines of:

class CfgGlasses {
class mar_proxy_PVS14up {
	scope = public;
	name = "PVS14 (up)";
	model = "\mar_inf_marines\proxies\nvg\pvs14_up.p3d";
	identityTypes[] = {"Mar_PVS14up", 1}; // I'm unsure exactly what the integer after the comma does here - maybe it's probability of the item being worn
};
};

Then under the 'class CfgVehicles' entries for your units (the bit where you tell them which weapons, magazines etc they have to carry) you need to add a line like this:

identityTypes[] = {"Head_USMC", "Mar_PVS14up"};

Or otherwise append the "Mar_PVS14up" identity that was created in your class CfgGlasses, to the list of whatever existing identitytypes you're using.

Edited by da12thMonkey

Share this post


Link to post
Share on other sites

You could also simply detect when the unit activates its NVGs (probably do-able via some form of eventhandler, not sure which would apply), and then simply hide the 'UP' NVGs via hiddenselections, and simply have the 'DOWN' NVGs as the normal NVGs proxy, without having to define a new NVG "weapon".

Share this post


Link to post
Share on other sites

Thanks for all the help, but I am still having troubles...

What I did was tried the CfgGlasses method and I am not getting the desired results. This is what I did:

1. This is in my config:

class CfgGlasses {
	class proxyPVS14UP {
 		scope = public;
 		name = "PVS-14 UP";
 		model = "\mar_inf_marines\proxies\nvg\pvs14up.p3d";
 		identityTypes[] = {"PVS14UP",100};
	};
};

Then I copied and pasted in the same location as my proxyPVS14 proxy and renamed it "\mar_inf_marines\proxies\nvg\pvs14up"

I added "PVS14UP" to my units identityTypes

The pvs14up is showing, but when I put on NVG's it does not disappear????

I would need help with the eventhandler method, but if it is possible I would like to know how... any other suggestions?

---------- Post added at 08:29 PM ---------- Previous post was at 07:50 PM ----------

I removed the "proxy: ....\pvs14up" and the CfgGlasses are working and the pvs14up.p3d

is showing. But, still it is not disappearing when I have NVG's on.

How would I determine if NVG's are being worn? I think the eventhandler method might need to come into play.

---------- Post added at 09:55 PM ---------- Previous post was at 08:29 PM ----------

BONSAI!! GOT IT!!

Was making some simple mistakes... the kind that you feel like punching yourself when you discover it. Basically, this is what needs to be done:

1. add something like this to your config:

//PVS-14 in up position (player must choose "PVS-14 UP" in profile under sunglasses) 
class CfgGlasses {
	class PVS14UP {
 		scope = 2;
 		name = "PVS-14 UP";
 		model = "\mar_inf_marines\proxies\nvg\pvs14up.p3d";
 		identityTypes[] = {"PVS14UP",1};
	};
};
//PVS-14 made standard NVG model and this tells the the proxy named proxy:pvs14 what model to use
class CfgNonAIVehicles {
class ProxyGoggles;  // External class reference
class ProxyBysta;
	class proxyPVS14: ProxyGoggles {
 	model = "\mar_inf_marines\proxies\nvg\pvs14.p3d";
 };
};
//Makes "PVS14" a weapon and gives it NVGoggles capabilities
class CfgWeapons {
class Default;
class Binocular;
class NVGoggles;

class PVS14: NVGoggles {
 		displayName = "PVS-14";
 		model = "\mar_inf_marines\proxies\nvg\pvs14.p3d";
 		picture = "\mar_inf_marines\proxies\nvg\data\mar_pvs14_ca.paa";
 		class Library  {
  			libTextDesc="Night vision goggles are intended for observation and terrain orientation at night. They work by intensifying the already available light in conditions of low illumination using, for instance, light from the moon or the stars.";
      };
 			descriptionShort = "Night Vision Goggles";
	};
};

2. There is no need for any other type of proxies, because CfgGlasses use your NVG proxy as where to position

You might have to tweak the position of your up position NVG model to be in the proper place.

arma2OA2011-07-1121-37-52-90.jpg

arma2OA2011-07-1121-37-12-03.jpg

Edited by Meatball0311

Share this post


Link to post
Share on other sites

You don't need to define a custom NVG "weapon", the default NVGs can use a custom proxy on your unit.

Share this post


Link to post
Share on other sites
You don't need to define a custom NVG "weapon", the default NVGs can use a custom proxy on your unit.

Hmmm... not really tracking what you are implying, but I dont want to use the default NVG's, I want to use the ones I modeled. So, I would have to configure it as a weapon if I wanted to use them instead of the default NVG's. Not tryingt to argue, but I am pretty sure I have done it in a way that will work for what purpose I am trying to accomplish. :)

Share this post


Link to post
Share on other sites

The way you're doing it works for existing units if you just want to re-config them (to use the PVS14s as glasses by default and to give them the new NVG weapon).

That said, ArmA2 supports custom proxies, in fact ArmA1 did. All you need to do is define the custom proxy on the unit models themselves. That worked with the SAS I released ages ago. You just path the NVG proxy in the unit models, to the custom NVG model, then with default NVGs, they show your custom models, not the default NVGs.

Either way works, but your way if units pick up default NVGs from crates (in MP or whatever), they'll show default NVGs, where-as the custom proxy way I suggest, works regardless of what class of NVGs they use.

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  

×