Jump to content
Sign in to follow this  
hamis

Textures config help needed

Recommended Posts

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_tank = _this select 0;

_engineon = _this select 1;

sleep 1;

if (_engineon) then {

_tank setObjectTexture [0,"\smurfc_era\data\t72_2_RED_co.paa"];

_tank setObjectTexture [1,"\smurfc_era\data\t72_2_RED_co.paa"];

if !(local _tank) exitwith {};

sleep 1;

if !(isengineon _tank) exitwith {};

_tank vehiclechat "Shtora system ONline";

}

else {

_tank setObjectTexture [0,"\smurfc_era\data\t72_2_co.paa"];

_tank setObjectTexture [1,"\smurfc_era\data\t72_2_co.paa"];

if !(local _tank) exitwith {};

sleep 2;

if (isengineon _tank) exitwith {};

_tank vehiclechat "Shtora system OFFline";

};

I need help to add last lines of next config to make textures to work then loading saved mission.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_tex = _this select 0;

_camo = _this select 1;

switch (_this select 1) do

{

case "SLA" :

{

_tex setObjectTexture [1,"\ch_t72\data\t-72\sla\t72_1_co.paa"];

_tex setObjectTexture [2,"\ch_t72\data\t-72\sla\t72_2_co.paa"];

_tex setObjectTexture [3,"\ch_t72\data\t-72\sla\t72_3_co.paa"];

_tex setObjectTexture [4,"\ch_t72\data\t-72\sla\t72_4_co.paa"];

_tex setObjectTexture [5,"\ch_t72\data\t-72\sla\t72_track_co.paa"];

};

case "Soviet" :

{

_tex setObjectTexture [1,"\ch_t72\data\t-72\soviet\t72_1_co.paa"];

_tex setObjectTexture [2,"\ch_t72\data\t-72\soviet\t72_2_co.paa"];

_tex setObjectTexture [3,"\ch_t72\data\t-72\soviet\t72_3_co.paa"];

_tex setObjectTexture [4,"\ch_t72\data\t-72\soviet\t72_4_co.paa"];

_tex setObjectTexture [5,"\ch_t72\data\t-72\soviet\t72_track_co.paa"];

};

case "Modern" :

{

_tex setObjectTexture [1,"\ch_t72\data\t-72\modern\t72_1_co.paa"];

_tex setObjectTexture [2,"\ch_t72\data\t-72\modern\t72_2_co.paa"];

_tex setObjectTexture [3,"\ch_t72\data\t-72\modern\t72_3_co.paa"];

_tex setObjectTexture [4,"\ch_t72\data\t-72\modern\t72_4_co.paa"];

_tex setObjectTexture [5,"\ch_t72\data\t-72\modern\t72_track_co.paa"];

};

case "Desert" :

{

_tex setObjectTexture [1,"\ch_t72\data\t-72\desert\t72_1_co.paa"];

_tex setObjectTexture [2,"\ch_t72\data\t-72\desert\t72_2_co.paa"];

_tex setObjectTexture [3,"\ch_t72\data\t-72\desert\t72_3_co.paa"];

_tex setObjectTexture [4,"\ch_t72\data\t-72\desert\t72_4_co.paa"];

_tex setObjectTexture [5,"\ch_t72\data\t-72\desert\t72_track_co.paa"];

};

case "RACS" :

{

_tex setObjectTexture [1,"\ch_t72\data\t-72\racs\t72_1_co.paa"];

_tex setObjectTexture [2,"\ch_t72\data\t-72\racs\t72_2_co.paa"];

_tex setObjectTexture [3,"\ch_t72\data\t-72\racs\t72_3_co.paa"];

_tex setObjectTexture [4,"\ch_t72\data\t-72\racs\t72_4_co.paa"];

_tex setObjectTexture [5,"\ch_t72\data\t-72\racs\t72_track_co.paa"];

};

};

//the following code is here to fix a bug with setObjectTexture command in singleplayer games

sleep 0.1;

waitUntil {time == 0};

CH_Textures = [_tex, _camo] execVM "\ch_t72_cfg\scripts\t-72\textures.sqf";

So i need to merge this to first config:

Quote[/b] ]//the following code is here to fix a bug with setObjectTexture command in singleplayer games

sleep 0.1;

waitUntil {time == 0};

CH_Textures = [_tex, _camo] execVM "\ch_t72_cfg\scripts\t-72\textures.sqf";

Quick answer appreciated.

Share this post


Link to post
Share on other sites

Quick answer: the second quote is from a SQF script, not a config. I would put that script into init.sqf and viola!

Share this post


Link to post
Share on other sites

Sorry,both are sqf's.There is no init.sqf,so what to do?

Share this post


Link to post
Share on other sites

You're right about that. I didn't bother reading the first two code blocks because you said you were trying to merge the new code with the "first config". The problem here is obvious then. There isn't a config. Just make a file called init.sqf for your mission, and it will load and run at the beginning of the mission. Make sure you include <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">sleep 0.001; at the beginning of your script, so that the game doesn't freak out on you.

