Jump to content

_qor

Member
  • Content Count

    294
  • Joined

  • Last visited

  • Medals

Posts posted by _qor


  1. Hey,

    I have a script which calls another one at the end.

    This new called script should work for each unit/group which calls it in another, defined way.

    I know this has to do with arrays, select an index and some variables but need some help because this is the first time I really use it to make a script independent.

    For the overview (see script at the end):

    There are 3 groups which should get in heli or move to a GUARD waypoint according to the the variable "attackSB".

    For each group there is one heli and one GUARD waypoint.

    For the first time it would help if you can tell me how I can refer to the caller of the script.

    Perhaps this will do it at all.

    addAction scripts have this to refer:

    _talker = _this select 0;
    _bother = _this select 1;
    _action = _this select 2;

    Does this even work for scripts which has not been called by addAction?

    Or do I have to create one script for each execution?

    talker = caller (object/unit)

    bother = player, the one who initialized the call

    action = addAction action

    if (!attackSB) then

    {

    wp3a = NBgrp1 addWaypoint [getPos NBch1, 3];

    wp3a setWaypointType "GETIN";

    wp3a waypointAttachVehicle NBch1;

    }

    else

    {

    wp3a = NBgrp1 addWaypoint [getMarkerPos "supdef1a", 10];

    wp3a setWaypointType "GUARD";

    wp3a setWaypointBehaviour "YELLOW";

    wp3a setWaypointBehaviour "AWARE";

    wp3a setWaypointFormation "VEE";

    waitUntil {!attackSB};

    wp4a = NBgrp1 addWaypoint [getPos NBch1, 3];

    wp4a setWaypointType "GETIN";

    wp4a waypointAttachVehicle NBch1;

    };


  2. Hey,

    there is a Combat Count News board in my mission which releases enemy and friendly death toll.

    So this is working for each attack of the enemy. But to distinguish between all those releases I want to add a time stamp to each CCN release.

    Assuming I would use the date code to handle it

    http://community.bistudio.com/wiki/date

    But how do I save a certain time? Calling the date by script would always return the current time.

    So I want to call the date code and to save the returned numbers to another variable to call it up later.

    thanks in advance


  3. Great, thank you ;)

    But what about modules which have no need of synchronization like SimpleSupportModule?

    Spawn and delete them? If this is the solution, how do I spawn that module, cant find a name for it!

    Because changing its availability with

    BIS_SSM_Airstrike_AVAILABLE_WEST = false;

    apparently doesnt work during game.

    Additionally, spawning HighCommand Module doesnt seem to work for also spawned units.

    Even if they have spawned before the HC module. And if I would create a subcommander module

    and sync with spawned unit, I lose the HC option for all player-side units.


  4. you are kidding me... -.-

    actually women are the same AI as men, except there is another "make-up". Why did the developers distinguish between make-up man and make-up woman?

    Never mind! Gonna change it to a man ;D

    > its working this way

    SuicideCar = createVehicle ["hilux1_civil_3_open_EP1", getMarkerPos "SScarMark", [], 0, "NONE"];
    
    _grp = createGroup civilian;
    
    _unit = _grp createUnit ["TK_CIV_Takistani03_EP1", getMarkerPos "SScarMark",[],0,"FORM"];
    
    _unit moveInDriver SuicideCar;
    
    
    Path1
    =[[###position data###];
    
    [suicideCar, Path1] spawn BIS_fnc_UnitPlay;
    


  5. Thanks!

    So at least I found a workaround for this:

    Due to the case that UnitPlay will start from the captured position, you can put the vehicle wherever you want on the map where it won't disturb the mission.

    Unfortunately this doesnt help when vehicle is destroyed (like my suicide car) and you want to play movements again.

    Additionally, setting enableSimulation to false will ensure that the unit inside won't flee (also prevents civilians from fleeing when in danger).

    It seems that vehicle used for UnitCapture/Play must not be empty.

    At the moment trying this way:

    abc = createVehicle ["hilux1_civil_3_open_EP1", getMarkerPos "hdSB1", [], 0, "NONE"];
    
    
    _grp = createGroup civilian;
    
    _unit = _grp createUnit ["TK_CIV_Woman01_EP1", getMarkerPos "hdSB1",[],0,"FORM"];
    
    
    _unit moveInDriver abc;
    
    

    Vehicle and civilian get spawned, but the civilian doesnt move in as driver. Why?


  6. Hey there,

    I already captured the movements for a suicide car, which blows up some enemy establishments > works!

    This event should be later on in the mission, so I'd like to spawn the vehicle and then play the movements instead of having the vehicle on the map all over the mission.

    But apparently there is a problem with referring to the vehicle's name.

    _veh = [getMarkerPos "SScarMark", 180, "hilux1_civil_3_open_EP1", CIVILIAN] call bis_fnc_spawnVehicle;
    
    SuicideCar2 = _veh select 0;
    
    rec = [] spawn RecPath2;

    This is the only thing I changed, the script which contains the data for movements still refers to a vehicle called "SuicideCar2". But the vehicle doesnt move.

    I already tried with createVehicle, same problem.

    init.sqf

    RecPath2 = compile preprocessfile "SScar.sqf";

    SScar.sqf

    Path2
    =
    [##position datas##];
    
    [suicideCar2, Path2] spawn BIS_fnc_UnitPlay;


  7. Question according to that switch function.

    May it be that you cant change variables within the script?

    _recruit = _this select 3;
    
    switch (_recruit) do
    {
    
        case "Mission1": 
    
    {
    
    script = [] execVM "mission1.sqf";
    
    missionOn = true;
    
    };
    
        case "Mission2": 
    
    {
    
    script = [] execVM "mission2.sqf";
    
    missionOn = true;
    
    };};

    After activating one of those cases, missionOn will stay false as initialized in the init.sqf.

    Of course setting it to true by other scripts work.


  8. Hey,

    By usind addAction, I want to have multiple choices when using an object.

    So I would just add this code one time for every menu item.

    this addAction ["Recruit X","scriptX.sqf"];

    But assuming there should be 20 menu items, I dont want to have a script for each.

    Is there some way to check which menu item (Recruit X) has been chosen and then execute the respective code (while having them all in one file)?


  9. I want to make kinda kills/deads scoreboard for SP.

    Therefore I created two gamelogics whose names should get a value (+1 for each dead).

    Something like

    gamelogic = 1

    Sometimes I want to return these values to display the deads.

    So how can I increase the values and how can I return them? I just cant find out...

    Would have used addScore but this apparently works only in MP


  10. Big sorry! I just wrote it down in a hurry, ingame code was correct.

    Problem was, that I didnt set the trigger to get activated by OPFOR!

    So having the code running, I tried a bit and it turns out that there already is kinda build in evaluation.

    At least AI share their knowledge about enemies to friendly units. So if they have a GUARD waypoint, they will move towards those enemies - regardless of that, they get the shared information.

    And apparently AI arranges enemies to which has been detected first and prioritizes the first detected.

    Great stuff, didnt know that! Gonna keep trying this out...


  11. Hey there,

    I want to create a script which evaluates the intensity of an attack, for example on an airbase.

    Depending on the result, various countermeasures should get executed.

    So I would handle this with the detected by function. Counting every detected enemy force would give a realistic image of what friendly AI is aware of the enemy.

    I am trying with countEnemy, but the return value is always 0 although the AI attacks the enemies.

    Besides, how to use this not for a single unit but for a whole side?

    thanks for any help! :)


  12. So I defined the return values:

    HDef1 = [getmarkerPos "heavyDefSB1", 300, "M2A2_EP1", West] call Bis_fnc_spawnvehicle;
    
    HDef1veh = HDef1 select 0;
    HDef1crw = HDef1 select 1;
    HDef1grp = HDef1 select 2;
    
    {_x setskill ["general",0.99];} foreach units HDef1crw;
    
    
    sleep 4;
    
    
    
    wp1 = HDef1grp addWaypoint [getMarkerPos "hdSB1", 10];
    wp1 setWaypointType "SAD";
    wp1 setWaypointBehaviour "AWARE";
    wp1 setWaypointFormation "VEE";
    wp1 setWaypointSpeed "FULL";
    wp1 setWaypointCombatMode "YELLOW";

    So it is working without having the setskill part. Cant find out whats wrong at that...


  13. Hey,

    so far I can spawn a BIS vehicle but cant give them waypoints.

    I tried with this:

    HDef1 = [getmarkerPos "heavyDefSB1", 0, "M2A2_EP1", West] call Bis_fnc_spawnvehicle;
    
    {_x setskill ["general",0.99];} foreach units HDef1;
    
    
    sleep 4;
    
    
    
    wp1 = HDef1 addWaypoint [getMarkerPos "hdSB1", 10];
    wp1 setWaypointType "SAD";
    wp1 setWaypointBehaviour "AWARE";
    wp1 setWaypointFormation "VEE";
    wp1 setWaypointSpeed "FULL";
    wp1 setWaypointCombatMode "YELLOW";

×