Joshii
Member-
Content Count
173 -
Joined
-
Last visited
-
Medals
Community Reputation
10 GoodAbout Joshii
-
Rank
Sergeant
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
ALICE Spawn inside buildings
Joshii replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
# "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. -
Getting possition of smoke grenade
Joshii replied to evans d [16aa]'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Gonna write you an example when I got my arma running again.That's in about 2 hours. -
Getting possition of smoke grenade
Joshii replied to evans d [16aa]'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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! -
Help with Random Mortar Script
Joshii replied to jimsolo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
_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 -
Help with Random Mortar Script
Joshii replied to jimsolo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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 [5] 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 -
Help with Random Mortar Script
Joshii replied to jimsolo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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 -
Spectating after dead
Joshii replied to JacobJ's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
http://forums.bistudio.com/showthread.php?t=74849 -
How to create a start game function?
Joshii replied to JacobJ's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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 -
event handler question
Joshii replied to SOLDIER X's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
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. -
How to call another .pbo
Joshii replied to blanic's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
.pbo? Don't you mean .sqf? -
Help with Random Mortar Script
Joshii replied to jimsolo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ye right.. My variable names probably were not as clear. So I will explain the stuff right now. boompos = getMarkerPos "boom"; // Right this is just the marker position from where the random is added. explosive = "Mine"; // Ammo type used in my case it's "Mine" you can change it to "ARTY_Sh_82_HE" though value = []; // This value is just to create markers for my mine field. You can simply just delete this if you only want random mortars. done = false; // This was my value to stop the artillery impact at some point. In my case it's executed when the markers are created. ufa = 1; // Just a counter to later on get names for the markers. Not necessarily needed while { !done } do // While loop running whilst done is false. { ufa = ufa + 1; // Starting to count how many times it's running. sleep 0.1; // A sleep of 0.1 s so my CPU can cool down. + Otherwise it would be pure spamm it might be usefull to change this if you do not want an artillery shell every 0.1 seconds _x = (boompos select 0) + random 1000; // x position of the marker + random 1000 _y = (boompos select 1) + random 1000; // y position of the marker + random 1000 _z = 0; // height of a mine = 0 usefull to change for artillery though so you actually see it dropping randomPos = [_x, _y, _z]; // This is the position array it's [x,y,z] string1 = format ["T%1",ufa]; // Formating a string so later on I could create markers. string = subammo createVehicle (randomPos); // Finally creating the impact value = value + [randomPos+ [string1]]; // Saving the co-ordinates + the name of the shell in an array. // e.g with 2 shells this array looks like this // [[0,0,0, T1], [1,1,1, T2]]; // So if I do select 0 I had an array of [0,0,0, T1] the name of the first impact. // This means I can call the positions of the array with select 0, 1, 2 and the name with select 3 // This is however not really important for an artillery script }; // Ending the while loop // Now this script was executed for me when I had enough mines placed. // I always had a hint running so I saw how many mines I had done = true; // Ending the while loop bd = count value; // Counting how many mines I had counter = 0; // Setting a counter to 0 while { bd != counter } do // While loop running while counter has not reached the last mine { t1 = format ["a%1", counter]; // a name for the marker it has to be unique so it's the counter number plus the letter "a" t1 = createMarker[value select counter select 3,[value select counter select 0,value select counter select 1]]; // The line above this is // String = createMarker [name, position] // String = t1 name = value select counter select 3 - Cause as said before select 3 always gives me the name of the mine // position = value select counter select 0,value select counter select 1 - This gives me the x and y co-ordinates of a marker t1 setMarkerShape "ICON"; sleep 0.01; // Sleep so my CPU won't over kill value select counter select 3 setMarkerType "DOT"; value select counter select 3 setMarkerText t1; // Creating the marker counter = counter + 1; // Adding +1 to the counter when the mines if done }; I agree this is not needed if you only want artillery still it's cool to learn how arrays work :P Anyhow I will post an "artillery only" script here in about 10 minutes or so. Edit1: For your post above mine your using SQS syntax in SQF. e.g Loop is not SQF http://community.bistudio.com/wiki/SQF Edit2 artillery script : explosive = "B_30mm_HE"; // Type of weapon ammount = 0; // Counter to get unique vehicle names while { true } 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 }; Tested and working if you have any questions feel free to ask. -
Help with Random Mortar Script
Joshii replied to jimsolo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I made one too for minfields but well still feel free to read and understand. test1.sqf / This creates the mines boompos = getMarkerPos "boom"; explosive = "Mine"; value = []; done = false; ufa = 1; while { !done } do { ufa = ufa + 1; sleep 0.1; _x = (boompos select 0) + random 1000; _y = (boompos select 1) + random 1000; _z = 0; randomPos = [_x, _y, _z]; string1 = format ["T%1",ufa]; string = subammo createVehicle (randomPos); value = value + [randomPos+ [string1]]; }; test2.sqf // This marks the mines on map done = true; bd = count value; counter = 0; while { bd != counter } do { t1 = format ["a%1", counter]; t1 = createMarker[value select counter select 3,[value select counter select 0,value select counter select 1]]; t1 setMarkerShape "ICON"; sleep 0.01; value select counter select 3 setMarkerType "DOT"; value select counter select 3 setMarkerText t1; counter = counter + 1; }; just for your information: You gotta change 2 things to make it an unlimited artillery instead of a limited mine field. Need help? Post back! -
Destroying steel hedghog and barbed wire?
Joshii replied to victim913's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
With or without ACE? With ace it's simple. Without ace it's simple aswell but well.. different to manage. -
Clusterbomb script
Joshii replied to NGagedFX's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Make your script more readable and instead of doing the same thing 100 times just use a while loop with variables. -
Clusterbomb script
Joshii replied to NGagedFX's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
That's quite weird. For me I start up in the A-10 drop any bomb on the right a hint appears and count the meters till impact at 30 it stops switches over to the bombing part and does it all well. Could you by any chance clear your arma2.rpt restart the mission and post me your rpt in here when your done?