If you're trying to put this into a config, then you've got a long way to go. I don't think that configs are the solution here. For scripting help, I would check in the Mission Editing & Scripting section.

Share this post


Link to post
Share on other sites

I assume you have done an addon wich consist of many skins for one-model tank, that you already have a config for it, that you set tank skin with an init EH properly and that the only problem you have with this by now is that textures are not set when loading a saved mission. If is that your case, maybe you would like to check this topic, I'm not an expert nor have tried to do it, but the guy that started it said he solved that matter, so it should work for you too.

If it's not what you are requesting please specify what's the point for all that stuff and maybe I can help you.

Share this post


Link to post
Share on other sites

Well,this should be easy.First sqf is from smurf_eraT72 pack which i'm using to replace BIS T72.Second one is from ch_t72_v0.91 T72 pack which i can't use.So i need those few lines to be integrated to smurf sqf ot get rid of texture loading bug.

Share this post


Link to post
Share on other sites

they released a fix themselves. get their update. wink_o.gif

Share this post


Link to post
Share on other sites

Last sqf is from that (CH)pack!!!I can't use that pack because it get no hull/any textures in that pack's tank's.

Share this post


Link to post
Share on other sites

Did you tell them about the problem?

Are do you want to setup this for your own addon?

Share this post


Link to post
Share on other sites

Yeah,i told them.They told me to try with vanilla arma which i can't do,because i have made lot's of changes for original pbo's.I plan this change for my personal use.

Share this post


Link to post
Share on other sites

I'm a bit confused. When You posted in CH Addons topic You meant that You have problem with original CH T72 or Smurf T72 when You tried to implement setObjectTexture fix?

About that setObjectTexture fix. At the end of the smurf script You need to put the following code:

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

waitUntil {time == 0};

Those two lines will detect if game was loaded. Under those two lines You need to execute once more the whole script. You can do that by pasting the code that originally executed this script (probably it's in config.cpp under event handlers) or by  using breakTo command:

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

_tank = _this select 0;

_engineon = _this select 1;

sleep 1;

if (_engineon) then

{

_tank setObjectTexture [0,"\smurfc_era\data\t72_2_RED_co.paa"];

_tank setObjectTexture [1,"\smurfc_era\data\t72_2_RED_co.paa"];

if !(local _tank) exitwith {};

sleep 1;

if !(isengineon _tank) exitwith {};

_tank vehiclechat "Shtora system ONline";

} else {

_tank setObjectTexture [0,"\smurfc_era\data\t72_2_co.paa"];

_tank setObjectTexture [1,"\smurfc_era\data\t72_2_co.paa"];

if !(local _tank) exitwith {};

sleep 2;

if (isengineon _tank) exitwith {};

_tank vehiclechat "Shtora system OFFline";

};

//the following code is here to fix a bug with setObjectTexture command in singleplayer games

sleep 0.1;

waitUntil {time == 0};

breakTo "Shtora";

note: I didn't tested the above script so it may not work properly wink_o.gif

Share this post


Link to post
Share on other sites

Well,thanks for help.But i found out it is that (sleep 0.1;

waitUntil {time == 0}) script that breaks ECS and GDTmodhdr functionality! crazy_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]But i found out it is that (sleep 0.1;

waitUntil {time == 0}) script that breaks ECS and GDTmodhdr functionality

Well,any solutions for this prob? banghead.gif

Share this post


Link to post
Share on other sites

Shouldnt it be more like this: waitUntil {time != 0}; ??

Share this post


Link to post
Share on other sites
Shouldnt it be more like this: waitUntil {time != 0}; ??

T_D - According to the ArmA wiki the time value is the time elapsed since mission started (in seconds). Value of time is not saved when the mission is saved and so will be reset to zero when a mission is restarted from a saved position (posted by hardrock).

In other words when time is equal to 0 after mission start it means that the saved game was loaded. Thanks to that we know when to execute code that is not working properly after savegame load.

hamis - I still don't know what You mean by saying that this code breaks ECS and GDTmodhdr functionality. You mean In whole game, in CH t72 or just in modified Smurfc t72?

Share this post


Link to post
Share on other sites
Quote[/b] ]You mean In whole game, in CH t72 or just in modified Smurfc t72?

I mean both.If i select one of them in the editor,ECS doesn't load and GDTmodhdr doesn't work.

Share this post


Link to post
Share on other sites

Sorry,i had wrong script at first post.This is correct one:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// e.g.: init="test=[this, 123] execVM ""\smurfc_era\assignNumber.sqf"";";

_tex = _this select 0;

_number = _this select 1;

_nr = (_number / 100) Mod 10;

_nr = _nr - (_nr Mod 1);

switch (format ["%1", _nr]) do

