-
Content Count
1304 -
Joined
-
Last visited
-
Medals
Everything posted by twirly
-
Getting out of the Area of Operation = Kill / Other?
twirly replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Something that needs to be pointed out is that scripting for a Multiplayer game is very different to scripting for a Single Player game. Trying to create a Multiplayer game without loads of scripting knowledge is going to be an almost impossible task. That would be jumping in on the deep end...and will only lead to frustration. With the trigger... it is more than likely that only one person will set it off but the whole group needs to get the message. Correct? -
Getting out of the Area of Operation = Kill / Other?
twirly replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Use thislist instead of list this. -
Quick trigger setup.
twirly replied to thamos33's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
For the area clear of OPFOR do this.... Place a trigger over the area set to:- Activation: OPFOR ONCE Not Present On Act. : titleText ["OPFOR not present in area!","plain down"]; For you (the player) entering an area do this.... Place a trigger over the area set to:- Activation: ANYONE ONCE Present Condition: this && player in (thislist); On Act. : titleText ["Player entered trigger!","plain down"]; -
sorting an array with numbers and objects
twirly replied to zonekiller's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Did you try typeName ? if (typeName _vehicle == "SCALAR") do { .... .... }; -
Scripting Questions
twirly replied to Deuce82's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi... Don't add them to the init fields of any units. Create a file in your mission folder called init.sqf. This will be executed once at mission start. You can use it to initialise things. Civilian setFriend [East, 0]; only needs to be done once... so it's ideal for the init.sqf. So put the line in the file....then try it. You can get commands like setFriend to work from the init fields of many things.... but much better from a script that you can easily open and read instead of clicking on every single item in your mission to try to find where you put the line. -
Need help with Inventory commands
twirly replied to Shinra123's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
In your init.sqf...or from anywhere really... once all the units are initialized and on the map... execute this little script. littlescript.sqf:- _allunits = allunits; for "_i" from 0 to (count _allunits)-1 do { _unit = _allunits select _i; if (not (_unit hasWeapon "ItemRadio")) then {_unit addWeapon "ItemRadio"}; sleep 0.01; }; EDIT: Another way to make the purists happy! littlescript.sqf:- _allunits = allunits; {if (not (_x hasWeapon "ItemRadio")) then {_x addWeapon "ItemRadio"}} foreach _allunits; -
Make unit stop immediatly and delete all waypoints!
twirly replied to Muadjin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ahhh... Sorry for missing that in your post. I'll see what I can knock up in the editor for you and post a demo mission. EDIT:- OK...this stops him when he enters the trigger. Waypoints are deleted... he is given a waypoint at his current location and he stops dead in his tracks. Demo here. _bot = _this select 0; _group = group _bot; while {(count (waypoints _group)) > 1} do { deleteWaypoint ((waypoints _group) select 1); sleep 0.01; }; _wp = _group addWaypoint [position _bot, 0]; What do you want him to do after he stops? -
Help with AI Convoy Ambushed
twirly replied to lax's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi lax... To keep the guys in cargo from getting out.... maybe temporarily disableAI To keep the vehicles moving and firing.... to my knowledge that's a hard one. -
onMapClick can't execute scripts
twirly replied to best2nd's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
' is the same as "" ...or... A single quote is the same as double quotes. -
Make unit stop immediatly and delete all waypoints!
twirly replied to Muadjin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Look up doMove see if that helps. -
MP compatible: Illuminate Helipads for incoming heli's, HOW???
twirly replied to BelgarionNL's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
When you run the mission...do you see the helipad at the height you want? Stupid question maybe! From looking through the code posted.... this is the line that spawns the chopper... _vcl = createVehicle [_type, [b]spawnPos[/b], [], 0, "None"]; Therefore the z element of spawnPos needs to be 3.5m I don't know where spawnPos is given it's value. That is what needs to be changed. If you hard code it to 3.5 before the vehicle is spawned... it's going to affect all vehicles. -
Best way to detect spawned unit
twirly replied to nomadd's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
How are you spawning them? Do you get back the handle/name of the spawned group when they are spawned? -
Make unit stop immediatly and delete all waypoints!
twirly replied to Muadjin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well the setWaypointPosition or addWaypoint was to give him a waypoint at his current position....which should stop him. You can always use doStop. -
Make unit stop immediatly and delete all waypoints!
twirly replied to Muadjin's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Not tested but should work.... maybe instead of the setWaypointPosition you might need to use addWaypoint and add a waypoint here....since they've all been deleted. I'm not sure. while {(count (waypoints _bot)) > 0} do { deleteWaypoint ((waypoints _bot) select 1); sleep 0.01; }; [group _bot, 0] setWaypointPosition [position _bot, 0]; -
Invisible walls on spawn, then removed after X amount of time?
twirly replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
There is some kind of invisible barrier... but for the life of me I can't find it and don't remember what it is called. Anyway I made a little test mission for you using hescos (h-barriers). It's a simple script that will smoothly lower an object below ground level. Here it lowers two objects.... h1 then h2. I use it to sink vehicles into the ground before respawn. See if it will be enough to do what you want. Test mission here. script.sqf:- _walls = [b][h1,h2][/b]; for "_i" from 0 to (count _walls)-1 do { _wall = _walls select _i; // Get the current position of the obj _origx = (getPos _wall) select 0; _origy = (getPos _wall) select 1; _origz = (getPos _wall) select 2; _z = 0; // Sink it in the ground while {(_z < 5)} do { _wall setPos [_origx,_origy,_origz-_z]; _z = _z + 0.05; sleep 0.02; }; //delete the wall deleteVehicle _wall; }; call it with:- nul = [] execVM "script.sqf"; -
Removing weapons, Adding another, And equipping.
twirly replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Ahhh... I don't know the answer to that one. Maybe someone else knows a way around that... I'd love to know myself now that you mention it. EDIT: From the little reading I just did... maybe changing his behaviour and combat mode to COMBAT and RED. setBehaviour setCombatMode -
Removing weapons, Adding another, And equipping.
twirly replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
no worries.... you're welcome -
Removing weapons, Adding another, And equipping.
twirly replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try it this way.... no need to loop it on the guy forever. _man = _this select 0; Removeallweapons _man; _man addmagazine "PG7V"; _man addmagazine "PG7V"; _man addweapon "RPG7V"; _man selectweapon "RPG7V"; -
Music on a moving vehicle?
twirly replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
try titles[] = {}; -
Music on a moving vehicle?
twirly replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I copied the description.ext into a new ext and formatted it properly and I think you should try removing that last }; at the bottom of the file. This may or not be your problem.... but try it anyway. Something looks fishy. Here's a tip... When you are posting code use the "Code" or "PHP" tags.... not the "Quote" tags. The code will be a lot easier for everyone to read. -
Music on a moving vehicle?
twirly replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Good tip. Thanks for mentioning it... I forgot about this. -
Eventhandlers are removed upon respawn?
twirly replied to headswe's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try this....add the line in bold after the lines below. _unit = _type createVehicle _position; _unit setPosASL _position; _unit setDir _dir; [b]_unit addEventHandler ["HandleDamage",{_boo = _this call func_head;_boo}];[/b] -
MP compatible: Illuminate Helipads for incoming heli's, HOW???
twirly replied to BelgarionNL's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
It was simply to show you how to do it. I didn't intend it to work without some substitution on your part. You know.... the "give a man a fish" thing! Have you tried replacing "UH60M_EP1" with HELI2TYPE? -
Music on a moving vehicle?
twirly replied to ayser's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi...try it this way... description.ext class CfgSounds { sounds[]= {music1}; class music1 { name = "music1"; sound[] = {\music\Qom_Nasheed.ogg, 1, 1.0}; titles[] = {}; }; }; Then do... playsound "music1"; //is non 3D sound or... _obj say3D "music1"; //is 3D sound EDIT: I'm not sure about the looping part... I think you're going to have to time it and then play the sound again to get the loops. -
I'm such a noob...
twirly replied to swatdog's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try replacing.... _veh = format["at_%1",_num] with.... call compile format ["_veh = at_%1",_num]; See if you get some joy. As you have it there.... _veh ends up being a STRING and not an OBJECT! EDIT: Forgot to scold you... lol! Go stand in the corner! Next time use a more descriptive header for your post. "I'm such a noob" doesn't help anyone that's searching for answers.