hamis 0 Posted January 9, 2009 <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 gamessleep 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
Namikaze 0 Posted January 9, 2009 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
hamis 0 Posted January 9, 2009 Sorry,both are sqf's.There is no init.sqf,so what to do? Share this post Link to post Share on other sites
Namikaze 0 Posted January 9, 2009 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
YO 0 Posted January 10, 2009 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
hamis 0 Posted January 10, 2009 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
.kju 3245 Posted January 10, 2009 they released a fix themselves. get their update. Share this post Link to post Share on other sites
hamis 0 Posted January 10, 2009 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
.kju 3245 Posted January 10, 2009 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
hamis 0 Posted January 10, 2009 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
Mateck 0 Posted January 12, 2009 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 Share this post Link to post Share on other sites
hamis 0 Posted January 12, 2009 Well,thanks for help.But i found out it is that (sleep 0.1; waitUntil {time == 0}) script that breaks ECS and GDTmodhdr functionality! Share this post Link to post Share on other sites
hamis 0 Posted January 14, 2009 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? Share this post Link to post Share on other sites
t_d 47 Posted January 14, 2009 Shouldnt it be more like this: waitUntil {time != 0}; ?? Share this post Link to post Share on other sites
Mateck 0 Posted January 16, 2009 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
hamis 0 Posted January 16, 2009 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
hamis 0 Posted January 19, 2009 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. <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
.kju 3245 Posted January 19, 2009 post your arma.rpt http://community.bistudio.com/wiki/arma.RPT Share this post Link to post Share on other sites
Mateck 0 Posted January 19, 2009 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
hamis 0 Posted January 20, 2009 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? Share this post Link to post Share on other sites
Mateck 0 Posted January 20, 2009 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
hamis 0 Posted January 20, 2009 <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! Do you know how to make it use always 3 numbers?Now i get usually tank with only 2 numbers eg. 27,22,53. Share this post Link to post Share on other sites
hamis 0 Posted January 22, 2009 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". Any ideas? Share this post Link to post Share on other sites
Mateck 0 Posted January 22, 2009 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
modemmaik 53 Posted January 22, 2009 <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. 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 Share this post Link to post Share on other sites