Jump to content

igneous01

Member
  • Content Count

    924
  • Joined

  • Last visited

  • Medals

Posts posted by igneous01


  1. while {_lives != 0} do {
     _veh = createVehicle [_vtype , getMarkerPos _spawnpos, [], 0, "NONE"];
     if (fuel _veh < 0.2) then {_veh setfuel 1}; 
     waitUntil { !alive _veh OR !canMove _veh };

    here is the problem with this loop.

    it will keep looping so long as _lives is not 0, that means it will spawn a new vehicle everytime at spawnpos, even if it isnt destroyed.

    you tried to get around this by using a waituntil !canmove or !alive, rendering your fuel check useless, as it only runs once, after the vehicle spawns.

    And i think your variable is returns nil, because you didnt add a sleep between the create vehicle, and fuel check. It takes a small amount of time for the vehicle to be created, and then once it successfully spawns, the variable _veh has been assigned a value.

    but because the code will process the IF statement while the vehicle is being created (were talking milliseconds here) it returns error _veh variable is nil or doesnt exist.

    so my solution to this is: add a sleep between your fuel check and create vehicle.

    OR:

    make separate functions for each, and using spawn to call simultaneous functions (like a function to check fuel, and a function to check if its been destroyed) that way, two things will be checked simultaneously at the same time.

    an example:

    FNC_FuelAndDamageCheck = {
         private ["_veh"];
         _veh = _this select 0;
               while {alive _veh && canmove _veh} do {
                      if (fuel _veh < 0.2) then {_veh setfuel 1}; 
                      sleep 1;
               };
    }:           
    
    while {_lives != 0} do {
    // creating vehicle and creating variable
         _veh = createVehicle [_vtype , getMarkerPos "_spawnpos", [], 0, "NONE"];
    
    // adding small delay in case something fails (like the vehicle getting made after the spawn is init
         sleep 1;
    
         // runs a new script (script within a script) of the function up top, it runs at the same time as this script, and is independant of it 
         FuelDamageCheckHandle = [_veh] spawn FNC_FuelAndDamageCheck;
    
         // waituntil the functions exits by via vehicle dead, or cannot move
         waituntil {scriptdone FuelDamageCheckHandle};
    
         _lives = _lives - 1;
    
         deletevehicle _veh;
    
    

    this example is almost the same as yours, only difference being, there are two while loops happening at the same time. (one is inside the function (which is run independant of this script) and the one inside the script. The variable _veh is created, then spawn initializes with the argument _veh (it references this as _veh in its own scope) which then runs a while loop to check if the vehicle can move, or if its alive. the if statement inside will check everysecond to see if fuel is low, and re apply fuel again. The function will exit if either condition (alive and canmove) is false. then the waituntil inside the main loop checks to see if the function has stopped running, it it has finished running, subtract the lives, delete the vehicle (I believe this also destroys, or overwrites the variable _veh to nil)

    then it loops back again, reassigning (or creating) _veh again.

    i did not test this, there may be some missing colons or whatever, but thats the idea.

    There are many different ways of approaching your problem, i like to create separate and smaller functions and then run them simulatenously inside the main loop of a script. Others may approach it differently


  2. sleep 3;
    
    //ACM settings    
          waitUntil {!isNil {BIS_ACM getVariable "initDone"}};
          waitUntil {BIS_ACM getVariable "initDone"};
      [] spawn {
          waitUntil {!(isnil "BIS_fnc_init")};
          [1, BIS_ACM1] call BIS_ACM_setIntensityFunc;                 //Sets the intensity of the ACM, in other words, determines how active it will be. Starts at 0 ends at 1.0, its been known to fail using 0.7 and 0.8
          [bIS_ACM1, 200, 450] call BIS_ACM_setSpawnDistanceFunc;      // This is the radius on where the units will spawn around the unit the module is sync'd to, 400m being the minimal distance and 700m being the maximum. Minimum is 1 I believe. 
          [["INS","CDF","GUE"], BIS_ACM1] call BIS_ACM_setFactionsFunc;     // This tells the ACM which faction of units it will spawn. In this case it will spawn Takistani Insurgents
          [0, 0.7, BIS_ACM1] call BIS_ACM_setSkillFunc;                // This determines what the skill rating for the spawned units will be
          [0.2, 0.5, BIS_ACM1] call BIS_ACM_setAmmoFunc;               // This sets their amount of ammo they spawn with
          ["ground_patrol", 1, BIS_ACM1] call BIS_ACM_setTypeChanceFunc; //If you want ground patrols then leave it as a 1, if you don't put a 0. They will use random paths
          ["air_patrol", 0, BIS_ACM1] call BIS_ACM_setTypeChanceFunc;    // Same thing for air patrols
          [bIS_ACM1, ["GUE_InfSquad", "GUE_InfTeam_AT", "GUE_GrpInf_TeamSniper", "GUE_MotInfSection", "GUE_MilitiaSquad","INS_InfSquad","INS_InfSquad_Weapons","INS_InfSection_AT","INS_InfSection_AA","INS_SniperTeam","INS_MilitiaSquad","CDF_InfSection_Patrol","CDF_TankPlatoon","CDF_SniperTeam","CDF_MotInfSquad"]] call BIS_ACM_addGroupClassesFunc;   // This determines which exact units will spawn from the group **Citation needed**
      };
    

    im using this code, why are there for example, Insurgent Choppers spawned also? i didnt define that in the code?!? I also saw an USMC UAV, but i dont even defined USMC as faction, whats the problem?

    u didnt activate it properly, whats happened is its just running the acm on default settings

    you have to define BIS_ACM1 as the name of your acm, then change all the BIS_ACM to BIS_ACM1 (or vise versa, remove or add the 1 to the name of your acm.

    here is mine, basically u need to make sure that BIS_ACM (the name of your module) is consistent throughout the code:

    //ACM settings    
    waitUntil {!isNil {BIS_ACM1 getVariable "initDone"}};
    waitUntil {BIS_ACM1 getVariable "initDone"};
    [] spawn {
       waitUntil {!(isnil "BIS_fnc_init")};
       [0.7, BIS_ACM1] call BIS_ACM_setIntensityFunc;                 //Sets the intensity of the ACM, in other words, determines how active it will be. Starts at 0 ends at 1.0, its been known to fail using 0.7 and 0.8
       [bIS_ACM1, 800, 1200] call BIS_ACM_setSpawnDistanceFunc;      // This is the radius on where the units will spawn around the unit the module is sync'd to, 400m being the minimal distance and 700m being the maximum. Minimum is 1 I believe. 
       [["USMC", "RU", "CDF", "GUE"], BIS_ACM1] call BIS_ACM_setFactionsFunc;     // This tells the ACM which faction of units it will spawn. In this case it will spawn Takistani Insurgents
       [0, 0.4, BIS_ACM1] call BIS_ACM_setSkillFunc;                // This determines what the skill rating for the spawned units will be
       [0.7, 0.8, BIS_ACM1] call BIS_ACM_setAmmoFunc;               // This sets their amount of ammo they spawn with
       ["ground_patrol", 1, BIS_ACM1] call BIS_ACM_setTypeChanceFunc; //If you want ground patrols then leave it as a 1, if you don't put a 0. They will use random paths
       ["air_patrol", 0, BIS_ACM1] call BIS_ACM_setTypeChanceFunc;    // Same thing for air patrols
       [bIS_ACM1, ["USMC_FireTeam", "USMC_FireTeam_AT", "USMC_MotInfSection_AT", "CDF_InfSection_MG", "RU_InfSquad", "RU_MotInfSection_Recon", "RU_InfSquad", "GUE_InfTeam_AT"]] call BIS_ACM_addGroupClassesFunc;   // This determines which exact units will spawn from the group **Citation needed**
    };
    


  3. Not Quite what I'm looking for I don't think...unless that is how that works :D.

    I meant, Once I reach a waypoint in game, and wait for the countdown to go down (it's on 5 minutes, or 300 seconds)...only then will it give me the next objective.

    The next objective is also a waypoint, or trigger.

    simple:

    your trigger and whatever conditions you have (lets say YOURGUY in thislist as condition)

    type countdown 300 seconds

    that means the trigger wont activate until 300 seconds from now, dont use timeout if you dont want the condition to wait to be true for 5 minutes.

    then add your objectives in its activation. it will activate then 5 minutes from the condition being true, then add the objectives


  4. Glad it sort of works for you.

    The original thread just wanted a non-moving person dead! ...so it was created for that in about an hour. ;)

    Some elevation tables will need to made for different rounds... just like a real sniper. Windage doesn't come into it... so just elevation. Can also check if the target is standing or prone and probably adjusst for that ewasily enough.

    Programming lead into it to hit moving targets will be a challenge.... but I could try when I have some time to spend on it.

    that would be great if you could manage to work it out, ive been trying to use unitpos to check if a unit is in prone, but it doesnt work, as it just gives back auto.

    there must be some way to defining it - maybe a height check would work on terrain?

    since this mission is evolving around ace - wind plays an important factor (but not so much so if the round goes at 1200m/s. I had to do it the dirty way by grouping invisible unarmed spotters that would watch certain positions and reveal targets so that the sniper would shoot and kill them from 500m away if they were out in the open. It works if there standing or crouch (albeit sometimes, even when not moving) but if they go prone then the round will always be 1 metre behind them.

    i guess ill just have to leave my sniper ai as is for now, and focus on the rest of the mission.


  5. Zora is ACM module right? the reason it doesnt move is because when you first executed the ACM module, the position was the last position of the marker before it activated. That means that in order for zora to update, you would have to reinitialize it in the same time frame as you are moving the markers that follow the mhq.

    and i dont know if thats a good idea, reiniting an ACM every second because the marker moved would probably cause alot of lag.


  6. Not quite sure what you're after but I made this little demo here and here the sniper will shoot at any OPFOR that walk into the trigger.... and take them out one by one.

    Basically create a trigger with vsniper_targets = thislist in the On Activation.

    Trigger set to REPEATEDLY / OPFOR PRESENT or whatever.

    Put this in your init.sqf

    nul = [] execVM "[b]vsnipercontrol.sqf[/b]";

    vsnipercontrol.sqf waits for targets from the trigger list and then tries to kill them one by one.

    vsnipercontrol.sqf:-

    private ["_target"];
    
    waituntil {count vsniper_targets >=1};
    
    _target  = vsniper_targets select 0;
    
    //keep firing till the guy is dead.
    while {alive _target} do {
    nul = [_target,vsniper,1.75,1,"B_127x107_Ball",1200] execVM "vsniper.sqf";
    sleep 5 + random 5;		//how often the sniper fires.
    };
    sleep 5 + random 5;		//wait some time before we run the script again
    nul = [] execVM "vsnipercontrol.sqf";

    Thanks twirly, thats exactly what i was trying to go for, except in my little script it would only sleep for 15 seconds but never add the random to it?

    Here is what i was using:

    private ["_sniper", "_Vsniperhandle", "_sniperheight", "_Fsniperheight", "_Fspotterheight"];
    _sniper = _this select 0;
    _sniperheight = getposasl _sniper select 2;
    hint "scriptrunning";
    
    while {alive _sniper} do {
       // Check if sniper has detected an enemy unit
       if (_sniper knowsabout sniper > 0.05) then {
           hint "Sniper Spotted"; 
           _Fsniperheight = getposasl sniper select 2;
           if (unitPos sniper == "DOWN") then {
               player sidechat "sniper is prone";
               _sniper action ["UseWeapon", _sniper, _sniper, 0]; 
               _Vsniperhandle = [sniper, _sniper, 0.3, 1, "B_127x107_Ball", 1000] execVM "vsniper.sqf";
           } else {
               _sniper action ["UseWeapon", _sniper, _sniper, 0]; 
               _Vsniperhandle = [sniper, _sniper, 1.6, 1, "B_127x107_Ball", 1000] execVM "vsniper.sqf";
           };
       };
       if (_sniper knowsabout spotter > 0.05) then {
           hint "Spotter Spotted"; 
           if (unitPos spotter == "DOWN") then {
               player sidechat "spotter is prone";
               _sniper action ["UseWeapon", _sniper, _sniper, 0]; 
               _Vsniperhandle = [sniper, _sniper, 0.3, 1, "B_127x107_Ball", 1000] execVM "vsniper.sqf";
           } else {
               _sniper action ["UseWeapon", _sniper, _sniper, 0]; 
               _Vsniperhandle = [sniper, _sniper, 1.6, 1, "B_127x107_Ball", 1000] execVM "vsniper.sqf";
       };
       sleep (random 30);
    };

    i noticed a problem where if i i laid down prone and the vsniper was at a higher elevation, he would keep trying to aim for the chest and never kill me, i was hoping unitpos would detect the stance of a unit, but looks like it only detects if it was setunitpos'd

    ill try yours and see if it works better

    ---------- Post added at 16:00 ---------- Previous post was at 14:02 ----------

    so i did some tests with it, he still misses alot :S

    he fired atleast 20 times on a walking fireteam i set up, when they were walking he couldnt hit them at all (even at 1200m/s bullet speed from 400m), then once they stopped he killed one of them. the rest went prone, and he wasted 10 shots trying to kill them prone (they all overshot or went under) until finally he managed to kill them prone.

    Kind of sucks because then players will just decide to go prone and he will miss most of the time.

    ill try adjusting the muzzle height to see if that might effect better aiming, as right now depending on which hiding spot he is at (there are 4 of them) the elevation offset and the person going prone leads to always missing the shot :S


  7. managed to finish it ^^. first 3 missions everyone made it (except i died 3 times in the third, and once on the fourth)

    then the next 4, dam. Lost half of my squad when i was assaulting a village (spark managed to get out okay :O) then i lost spark and two of my guys when i had to help secure the ambushed convoy. one of my guys died under the helicopter when we were trying to extract, and spark got lost and never made it to the evac chopper lol.

    managed to finish it with 9 men left. Pretty bad, but ill probably play it again to see if i can do better.

    However i noticed a tiny problem when i called for extraction after mission 6 (the convoy ambush one)

    the mi6 landed and my guys got in, however spark was still engaging and so i stayed back a bit to offer some support.

    The mi8 took off without me, and started flying around the ao. I tried to get it to comeback down again, but it wouldnt. I had to order all my men to disembark in order for it to land, then tell them to get in again when it landed, so that i could get in as well.

    I think because it took off to early, spark got confused and never moved to the extraction point, and ended up dying in the process.

    Perhaps check for better conditions when the chopper should take off?


  8. Ok, so I am having a bit of an issue here getting my ai sniper (who is well hidden watching a position) fire at a specific unit if they are detected.

    What i want the trigger to do is to check if my sniper or spotter was detected, then execute twirlys virtual sniper script to fire and kill the person that was detected.

    Problem is, if i send my spotter to an open area where the ai will detect him, the enemy sniper keeps firing and killing me instead of him. I cant seem to figure out how to get the ai sniper to fire at who he sees.

    here is what i have in the trigger

    name of trigger: Vsnipetrig

    Blufor Present

    repeatedly

    condition:

    (vsniper knowsabout sniper) > 0.05 || (vsniper knowsabout spotter) > 0.05 && alive vsniper

    on act:

    UnitsTriggered = list Vsnipetrig; vsniper action ["UseWeapon", vsniper, vsniper, 0]; hint "activated"; nul5vsi = [unitsTriggered Select 0,vsniper] execVM "vsniper.sqf";

    I thought list would list all units that activated the trigger? Since I as the sniper was hidden and not detected, i didnt activate the trigger. I suspect list preestablishes the array order, so that no matter who activated it, the first element in the array will always be the same person.

    Is there a solution to getting this to work? Ive been trying to think up a solution to scripting this behaviour, but Im not sure how to approach this (the amount of time to wait between shots, priority of targets, and alot of other factors)

    also another problem ran into is the speed in which the trigger needs to fire. I have it set at 0 right now so that he will immediatly fire when the trigger becomes activated, and since its set to repeatedly, the script will be firing off like a machine gun. But yet when i set the timeout to 30 seconds, even after I killed vsniper, the trigger still activated and i was shot and killed by his ghost! I thought timeout will wait and cancel the activation if the allotted time isnt fulfilled?

    any kind of solutions you could think of, ive spent days trying to make a work around on this with no success. I want my enemy sniper to be somewhat intelligent, it would make this mission alot more funner and challenging trying to kill him.

    ---------- Post added at 03:02 ---------- Previous post was at 01:23 ----------

    Ok, so i tried to experiment with the ai snipers behavior using an FSM. Unfortunately this time FSM fails :S

    Since there isnt a reliable way of suspending an fsm to a random amount of time (to keep the sniper from firing an automatic machine gun) it wont work. I shall look into scripting it the old fashioned way for now.

    If anyone has any solutions, please im desperate!


  9. Tried without Proper addons, without Zeus AI. I have the full PMC and other missions that use Proving Grounds work fine. Still hangs after the cutscene intro. Maybe I should just delete any saves for the campaign from My Documents\Arma 2. I'll try that.

    http://dev-heaven.net/projects/proper-projects/wiki

    sorry, my BAD! forgot that i had USNavy enabled and so its also dependant on that (my apologies)

    I will work on turning down some of the mods required, as USNavy is not supposed to be included (and RU and SM arent mandatory either)

    i will post updates soon


  10. Hangs for me right at the start after the first cutscene ... However, I have a low end system. A2OA 1.57, Duo Core 2.8 GHz, 4 Gb RAM, 500 Gb SATA HD, ATI Radeon HD 4650. I also run Proper mods simple vegetation/buildings/distanance models. Have never had a problem with any other missions/campaigns hanging (I'm running latest ACE2,ACEX2 and Zeus AI).

    I ran a few tests with zeus and some extra mods, worked fine for me.

    Do you have PMC lite enabled? the first 3 missions are done on proving grounds. My fault for not mentioning this (it autoupdated and enabled the lite DLCs for me, so never thought of it as an issue before)

    see if you have the PMC or BAF lite enabled (i think PMC has proving grounds) and it should work afterwards. Might have been a missing island and thats why it never loaded.

    Now that there's only a single mag of M107 in gear, I don't think the best sniper in the world could make that boathouse shot, even in full daylight with wind disabled. The closest shot you can make is 1600m, pushing the edge of the Barret's effective range.

    Or if you do make it, you may not have enough left for the other 3.

    Hes optional, you dont need to kill him. Focus on finding and killing the 3 main snipers and then go back to the boathouse to finish the mission.

    Btw, has anyone managed to make it past Skalisty yet? Ive been testing the next two missions and they seem to run fine, but who knows :)


  11. stick to sqf. theres alot of problems with sqs and its missing alot of useful commands.

    add an eventhandler to each player, type killed.

    player1 addeventhandler ["killed", player1Lives = player1Lives - 1; if (player1Lives <= 0) then {//Turn off your revive script or make them teamswitch to some animal or w.e};]

    of course you would have to define all players with a variable for their number of lives.

    so in the init:

    playe1Lives = 3;

    player2Lives = 3;

    etc etc

    might be better using setVariable on a player, so that globals dont effect other things in the game.


  12. I finally gave this a go.

    First thing:

    Amazing job on the cutscene, that was really well done, i wonder how you made the warlord animate on top of the bmp? that was a nice touch.

    one thing tho:

    the warlord on top of the bmp was blinking a bit. (as in move a bit, quick flash, then move again flash)

    just finished the first mission and doing the second. Im running it with ace to see if it works, and so far no bugs at all with it and ace running (except script load time is increased, but i have no real problems with it loading an extra couple of seconds)

    only thing that kind of was annoying for me was in the first mission where the fog was jumping back and forth between very close and very far. It stablized for sometime afterwards, but initially it was changing too fast.

    that might be an issue with ace tho, so im not going to suggest it as a bug.

    another thing was the hints. They were difficult to read because the mission planning interface and and hint colors would merge. And sometimes the mission overview would overlap with the hints as well. No solution comes to mind either, except maybe titletext at the bottom. but even then you cant control it.

    Great job on this, especially love the menus you created and the features. The number one best campaign i have played so far.


  13. here is a copy of mine, just change the title and descriptions and it will work, make sure its an html file.

    <html>
    <head>
    <title>Mystery Man</title>
    </head>
    <body>
    
    <!GAME OVER------------------------------------------------->
    <br>
    <h2><a name="Debriefing:End1"><localized id="str_ep1_sp01_end1"/></a></h2>
    <br>
    <p>You have successfuly completed your objectives. Job well done team.</p>
    <br>
    
    <hr>
    <br>
    <h2><a name="Debriefing:Loser"><localized id="str_ep1_sp01_endl"/></a></h2>
    <br>
    <p>You have failed to complete your objectives.</p>
    <br>
    
    
    </body>
    </html>


  14. it wont corrupt your saves, just make sure that when your updating:

    arma 2 is not running

    replace the campaign with the new one (as in copy it over)

    and go back to arma 2, your saves will still be there.

    ---------- Post added at 20:14 ---------- Previous post was at 20:12 ----------

    Hangs for me right at the start after the first cutscene ... However, I have a low end system. A2OA 1.57, Duo Core 2.8 GHz, 4 Gb RAM, 500 Gb SATA HD, ATI Radeon HD 4650. I also run Proper mods simple vegetation/buildings/distanance models. Have never had a problem with any other missions/campaigns hanging (I'm running latest ACE2,ACEX2 and Zeus AI).

    hmm, did you try the campaign without those mods on? try just running it with cba and the ace's, and see if it starts, i will test to see if it hangs with zeus ai.


  15. best idea is for you to learn to organize your brackets.

    having something like

    sv = {blah do this; if (blah) then {blah blah blah; if (blah again) then {blah[blach,array,aray]}}}

    it becomes very easy to forget what the hell is happening in your code and which brackets connect to which control structures.

    so

    sv = {
          blah do this;
          if (blah) then {
                  blah happens;
                  if (new blah) then {
                           another blah;
                  };
          };
    };

    this is alot easier to follow, and clearly lets you see which control structure does what (which is what i think happened for you, you put the brackets in the wrong places.

    also, you need to get squint!


  16. nice, cannot wait for the update ^^

    btw: I think I just stumbled across a small bug in the Chernogorsk mission - when I advised my spotter to "range me" it said "Script rangeme.sqs not found".

    Nevertheless keep up the good work !

    edit: just found a small typo in the briefing of "Skalisty Island": [...] Snipers [...] are dealing effecting damage [...]

    I hope you don't mind me reporting all those small bugs/typos/whatever, but I think this may help you safe time when fine-tuning the missions ^^

    i dont, its good your spotting them for me, as i would be sure to miss it.

    added to my to do list. Thanks! and keep em coming !

    ---------- Post added at 02:37 ---------- Previous post was at 00:53 ----------

    In the grass only the guy's head was sticking out, and I swear to God it wasn't ghillie-colored but red! I thought it was an autumn bush.

    i just replayed the mission when adding the features in and fixing the bugs. And i saw it to :S. Seems to be a problem with the custom ghillie i had applied to him later on, i will fix that so that he looks human again.

    Small update will be released in a few hours, fixing all mentioned things in previous missions and adding some neccessary things as well. ill post when its up for dl.

    ---------- Post added at 04:03 ---------- Previous post was at 02:37 ----------

    First post updated with new links and changelog, updated to 0.85

×