  # Joshii

Member

173

10 Good

• Rank
Sergeant

## Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

1. # "ALICE_population" = <array>; - list of all civilians in town # "ALICE_populationActive" = <array>; - list of all active civilians in town (e.g. civilians who are outside) You can work with these two and figgure out something I guess.
2. Gonna write you an example when I got my arma running again.That's in about 2 hours.
3. Short form pseudo code: -Event Handler fired -Figure out what type of object was fired if(smokegrenade) then getPos _this select X Then you got it! questions? Ask!
4. _impact = _this select 0; _ammo = _this select 1; _rnds = _this select 2; _count = 0; serial = 0; hint "INCOMING"; // For Testing Purposes & can be removed. //------------------------------------------------------------------------------------ while { _count < _rnds } do // Infinite loop. { _randomnumberx = ceil(random 2); // Creating a random number result is either 1 or 2. _randomnumbery = ceil(random 2); // Creating a 2nd random number. _impactx = getPos _impact select 0; // Assigning the x value of the impactzone to the variable. _impacty = getPos _impact select 1; // Same with the y value. switch(_randomnumberx) do // Using the random number to either add or subtract an ammount to / of the x value otherwise the artillery would always be infront or behind the player. { case 1: { _impactx = _impactx + (random(100));}; // If 1 is the random number. case 2: { _impactx = _impactx - (random(100));}; // If 2 is the random number. }; switch(_randomnumbery) do // Using the random number to either add or subtract an ammount to / of the y value this will make the impact left / right random. { case 1: { _impacty = _impacty + (random(100)); }; case 2: { _impacty = _impacty - (random(100)); }; }; _shellname = format ["shell%1", serial]; // Formating a unique round name. _shellname = _ammo createVehicle ([_impactx, _impacty, 10]); serial = serial + 1; // Changing the round "serial" so the name stays unique. hint "SPLASH"; // For Testing Purposes & can be removed. _count = _count + 1; sleep random 5; // Adjusts the amount of time between impacts. }; Issues fixed. It was 1. You did not set serial = 0; 2. _scpt1 = [target1,"B_30mm_HE",16] execVM "FireSupport.sqf"; 3. Getting the position was forgotten in your I changed that and added getPos at @ _impactX and y 4. Please note getPos only works if its an object not a marker if your using a marker change it accordingly ( Put it in a string and change it to getMarkerPos
5. It wasn't meant like "Eat my script or die!" More like take it as an example. I like the fact that you wanna learn instead of begging others to do work for you. while{condition} do {code}; The loop ends as soon as the condition = false while { ammount < rounds } do // Infinite loop My // Infinite loop command is not accurate anymore sorry for not changing I just realized. The script get started with  execVM "RandomArtillery.sqf"; In that case 0 < 5 = true after 3 runs 3 < 5 = true after 5 runs 5 < 5 = false While loop stops Edit your version 2: hint "INCOMING"// For Testing Purposes & can be removed. Forgot the ; hint "INCOMING"; // For Testing Purposes & can be removed. Also in line 29 the other hint hint "SPLASH"// For Testing Purposes & can be removed. for the ; hint "SPLASH"; // For Testing Purposes & can be removed. Also the way you call it You save it all as a string even though that not all of it are strings the " " defines if it's a script or not. i.e [10, "5"] execVM "example.sqf" example.sqf a = _this select 0; b = _this select 1; while{ a < b } Output : ERROR EXPECTING NUMBER GOT STRING (( Or something like this )) Reason: "5" gives the 5 over as a string and not a number while 10 is a number so using [10, 5] execVM "example.sqf"; would work
6. You have hint "SPLASH"/ For Testing Purposes & can be removed. instead of hint "SPLASH"; // For Testing Purposes & can be removed. I changed it but it is still not working so there is another issue with your script. THis entire line for [{_count = 0},{_count < _rnds},{_count = _count + 1}] exitwith {_check = false}; Is redundant just use my script like this and it works explosive = "B_30mm_HE"; // Type of weapon ammount = 0; // Counter to get unique vehicle names rounds = 0; _rounds1 = _this select 0; rounds = rounds + _rounds1; // To avoid problems if the script is called multiple times. while { ammount < rounds } do // Infinite loop { impactZone = getPos player; // Impactzone _randomnumberx = ceil(random 2); // Creating a random number result is either 1 or 2 _randomnumbery = ceil(random 2); // Creating a 2nd random number _impactx = impactZone select 0; // assigning the x value of the impactzone to the variable _impacty = impactZone select 1; // same with the y value switch(_randomnumberx) do // Using the random number to either add or subtract an ammount to / of the x value otherwise the artillery would always be infront or behind the player { case 1: { _impactx = _impactx + (random(100));}; // If 1 is the random number case 2: { _impactx = _impactx - (random(100));}; // If 2 is the random number }; switch(_randomnumbery) do // Using the random number to either add or subtract an ammount to / of the y value this will make the impact left / right random. { case 1: { _impacty = _impacty + (random(100)); }; case 2: { _impacty = _impacty - (random(100)); }; }; _vehiclename = format ["shell%1", ammount]; // Formating a unique name _vehiclename = explosive createVehicle ([_impactx, _impacty, 10]); ammount = ammount + 1; // Changing the ammount + 1 so the name stays unique sleep 0.5; // So it's not 10 impacts per second and CPU cooldown }; Modified - 4:08
7. http://community.bistudio.com/wiki/Dialog_Control If you manage to do it with Dialogs then you have clearly chosen the best option if not just use BIS_Communication stuff. Addaction should also work if you just put in the right conditions. There is another thread just about this http://forums.bistudio.com/showthread.php?t=109547
8. http://community.bistudio.com/wiki/list http://community.bistudio.com/wiki/forEach http://community.bistudio.com/wiki/addEventHandler _tlist = list _triggerOne; {_x addEventHandler ["killed", {_this exec "playerKilled.sqs"}] } forEach _tlist or something like this.