Jump to content

donborrego

Member
  • Content Count

    4
  • Joined

  • Last visited

  • Medals

Posts posted by donborrego


  1. On 9/10/2017 at 8:05 AM, strider42 said:

    I modified the fn_spawnVehicle.sqf file to solve this problem.  It works in the USS Freedom but I have not check it still works on land.

    Basically I check if the position is over water and assume that means it is on the Freedom and then modify the position to take into account the height of the carrier deck.

    The checking the respawn point is clear still works (if it is not the vehicle is deleted, as before).

    
    /*
    	File: fn_spawnVehicle.sqf
    	Author: Bryan "Tonic" Boardwine
    	
    	Description:
    	Spawns the selected vehicle, if a vehicle is already on the spawn point
    	then it deletes the vehicle from the spawn point.
    
       Edit: Strider 10 Sep 2017
       Updated to work with the USS Freedom aircraft carrier.
    */
    disableSerialization;
    private["_position","_direction","_className","_displayName","_spCheck","_cfgInfo"];
    if(lnbCurSelRow 38101 == -1) exitWith {hint "You did not select a vehicle to spawn!"};
    
    _className = lnbData[38101,[(lnbCurSelRow 38101),0]];
    _displayName = lnbData[38101,[(lnbCurSelRow 38101),1]];
    _position = getMarkerPos VVS_SP;
    
    // Check if we are over water (and assume we are on the USS Freedom.
    if ( surfaceIsWater _position ) then {
       _position = _position vectorAdd [0,0,24];
    };
    
    _direction = markerDir VVS_SP;
    
    //Make sure the marker exists in a way.
    if(isNil "_position") exitWith {hint "The spawn point marker doesn't exist?";};
    
    //Check to make sure the spawn point doesn't have a vehicle on it, if it does then delete it.
    _spCheck = nearestObjects[_position,["landVehicle","Air","Ship"],12] select 0;
    if(!isNil "_spCheck") then {deleteVehicle _spCheck;};
    
    _cfgInfo = [_className] call VVS_fnc_cfgInfo;
    
    /*
     * Spawn the requested vehicle.
     */
    
    // Spawn vehicle somewhere where we can manipulate it.
    _vehicle = createVehicle [_className, [0,0,10], [], 0, "CAN_COLLIDE"];
    
    // Stop it being damaged.
    _vehicle allowDamage false;
    
    // Set the vehicle direction.
    _vehicle setDir _direction;
    
    // Put the vehicle where we  want it.
    _vehicle setVehiclePosition [_position , [], 0, "CAN_COLLIDE"];
    
    
    if((_cfgInfo select 4) == "Autonomous") then
    {
    	createVehicleCrew _vehicle;
    };
    
    if(VVS_Checkbox) then
    {
    	clearWeaponCargoGlobal _vehicle;
    	clearMagazineCargoGlobal _vehicle;
    	clearItemCargoGlobal _vehicle;
    };
    
    _vehicle allowDamage true;
    hint format["You have spawned a %1",_displayName];
    closeDialog 0;

    The new bits of code are:

    Checking if the respawn position is over water and them modifying the _postion variable.

    
    // Check if we are over water (and assume we are on the USS Freedom).
    if ( surfaceIsWater _position ) then {
       _position = _position vectorAdd [0,0,24];
    };

    Respawn the vehicle safely.  This uses a template I like for safe vehicle respawn and the simple way seemed to cause problems with some vehicle spawning and other disappearing.

    
    /*
     * Spawn the requested vehicle.
     */
    
    // Spawn vehicle somewhere where we can manipulate it.
    _vehicle = createVehicle [_className, [0,0,10], [], 0, "CAN_COLLIDE"];
    
    // Stop it being damaged.
    _vehicle allowDamage false;
    
    // Set the vehicle direction.
    _vehicle setDir _direction;
    
    // Put the vehicle where we  want it.
    _vehicle setVehiclePosition [_position , [], 0, "CAN_COLLIDE"];

    Hope this might help you.  S

     

    I tried this to create a spawner inside the USS Liberty's deck (destroyer) but ended up spawning the vehicles on top of the ship. Anyone have any idea on how to make this possible?


  2. Im looking for a script that allow players in a dedicated srv spawn custom tasks with a map click for location. A few years ago I played with a unit that uses a script to generate practice tasks. It was very simple, you interact with an object then choose a task type from a lists and then just click on the map to generate the task. It was very simple: click on the flag, click on the Tasks Options screen, click on map, play!


  3. Hey guys, I've been reading posts and watching youtube videos about the helicopter edition and I can't find any answer to my problem. I am making a simple mission, a fire team is trasportaded from the airport to the south of Straits via heli to eliminate an enemy mortar. I've made the heli to load and unload the team at the infiltration zone and then I created a cycle waypoints to make the heli patrol the area while the team deal with the target. After the enemy is neutralized the team goes to an exfiltration point to be picked up by the heli to head back to the base.

    The only problem with the mission is that I can't make the heli stop the patrol and load the team. i know how to do it without the patrol order, but i want it with the patrol. Also i know how to do it using the timer but I want it to be done without it. More or less words, I want the heli to pick up the team when they are done with the elimination.

    I can't find a post with that info, if there is any post with that please someone let me know and sorry for the repost if that's the case.

    Thx a lot and sorry for my terrble english

×