Forum Jump :

Author Message

paga  



Posts: 41
Rank:


Level: Member

Country: hu
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2015-10-17 20:55        
     
Hi!

I want to lower the skill of the ai in my coop mission(for us they are extreamly hard somehow). So i wuold like to know is there any way to do that with a script or something like instead of using the scroll in unit select in editor.

I have heard and saw some missions which you can set their skill separetly, accuarancy aimspeed etc... in lobby parametrer. I want similar to that but not important to be changeable in lobby just have something in my mission folder which editable.

Is there script, parameter init code which do this?

Thaks for help!


Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#2 Posted at 2015-10-17 22:21        
     
setSkill

setSkill array

This post was edited by 654wak654 (2015-10-18 11:54, 735 days ago)

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Advertisement


Author Message

paga  



Posts: 41
Rank:


Level: Member

Country: hu
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2015-10-18 11:02        
     
The first link doesn't help me out i don't want to set it one by one especially when im usin site modules.
The second link is broken.

Im thiking of something like this below but don't know how to use it.

"someScript.sqf

//setSkill for ai on map from editor
//AI Skill
{
_x setUnitAbility 0.1;
_x setskill ["aimingAccuracy",0.05];
_x setskill ["aimingShake",0.9];
_x setskill ["aimingSpeed",0.1];
_x setskill ["Endurance",0.1];
_x setskill ["spotDistance",0.5];
_x setskill ["spotTime",0.5];
_x setskill ["courage",0.1];
_x setskill ["reloadSpeed",0.1];

_aA = _x skill "aimingAccuracy";
_aS = _x skill "aimingShake";
_aSp = _x skill "aimingSpeed";
_e = _x skill "Endurance";
_sD = _x skill "spotDistance";
_sT = _x skill "spotTime";
_c = _x skill "courage";
_rS =_x skill "reloadSpeed";

if (DebugDeep) then {
hint format [
"unit: %1\naimingAccuracy: %2\naimingShake: %3
\naimingSpeed: %4\nEndurance: %5\nspotDistance: %6
\nspotTime: %7\ncourage: %8\nreloadSpeed: %9"

,_x,_aA,_aS,_aSp,_e,_sD,_sT,_c,_rS];
//sleep 0.1;
};
} forEach allUnits;

"

Added 5 hours 59 minutes later:

any idea?

This post was edited by paga (2015-10-18 17:01, 735 days ago)


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#4 Posted at 2015-10-18 18:28        
     
the easiest way:
put the code in init.sqf (create it if it doesn't exist yet),
or wrap this code in 0 = [] spawn { all the code here without any comment } ,
then put that in a trigger (on activation field) and erase "this" condition to make trigger unconditional.

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message


Posts: 1189
Rank:


Level: Member

Country: tr
Location:
Occupation: Computer Science student
Age: 20
In-game name: Wak

 
#5 Posted at 2015-10-18 19:02        
     
I fixed the second link, but how can you think of that code and not be able to use it? You'd just have to put it in a script file and run it with execVM.

Sometimes I like to think as I started the whole "earplugs" thing.

W0lle: The only advice I can give you is: Do not try to understand BI. You will not succeed and it only makes your brain go boom. I would even go so far and say that not even they understand their own actions :-D.

#define getDamage getDammage

Author Message

paga  



Posts: 41
Rank:


Level: Member

Country: hu
Location:
Occupation:
Age:
In-game name:

 
#6 Posted at 2015-10-18 20:32        
     
sorry about that if it was not clear. im beginner in mission making that's why i don't know how to make it.

So copy and paste the lines below into my init.sqf then it is going to work? Or i should do any further steps.

//setSkill for ai on map from editor
//AI Skill
{
_x setUnitAbility 0.1;
_x setskill ["aimingAccuracy",0.05];
_x setskill ["aimingShake",0.9];
_x setskill ["aimingSpeed",0.1];
_x setskill ["Endurance",0.1];
_x setskill ["spotDistance",0.5];
_x setskill ["spotTime",0.5];
_x setskill ["courage",0.1];
_x setskill ["reloadSpeed",0.1];

_aA = _x skill "aimingAccuracy";
_aS = _x skill "aimingShake";
_aSp = _x skill "aimingSpeed";
_e = _x skill "Endurance";
_sD = _x skill "spotDistance";
_sT = _x skill "spotTime";
_c = _x skill "courage";
_rS =_x skill "reloadSpeed";

if (DebugDeep) then {
hint format [
"unit: %1\naimingAccuracy: %2\naimingShake: %3
\naimingSpeed: %4\nEndurance: %5\nspotDistance: %6
\nspotTime: %7\ncourage: %8\nreloadSpeed: %9"

,_x,_aA,_aS,_aSp,_e,_sD,_sT,_c,_rS];
//sleep 0.1;
};
} forEach allUnits;

Added 15 hours 17 minutes later:

null = [] spawn { _x setUnitAbility 0.1;
_x setskill ["aimingAccuracy",0.05];
_x setskill ["aimingShake",0.9];
_x setskill ["aimingSpeed",0.1];
_x setskill ["Endurance",0.1];
_x setskill ["spotDistance",0.5];
_x setskill ["spotTime",0.5];
_x setskill ["courage",0.1];
_x setskill ["reloadSpeed",0.1];
} forEach allUnits;
};

I put this into on act field in trigger and deleted "this" from condition. But it doenst want to work. Doesn't allow me to hit ok when "foreach allunits" is there.

This post was edited by paga (2015-10-19 11:50, 734 days ago)


Author Message


Posts: 1589
Rank:


Level: Member

Country: pf
Location: Tahiti
Occupation: too many Arma
Age: 57
In-game name: Kobayashi Maru

 
#7 Posted at 2015-10-19 16:10        
     
missing {
null = [] spawn {{ _x setUnitAbility 0.1;
_x setskill ["aimingAccuracy",0.05];
_x setskill ["aimingShake",0.9];
_x setskill ["aimingSpeed",0.1];
_x setskill ["Endurance",0.1];
_x setskill ["spotDistance",0.5];
_x setskill ["spotTime",0.5];
_x setskill ["courage",0.1];
_x setskill ["reloadSpeed",0.1];
} forEach allUnits;
};

PLEASE CONTACT ME ON BI FORUMS FOR ANY SCRIPT / MOD QUESTION. TKS

Author Message

paga  



Posts: 41
Rank:


Level: Member

Country: hu
Location:
Occupation:
Age:
In-game name:

 
#8 Posted at 2015-10-19 22:40        
     
Thanks Pierre works great this way!:)

I have found something for the other method trough execvm or just in my opinion that way.
Under this link Enter text for the link here...
I made an .sqf file and put all the code in it.
I placed a trigger and wrote on act null = [] execVM "somescript.sqf"

I don't really know if it changed anything or works as i did.