Jump to content
Sign in to follow this  
IndeedPete

RVMATs And Relative Dirs

Recommended Posts

Hey there,

not sure if this should be in some addon related subforum or here. I'm having this problem in a mission so I thought this place is as good as any.

Anyway, I've been working with (unbinarised) RVMATs, SMDIs, NOHQs and stuff before - but only on a campaign or addon level. I'm basically clearing the CSAT dots off a uniform to make a custom texture look better using setObjectMaterial. However, the RVMAT throws errors when I write in relative paths to find both NOHQ and SMDI files. Works fine when storing that stuff in the Campaigns dir or an addon folder but this time it will be a simple SP/MP mission.

Any of you brilliant minds knows a fix or workaround for this issue?

For reference, the unbinarised RVMAT, important stuff marked in red:

class StageTI
{
texture="a3\characters_f\opfor\data\clothing_ti_ca.paa";
};
ambient[]={1,1,1,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,0};
emmisive[]={0,0,0,1};
specular[]={1,1,1,1};
specularPower=100;
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1
{
[b][color="#FF0000"]texture="images\OpforClothing_GreyNOHQ.paa";[/color][/b]
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage2
{
texture="#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage3
{
texture="#(argb,8,8,3)color(0,0,0,0,MC)";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage4
{
texture="#(argb,8,8,3)color(1,1,1,1,AS)";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage5
{
[b][color="#FF0000"]texture="images\OpforClothing_GreySMDI.paa";[/color][/b]
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};
class Stage6
{
texture="#(ai,64,64,1)fresnel(1,0.7)";
uvSource="none";
};
class Stage7
{
texture="a3\data_f\env_co.paa";
uvSource="tex";
class uvTransform
{
	aside[]={1,0,0};
	up[]={0,1,0};
	dir[]={0,0,0};
	pos[]={0,0,0};
};
};

Please also note that adding an additional \ in front of the path doesn't help either.

Thanks for any help!

Share this post


Link to post
Share on other sites

And how would I do that? I'm not sure I understand what you mean.

Share this post


Link to post
Share on other sites

What does your folder structure look like? And specifically, where are the RVMAT and texture files located in relation to the mission root folder? The mission root folder is the folder you put all your mission files and might look something like this for example:

<MISSION FOLDER>\init.sqf

<MISSION FOLDER>\data\images

<MISSION FOLDER>\scripts

<MISSION FOLDER>\moar_data

Simply put, if the images folder with the PAAs happens to be in data

this:

texture="images\OpforClothing_GreyNOHQ.paa";

would become:

texture="data\images\OpforClothing_GreyNOHQ.paa";

If this doesn't work, you may need to include the mission folder in the path as well:

texture="<MISSION FOLDER>\images\OpforClothing_GreyNOHQ.paa";

Looking at the RVMAT in this thread, that does seem to be the case.

Edited by BadLuckBurt
added some info

Share this post


Link to post
Share on other sites

If you do need to have mission root included besides \images\ try this:

_filePath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
texture = format ["%1images\OpforClothing_GreyNOHQ.paa",_filepath];

Technically _filepath should already have a last \ included (ie missions\test.altis\) but if not, just add that between %1 and images.

Share this post


Link to post
Share on other sites

Ah, huge thanks, I'll try these ideas later and report back!

Share this post


Link to post
Share on other sites

tryteyker, that won't work inside an rvmat file :P

Pete I think rvmats are preprocessed, so maybe the "__FILE__" tag works.

Try this:

1. assuming your rvmat is named like this: "OpforClothing_Grey.rvmat"

2. rename your other files (and put them in the same dir as the rvmat)

OpforClothing_Grey.rvmat.SMDI.paa

OpforClothing_Grey.rvmat.NOHQ.paa

3. change the texture paths accordingly:

texture="__FILE__.NOHQ.paa";

texture="__FILE__.SMDI.paa";

Share this post


Link to post
Share on other sites

@BadLuckBurt, Tajin: Thanks for your help but I still get "cannot load XYZ.paa" errors. :/

@tryteyker: Not sure how I could get that into the RVMAT as it's a config file and doesn't accept code.

Share this post


Link to post
Share on other sites
@BadLuckBurt, Tajin: Thanks for your help but I still get "cannot load XYZ.paa" errors. :/

You're welcome. I have one final question, have you tried changing the filenames to all lowercase like OpforClothing_GreyNOHQ.paa to opforclothing_greynohq.paa? I noticed there are a few vanilla a3 textures in your RVMAT, do those throw errors as well?

Edited by BadLuckBurt
quote tag was messed up o.O

Share this post


Link to post
Share on other sites

No, I haven't but my files in the Campaign dir contain upper case letters as well and they don't cause errors.

Share this post


Link to post
Share on other sites
No, I haven't but my files in the Campaign dir contain upper case letters as well and they don't cause errors.

I know that when I was putting roads on a terrain in Terrain Builder, a certain file had to have the paths and filenames in lowercase, this might be the same thing. I don't mind if you don't want to try it out but that's the only thing I can think of to try and since the vanilla paths are also in lowercase. it could be worth a shot unless the PAA files are somehow corrupted.

Share this post


Link to post
Share on other sites

No, of course I will try it.^^ I think it's unlikely that the files are corrupted but I'll also try files I know are working. It's odd, I had this issue like six months ago when testing something but didn't really mind because it was for my campaign and worked within the campaign environment. Now it's quite the opposite, got them working within campaign folder but not in a single mission. Anyway, thanks for your help again, I'll do some more experiments. If everything fails it's not too much of a problem anyway as the mission is mostly dark and only enemies wear these uniforms.

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  

×