Jump to content

Ghost

Member
  • Content Count

    668
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by Ghost


  1. I am trying to kill the players group AI when a player disconnects from a dedicated server for whatever reason. I have been searching and trying many different things for this and cannot get it to work. disabledAI = true; what i have so far is in the init.sqf i put

    if (isServer) then {onPlayerDisconnected "xhandle = [_name] execVM ""dta\scripts\playerdis.sqf""";};

    then in playerdis.sqf

    _grp_player = group player;
    
    {
    _x removeAllEventHandlers "killed";
    _x setdamage 1;
    hidebody _x;
    sleep 2;
    deletevehicle _x;} foreach _grp_player;

    Currently the AI do not die or anything and when a player joins the same slot again the AI will follow him like they are part of the group, but the player is not able to command them. When you shoot them they are reported as 1 is down.


  2. remove that task from your briefing file and put it in a trigger or script file that is actiavted when it is needed. Other option would be to put it in an if/then statement.

    if (objcomplete) then {your task code};

    now you just define the objcomplete in your init.sqf like

    objcomplete=false; publicvariable "objcomplete";

    so once the condition is right have a trigger with onactivation of

    objcomplete=true; publicvariable "objcomplete"; and your task code or script to run your task code

    having the if/then statement will keep the code in {}; from activating until the () code is true. This is great for respawn so you dont lose the status of your task.


  3. for onmapsingleclick try implementing this set of code

    mapclick = false;
    
    onMapSingleClick """arty"" setMarkerPos _pos; clickpos = _pos; mapclick = true; onMapSingleClick """";true;";
    
    waituntil {mapclick};
    _pos = clickpos;

    so _pos is the position of mapclick. Change arty to your marker name. Pay attention to how many "" are used. Might be excessive at the end but does not give errors and works. I read somewhere thats how you end a mapclick.


  4. Thank you all for the replies. At the spawn there is an Officer that when you get close to will give you the options via action menu to: change viewdistance, recruit ai, and halo. Once a unit is recruited he will join your group and you control him like normal.

    ** Update **

    I added a poll, please vote


  5. Not everyone (points at self) have played since OFP, and it's not obvious at all. Not something that warrants fixing, but something that one could obviously make a mistake with. Fact is I'm not the first one to get confused by this.

    Rectangles have no radius ;)

    good link for you http://community.bistudio.com/wiki/ArmA:_Mission_Editor#Triggers_Mode_.28F3.29

    look at trigger axis descritpion.


  6. I noticed after a long time working on this mission someone else has a similar named mission. If anyone has some good ideas for a name for this mission let me know but please play it first before giving me a name suggestion. I have been tweaking this mission for a while now, developing new basic scripts, expanding my mission making knowledge. I know it can be buggy and some things arent perfect but it has been tested on a dedicated server with 1-4 people and after numerous trys and many hours we finally beat it.

    http://www.filefront.com/14129875/Longest_Day_CO10_V1.7z

    Thanks to Armaholic for mirror

    http://www.armaholic.com/page.php?id=6562

    3141292.gif

    Features:

    1. Recruit AI up to 13 total units
    2. Vehicle Spawn with markers (deleted when vehicle is dead)
    3. Viewdistance adjustment
    4. Halo jump option
    5. Exstensive mission with numerous objectives
    6. Base respawn and you keep your loadout at death
    7. Vehicle resupply point (rearm,repair,refuel)
    8. AI units die when player dies (keeps them from taking command still wip)
    9. Body deletion script to keep the server running well
    10. Spawned vehicles delete after 30 secs
    11. Almost all objective town enemy units spawn when objective is activated

    Known issues:

    1. On player disconnect ai from players group are not deleted and follow player when player joins same unit slot again. No controll over units though.
    2. Unlimited Vehicle spawns (need to limit players so there is not hundreds of vehicles)
    3. Halo script works but does require user to open/close map to activate Halo and bring up gps to see where he is
    4. Vehicle resupply point does not fill the extra magazine slots for turrets


  7. thats a complicated resupply. Do a search and you will find very simply yet effective scripts to resupply vehicles using setfuel, setvehicleammo, and setdamage commands. But if you want it to be a specific resupply script for a few name vehicles then you would need a switch case http://community.bistudio.com/wiki/SQS_to_SQF_conversion#Structured_conditional_command.

    before that structured command you will need to get the vehicle type, example:

    _aircraft = _this select 0;
    
    _type = typeof _aircraft;
    
    switch (_type) do {
    case "C130J": {_aircraft animate ["ramp_top", 1]; _aircraft animate ["ramp_bottom", 1]};
    case "MV22": {_aircraft animate ["ramp_top", 1]; _aircraft animate ["ramp_bottom", 1]};
    };

    for the sit still part have something like this in beginning of script

    _unit = _this select 0;
    
    WaitUntil{_unit in list Rearmlist};
    sleep 4;
    if(!(_unit in list Rearmlist)) exitWith {_unit vehiclechat "Repair Aborted"};

    now the trigger that the vehicle has to drive in will be named rearmlist

×