{

case "0": { _tex setObjectTexture [2,"\smurfc_era\numbers\zero"];};

case "1": { _tex setObjectTexture [2,"\smurfc_era\numbers\one"];};

case "2": { _tex setObjectTexture [2,"\smurfc_era\numbers\two"];};

case "3": { _tex setObjectTexture [2,"\smurfc_era\numbers\three"];};

case "4": { _tex setObjectTexture [2,"\smurfc_era\numbers\four"];};

case "5": { _tex setObjectTexture [2,"\smurfc_era\numbers\five"];};

case "6": { _tex setObjectTexture [2,"\smurfc_era\numbers\six"];};

case "7": { _tex setObjectTexture [2,"\smurfc_era\numbers\seven"];};

case "8": { _tex setObjectTexture [2,"\smurfc_era\numbers\eight"];};

default { _tex setObjectTexture [2,"\smurfc_era\numbers\nine"];};

};

_nr = (_number / 10) Mod 10;

_nr = _nr - (_nr Mod 1);

switch (format ["%1", _nr]) do

{

case "0": { _tex setObjectTexture [3,"\smurfc_era\numbers\zero"];};

case "1": { _tex setObjectTexture [3,"\smurfc_era\numbers\one"];};

case "2": { _tex setObjectTexture [3,"\smurfc_era\numbers\two"];};

case "3": { _tex setObjectTexture [3,"\smurfc_era\numbers\three"];};

case "4": { _tex setObjectTexture [3,"\smurfc_era\numbers\four"];};

case "5": { _tex setObjectTexture [3,"\smurfc_era\numbers\five"];};

case "6": { _tex setObjectTexture [3,"\smurfc_era\numbers\six"];};

case "7": { _tex setObjectTexture [3,"\smurfc_era\numbers\seven"];};

case "8": { _tex setObjectTexture [3,"\smurfc_era\numbers\eight"];};

default { _tex setObjectTexture [3,"\smurfc_era\numbers\nine"];};

};

_nr = (_number) Mod 10;

_nr = _nr - (_nr Mod 1);

switch (format ["%1", _nr]) do

{

case "0": { _tex setObjectTexture [4,"\smurfc_era\numbers\zero"];};

case "1": { _tex setObjectTexture [4,"\smurfc_era\numbers\one"];};

case "2": { _tex setObjectTexture [4,"\smurfc_era\numbers\two"];};

case "3": { _tex setObjectTexture [4,"\smurfc_era\numbers\three"];};

case "4": { _tex setObjectTexture [4,"\smurfc_era\numbers\four"];};

case "5": { _tex setObjectTexture [4,"\smurfc_era\numbers\five"];};

case "6": { _tex setObjectTexture [4,"\smurfc_era\numbers\six"];};

case "7": { _tex setObjectTexture [4,"\smurfc_era\numbers\seven"];};

case "8": { _tex setObjectTexture [4,"\smurfc_era\numbers\eight"];};

default { _tex setObjectTexture [4,"\smurfc_era\numbers\nine"];};

};

//the following code is here to fix a bug with setObjectTexture command in singleplayer games

sleep 0.1;

waitUntil {time != 0};

init="test=[this, 123] execVM ""\smurfc_era\assignNumber.sqf";

I tried it this way,but it doesn't work. banghead.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">testi=[this, 123] execVM ""\smurfc_era\assignNumber.sqf"";";

Tried also this but always error msg about missing; at last line!

Share this post


Link to post
Share on other sites

Probably there is to many quotes. Try the following:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">testi=[this, 123] execVM "\smurfc_era\assignNumber.sqf";

Share this post


Link to post
Share on other sites
Quote[/b] ]Probably there is to many quotes. Try the following:

Code Sample

testi=[this, 123] execVM "\smurfc_era\assignNumber.sqf";

Yep,tried that but now got error msg about bool and expecting object? crazy_o.gif

Share this post


Link to post
Share on other sites

Try this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">testi=[_this select 0, 123] execVM "\smurfc_era\assignNumber.sqf";

"this" is not proper object in sqf scripts.

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">testi=[_tex, _number] execVM "\smurfc_era\script\assignNumber.sqf";

It works with this!Thanks a lot Mateck! biggrin_o.gif

Do you know how to make it use always 3 numbers?Now i get usually tank with only 2 numbers eg. 27,22,53. huh.gif

Share this post


Link to post
Share on other sites

Well,i found that this:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">waitUntil {time != 0};and this<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">waitUntil {time == 0}; causes terrible "control lag".

sad_o.gif Any ideas?

Share this post


Link to post
Share on other sites

You mean that the code that is after waitUntil {time == 0}; is causing "control lag"? This is only condition and it cannot cause any lags when used alone.

Don't use waitUntil {time != 0}; because this condition is always true and will execute code that is below all over again and it surely will cause lags.

As I described it earlier, the time value is reset after mission load. In other words waitUntil {time == 0}; will be true only when mission is loaded.

Share this post


Link to post
Share on other sites
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">testi=[_tex, _number]...
Do you know how to make it use always 3 numbers?Now i get usually tank with only 2 numbers eg. 27,22,53. huh.gif

Have you tested it using testi=[_tex, 333]? May be one number is too close to the next surface. This may cause it to be invisible.

:edit: Mateck just answered the question smile_o.gif

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  

×