# Joshii

Member

173

1. ## ALICE Spawn inside buildings

# "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. ## Getting possition of smoke grenade

Gonna write you an example when I got my arma running again.That's in about 2 hours.
3. ## Getting possition of smoke grenade

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. ## Help with Random Mortar Script

_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. ## Help with Random Mortar Script

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
6. ## Help with Random Mortar Script

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

8. ## How to create a start game function?

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
9. ## event handler question

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.
10. ## How to call another .pbo

.pbo? Don't you mean .sqf?

12. ## Help with Random Mortar Script

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!
13. ## Destroying steel hedghog and barbed wire?

With or without ACE? With ace it's simple. Without ace it's simple aswell but well.. different to manage.
14. ## Clusterbomb script

Make your script more readable and instead of doing the same thing 100 times just use a while loop with variables.
15. ## Clusterbomb script

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?
16. ## Problem with making IED script

You possibly saved it as .sqf.txt make sure to let windows show known file extension in your CP and try again.
17. ## Clusterbomb script

Maybe you did something wrong? I dunno anyhow here is my test mission it's working fine for me. However be sure to be at above clusterheight in my case 70 meters when dropping it otherwise it wont work. Cluster.Desert_E http://uploaded.to/file/3ln3ar ______ I will just pickup some of your ideas and state my point to them. Well normal weapon is quite simple you can either do an entire addon which would not make it a script anymore. Also I have no idea how that works. The easier way is possibly to just limit the script on one weapon. Smoke is easy to do. I would write a function that is called on each to add smoke to it. Sound is more difficult but not impossible. Different ammo versions is simply done either by a GUI or by a simple menu in the radio.
18. ## Clusterbomb script

Here is my attempt - well it's actually working out pretty good. To be done: - Add a check if it's the "clusterbomb" launched cause right now it will do it for ANY weapon including pistols etc. :D Just fix that if you have time. - How to : put an A10 in put this in it's init init of a10 Create a debug.sqf debug.sqf Also I wrote a camera script for watching the explosion but it's not as good :D Just watch it from above that it much cooler. variable explinations subammo = "ARTY_Sh_82_HE"; // Subammo type I am using artillery shells unrealistic but good for debuging as they make a BIG boom clusterbombs = 20; // Ammount of bombs ropped clusterheight = 30; // Height in which the bombs are created height = 100; // Just don't change this number it is just cause I was to lazy to script it better - if you read through it you will see why.
19. ## Executing snippets during game

Can be closed.
20. ## Artillery Bombardment?

The scripting is fairly simple though just make it BOOM all around the city.
21. ## Limited vehicle Access?

if(driver this != "Name of the guy you want in there") then {driver this leaveVehicle this} or something like this
22. ## Obtain Grid Reference of an object/marker

If you can't find it. Jones, the scripter of Charlie Foxtrot. Wrote this in one of his missisons. pos2grid
23. ## How do I stop AI from moving, but still rotate to shoot?

I know a lame way to do it. It's not a cool try but it will work very well pos = getPos unit; while {true} do {setPos Unit _pos; sleep 0.25; } It's lame I know.. Or just a while with a if included to check if its moved.
24. ## Some questions to improve my mission quality

Sorry about the == should be "=" of course. However the trigger was just a way of showing how a waypoint is ONLY executed if something else is triggered before thats why I was talking about the boolean in the trigger that the waypoint needs to be activated.
25. ## Some questions to improve my mission quality

How to: Waypoint that will KILL YOU WHEN YOU REACH IT 1. Create waypoint put in whatever you want BUT On Act(ivation): reached == true So what we do is, that we create a variable called "reached" and we put its status on true. 2. Create a trigger. Condition: reached On act(ivation): player setDamage 1
×

• Clubs