Jump to content

tryteyker

Member
  • Content Count

    1164
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by tryteyker

  1. If what Iceman described is your case I strongly suggest you create the tanks and crew mid-mission using either createUnit array (which will include the crew) or createvehicle array (which does not include the crew since it creates an empty vehicle). Waypoints etc can still be assigned to these units via addWaypoint and so on.
  2. I've tested your trigger with the condition you originally stated, Activation set to BLUFOR & Repeatedly & present. A regular HMMVV doesn't trigger it, but a tank does. What exactly is the problem, do you get any errors script-wise?
  3. tryteyker

    TitleText in a loop

    Just a note, the higher the value, the slower it is, since the value 99999 defines the speed at which it's appearing, the higher, the slower it is. Did you try using titleText without any speed and just add a sleep of 0.5 or 1? NOPE, I never wrote that. Just noticed you had a sleep at the end of your while loop. //Edit: It seems like having a value within titleText is irrelevant if you have a sleep value outside of that. The sleep value overrides the titleText value, so for example having a titleText speed value of 6 will greatly slow down the appearance of titleText and automatically restart the process after 1 sec due to sleep. So it seems like editing the sleep value seems like the only option, atleast as far as I can see.
  4. Init line of each tank: tank disableAI "move"; tank disableAI "autotarget"; tank disableAI "target"; Change "tank" to your tanks' names. Then, create a trigger with a countdown, On Act: tank enableAI "move"; tank enableAI "autotarget"; tank enableAI "target"; And synchronize the trigger with the waypoint given for the tank group. Should work, not tested though.
  5. I recommend you use a switch-statement instead of if-else-if-else-if-else etc. Makes things alot more readable and is generally alot better. Also, I believe you're using else if wrong. It would be something like this: if (CONDITION) then { // CODE }else if (CONDITION) then { //CODE }; instead of if (CONDITION) then { //CODE } else { if (CONDITION) then { //CODE }; }; //Edit: switch-statement Syntax would be like this: switch (CONDITION) do { case X: //CODE case Y: //CODE case Z: //CODE };
  6. Sorry, didn't see that then. D: I was just pointing out to Nimrod that double quotes can't really be used within double quotes. (Not usually anyway)
  7. Try this: _unit = group player createUnit ["SoldierWB", Position player, [],"P1=this", 0, "FORM"] That's the BIKI example btw. I've used createUnit array, not createUnit. Or try setvehiclevarname.
  8. @Nimrod eagledude's code was basically right, if you use "" within "", then the condition will end at the first " So for instance: "player distance getmarkerpos "House1DoorF" <= 2 and _House1Owner == None" It should be self-explaining where it ends and begins again. To fix this, you can either use eagledude's version or this: "player distance getMarkerPos 'House1DoorF' <= 2 and _House1Owner == None" The "" used for House1DoorF simply get changed to single quotation marks (''). @eagledude Looking at the BIKI's setvariable, the value in setvariable ("None") can be any value, so in your case it's a string, not a variable. Try None instead of "None".
  9. If there is AI in the car LightOn and LightOff won't work, since this is dependent on their combat mode ("Combat" & "Stealth" = Lights off).
  10. {side _x} in thisList == WEST You could try that.
  11. How is the vehicle spawned? Mid-mission or in the editor, and in which init line do you put the above action? Players/Vehicles?
  12. How did you initialize the empty variables? _a = ""; or _a = []; //Edit I ABSOLUTELY suck at reading properly.. Well maybe try the other method with [], I'm not sure.
  13. I've been reading through this topic and it seems like if you 1) use ACE 2) do it in MP the plane seems to stutter. Also, how did you use UnitCapture to capture the flight? Did you start mid-flight?
  14. Didn't see that you also informed him of the global variable stuff, sorry. :o
  15. Try [_this] execVM "script.sqf"; if that doesn't work _this can't be used to execute the script since _this is what gets returned by execVM (to the script). Try the name of the truck otherwise.
  16. In the condition, what you're doing is simply define what UAVbag is, but you're not telling the game that the player needs to have that weapon Have a look at hasWeapon. Maybe something along the lines of: player hasWeapon "unitBackpack pl" (or maybe try this since you already defined uavbag) player hasWEapon "UAVbag" I'm not sure if this works for backpacks aswell but I'm pretty sure it does. //Edit slowpoke, forget what I said.
  17. _target = player; _dist = random 50; _dir = random 360; _pos = getpos _target; _positions = [(_pos select 0) + (sin _dir) * _dist, (_pos select 1) + (cos _dir) * _dist, 0]; You can change the values obv, this gets a random position within 50 m distance and a radius of 360 around the player. (Well the above does nothing but that's what I used it for anyway)
  18. Your script still contains minor errors, such as missing commas and semicolons. Incase you haven't done it I've fixed it for you: ////////////////////////////////////////////////////////////////// // Function file for Armed Assault // Created by: ThRyCkz ////////////////////////////////////////////////////////////////// // The variable Polizei has to be GLOBAL. By adding _ infront you are making it local, thus only useable within the init.sqf Polizei = [Polizei, Polizei_1, Polizei_2, Polizei_3, Polizei_4, Polizei_5, Polizei_6, Polizei_7, Polizei_8, Polizei_9, Polizei_10, Polizei_11, Polizei_12, Polizei_13, Polizei_14, Polizei_15, Polizei_16, Polizei_17, Polizei_18, Polizei_19]; // Fixed semicolon, everything has to end has with a semicolon. (So if I write "player moveTo position" you have to end it with a semicolon (;) unless there is code after that, but I strongly recommend using a semicolon even if there is no code after that, since you'll easily forget it) //Same thing, variable made gobal. Citizens= [Citizen, Citizen_1, Citizen_2, Citizen_3, Citizen_4, Citizen_5, Citizen_6, Citizen_7, Citizen_8, Citizen_9, Citizen_10, Citizen_11, Citizen_12, Citizen_13, Citizen_14, Citizen_15, Citizen_16, Citizen_17, Citizen_18, Citizen_19]; (Fixed semicolon) Also, if you are not using the variables Citizen or Polizei in more than one script, see if you put the variables there instead, since the init.sqf is only real useful if you use the variables in multiple scripts. Look up this and check if you use sqs commands within sqf after changing it.
  19. lightAttachObject ParticleArray Two links that might help you out, especially the first one. You can also use createVehicle to attach a lightobject to a house, but that'll be alot of work to do it for the whole map manually. This is something I just came up real quick, and it isn't really perfect, since it requires lots of manual work and ParticleArray is complex.
  20. You could name the addAction by using this: namehere = this addAction ["kill", "kill.sqf",player distance <3]; Then you can simply use _playerone removeAction nameHere; to remove it.
  21. I hope it's alright if I make a new post for this (since my original post was a bit long). I managed to get it working for the A10 and the AV8B (the one without LGBs, so AV8B2). The issue seemed to be that I spawned the unit too close. There's also an issue with the AV8B, it seems to randomly drop a bomb before actually entering the loop (in the test mission below this hits the cars). So far the spawn has to be defined, but doing it dynamically might be an easy task. So, for anyone who wants to use it, here's the script (It has it's flaws, but it's something): // Creating the plane & pilot _grp = creategroup WEST; setfire = true; hintSilent "Select your firedirection"; onMapSingleClick { //We only need this event to fire once, once that happens we reset it onMapSingleClick {}; //ASL height _height = getTerrainHeightASL _pos; //Move the object ASTarget setPosASL [_pos select 0, _pos select 1, _height]; //Set variable setfire = false; }; waituntil {!setfire}; _targets = nearestObject [ASTarget, "Tank"]; hintSilent format ["%1",_targets]; if (!setfire) then { "Firedirection" setMarkerPos getpos ASTarget; // plane = createvehicle ["AV8B2", getmarkerpos "unitspawn",[],0,"FLY"]; plane = createvehicle ["A10", getmarkerpos "unitspawn",[],0,"FLY"]; plane setposATL [(getposATL plane select 0), getposATL plane select 1, 200]; plane setspeedmode "full"; plane setDir 90; plane setvelocity [100,0,0]; plane allowDamage false; pilot = _grp createunit ["USMC_Soldier_Pilot",getmarkerpos "unitspawn",[],0,"FORM"]; pilot moveindriver plane; pilot action ["LandGearUp", plane]; pilot doMove getpos _targets; pilot doTarget _targets; pilot flyinheight 300; pilot allowdamage false; }; // Dropping MK82 /* for [{_i = 0},{pilot distance _targets < 1500 && _i <= 2},{_i = _i + 1}] do { MyGameLogic action ["useWeapon",plane,pilot,5]; hintSilent format ["%1",_i]; sleep 0.2; }; */ waituntil {pilot distance _targets < 500}; //Declaring variable to limit bomb usage _i = 0; // A10 while {_i <= 3} do { MyGameLogic action ["useWeapon",plane,pilot,7]; sleep 1; _i = _i + 1; hintSilent format ["%1",_i]; }; /* AV8B2 while {_i <= 4} do { MyGameLogic action ["useWeapon",plane,pilot,5]; sleep 2; _i = _i + 1; hintSilent format ["%1",_i]; }; */ _pwp = _grp addWaypoint [getmarkerpos "planewp",0]; pilot doMove (getMarkerPos "planewp"); There's both a for-loop and a while-loop, both work. I also left both methods, for the AV8B2 and the A10. For anyone interested, here's an example mission (You can change between AV8B2 and A10 in the createUnit line): http://www.speedyshare.com/MkEDK/AV8BTestMission.utes.rar (Couldn't find a better host so yeah)
  22. Hey, I'm still working on a little Airstrike script, but I'm running into issues when telling the AI to target an empty object and drop bombs. This is the full script (from the point where the plane gets created to the drop): // Creating the plane & pilot _grp = creategroup WEST; setfire = true; hintSilent "Select your firedirection"; onMapSingleClick { //We only need this event to fire once, once that happens we reset it onMapSingleClick {}; //ASL height _height = getTerrainHeightASL _pos; //Move the object ASTarget setPosASL [_pos select 0, _pos select 1, _height]; //Set variable setfire = false; }; waituntil {!setfire}; hint "end"; if (!setfire) then { "Firedirection" setMarkerPos getpos ASTarget; plane = createvehicle ["AV8B", getmarkerpos "unitspawn",[],0,"FLY"]; plane setposATL [(getposATL plane select 0), getposATL plane select 1, 200]; plane setspeedmode "full"; plane setDir 90; plane setvelocity [100,0,0]; plane allowDamage false; pilot = _grp createunit ["USMC_Soldier_Pilot",getmarkerpos "unitspawn",[],0,"FORM"]; pilot moveindriver plane; pilot action ["LandGearUp", plane]; pilot doMove getpos ASTarget; pilot flyinheight 300; pilot allowDamage false; }; _pwp = _grp addWaypoint [getmarkerpos "planewp",0]; hintSilent "WP added"; // Dropping MK82 while {pilot distance ASTarget < 2000} do { gamelogic action ["useWeapon",plane,pilot,5]; }; /*while loop to repair damage (not working) while {(damage plane) > 0.1} do { plane setDamage 0; }; */ I've been reading about this on Armaholic that the AI has general issues with firing on empty objects, to prevent this I've placed 3 T-72's in the middle of the empty object. I'm not entirely sure if the while-loop is the best way to go about this, but an if-statement only seems to check once. So, what the plane does is the following: It gets created at a static marker, flies towards the position selected via onmapsingleclick (it's an invisible HPad and the HPad has the correct height ASL (18), tested it with a radio tower). The plane flies over the position, but does not drop the bomb. Then, it apparently flies to the assigned waypoint and gets deleted. Instead, it comes back and bombs the living hell out of the T-72s until it gets shot down and everybody's dead. For testing purposes I've done 2-3 additional missions testing this and in one mission I got the AV8B to drop an Mk82 once, and that Mk82 went directly towards the T-72. Directly, hit it spot on. I've tested the index numbers of the harrier up to 10, and 5 is definitely the index number for the Mk82 (unless using ACE, but I don't use ACE for this testing mission). During another testing mission, I've created the same scenario, only giving the plane a range of 2000 in the while loop. Dropped all 5 bombs and got deleted. On the other hand, when giving the plane a range below 2000, it doesn't seem to work. In my current mission (the one with the 3 T-72's and the onmapsingleclick), range doesn't seem to affect anything. At the early stages I've played with the range a bit and gave the plane 4000 range, dropped one bomb right infront of the fence of Utes airport. 2000 range, same result. This issue is still there, just that the plane doesn't drop any bombs now. I also took a look at Mr Murrays Airstrike script in his guide, and very early on I've tried to do this, and eventually got it to work (using sqs obviously, I just copied his whole script really, but it makes me wonder why it won't work now, since I'm using almost the same concept). Also, I tried "fire", but since that is broken, I've been using "useweapon" instead. Maybe I mixed up the syntax there? Anyway, I'd appreciate some help here. //Edit1: So, I cleaned up my code a bit, made sure everything's correct. I also made use of nearestObject, so instead of telling the Harrier to target the HPad, as soon as the HPad has been moved, it gets the nearest object. That variable gets passed to the plane eventually and the plane will target that object. Since it is supposed to cause collateral damage this method seems to be sufficient enough, since it shouldn't target a specific unit only (Who drops 3 bombs to kill 1 tank anyway) So as it stands it looks like this: // Creating the plane & pilot _grp = creategroup WEST; setfire = true; hintSilent "Select your firedirection"; onMapSingleClick { //We only need this event to fire once, once that happens we reset it onMapSingleClick {}; //ASL height _height = getTerrainHeightASL _pos; //Move the object ASTarget setPosASL [_pos select 0, _pos select 1, _height]; //Set variable setfire = false; }; waituntil {!setfire}; _targets = nearestObject [ASTarget, "Tank"]; hintSilent format ["%1",_targets]; if (!setfire) then { "Firedirection" setMarkerPos getpos ASTarget; plane = createvehicle ["AV8B2", getmarkerpos "unitspawn",[],0,"FLY"]; plane setposATL [(getposATL plane select 0), getposATL plane select 1, 200]; plane setspeedmode "full"; plane setDir 90; plane setvelocity [100,0,0]; plane allowDamage false; pilot = _grp createunit ["USMC_Soldier_Pilot",getmarkerpos "unitspawn",[],0,"FORM"]; pilot moveindriver plane; pilot action ["LandGearUp", plane]; pilot doMove getpos _targets; pilot doTarget _targets; pilot flyinheight 300; pilot allowdamage false; }; //Adding a plane waypoint & declaring a variable to limit bomb usage _pwp = _grp addWaypoint [getmarkerpos "planewp",0]; _i = 0; // Dropping MK82 while {pilot distance _targets < 1050 && _i <= 1} do { pilot flyinheight 150; MyGameLogic action ["useWeapon",plane,pilot,5]; hintsilent "used"; _i = _i + 1; sleep 0.2; /* if (pilot distance _targets > 2000) then { _pwp = _grp addWaypoint [getmarkerpos "planewp",0]; pilot moveTo _pwp; }; */ }; /*while loop to repair damage (not working) while {(damage plane) > 0.1} do { plane setDamage 0; }; */ I've also include an if-statement within the while-loop to break it, but that doesn't seem to work. The problem with range also persists. Anything below 1500 and the while-statement will not activate. 1500m is basically just about the spawn distance, so the code gets activated instantly. This causes the bombs to drop roughly 100-200 m off the target, so it's extremely unreliable. I'm still trying to narrow it down to 50-100m max, but the while-statement refuses to work if it is being initialized AFTER spawn. (Maybe it's terminating itself after a while since it's getting started via the unit's init line?) I'll continue experimenting. //edit2 Apparently the script likes skipping the whole while-loop and moves onto the next one instead (I included a test while loop to see if he skips the other one). So he apparently only runs the loop once and then ignores it.
  23. Maybe count ESCORT_Units again for the speed? Not sure if it kind of saves the count within the if-statement or not.
  24. What you could try to do is the following: Create an OPFOR Rifleman, place it somewhere on the edge of the map. In the init put this: opfor = group this; Now, in the init of the littlebird put this: littlebird join opfor; I can't guarantee that this works if the unit is player-controlled, just got this out of Mr. Murrays guide. You also might want to make the littlebird the leader of the group so the OPFOR Rifleman doesn't annoy you to death with "GET BACK" etc.
  25. If you want certain sounds to play at certain times of day you could probably take a look at daytime. I'm not really great with locality stuff and so on though so I'm not sure if it works. A switch-statement seems useful here aswell.
×