RonnieJ
-
Content Count
119 -
Joined
-
Last visited
-
Medals
Posts posted by RonnieJ
-
-
Great guys... but not working quite yet... tried this:
_fireMissions = [["IMMEDIATE","WP",0,5],["IMMEDIATE","HE",0,5],["IMMEDIATE","ILLUM",0,5]];
if (dayTime >= 6 AND dayTime < 19) then {
player sideChat "day";
_randFireMission = _fireMissions select (round(random 1));
} else {
player sideChat "night";
_randFireMission = _fireMissions select (round(random 2));
};
player sideChat format["fire %1",_randFireMission];
I get "ANY" returned... so it doesent get set yet?
-
Hey guys... im having problems with the following:
if(daytime > 19 or dayTime < 6) then {
player sideChat "day";
_randN = floor(random 2);
player sideChat format["ran %1",_randN];
_fireMission = switch (_randN) do {
case 0: { ["IMMEDIATE","WP",0,5] };
case 1: { ["IMMEDIATE","HE",0,5] };
case 2: { ["IMMEDIATE","ILLUM",0,5] };
};
} else {
player sideChat "night";
_randN = floor(random 1);
_fireMission = switch (_randN) do {
case 0: { ["IMMEDIATE","WP",0,5] };
case 1: { ["IMMEDIATE","HE",0,5] };
};
};
Apparently it dosent set _fireMission ... and even though its daytime I always end up in the else... any ideas how to solve the 2 issues?
-
I have tried making the AI attack the unit its self without the laserdesignator but everytime the bombs dosent hit its target....
-
Thx for the answers guys...
F2k Sel> Ill try the script later since I havent got the time now - But it looks perfect and im looking forward to it! :)
And yes this is a part of a random script where I put a FAC into an excisting enemy group... this unit and only this unit may call in an enemy airstrike on the players when he sees them...
I made a workaround conserning the laserdesignator and he now stops up and uses it correctly... this have only been testet on a car (succesfully airstrike) so I have to try on some infantry to see if it is possible.
If not I might have to script the airstrike so I can avoid the laserdesignator...
Jonescrusher> did you have any ideas concerning an enemy airstrike?
And again thx guys for the help so far :)
-
Okay I made a work around but I still need to know how to target what ever unit it is he have seen...
-
Works perfectly... theres just one last question... how do I know what player he have seen? I need him to target that one... tried with _x with no luck
---------- Post added at 08:06 PM ---------- Previous post was at 07:52 PM ----------
_unit dotarget _x;
---------- Post added at 08:55 PM ---------- Previous post was at 08:06 PM ----------
Strange... I try:
_unit disableAI "MOVE";
_unit selectWeapon "Laserdesignator";
_unit dotarget _x;
_unit dofire _x;
The movement is disabled but the unit dosent select the laser designator and target me?? If I kill the target the laser designator is on with batteries...
---------- Post added at 09:02 PM ---------- Previous post was at 08:55 PM ----------
Seems to have something to do with the group he is in... the unit apparently get commands from the leader... is there any way to "disable" the group commands so he cant act according to the commands he get from the script?
-
But will that make the code run all the time? As I understand this... this code will only be run once... but I need it to look all the time... or at least every 5 seconds or something
-
hey guys... ive got this piece of code that checks if s1-s10 players have been found by enemyUnit:
_unitArray = [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10];
if ({enemyUnit knowsAbout _x > 3} count _unitArray > 0) then {
hint "player spotted by enemyUnit";
} else {
hint "enemyUnit hasn't spotted a player yet";
};
But im not sure how to incorporate this code... if I place it in a units init then its only run once and I surpose this should be turned into a while loop insted then? Or should it be a trigger... im really not sure... any one who can help me?:confused:
-
bhaz> if I want an array of enemys as well... how would I do that? if possible...
So I can use this nice code on a couple of guys insted of copy paste for each unit
-
bhaz> thats perfect! Just what I needed.... thumbs up - thx m8
-
JW Custom> that will force the trigger to go off if any of the 100 OPFOR detects any if the s1-s10 units in the trigger but that is not what im asking for! :) I want only 1 of the 100 OPFOR to do something when he and he alone detects s1-s10
-
Did you ever get this to work? I have the same problem
-
Ah sorry misread the info... but I tried this:
_unit1 setVehicleInit "[this] call BIS_ARTY_F_initVehicle";
_unit2 setVehicleInit "[this] call BIS_ARTY_F_initVehicle";
_unit3 setVehicleInit "[this] call BIS_ARTY_F_initVehicle";
processInitCommands;
But it dosent seem to work anyway... im really not sure what to do...
-
Ye but its only one enemy unit that I want to take action when he and he alone detects one of the 10 players... so im not sure thats what I need...
Its because I want the single enemy unit to mark us with a laser and call in an enemy aircraft... that bit is sorted but im not sure how I can make only that unit detect only s1-s10 :S
-
Ye I did expect some scripting would be needed for the arming etc... but im not even able to get the damn thing to show on the ground hehe :) But sure if its still in the making there no need to keep trying ;)
-
Hey guys... im having some problems with detection.
I want an enemy to do a speciel action when he detects one of the players in-game but im not sure how to do this...
I know you can create a detection trigger to look for a speciel unit... but not how to make a single unit look for 10 speciel players s1- s10...
I guess its some on going loop looking fo s1-s10 inlist? or something... really not sure how to do it hehe :P
-
Still cant get it to work... no mine pop's... can you even spawn at mine that will explode on the normal conditions?
I can see im able to spawn the normal "Mine" and "MineE" from the standard arma 2 classes... but I cant seem to spawn one from Ace2
-
Hey guys... im tring to make my self a mine field... ive seen scripted ones with invisible triggers but I dont think that is so realistic :)
Im want to make the new ace2 mines called "ACE_BBetty_M"...
mine = createVehicle ["ACE_BBetty_M", [(getMarkerPos "test2") select 0,(getMarkerPos "test2") select 1,1], [], 0, "NONE"];
Ive tried this but I cant seem to get it to create the damn mine... any idea what im doing wrong?
-
Ye that might be it but it dosent say how I create the artilleri module with create vehicle :S
-
Hey guys.... im having some problems with my morter section...
If I create them in the editor -> sync with module and then fire the script everything runs perfectly...
If I try spawning the group through a script and do
_Unit4 synchronizeobjectsadd [iNS_mortar];
then my script won't run... its like the synchronizeation havent worked :confused:
Is the module created after the script have run? If so... is it possible to create an artilleri module through scripting?
The script im using is this:
Morters= Creategroup EAST;
_Unit1= createVehicle ["2b14_82mm",[(getMarkerPos "test") select 0,(getMarkerPos "test") select 1,0],[],0,"FORM"];
_Unit2= createVehicle ["2b14_82mm",[(getMarkerPos "test") select 0,(getMarkerPos "test") select 1,0],[],0,"FORM"];
_Unit3= createVehicle ["2b14_82mm",[(getMarkerPos "test") select 0,(getMarkerPos "test") select 1,0],[],0,"FORM"];
_Unit4= Morters createUnit ["RU_Soldier",[(getMarkerPos "test") select 0,(getMarkerPos "test") select 1,0],[],0,"FORM"];
_Unit5= Morters createUnit ["RU_Soldier",[(getMarkerPos "test") select 0,(getMarkerPos "test") select 1,0],[],0,"FORM"];
_Unit6= Morters createUnit ["RU_Soldier",[(getMarkerPos "test") select 0,(getMarkerPos "test") select 1,0],[],0,"FORM"];
_Unit4 moveInGunner _Unit1;
_Unit5 moveInGunner _Unit2;
_Unit6 moveInGunner _Unit3;
_unit4 setunitrank "CORPORAL";
_unit1 setunitrank "SERGEANT";
_Unit4 synchronizeobjectsadd [iNS_mortar];
while {(alive _unit4 and [iNS_mortar] call BIS_ARTY_F_StillViable)} do {
(something)
};
---------- Post added at 12:57 AM ---------- Previous post was at 12:52 AM ----------
The main point here is when done through the editor it works...
When I make the module in the editor and try the rest through scripting it dosent... its like the module is created after the code is run and because of this it wont run...
-
Great it works... fail'd at first but didnt see you changed the position where it is placed :) Thx m8! Great work!
-
Still cant get it to end the missions... I have tried with:
_trg = createTrigger["end1",getPos player];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerStatements["this","", "!alive maintarget"];
_trg setTriggerType "END1";
and
_trg = createTrigger["end1",getPos player];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerStatements["this","", "!alive _Radar"];
_trg setTriggerType "END1";
and
_trg = createTrigger["end1",getPos player];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerStatements["!alive _Radar","", ""];
_trg setTriggerType "END1";
and
_trg = createTrigger["end1",getPos player];
_trg setTriggerArea[0,0,0,false];
_trg setTriggerStatements["!alive maintarget","", ""];
_trg setTriggerType "END1";
-
Hmm might be me who's a bit confused then... I thought activation was what it took for the tigger to go off...
Ill try it when I get home...
-
I cant seem to get this working...
Im testing the map in the editor not sure if that makes any difference... start out by doing this:
_option = round(random 1);
switch _option do {
case 0: {
call {[getMarkerPos "enemy","Infantry",200] execVM "cB_randomGroup.sqf"};
call {[getMarkerPos "enemy","Infantry",300] execVM "cB_randomGroup.sqf"};
};
case 1: {
call {[getMarkerPos "enemy","Infantry",500] execVM "cB_randomGroup.sqf"};
call {[getMarkerPos "enemy","Infantry",400] execVM "cB_randomGroup.sqf"};
};
};
I can see the units beeing created and the BIN_taskPatrol script is beeing called (tried placing hint's in the code)... Ive forced the _debug to 1; but no markers on the map is created and no units start patrolling...
I seem to have some trouples after the line
sleep 1;
If I do the hint "yay"; before it I get the yay... after no matter where i place it I get nothing.... any ideas?
Problems with if and switch
in ARMA 2 & OA : MISSIONS - Editing & Scripting
Posted
Bon> Sorry m8! totally missed that one... didnt know varibels was contained in a if statement... I thought _var was varibels used in the sqf file and var was used across sqf files...
But everything is working great now! So many thx to you all :)