Jump to content

Melmarkian

Member
  • Content Count

    123
  • Joined

  • Last visited

  • Medals

Posts posted by Melmarkian


  1. if you want it really simple do this:

    into init field of unit:

    this addAction ["Arty Shot", "artyshot.sqf", laserTarget player, 6, false, true, "", "currentweapon player == 'Laserdesignator'"];

    artyshot.sqf

    _round = "sh_120_he" createVehicle [getpos cursorTarget select 0, getpos cursorTarget select 1, 5];

    You will get the action when you use the Designator. Point at something and boom!

    If you want to do real artillery action take a look at this:

    Artillery Module


  2. Ok,

    He plays it one more time after the switchtrigger. But this has worked:

    1. Into init-field:

    an2 addEventHandler ["AnimStateChanged", {an2 switchMove "UnaErcVelitelProslov1"}];

    2. Trigger opfor detected by blufor with

    an2 switchMove "";  an2 removeEventHandler ["AnimStateChanged", 0];

    I used this for captives in one of my missions.


  3. I would do it this way:

    1. Create a waypoint after the cycle

    2. Place a Trigger with OPFOR detected by BLUFOR. Set Type to Switch and sync it with the cycle waypoint. Maybe place in the on act. Field unit switchmove "";

    3. In case of friendly fire I would use the firednear eventhandler with switchmove "";

    or set a variable to true with the firednear eventhandler and make it another condition for the trigger at 2. (this OR hasfired)


  4. just use addaction:

    player addaction ["TAKE PHOTO", "Photoscript.sqf", [], 0, false, false, "", "player distance target1 < 100"];

    photoscript:

    titletext ["", "WHITE OUT"];
    titletext ["", "WHITE IN"];
    
    phototaken = true;

    Don´t know about a sound. You have to look through the soundfiles or add one.


  5. Demonized is right. Just spawn stuff if you use it.

    I found something helpful to get rid of an area of objects:

    I placed a gamelogic called "sidemission" at the center of the area I want to delete and create a trigger with the following On Act.

    {deleteVehicle _x} foreach (position sidemission nearEntities 200); {deleteVehicle _x} foreach (position sidemission nearObjects 200);

    Deletes even furniture and crews of vehicles.


  6. This works:

    stealm18 = createVehicle ["Ka52Black", getMarkerPos "helimarker", [], 0, "NONE"];
    stealm18 setvehiclevarname "stealm18";
    
    stealm18 setFuel 0; 
    stealm18 allowDamage false;

    why more complicated?

    And what is _vehicle in your code? It don´t see where it points.

    Or just:

    _vehicle = createVehicle ["Ka52Black", getMarkerPos "helimarker", [], 0, "NONE"];
    _vehicle setvehiclevarname "stealm18";
    _vehicle Call Compile Format ["%1=_This ; PublicVariable ""%1""","stealm18"];
    _vehicle setFuel 0; 
    _vehicle allowDamage false;


  7. Hi,

    to get a string out of it I would do:

    thearray = ["1","2","3","4"];
    thestring = format ["%1,%2,%3,%4", thearray select 0, thearray select 1, thearray select 2, thearray select 3];

    To do this dynamic.. I don´t know. You can get the number of array elements with

    count thearray

    I don´t know about string manipulation in arma/sqf.

    EDIT: Wasn´t that hard:

    thearray = ["1","2","3","4","5"];
    _string = "";
    
    for "_i" from 0 to (count thearray) -1 do
    {
    
       _string1 = format ["%1,", thearray select _i];
       _string = _string + _string1;
    
    };
    
    hint _string;

    EDIT2: And if you want to get rid of the last comma:

    thearray = ["1","2","3"];
    _string = "";
    
    for "_i" from 0 to (count thearray) -1 do
    {
       if (_i == ((count thearray) -1)) then 
       {
           _string1 = format ["%1", thearray select _i];
           _string = _string + _string1;
       }else 
       {
           _string1 = format ["%1,", thearray select _i];
           _string = _string + _string1;
       };
    };
    
    hint _string;


  8. Hi,

    I tried your script today and noticed something strange:

    Most of the groups I place in the editor without waypoints start to run to some random position a few hundred meters away when I start the mission.

    It seems like this isn´t a problem in your code but some new ai behaviour, because when I use the RMM_Reducer from Rommel they do the same.

    I include a sample mission:

    http://www.mediafire.com/?852yzuqix29ftj6

    When I start the mission, the USMC unit starts to run to a place near the airport and the russian one stays at its starting point.

    Edit:

    When I create a waypoint for the USMC group he first runs to his random spot and then moves to the waypoint.

    Edit2:

    Just tested it: The remaining unit is fleeing (tested with fleeing _unit) when all his friends disapear.

    Edit3:

    I have inserted two lines of code into the fsm:

    At "Cache Units" :

    _cep_grp allowFleeing 0;

    before the group is deleted

    and

    At "Normalise Units":

    (group _cep_leader)  allowFleeing 0.3;

    as last line.

    This way it works even when the AI skill is low. I would like to set the allowFleeing to the value it was before the unit is cached but I don´t know how to get the number.

×