Jump to content
Sign in to follow this  
hamis

Textures config help needed

Recommended Posts

Quote[/b] ]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.

Nope,didn't work.Also that "lag" appears also with time == 0.Well,to discribe it better,it affects turning of soldiers and turrets.It's like this fraction of a second turning hangs completely next it is very jerky and next it works normally but little slower.It doesn't appear if i disable this part of script.

Share this post


Link to post
Share on other sites

Well,it's not that script.Could it be my T72 config(tracked.pbo)?Config

Share this post


Link to post
Share on other sites

sorry mate could you explain again what you are trying to achieve

it looks like that you have little clue what you are actually doing here  huh.gif

i mean dont get me wrong. yet you just posted a config

that only has a different model and references a third party

script via config based EH or do i miss sth?

you know even that you talked about tracked.pbo scares me

and the config need serious overhaul as well.

in other words everything should be dropped apart from your actual

changes, you need a new pbo and new cfgPatches definition

with correct requiredAddons.

Share this post


Link to post
Share on other sites
Quote[/b] ]sorry mate could you explain again what you are trying to achieve

Model change with working numbering even after loading saved game.

Quote[/b] ]i mean dont get me wrong. yet you just posted a config

that only has a different model and references a third party

script via config based EH or do i miss sth?

Think you are right.

Quote[/b] ]you know even that you talked about tracked.pbo scares me

and the config need serious overhaul as well.

Well i did all the model changes in OFP this way without too much trouble.

Quote[/b] ]in other words everything should be dropped apart from your actual

changes, you need a new pbo and new cfgPatches definition

with correct requiredAddons.

I don't want million pbo's in million mod folders.

Share this post


Link to post
Share on other sites
Quote[/b] ]I don't want million pbo's in million mod folders.

why not?

as long as your addon is "perfect" you never need to touch it

again.

if you name it well, you know what it does and can disable it if

needed.

of course you can edit the original files, yet you will get

problems playing in MP, with patches, with other addons.

i agree that there is no good info out there about this topic.

yet i plan to make the "elite guide" sometime soon wink_o.gif

Share this post


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

Because i want to keep file/folder structure as simple as possible,so i find what i need to quickly.I'm editing arma quite often and now i',m making sounds for p_85 mod which makes this even more important.Btw,does anybody have ideas about that "lag"?

Share this post


Link to post
Share on other sites

I have tried to fix the issue by a modified version of the texture assignment script:

<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_ukr_t55\assignNumber.sqf"";";

_tex = _this select 0;

_number = _this select 1;

...

_nr = (_number / 100) Mod 10;

_nr = _nr - (_nr Mod 1);

while {true} do {

sleep 0.1;

waitUntil {time != 0};

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

{

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

...

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

};

sleep 1;

};

as you can see, the texture assignment is encapsulated with a while-forever loop. I have tested save / load, and the numbers are displayed after reload, but I expect some lags, when those units are used in higher numbers.

BR,

mike

p.s.: I have included this into the latest WIP-version, available at zShare

Share this post


Link to post
Share on other sites

Well,hope it doesn't lag more than previous solution i found(not tested with more units)Now i found out that "lag" i mentioned is appearing only in editor,not in missions. huh.gif Do i have always 3 numbers with this script?That prob should be worked out yet.

Share this post


Link to post
Share on other sites
...Now i found out that "lag" i mentioned is appearing only in editor,not in missions. huh.gif Do i have always 3 numbers with this script?That prob should be worked out yet.

In the editor only... that is suprising  wow_o.gif

Actually the script calulates only 3 digits, but when you extend the range of the second parameter, you may use the 4'th digit like this:

// 4'th digit

_nr = (_number / 1000) Mod 10;

_nr = _nr - (_nr Mod 1);

...

e.g. _number=7896

(_number / 1000) Mod 10 =7

(_number / 100) Mod 10 =8

(_number / 10) Mod 10 =9

(_number) Mod 10 =6

:edit: The computer ran out of memory, testing on a crCTI. Now I try an alternative algorithm, based on a reset of time after mission save / load:

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

while {true} do {

sleep 0.1;

waitUntil {time != 0};

// if load, time is reset

if (time < 2) then

{

// assign texture

...

};

sleep 1;

};

I hope this fixes the issue...  crazy_o.gif

Share this post


Link to post
Share on other sites
Quote[/b] ]Actually the script calulates only 3 digits, but when you extend the range of the second parameter, you may use the 4'th digit like this:

Well,my problem is that mostly there is only 2 numbers in use,sometimes 3.As i understand there should always be 3 numbers.Hope you get new script problem sorted out.

Share this post


Link to post
Share on other sites
Well,my problem is that mostly there is only 2 numbers in use,sometimes 3.As i understand there should always be 3 numbers.Hope you get new script problem sorted out.

