User Tag List

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2007
    Last Online
    Today
    Country
    This is Bailing_Out's Country Flag

    Posts
    3,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Things that aren't so simple Thanks to Pierremgi

    I could not figure a way to just respawn stuff for a side only when it owned the nearby sector, sure people write very long scripts for this with multiple files and folders in the mission folder but they are almost always for missions, not multiplayer scenarios.

    Peirremgi doesn't really like the modules (he writes those very long scripts usually) but he wrote this to make it work like I wanted. So if you ever see him over at the BIS studio forums tell him I made damn sure to credit him for this.

    You can still read this but go down a few post to get the new less complicated way of doing this.


    Module:
    place a module: respawn vehicle. In its init field:
    moduleLogic1 = (nearestObjects [getpos this ,["ModuleRespawnVehicle_F"],5]) select 0;
    You can change the variable name. Do not link to vehicles if you want then to respawn only with the trigger activated. All linked vehicles will respawn automatically.

    You can choose your options in module.


    Vehicles:
    Name them or identify them with all you want but you need an array of vehicles to be respawned (remember: they are not linked to module) .
    say in example below [car1,car2,car3,car4]


    Trigger: BLUFOR PRESENT or else , make your condition for respawning vehicles
    repeatable, server only
    in on act field:
    I named the trigger modulelogic1, the variable name he used above, it works without that but if you have multiple of these setups then they'd have to be named different I am sure. The vehicles DO have to be synced to the trigger. Else you drive outside the trigger and it get killed and it won't respawn.
    In the on activation field of trigger.
    Code:
    {
      _x  synchronizeObjectsAdd [moduleLogic1];
      _x spawn {
        private ["_delay","_desertedDelay","_respawnCount","_init","_position","_wreck", "_respawnWhenDisabled"];
        _delay = (moduleLogic1 getvariable ["Delay","0"]) call bis_fnc_parsenumber;
        _desertedDelay = (modulelogic1 getvariable ["DesertedDelay","-1"]) call bis_fnc_parsenumber;
        _desertedDistance = (moduleLogic1 getvariable ["DesertedDistance","-1"]) call bis_fnc_parsenumber;
       _respawnCount = (moduleLogic1 getvariable ["RespawnCount","-1"]) call bis_fnc_parsenumber;
       _init = compile (moduleLogic1 getvariable ["Init",""]);
       _position = (moduleLogic1 getvariable ["Position","0"]) call bis_fnc_parsenumber;
       _positionType = (moduleLogic1 getvariable ["PositionType","0"]) call bis_fnc_parsenumber;
       _wreck = ((moduleLogic1 getvariable ["Wreck","2"]) call bis_fnc_parsenumber);
       _showNotification  = ((moduleLogic1 getvariable ["ShowNotification","1"]) call bis_fnc_parsenumber);
       _forcedRespawn = ((moduleLogic1 getvariable ["ForcedRespawn","0"]) call bis_fnc_parsenumber);
       _respawnWhenDisabled = moduleLogic1 getvariable ["RespawnWhenDisabled", false];  
       [_this,_delay,_desertedDistance,_respawnCount,_init,_position,_positionType,_wreck,_showNotification,_forcedRespawn,_desertedDistance, _respawnWhenDisabled] call bis_fnc_moduleRespawnVehicle;
      }
    } forEach [car1,car2,car3,car4];
    In the deactivation field
    Code:
    {
      _x  synchronizeObjectsRemove [moduleLogic1];
      (_x getVariable "bis_fnc_modulerespawnvehicle_data") set [0,false]
    } forEach [car1,car2,car3,car4];
    He and I now disagree about something but I think its because of language difference or something. He says it should work even if the vehicles are not synced to the trigger, I think he he thinks I'm syncing them to the veh rsp module. That would not work right.

    You can still change all that stuff, delay, number of respawns, in the vehicle respawn module. I think he took some of that code from one of his other scripts.

    The vehicles/planes/tanks have to have variable names because of the array or something.
    No longer need to link the vehicles in the new way or name them all.

    Last edited by Bailing_Out; 11-27-2017 at 02:02 AM. Reason: New way of doing things
    Kissinger Quote "The superpowers often behave like two heavily armed blind men feeling their way around a room, each believing himself in mortal peril from the other, whom he assumes to have perfect vision.
    Over time even two armed blind men in a room can do enormous damage to each other, not to speak of the room."

    Josey Wales: When I get to likin' someone, they ain't around long.
    Lone Watie: I notice when you get to DISlikin' someone they ain't around for long neither.

    The camps I remember being in. Maybe some others, I was drinking, I was on the moon with Steve.



    my blog Which I rarely post to.

  2. #2
    Registered User
    Join Date
    Nov 2007
    Last Online
    Today
    Country
    This is Bailing_Out's Country Flag

    Posts
    3,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Things that aren't so simple Thanks to Pierremgi

    That picture shows the vehicles inside the area of the trigger but the trigger can be one of those without an area. Just tried on the scenario I'm doing and it works perfect. Just make damn sure you name the vehicles and that that name is in the code for that particular respawn combo of module and trigger. Nothing like spending 20 minutes wonder why it didn't work then remembering you didn't name the vehicles in that group.

    Really this was all I needed to make the scenarios I wanted to make all along. I have spent a long damn time trying to make something like this work. LOL the vehicle explosions were funny when they'd spawn over/on each other over and over. I thought I almost had it when that happened.

    It is the damnedest things that will mess it up, respawnOnStart = 1; <-without that in the init.sqf the repair script won't work and I don't know what else won't work without it, all I know is someone told me to use that in the init, who I don't remember.
    Last edited by Bailing_Out; 11-22-2017 at 02:04 AM.
    Kissinger Quote "The superpowers often behave like two heavily armed blind men feeling their way around a room, each believing himself in mortal peril from the other, whom he assumes to have perfect vision.
    Over time even two armed blind men in a room can do enormous damage to each other, not to speak of the room."

    Josey Wales: When I get to likin' someone, they ain't around long.
    Lone Watie: I notice when you get to DISlikin' someone they ain't around for long neither.

    The camps I remember being in. Maybe some others, I was drinking, I was on the moon with Steve.



    my blog Which I rarely post to.

  3. #3
    Registered User
    Join Date
    Nov 2007
    Last Online
    Today
    Country
    This is Bailing_Out's Country Flag

    Posts
    3,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Things that aren't so simple Thanks to Pierremgi

    Ok so apparently Pierremgi writes even better than he knows, while you do have to changed the name of each trigger you use with the vehicle respawn module, and change the name of the trigger inside the vehicle respawn module itself YOU DO NOT HAVE TO NAME EACH VEHICLE if you do it like this.

    Module:
    place a module: respawn vehicle. In its init field:
    moduleLogic1 = (nearestObjects [getpos this ,["ModuleRespawnVehicle_F"],5]) select 0;

    You can change the variable name. Do not link to vehicles if you want then to respawn only with the trigger activated. All linked vehicles will respawn automatically.

    You can choose your options in module.


    Vehicles:
    Name them or identify them with all you want but you need an array of vehicles to be respawned (remember: they are not linked to module) .
    say in example below [car1,car2,car3,car4]



    Trigger: BLUFOR PRESENT or else , make your condition for respawning vehicles
    repeatable, server only
    in on act field:
    The best condition I've found for this is if you're blufor then you put independent not present. That way it won't respawn if any independent is nearby, also I will put the sector in the condition
    (sector1 getvariable "owner") = blufor
    That way their stuff will only respawn if they have the sector.

    You have to have the same name for the trigger, in this case modulelogic1 and the named used in the vehicle respawn module. This goes in the init of the vehcile respawn module. It is synced to the trigger
    Code:
    moduleLogic1 = (nearestObjects [getpos this ,["ModuleRespawnVehicle_F"],5]) select 0;

    for triggers on activation field

    Code:
    {
      _x  synchronizeObjectsAdd [moduleLogic1];
      _x spawn {
        private ["_delay","_desertedDelay","_respawnCount","_init","_position","_wreck", "_respawnWhenDisabled"];
        _delay = (moduleLogic1 getvariable ["Delay","0"]) call bis_fnc_parsenumber;
        _desertedDelay = (modulelogic1 getvariable ["DesertedDelay","-1"]) call bis_fnc_parsenumber;
        _desertedDistance = (moduleLogic1 getvariable ["DesertedDistance","-1"]) call bis_fnc_parsenumber;
       _respawnCount = (moduleLogic1 getvariable ["RespawnCount","-1"]) call bis_fnc_parsenumber;
       _init = compile (moduleLogic1 getvariable ["Init",""]);
       _position = (moduleLogic1 getvariable ["Position","0"]) call bis_fnc_parsenumber;
       _positionType = (moduleLogic1 getvariable ["PositionType","0"]) call bis_fnc_parsenumber;
       _wreck = ((moduleLogic1 getvariable ["Wreck","2"]) call bis_fnc_parsenumber);
       _showNotification  = ((moduleLogic1 getvariable ["ShowNotification","1"]) call bis_fnc_parsenumber);
       _forcedRespawn = ((moduleLogic1 getvariable ["ForcedRespawn","0"]) call bis_fnc_parsenumber);
       _respawnWhenDisabled = moduleLogic1 getvariable ["RespawnWhenDisabled", false];  
       [_this,_delay,_desertedDistance,_respawnCount,_init,_position,_positionType,_wreck,_showNotification,_forcedRespawn,_desertedDistance, _respawnWhenDisabled] call bis_fnc_moduleRespawnVehicle;
      }
    } Foreach thislist;
    with the name modulelogic1 as its variable name. FOR THE LOVE OF ALL THAT IS HOLY DO NOT FORGET TO GIVE A TRIGGER OR MODULE A VARI8ABLE NAME IF THAT NAME IS GOING TO BE USED BY ANOTHER MODULE OR ANYTHING ELSE!!!

    All I changed was, forEach [car1,car2,car3,car4]; to foreach thislist; No more naming the vehicles, no more linking the vehicle to the trigger. Whatever is in the area of that trigger at round start will respawn until either the round ends or till it uses the tickets you give them in the vehicle respawn module.


    In the deactivation field
    Code:
    {
      _x  synchronizeObjectsRemove [moduleLogic1];
      (_x getVariable "bis_fnc_modulerespawnvehicle_data") set [0,false]
    } forEach thislist;
    Kissinger Quote "The superpowers often behave like two heavily armed blind men feeling their way around a room, each believing himself in mortal peril from the other, whom he assumes to have perfect vision.
    Over time even two armed blind men in a room can do enormous damage to each other, not to speak of the room."

    Josey Wales: When I get to likin' someone, they ain't around long.
    Lone Watie: I notice when you get to DISlikin' someone they ain't around for long neither.

    The camps I remember being in. Maybe some others, I was drinking, I was on the moon with Steve.



    my blog Which I rarely post to.

  4. #4
    Registered User
    Join Date
    Nov 2007
    Last Online
    Today
    Country
    This is Bailing_Out's Country Flag

    Posts
    3,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Things that aren't so simple Thanks to Pierremgi

    Found out that any vehicle you lose while not having the sector will no longer respawn after you gain it back. Makes keeping the sector with the most valuable vehicles very important.
    Kissinger Quote "The superpowers often behave like two heavily armed blind men feeling their way around a room, each believing himself in mortal peril from the other, whom he assumes to have perfect vision.
    Over time even two armed blind men in a room can do enormous damage to each other, not to speak of the room."

    Josey Wales: When I get to likin' someone, they ain't around long.
    Lone Watie: I notice when you get to DISlikin' someone they ain't around for long neither.

    The camps I remember being in. Maybe some others, I was drinking, I was on the moon with Steve.



    my blog Which I rarely post to.

  5. #5
    Registered User
    Join Date
    Nov 2007
    Last Online
    Today
    Country
    This is Bailing_Out's Country Flag

    Posts
    3,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Things that aren't so simple Thanks to Pierremgi

    If you want vehicles to keep respawning after a side has lost and regained a sector then the first way, where you name the vehicles works. The "thislist" version works but any vehicles killed while the sector they spawn at belongs to the other side, they will no longer respawn.
    Kissinger Quote "The superpowers often behave like two heavily armed blind men feeling their way around a room, each believing himself in mortal peril from the other, whom he assumes to have perfect vision.
    Over time even two armed blind men in a room can do enormous damage to each other, not to speak of the room."

    Josey Wales: When I get to likin' someone, they ain't around long.
    Lone Watie: I notice when you get to DISlikin' someone they ain't around for long neither.

    The camps I remember being in. Maybe some others, I was drinking, I was on the moon with Steve.



    my blog Which I rarely post to.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •