-
Content Count
1304 -
Joined
-
Last visited
-
Medals
Everything posted by twirly
-
Naming a spawmed group problem
twirly replied to f2k sel's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Mate ... it appears I gave you some bogus code above. It was worrying me.... so I tested and fixed it. So changes made to code above. All is good now. Spot on man! Dynamically named groups. -
Naming a spawmed group problem
twirly replied to f2k sel's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hope I read you right but you can do something like:- grplist = []; for "_i" from 0 to 4 do { [s]_grpnam = format ["grp_%1",_i][/s]; [s]_grpnam = [] call createMyGroup[/s]; [s]_grplist set [count _grplist, _grpnam][/s]; call compile format ["grp_%1 = [] call createMyGroup;",_i]; hint format ["grp_%1",_i]; call compile format ["_grplist set [count _grplist, grp_%1]",_i]; sleep 0.01; }; hint format ["_grplist:\n%1",_grplist]; Which will (tested) give you an array.... [grp_0,grp_1,grp_2,grp_3,grp_4]; The array is actually not necessary.... it's just included so that the names can be displayed after with hint. You should be able now to refer to those groups from anywhere. EDIT: I found that the names displayed in the hint are the usual Arma 2 groupnames. But using grp_1, grp_2 etc will also work. -
Need help making intros work for single player missions.
twirly replied to armamonkey's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi mate... can't solve your problem for you but can suggest a way forward. Get Eliteness or some similar tool and de-pbo a single player mission that does what you want and try to figure it out from there. You can load the de-pbo'd mission into the editor and fiddle with it. -
Generic error, getPosASL and array
twirly replied to scajolly's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi... Do a3,a4,a5 etc actually exist? -
Naming a spawmed group problem
twirly replied to f2k sel's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
F2K.... I had tested. Here are my files:- init.sqf:- waitUntil { !isNil "BIS_fnc_init" }; createMyGroup = compile preprocessFile "createMyGroup.sqf"; sleep 1; _grp = [] call createMyGroup; hint format ["_grp: %1",_grp]; createmygroup.sqf:- private ["_grp","_unit"]; _grp = createGroup East; _unit = _grp createUnit ["TK_Soldier_SL_EP1", [(getMarkerPos "pawn1") select 0,(getMarkerPos "pawn1") select 1,0], [], 3, "FORM"]; _unit = _grp createUnit ["TK_Soldier_GL_EP1", [(getMarkerPos "pawn1") select 0,(getMarkerPos "pawn1") select 1,0], [], 3, "FORM"]; _unit = _grp createUnit ["TK_Soldier_EP1", [(getMarkerPos "pawn1") select 0,(getMarkerPos "pawn1") select 1,0], [], 3, "FORM"]; _unit = _grp createUnit ["TK_Soldier_EP1", [(getMarkerPos "pawn1") select 0,(getMarkerPos "pawn1") select 1,0], [], 3, "FORM"]; _unit = _grp createUnit ["TK_Soldier_EP1", [(getMarkerPos "pawn1") select 0,(getMarkerPos "pawn1") select 1,0], [], 3, "FORM"]; _grp Can up a little demo if you need it. Let me know. PS. I did notice you had a space in "createmygroup(space here).sqf" ..so check that. -
Map or editor created locations as waypoints
twirly replied to katipo66's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Here mate. I knew I had something on Citycenters somewhere. Just dug it out and had a look. Not my code.... but might help. Many thanks to whoever wrote it. Did not play with it much... but seems to return stuff you'd be interested in. private ["_list", "_typeVar", "_neighbors", "_name"]; waituntil {!isnil "bis_fnc_init"}; //[] call BIS_fnc_help; _list = ["CityCenter",[position player,4000],true] call bis_fnc_locations; hint format ["list = %1", _list]; sleep 2; { hint format ["element %1 = %2", _x, getPos _x]; sleep 2; _typeVar = _x getVariable "type"; _neighbors = _x getVariable "neighbors"; _name = _x getVariable "name"; hint format ["neighbours: %1\ntypevar: %2\nname: %3", _neighbors, _typeVar, _name]; sleep 2; } forEach _list; -
All remaining enemy Chase player/team
twirly replied to snowmirage's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Well... the main thing is doMove works with units..... not groups. This is why you need to look up the commands and not just guess mate! See how you go and post again. -
Naming a spawmed group problem
twirly replied to f2k sel's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Use this for the function:- Get rid of _createMyGroup = { and the last bracket }. "createMyGroup.sqf":- private ["_grp","_unit"]; _grp = createGroup East; _unit = _grp createUnit ["TK_Soldier_SL_EP1", [(getMarkerPos "pawn1") select 0,(getMarkerPos "pawn1") select 1,0], [], 3, "FORM"]; _unit = _grp createUnit ["TK_Soldier_GL_EP1", [(getMarkerPos "pawn1") select 0,(getMarkerPos "pawn1") select 1,0], [], 3, "FORM"]; _unit = _grp createUnit ["TK_Soldier_EP1", [(getMarkerPos "pawn1") select 0,(getMarkerPos "pawn1") select 1,0], [], 3, "FORM"]; _unit = _grp createUnit ["TK_Soldier_EP1", [(getMarkerPos "pawn1") select 0,(getMarkerPos "pawn1") select 1,0], [], 3, "FORM"]; _unit = _grp createUnit ["TK_Soldier_EP1", [(getMarkerPos "pawn1") select 0,(getMarkerPos "pawn1") select 1,0], [], 3, "FORM"]; _grp What you have would work (with a few minor changes) if you used:- #INCLUDE "createMyGroup.sqf" at the top of your init.sqf.... or included the actual code in the file where it is called from (init.sqf). Then you would have been able to call the function. -
How to start for an absolute beginner ?
twirly replied to Joe98's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yeah.... Wow! -
All remaining enemy Chase player/team
twirly replied to snowmirage's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
These posts here should get you started. If you're here 'till the end of the war.... you will have to learn how to modify code to suit your own needs at some point. You might as well start that learning process now. http://forums.bistudio.com/showthread.php?t=119376 http://forums.bistudio.com/showthread.php?t=112731 Familiarise yourself with these.... Scripting Commands -
Turrets - a living nightmare
twirly replied to CarlGustaffa's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Oooops... was too slow in my reply. -
Turrets - a living nightmare
twirly replied to CarlGustaffa's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi Carl. This is what I've been using to get an empty vehicles turrets/crew positions. Some BIS scripts modified by Murklor. Not sure if they will help you or not but here goes. As it is the functions are meant to be part of an include file. // These functions thanks to Murklor // -------------------------------------------------------- // // ----------------- Start Functions -------------------- // // -------------------------------------------------------- // // *WARNING* BIS FUNCTION RIPOFF - Taken from fn_returnConfigEntry as its needed for turrets and shortened a bit _fnc_returnConfigEntry = { private ["_config", "_entryName","_entry", "_value"]; _config = _this select 0; _entryName = _this select 1; _entry = _config >> _entryName; //If the entry is not found and we are not yet at the config root, explore the class' parent. if (((configName (_config >> _entryName)) == "") && (!((configName _config) in ["CfgVehicles", "CfgWeapons", ""]))) then { [inheritsFrom _config, _entryName] call _fnc_returnConfigEntry; } else { if (isNumber _entry) then { _value = getNumber _entry; } else { if (isText _entry) then { _value = getText _entry; }; }; }; //Make sure returning 'nil' works. if (isNil "_value") exitWith {nil}; _value; }; // *WARNING* BIS FUNCTION RIPOFF - Taken from fn_fnc_returnVehicleTurrets and shortened a bit _fnc_returnVehicleTurrets = { private ["_entry","_turrets","_turretIndex","_i"]; _entry = _this select 0; _turrets = []; _turretIndex = 0; //Explore all turrets and sub-turrets recursively. for "_i" from 0 to ((count _entry) - 1) do { private ["_subEntry"]; _subEntry = _entry select _i; if (isClass _subEntry) then { private ["_hasGunner"]; _hasGunner = [_subEntry, "hasGunner"] call _fnc_returnConfigEntry; //Make sure the entry was found. if (!(isNil "_hasGunner")) then { if (_hasGunner == 1) then { _turrets = _turrets + [_turretIndex]; //Include sub-turrets, if present. if (isClass (_subEntry >> "Turrets")) then { _turrets = _turrets + [[_subEntry >> "Turrets"] call _fnc_returnVehicleTurrets]; } else { _turrets = _turrets + [[]]; }; }; }; _turretIndex = _turretIndex + 1; }; sleep 0.01; }; _turrets; }; The call is:- _turrets = [configFile >> "CfgVehicles" >> [b]_vehicle[/b] >> "turrets"] call _fnc_returnVehicleTurrets; As I said.... I hope it is of some help. -
Simple Mobile Respawn?
twirly replied to acoustic's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You know... I did not know this!! :) My bad! -
To math freaks: objects on border of irregular rectangle?
twirly replied to roguetrooper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The purpose is to rotate (x,y) points around an origin. For instance if you had a marker and a bunch of (x,y) points in the area covered by the marker. Where would these points end up if you rotated the marker and the points by 20 degrees. Can't explain much better than that. Google "geometric rotation". -
Simple Mobile Respawn?
twirly replied to acoustic's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
The AI won't respawn unless you write a script to make them respawn. -
To math freaks: objects on border of irregular rectangle?
twirly replied to roguetrooper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try this mate.... this works with a marker. I'm sure you can figure it out from here. //rotate it _newx = 2 * ((_xdis * cos(_mkrdir)) - (_ydis * sin(_mkrdir))); _newy = 2 * ((_xdis * sin(_mkrdir)) + (_ydis * cos(_mkrdir))); //add it to center coords _newx = (_mkrpos select 0) + (_newx); _newy = (_mkrpos select 1) + (_newy); -
call bis_fnc_taskPatrol globally for every unit
twirly replied to katipo66's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Make a copy of allGroups and then subtract whatever group(s) from the copy. Work with this new array. _mygroups = allGroups; _mygroups = _mygroups - [somegroup]; Then use _mygroups for bis_fnc_taskPatrol. -
Editing Tutorial via YouTube
twirly replied to Pauldarrington's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You can get plugins for Explorer and Firefox that will allow you to download .flv video from YouTube. Here's a link to the Firefox one. http://www.downloadhelper.net/ -
Editor question
twirly replied to fasterthanlight's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Wrong forum section for this I think man. -
Patrol between setPosATL
twirly replied to Skagget's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Here mate. Put together a little demo mission with random soldiers from a given group randomly patrolling the buildings within a given radius. They will patrol indefinately. Demo here. Look at the scripts. From those...it shouldn't be too hard to figure out how to make your two soldiers patrol between two building positions. Hope it helps you..... and maybe you will learn something along the way. Note that this code is in the INIT of the groups leader:- nul = [this,group this,50] execVM "rndbldpat.sqf"; -
A setpos script for which I need help
twirly replied to guyfawkestom's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
A couple things I found while playing with this. This should work but it doesn't seem to... _building = nearestBuilding _pos; This does work.... _building = nearestObject [_pos, "Building"]; Also... it seems _pos (pos1 object) can only be certain objects. It works with a fuel can... but not with a garbage can or flagpole! For instance... when you use a garbage can the nearest building returned is the garbage can itself.... so no positions to be found there! -
A dialog that the player can not influence?
twirly replied to roguetrooper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Here is a post I had found some time back with an example using the minimap. If you haven't already seen it maybe it might be of some help. http://forums.bistudio.com/showpost.php?p=1865767&postcount=8 -
Terrorist Hunt Template (Make Your Own Terrorist Hunt)
twirly replied to Phantom Six's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi... just a heads up mate. Your link "Download the Make Your Own Terrorist Hunt Template Here" needs fixing. -
A dialog that the player can not influence?
twirly replied to roguetrooper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hi mate...don't know too much about dialogs but in that code true and false aren't defined so it probably won't work. Use 0 and 1 for movingEnable and enableSimulation Or define true and false with:- #define false 0 #define true 1 -
At a loss with SPAWNING
twirly replied to goose4291's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I updated the link to the demo on that post and it is also linked here.