That surprises me  wow_o.gif

My tests show all 3 digits are used. Meanwhile the last version passed all tests (crCTI + SP save / load): T-55 prerelease Version 2 by zShare

I have modified the algorithm:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_tex", "_number", "_nr", "_mytime"];

// e.g.: init="test=[this, 123] execVM ""\smurfc_ukr_t55\assignNumber.sqf"";";

_tex = _this select 0;

_number = _this select 1;

if (_number < 0) then

{

_number=(((getpos _tex select 0)+(getpos _tex select 1)*3+(time-(time Mod 5))*17)Mod 1000)-1;

};

// set _mytime to zero to assign the texture once

_mytime=0;

while {true} do {

sleep 0.1;

waitUntil {time != 0};

// if load, time is reset

if (_mytime < 2) then

{

_nr = (_number / 100) Mod 10;

_nr = _nr - (_nr Mod 1);

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

{

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

...

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

};

};

_mytime=time;

sleep 1;

};

The only trick included is the _mytime local variable, which is set to 0 at init and will be set to a value <2 at SP load (time will be reset to 0 sec. at SP load).

I have included a time related offset for crTI / Warfare style missions (the numbers would have indicated the position of the base).

Share this post


Link to post
Share on other sites

Well,could you convert that script for smurf_era so i could test it?

Share this post


Link to post
Share on other sites
Well,could you convert that script for smurf_era so i could test it?

I only have a rather old version, but it should look like this: pastebin

May be you have to adjust the paths.

When you send a -1 as number, a position calculated number will be displayed (MP compatible).

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

Share this post


Link to post
Share on other sites
Quote[/b] ]When you send a -1 as number, a position calculated number will be displayed

Well,i maybe stupid but i didn't fully understand.Are you going to update era_pack with new script sometime?

Share this post


Link to post
Share on other sites
...Are you going to update era_pack with new script sometime?

No, I do not plan to update the pack, but I use similar scripts for T-55, T-84, M1A1 and T-72.

I plan to update the open source T-72 with the new scripts within the next days.

Share this post


Link to post
Share on other sites
Quote[/b] ]I plan to update the open source T-72 with the new scripts within the next days.

Nice thing,i'll wait. smile_o.gif

Share this post


Link to post
Share on other sites

Well, i might be really bad with scripts,but i tried to "update" old scripts:

assignnumber.sqf:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_tex", "_number", "_nr", "_mytime"];

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

_tex = _this select 0;

_number = _this select 1;

if (_number < 0) then

{

_number=(((getpos _tex select 0)+(getpos _tex select 1)*3+(time-(time Mod 5))*17)Mod 1000)-1;

};

// set _mytime to zero to assign the texture once

_mytime=0;

while {true} do {

sleep 0.1;

waitUntil {time != 0};

// if load, time is reset

if (_mytime < 2) then

{

_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"];};

};

};

_mytime=time;

sleep 1;

};

textures.sqf:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">private ["_xehPars", "_unit", "_mytime"];

//Definitions passed to script

_xehPars = _this select 0;

_unit = _xehPars select 0;

// set _mytime to zero to assign the texture once

_mytime=0;

while {true} do {

sleep 0.1;

waitUntil {time != 0};

// if load, time is reset

if (_mytime < 2) 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"];

};

_

mytime=time;

sleep 1;

};

I wasn't able to test sleep thingy yet,but i still get only 2 first numbers.

Share this post


Link to post
Share on other sites
...

I wasn't able to test sleep thingy yet,but i still get only 2 first numbers.

Can you post your config.cpp's hiddenSelections?

My oplot-entry looks like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hiddenSelections[] = {"n1","n2","n3","1_co_cust"};

Your's should look like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hiddenSelections[] = {"xxx","yyy","n1","n2","n3"};

This would result in texture-areas 2-4 for the numbers and 0/1 for the tank's textures.

Share this post


Link to post
Share on other sites

Here it is:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hiddenSelections[] = {"1_co_cust","2_co_cust","3_co_cust","num1","num2","num3"};

Share this post


Link to post
Share on other sites
Here it is:<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">hiddenSelections[] = {"1_co_cust","2_co_cust","3_co_cust","num1","num2","num3"};

Ummm... that is the error. You number sections are 3-5.

0: 1_co_cust

1: 2_co_cust

2: 3_co_cust

3: num1

4: num2

5: num3

So you have to adjust your numbers-script:

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

...

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

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

};

_nr = (_number / 10) Mod 10;

_nr = _nr - (_nr Mod 1);

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

{

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

};

_nr = (_number) Mod 10;

_nr = _nr - (_nr Mod 1);

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

{

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

BR,

mike

Share this post


Link to post
Share on other sites

Thanks,Mike!Numbering works now. 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  

×