Jump to content

_qor

Member
  • Content Count

    294
  • Joined

  • Last visited

  • Medals

Posts posted by _qor


  1. Okay I will try out with disableAI "MOVE", that seems to be a good option I excluded so far due to some former problems.

    But I also tried out the assignAsCargo way and it totally failed. Perhaps because the DF group doesnt belong to the convoy group and just has been movedInCargo.

    Unfortunately add the vehicle by addVehicle to the group won't do the thing.

    Anything I have to be aware of?


  2. Hey,

    I am trying to create a realistic ambush on convoy script to achieve the following sequence:

    #1 convoy is led by an HMMWV (M2) and an external Delta Force group inside

    #2 convoy detects enemies and immediately stops

    #3 DF group gets out and attacks enemy together with HMMWV (M2)

    #4 when area is clear, DF group gets back in HMMWV and the convoy keeps on following the preset waypoints

    so far I created this:

    
    waitUntil {velocity convoy1 select 1 == 0};
    
    _c1pos = getPos convoy1;
    
    skt = createVehicle ["Sign_sphere10cm_EP1", _c1pos , [], 0, "CAN_COLLIDE"];
    
    skt attachTo [convoy1, [0, 0, 1] ]; 
    
    skt enableSimulation false;
    
    [color="#00FF00"]//convoy automatically stops because DF group wants to disembark when under fire/convoy's behaviour changes to "COMBAT" > check![/color]
    [color="#FF0000"]// unfortunately, I dont get the leading convoy vehicle to freeze by attaching the SkeetDisc > solution?[/color]
    
    waitUntil {behaviour leader convoyGuard == "AWARE"};
    
    sleep 8;
    
    {_x moveInCargo convoy1} forEach units convoyGuard;
    
    [color="#FF0000"]//I dont get how to make the DF group reentering the convoy with animations/using assignAsCargo > solution?[/color]
    
    
    waitUntil {{_x in convoy1} count units convoyGuard == count units convoyGuard};
    
    convoy1 setBehaviour "AWARE";
    
    detach skt;
    
    [color="#00FF00"]//would make the convoy continue driving if attaching an object to convoy1 would freeze it ;)[/color]
    
    
    
    

    Would be great if you have a solution to the problems stated in the script.

    But there also is a strange behaviour I still dont understand:

    It is a night scenario so the convoy has turned on lights. But when the enemy fires on the convoy, it first turns out the lights, starts to fire on the enemy and THEN the knowsAbout level reaches 0.105.

    Although the behaviour changes to COMBAT when the lights get turned out. So this seems to be a more reliable way to check if a unit is under attack.

    Is this a usual behaviour during night? It is said that units only fire when the KnowsAbout level is higher than 0.105 and not before!

    thanks in advance


  3. Hey there,

    I am just trying to freeze a vehicle by attaching it to a SkeetDisc. Although the SkeetDisc is very small, I use hideObject to really hide it.

    But doing so, the attachTo command seems to get ineffective and the vehicle starts to drive.

    I tested this by triggering the code viy radio, same thing!

    Can anybody confirm and add this to the wiki (not registered)?

    Problem is that I am currently uncertain about whether attachTo freezes a vehicle at all.

    Curiously in some cases it seemed to work, while it didnt work in other cases.


  4. Guess you dont want to group each plane to the trigger. But I think this might be the easiest way.

    So you might need BIS_fnc_inTrigger:

    http://forums.bistudio.com/archive/index.php/t-138583.html

    But there certainly is a better way...

    For the sound: On the bottom-left of the trigger's menu there is a button called Effects.

    There you can find your soundfile in the drop-downs. Try it at "anonymous" and "voice" etc. I would advice to use anonymous, but it didnt work for me.

    Actually you can also type playSound "Siren" but again this didnt work for me. Give it a try by yourself...


  5. You need to define your soundfile in an description.ext first.

    https://community.bistudio.com/wiki/Description.ext#cfgSounds

    But be sure that your soundfile is recorded in mono. You can easily modify your file to mono with audacity.

    In the editor you have to set the trigger's conditions as you want it and you will find your sound in the trigger menu under "effects/voice/yoursoundname" (scroll down completely)

    Trigger: OPFOR, Present, repeatedly

    Condition: "Su34" countType thislist > 0

    you can find your class/subclass here:

    https://community.bistudio.com/wiki/CfgVehicles

    This works when you have a single plane.

    Otherwise you can group the trigger with each plane. So each time a new plane enters the trigger area, the trigger fires the sound.


  6. Hey there,

    I am currently creating a battlefield-like scenario in which players have to conquer checkpoints.

    Now I want to fill it up with AI which requires a script to determine their procedure.

    My idea was to evaluate this by 3 aspects:

    #1 if support is required

    #2 if checkpoint has enough manning

    #3 nearest checkpoint

    First script structure:

    if (demand) then {
    
    getList (demand = true)
    _CP = nearest demand AND !manned
    create waypoint _CP
    
    	if (all demands manned) then {
    		getList (demand = false)
    		_CP = nearest CP !manned
    }}
    
    else
    
    {
    
    getList (demand = false)
    _CP = nearest CP !manned
    
    };
    
    

    So you might have seen the getList expression which is no .sqf command.

    And this is my question about.

    Is there a way to get a list of all objects/triggers/markers which have a certain variable value?

    I know this from a rhino-plugin called grasshopper, but of course, this is ArmA :D

    But there might be a way?!

    Thanks for reading, advices and proposals are welcomed!

    Perhaps there is a much easier way to achieve a dynamic AI procedure, but first of all I want to do it on my way...


  7. _run should substitute the H1WammoRun variable in the script.

    So I can change the variable's value on the top of the script and dont need to search for each position of the variable.

    E.g. when the script should work for another checkpoint (in my scenario) called BASE2. So I would only change _run = Base2ammoRun once.

    But at this certain point, I actually want to change the value of H1WammoRun, although I substituted it with _run.

    So when I want to have H1WammoRun = true I cant type _run = true. Because this would mean that _run is not H1WammoRun anymore.

    I'm kinda confused right now and cant simplify this description :D

    Hope you'll get it xD


  8. But wouldnt the script end anyway because of exitWith? At least I hoped so!

    And there is another question about the script.

    I'd like to simplify the variables so I can copy the script and just need to change some names at the top.

    But there is a problem with "H1WammoRun". When I do _run = H1WammoRun and then _run = true, I dont really change the actual variable but the _run variable.

    Is there a way to do this?

    
    
    _trig = HOME1W;
    _ammo = HOME1Wammo;
    _mark1 = "H1_ammo1_mark";
    _mark2 = "H1_ammo2_mark";
    [color="#B22222"]_run = H1WammoRun;[/color]
    
    
    _talker = _this select 0;
    _bother = _this select 1;
    
    _progress = 0;
    
    
    
    
    while {alive _talker AND alive _bother AND _progress < 100} do { 
    
    if(_trig == west AND !_ammo AND (_talker distance _bother <8)) then {
    
    [color="#B22222"]_run = true;[/color]
    _progress = _progress + 10;
    titleText [format ["UNLOADING: %1 PERCENT COMPLETE", _progress], "PLAIN DOWN"];
    titleFadeOut 2.5;
    
    };
    
    
    
    if (_talker distance _bother >8) exitWith {titleFadeOut 1; H1WammoRun = false};
    
    if (_progress == 100 AND player != _bother) exitWith {
    
    deleteVehicle H1box1;
    deleteVehicle H1box2;
    
    H1box1 = createVehicle ["USBasicWeapons_EP1", getMarkerPos "H1_ammo1_mark", [], 0, "NONE"];
    H1box2 = createVehicle ["USBasicWeapons_EP1", getMarkerPos "H1_ammo2_mark", [], 0, "NONE"];
    
    _ammo = true;
    H1WammoRun = false;
    
    script = [] execVM "CHECKPOINTS\Ammo\HOME1\#1_H1gunnery.sqf";
    script = [] execVM "CHECKPOINTS\Ammo\HOME1\#2_H1gunnery.sqf";
    
    };
    
    if (_progress == 100 AND player == _bother) exitWith {
    
    playSound "CodeBad";
    
    deleteVehicle H1box1;
    deleteVehicle H1box2;
    
    H1box1 = createVehicle ["USBasicWeapons_EP1", getMarkerPos _mark1, [], 0, "NONE"];
    H1box2 = createVehicle ["USBasicWeapons_EP1", getMarkerPos _mark2, [], 0, "NONE"];
    
    _ammo = true;
    H1WammoRun = false;
    
    script = [] execVM "CHECKPOINTS\Ammo\HOME1\#1_H1gunnery.sqf";
    script = [] execVM "CHECKPOINTS\Ammo\HOME1\#2_H1gunnery.sqf";
    
    
    
    };
    
    
    sleep 1;
    
    
    };
    
    
    


  9. Yaaah thats the problem!

    So using strings is of course not impossible, but requires definitively more effort and thoughts!

    Here is how I use your script-pattern now. I somehow feel that I use this in an inadequate way, but it works so far!

    Perhaps you guys have some additional improvements for the script?!

    
    
    
    
    _talker = _this select 0;
    _bother = _this select 1;
    
    _progress = 0;
    
    
    
    
    while {alive _talker} do { 
    
    if(HOME1 == west AND !HOME1ammo AND (_talker distance _bother <8)) then {
    
    H1ammoRun = true;
    _progress = _progress + 10;
    titleText [format ["UNLOADING: %1 PERCENT COMPLETE", _progress], "PLAIN DOWN"];
    titleFadeOut 2.5;
    
    };
    
    
    
    if (_talker distance _bother >8) exitWith {titleFadeOut 1; H1ammoRun = false};
    
    if (_progress == 100 AND player != _bother) exitWith {
    
    deleteVehicle H1box1;
    deleteVehicle H1box2;
    
    H1box1 = createVehicle ["USBasicWeapons_EP1", getMarkerPos "H1_ammo1_mark", [], 0, "NONE"];
    H1box2 = createVehicle ["USBasicWeapons_EP1", getMarkerPos "H1_ammo2_mark", [], 0, "NONE"];
    
    HOME1ammo = true;
    H1ammoRun = false;
    
    script = [] execVM "CHECKPOINTS\Ammo\HOME1\#1_H1gunnery.sqf";
    script = [] execVM "CHECKPOINTS\Ammo\HOME1\#2_H1gunnery.sqf";
    
    };
    
    if (_progress == 100 AND player == _bother) exitWith {
    
    playSound "CodeBad";
    
    deleteVehicle H1box1;
    deleteVehicle H1box2;
    
    H1box1 = createVehicle ["USBasicWeapons_EP1", getMarkerPos "H1_ammo1_mark", [], 0, "NONE"];
    H1box2 = createVehicle ["USBasicWeapons_EP1", getMarkerPos "H1_ammo2_mark", [], 0, "NONE"];
    
    HOME1ammo = true;
    H1ammoRun = false;
    
    script = [] execVM "CHECKPOINTS\Ammo\HOME1\#1_H1gunnery.sqf";
    script = [] execVM "CHECKPOINTS\Ammo\HOME1\#2_H1gunnery.sqf";
    
    
    
    };
    
    
    sleep 1;
    
    
    };
    
    

    Thanks to you PhonicStudios ;)


  10. Hey there,

    I want to have progress bar with a titleText, so I put it in a loop.

    But although a condition turns false (distance to object), the text continous.

    
    
    _talker = _this select 0;
    _bother = _this select 1;
    
    
    
    deleteVehicle H1box1;
    
    deleteVehicle H1box2;
    
    while {HOME1 == west AND !HOME1ammo AND (_talker distance _bother <10)} do {
    
    
    titleText ["REARMING PROGRESS:[|         ]COMPLETE", "PLAIN DOWN"];
    sleep 1;
    titleText ["REARMING PROGRESS:[||        ]COMPLETE", "PLAIN DOWN"];
    sleep 1;
    titleText ["REARMING PROGRESS:[|||       ]COMPLETE", "PLAIN DOWN"];
    sleep 1;
    titleText ["REARMING PROGRESS:[||||      ]COMPLETE", "PLAIN DOWN"];
    sleep 1;
    titleText ["REARMING PROGRESS:[|||||     ]COMPLETE", "PLAIN DOWN"];
    sleep 1;
    titleText ["REARMING PROGRESS:[||||||    ]COMPLETE", "PLAIN DOWN"];
    sleep 1;
    titleText ["REARMING PROGRESS:[|||||||   ]COMPLETE", "PLAIN DOWN"];
    sleep 1;
    titleText ["REARMING PROGRESS:[||||||||  ]COMPLETE", "PLAIN DOWN"];
    sleep 1;
    titleText ["REARMING PROGRESS:[||||||||| ]COMPLETE", "PLAIN DOWN"];
    sleep 1;
    titleText ["REARMING PROGRESS:[||||||||||]COMPLETE", "PLAIN DOWN"];
    titleFadeOut 1;
    
    
    HOME1ammo = true;
    
    H1box1 = createVehicle ["USBasicWeapons_EP1", getMarkerPos "H1_ammo1_mark", [], 0, "NONE"];
    
    H1box2 = createVehicle ["USBasicWeapons_EP1", getMarkerPos "H1_ammo2_mark", [], 0, "NONE"];
    
    	if (player == _bother) then {
    
    	playSound "CodeBad"
    
    	};
    
    };
    
    

    What am I doing wrong?


  11. Great!

    But there is still one problem with removing the action.

    Is there a way to remove only a specific action not an index? It could happen that there are other addAction commands which have been added before.

    I need to remove the action on deactivation because there are multiple conditions for the add of the action.

    CONDITION:

    HOME1 == west AND !HOME1ammo AND "MtvrSupply_DES_EP1" countType list HOME1trig > 0;

    OnAct.:

    {_x addAction ["UNLOAD AMMOCRATES","CHECKPOINTS\Ammo\HOME1\ammoAction.sqf", [],1,false,false,"","((_target distance _this) <8) and [HOME1trig,_this] call bis_fnc_inTrigger"];} forEach (entities "MtvrSupply_DES_EP1")

    Deact.:

    {_x removeAction 0} forEach (entities "MtvrSupply_DES_EP1")

    When the action is executed, HOME1ammo turns to true. At this time, the action of every MTVR gets removed. But there are other MTVRs in another trigger where HOME2ammo is still false.

    EDIT: I just need to make the removeAction forEach entities thislist. But how do I do that? {_x removeAction 0} forEach (entities "MtvrSupply_DES_EP1") thislist doesnt work


  12. just define a trigger's condition in the editor and execute a script like the following.

    Trigger:

    Condition: attack

    OnAct: script = [] execVM "alarmScript.sqf"

    alarmScript.sqf

    [color="#FF0000"]alarmName1[/color] = createSoundSource ["Sound_Alarm2", [color="#0000FF"]markername[/color], [], 0];
    [color="#FF0000"]alarmName2[/color] = createSoundSource ["Sound_Alarm2", [color="#0000FF"]markername[/color], [], 0];
    [color="#FF0000"]alarmName3[/color] = createSoundSource ["Sound_Alarm2", [color="#0000FF"]markername[/color], [], 0];
    
    
    
    waitUntil {!attack};
    
    deletevehicle [color="#FF0000"]alarmName1[/color];
    deletevehicle [color="#FF0000"]alarmName2[/color];
    deletevehicle [color="#FF0000"]alarmName3[/color];
    

    You also need to create markers and type their names in the script.

    Alarms are soudsources, so you will hear where they come from: Marker position = sound position.

    Cant really understand what you mean with your CODE RED stuff. But I guess you need three trigger's which fire individually for the different situations.

    Or perhaps you can use the switch command.

    Give more information and we could help you out ;)


  13. Hey there,

    I am trying to have a scenario, where the class "MtvrSupply_DES_EP1" (MTVR Supplytruck) can unload ammocrates within a trigger area.

    So when a truck is inside the trigger, it gets an action.

    Script:

    { while {H1_truck} do {

    _x removeAction 0;

    _x addAction ["UNLOAD AMMOCRATES","CHECKPOINTS\Ammo\HOME1\ammoUnload.sqf", [],1,false,false,"","((_target distance _this) <8)"];

    sleep 5;

    };} forEach (entities "MtvrSupply_DES_EP1") in list HOME1trig;

    First problem: When multiple trucks inside, they all should have the action. But only the first truck have it. I tried to solve this with a while statement, but this adds it to the first entered vehicle only. Using the same script just as an if statement, it adds the action to each MTVR inside. So how can I add the action dynamically to every truck inside, not just to the first entered?

    Second problem: Removing the action. I need to remove only this certain action, but using an index would remove an action this has been added sometime before. Isnt there a way to give the action a global variable?

    All in all, the first entered truck receives every 5 seconds a new action and all the other trucks not.

    Hope the pursued scenario is clear, and thanks for your helps dudes!

×