-
Content Count
2658 -
Joined
-
Last visited
-
Medals
Everything posted by demonized
-
Repairing mapobjects (houses)
demonized replied to Sekra's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
place player on safe distance and place this code in alpha radio trigger. player allowDammage false; _null = [] spawn { _cnt = 500; _pos = getPos rebuilder; while {_cnt != 0} do { _lightsoff = "Bo_GBU12_LGB" createVehicle [(_pos select 0)+((random 300)+(random -300)),(_pos select 1)+((random 300)+(random -300)),50]; _cnt = _cnt - 1; sleep 0.05; }; hint "back to the stoneage, ah well"; }; place a game logic named rebuilder where you want to fix buildings. place this code in a bravo radio trigger: _null = [rebuilder,500] spawn { _pos = _this select 0; _dist = _this select 1; _static = nearestobjects [_pos,["Building"], _dist]; {_x setdammage 0} foreach _static; }; demo mission: -
Repairing mapobjects (houses)
demonized replied to Sekra's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I dropped 200 GBUS over a 300 diameter circle in the middle of ferus abad city (Takistan MAP), when the smoke cleared i pressed the radio trigger wich activated the repair and the city came back. I asure you, it was completely in rubble... -
Repairing mapobjects (houses)
demonized replied to Sekra's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
tested and working in 1.60 http://forums.bistudio.com/showthread.php?107028-Repair-building-script&p=1742270&viewfull=1#post1742270 -
Teleport to Blackhawk script - fails on dedicated server
demonized replied to A-SUICIDAL's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
addaction is local command so should work as is. Are you sure the blackhawk is named? you could try this if (count _this != 1) exitWith { _caller = _this select 1; [nil,_caller,"loc",rEXECVM,"teleport_blackhawk.sqf",_caller] call RE; }; _unit = _this select 0; if ( !alive blackhawk ) then { hint "The Blackhawk is currently destroyed."; } else { _freePosGunner = (vehicle blackhawk) emptyPositions "gunner"; _freePosCargo = (vehicle blackhawk) emptyPositions "cargo"; if (_freePosGunner > 0 and _freePosGunner < 2) then { _unit moveInGunner (vehicle blackhawk); } else { if (_freePosCargo > 0) then { _unit moveInCargo (vehicle blackhawk); }; }; }; need functions module on map. also if its not working, replace call re line with this: [nil,blackhawk,"loc",rEXECVM,"teleport_blackhawk.sqf",_caller] call RE; -
How to utilize the "say"-command in multiplayer
demonized replied to almanzo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
use the remote execVM to easily work around locality if you cannot use the appropriate triggers: if (isServer) then {[nil,nil,"per",[color="#0000FF"]rEXECVM[/color],[color="#FF0000"]"speech.sqf"[/color],[color="#00FF00"]man1, lead[/color]] call RE}; blue color = the command in this case execVM wich is fronted by a r for remote. red color = the scriptname. green color = the passed arguments in a array, in this case all after red is _this in the script executed. (man1, lead) if you had placed [man1, lead] after red, you would get [[man1, lead]] in the script. if (isServer) then {[nil,nil,"per",rEXECVM,"speech.sqf",[man1, lead]] call RE}; -
Server Player Count
demonized replied to OB1's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
if (count playAbleunits >= 5) then { // execVM your script here, and read the guide in my sig to get to know the basics. hint "number of players in mission is 5 or higher"; }; >= left is same or higher than right <= lower == equal to -
Simple patrol setup question
demonized replied to almanzo's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
What you want is "CYCLE" waypoint. More info on waypoints here: Cycle waypoint will make group go to nearest waypoint to the cycle waypoint, creating a infinite loop. -
_id = player addAction ["Switch on generator", "activate_generator.sqf"]; player removeAction _id;
-
Custom named characters
demonized replied to Veinlockx's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
you can fake it with somewhat with addAction: place in player unit init: this addAction ["John", "someEmptyScript.sqf", [], 1, true, true, "", "cursorTarget == unit1"]; Make sure you have a file in your missionfolder named "someEmptyScript.sqf", i can just be empty we dont need it other than to avoid a error message. The text john will come up center screen (also in scroll list) when player points and aims at the unit named unit1 in editor. edit: bad picture, here is big size of it: http://imageshack.us/photo/my-images/513/arma2oa2012021217474251.gif/ -
Smoke effect time setting question.
demonized replied to ssm4862's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
replace anyobject_fire with _obj -
Smoke effect time setting question.
demonized replied to ssm4862's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
stop smoke: {deleteVehicle _x} foreach [_PS1,_PS2,_PS3]; give damage: while {alive anyobject_fire} do { { if ( (_x distance anyobject_fire) < 2 ) then {_x setDammage ((getDammage _x)+0.05)}; } foreach allUnits; sleep 1; }; // anyobject_fire = whatever object to be near to get damage from. // 2 = how near you need to be to take damage in meters. // 0.05 = the damage taken every second when near object. ; -
How to get more civilians?
demonized replied to acoustic's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
there are some options like vehicleCount, vehicleRarity wich can achieve what you need. http://community.bistudio.com/wiki/Ambient_Civilian_Vehicles same for the other one: http://community.bistudio.com/wiki/Ambient_Civilians -
Some advise on a While loop
demonized replied to 1para{god-father}'s topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
aside from you are using _alarm1 etc in the while {condition} do { and inside you use alarm1 in the wps. here is also a shorter version of it, and remember to include a if (!isServer) exitWith {}; before the while loop if its not a locally spawned script. while {alive _alarm1 && alive _alarm2 && alive _alarm3} do { /////////////////////////ambush //////////////////////////////////// _units = []; // for the waitUntil instead of sleep, can be deleted if sleep is used. { _grp = [(_x select 1), RESISTANCE, (configFile >> "CfgGroups" >> "Guerrila" >> "GUE" >> "Mechanized" >> (_x select 2))] call BIS_fnc_spawnGroup; _units = _units + [units _grp]; // for the waitUntil instead of sleep, can be deleted if sleep is used. _info = _x; // assign _info so we can use it inside wp foreach block. { _wp = _grp addwaypoint [getPos (_info select 0),0]; _wp setWaypointType _x; // here _x is type of wp, in order from left to right. _wp setWaypointCombatMode "RED"; _wp setWaypointSpeed "FULL"; _wp setWaypointBehaviour "AWARE"; } foreach ["SAD","MOVE"]; } foreach [ [alarm1,[2169.94,12353.6,0.00115585],"GUE_MechInfSquad"], [alarm2,[1124.94,12042.3,0.00132751],"GUE_MechInfSquad"], [alarm2,[1333.93,11029.9,0.00180054],"GUE_MechInfSquad"], [alarm3,[2297.37,11465.4,0.00196838],"GUE_MechInfSection"] ]; sleep 300; // or here to wait until all is dead: // waitUntil { ({alive _x} count _units) <= 0 }; // change 0 to any number and when number of alive units total for all groups combined is same or less it moves on. }; tested on my SP editor, no lag whatsoever, most likely its the isServer check that is missing or its the __alarm1 VS alarm1 thing... edit: you cannot check alive against a group, you use count instead: waitUntil { ({alive _x} count units _grp1) == 0 AND ({alive _x} count units _grp2) == 0 AND ({alive _x} count units _grp3) == 0 ({alive _x} count units _grp4) == 0 }; or the clever version: waitUntil { ({ ({alive _x} count units _x) != 0 } count [_grp1,_grp2,_grp3,_grp4]) == 0 }; -
Is there a clever guy/girl:p out there who knows how to extract the Single Player teamswitch dialog? Im working on a teamswitch ability for MP, using addactions wich works fine, but i wanted something more easily viewable like the scroll menu in teamswitch dialog with buttons for switch, view or exit. Fiddling with various forum dialog thread examples i managed to create 1 box i could click to perform a action, but its as simple as it can ever be, and i must admit, its mostly greek to me. Found some other examples aswell, but it seems they are all mostly ancient or atleast ofp era putting out errors when i tested them. I wanted a list of units in a array i define myself dynamically to appear in a window wich one could scroll if long, and click on one of the names/units and you would have 3 boxes in bottom of dialog with: view, switch and close. So to sum up: Either how to extract and manipulate the original BIS teamswitch dialogs to work with custom lists of units with custom code on button clicks no matter if its SP or MP. OR 1: player presses a button or uses an addaction, and the createDialog runs and the window appears center of screen. 2: dialog contains list of units from a array defined by me (array content can change throughout the mission), with scrollbar for long lists, with unitname, type or something else i can define, maybe using setvariable and getvariable to present text for each unit..? 3: dialog have 3 clickable boxes at bottom, 1 wich can be clicked always (CLOSE) and 2 wich can be clicked, once a unit is selected or clicked from/in the list.(VIEW and SWITCH) * close button simply closes the dialog window doing nothing else. * view and switch buttons start a script, passing the select unit from the list with it: example: clickedUnit execVM "someScript.sqf"; I imagine something like this highly artistic picture: Nothing more :D
-
Editing, Expanding and Modifying Domination
demonized replied to Tankbuster's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
just a guess, using vectorUp and vectorDir _camonet setVectorDirAndUp [(vectorDir _mhq),(vectorUp _mhq)]; if the results are not good, try switching the vectorUp _mhq and vectorDir _mhq around. Edit: you probably need to set the direction again after the code. -
Triggers' issues in multi/coop missions
demonized replied to bardosy's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
yes, thats how it should work officially, the group is local to the leader but in the allGroups array wich is global, being checked against each player/clients trigger, so all clients triggers should activate if only one unit of the group is inside. will try and run a dedi test later tonight to verify your findings, maybe you have a sample mission of whats not working for you? -
Triggers' issues in multi/coop missions
demonized replied to bardosy's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
It depends on the condition of the trigger ofc, if you have: !alive player then the trigger will only run for the player that is dead, player variable is only local to himself, and on other clients wich is still alive, player is alive so it doesnt activate. if you have: !alive unitname then the trigger will run on all clients and server because the unitname is dead and the alive command can gather unitnames wich is not local, but added to the allUnits arrays. same goes for global variables: if you have myGlobalVariable = true; and condition checking if its true in trigger, then if a client sets that variable to false and do not pub var it, then only that one will not see the trigger, on the other hand if its pub varred, then all clients will not see the trigger etc... I cannot say 100% for sure that is how it always works, but im 98%.... :D Yeah, i got that impression aswell, but there were some techincal insight from xeno and sickboy on both of the variants. I personally find MPF working just fine for my usage. -
Triggers' issues in multi/coop missions
demonized replied to bardosy's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
1: you could just script the trigger for each client when needed with either a publicVariableEventHandler or MP framework. 2: this is how triggers have worked all the time afaik, all triggers in MP was local. though again, this can be solved by MP framework. Note, i find MP framework to do its job just fine for simple tasks like execVM or hint sidechat etc, you can specify to run for all clients, even JIP. But many (professional scripters) do not like it, the best other way is to use CBA afaik. There was a thread created just recently that discussed MP framework and CBA in the editing section. -
Helicopter & crew created by script do not "unload"
demonized replied to roguetrooper's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
http://community.bistudio.com/wiki/setWaypointStatements new_wp setWaypointStatements ["true", "hint 'hello'; hint 'goodbye'"]; // there is both on act and on de act fields seperated by a ; this should work, have used it in my PR scripted waypoints. [_grpP, 1] setWaypointStatements ["true", "helo land 'GET OUT'; {unassignVehicle _x; dogetout _x} forEach units grpT;" ""]; the original code ran from PR script: -
Run script when button is pressed.
demonized replied to Orion987's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
maybe this one is what you need: http://community.bistudio.com/wiki/displaySetEventHandler list of other keys: http://community.bistudio.com/wiki/ListOfKeyCodes -
Trigger with "not alive" not working
demonized replied to snaiperskaya's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
One important thing is that if units or only 1 of the units are inside vehicles, you cannot delete them directly it will halt or error out. The trick is to setPos them away then delete: {_x setPos (getPos _x); deleteVehicle _x} foreach units Antiaa; also for the condition, dont think it matters much, but this is how i write those conditions and that works: ({alive _x} count units Antiaa) == 0 the paranteces makes sure that the one variable inside the paranteces is checked against the variable outside it, in this case 0. -
Editing, Expanding and Modifying Domination
demonized replied to Tankbuster's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
did you place functions module in editor? also if much code, or early on in mission, to make sure MP framework is loaded use this before using it: waitUntil{!(isNil "BIS_MPF_InitDone")}; http://community.bistudio.com/wiki/Multiplayer_framework -
Trigger with "not alive" not working
demonized replied to snaiperskaya's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
just a note: !alive Antiaa without paranteces works just as well, it comes down to personal preference. -
Get AI's Target
demonized replied to [aps]gnat's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Voted! -
Editing, Expanding and Modifying Domination
demonized replied to Tankbuster's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
MP framework is the thing to use: [nil,Miles,"loc",rSIDECHAT,"Miles is local here, and only he will see this chat"] call RE;