

samatra
Member-
Content Count
652 -
Joined
-
Last visited
-
Medals
-
Medals
-
Everything posted by samatra
-
spawning fuel_dump_ru1 cannot error
samatra replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Have you tried to dump what your _fuelbunker contains? Try diag_log _fuelbunker; and look into your RPT. When you place composition, it returns array with all composition objects. You can't attach EHs to arrays just like error states. -
Adding a respawn script to vehicles created during mission
samatra replied to clydefrog's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Had no idea what script returns and thought it was vehicle itself because of how OP used the script in his example. -
Multiplayer globalChat messages not showing up for all players
samatra replied to ionpballer05's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
globalChat is local command and although it looks like global chat, only clients that execute this command will see it. Use Multiplayer Framework instead (Functions module on map): [player, nil, rGlobalChat, "Everyone should see this"] call RE; Switch player to captain variable name so messages will have your ai unit name at the beginning. -
spawning fuel_dump_ru1 cannot error
samatra replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Bit off-topic, but since I see that you write a lot of scripts and ask many questions I would recommend you to read this article: Code Optimisation, I'm sure you will find lots of interesting info there, especially since I see that you use old createVehicle command instead of createVehicle array. Quote from article: -
spawning fuel_dump_ru1 cannot error
samatra replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Dynamic Object Compositions -
SetObjectTexture and Triggers
samatra replied to bloodxgusher's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You actually need global effect of triggers since setObjectTexture is local command and trigger will execute it on all clients. I never used triggers but I think that list of trigger-activated vehicles should be in thislist variable. On act probably should be something like this: (thislist select 0) setObjectTexture [0, "PurpleSUV.jpg"]; Oh and SUV base class is "SUV_Base_EP1", not "SUV". Use config browser as reference when working with vehicle classes. -
Adding a respawn script to vehicles created during mission
samatra replied to clydefrog's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
I don't know how your respawn script works, but I guess it should be like this: heli1 = createVehicle "MH60S" (getMarkerPos "heli1spawn"); heli1 = [heli1, Delay, Deserted timer, Respawns, Effect, Static] execVM "vehicle.sqf; ---- About CAN_COLLIDE: createVehicle array -
Adding a respawn script to vehicles created during mission
samatra replied to clydefrog's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Of course it is, your question is too uncertain though. Anyway: _veh = createVehicle ["BTR90", _somepos, [], 0, "CAN_COLLIDE"]; _veh execVM "what_ever_respawn_script_you_use.sqf"; -
Script Error - add action and if
samatra replied to BullyBoii's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Removeallweapons will also remove all magazines. I would recommend you to store and remove primaryWeapon and secondaryWeapon. -
Script Error - add action and if
samatra replied to BullyBoii's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
if (player distance shopman <= 5) then { _accessShop = shopman addAction ["Use Shop", "shop_access.sqf"]; } else { shopman removeAction _accessShop; hint "action removed"; }; Speaking of 5 meters distance, there is "condition" argument for addAction. Your script will actually do nothing since it will run check once and end. -
VIP "Panic Button"
samatra replied to Sc0rc3d's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
alert.sqf: { if((playerSide == side _x) && (player distance _x < 4000)) then { [nil, _x, "loc", rHINT, "VIP needs help!"] call RE; }; } forEach playableUnits; This will show hint to all players which has VIP's side and within 4 kilometers Action can be used as many times as you want. -
VIP "Panic Button"
samatra replied to Sc0rc3d's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Doesn't look like it will work. Here is how I would do it VIP unit init line: if(local this) then {this addAction ["Alert!", "alert.sqf"];}; alert.sqf: [nil, nil, rHINT, "VIP needs help!"] call RE; You need to have Functions module added into mission. -
ctrlSetText problem
samatra replied to A-SUICIDAL's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Do diag_log _dam; If it will return "scalar" then getDammage didn't return damage value (_object is not valid object pointer). -
To private or not to private?
samatra posted a topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Hello. I've noticed that I tend to have all my local variables listed in private list at the beginning of each script/function. Is this a good idea? I'm looking to squeeze as much performance as possible out of my scripts and I'm starting to wonder if privating everything is a good idea? Would appreciate advices or own experiences on this matter. Thank you. -
To private or not to private?
samatra replied to samatra's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
What tool are you referring to? May I take a look? -
Turning a script into an editor module
samatra replied to zorilya's topic in ARMA 2 & OA : ADDONS - Configs & Scripting
http://community.bistudio.com/wiki/CfgVehicles_Config_Reference How original modules config looks like: http://pastie.org/pastes/4793504/text -
Turning a script into an editor module
samatra replied to zorilya's topic in ARMA 2 & OA : ADDONS - Configs & Scripting
Most likely it will require a mod, new logic vehicle definition which will do something on load. -
How to find GUID through script?
samatra replied to Horner's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
You can't. You have to look into server_console.log or write side application which will do it for you. -
Random sleep time?
samatra replied to marker's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Sure, go ahead. -
Random sleep time?
samatra replied to marker's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Can't quite remember if you can use sleep in init.sqf but if you can, use: //init.sqf // Code for convoy defend script if (isServer) then { sleep (50 + (random 50)); [["pos1","pos2","pos3","pos4"],[c1,c2,c3,c4,c5,c6]] execVM "convoyDefend\convoyDefend_init.sqf"; }; and if you can't (throws error, no actual delay), use: //init.sqf // Code for convoy defend script if (isServer) then { [] spawn { sleep (50 + (random 50)); [["pos1","pos2","pos3","pos4"],[c1,c2,c3,c4,c5,c6]] execVM "convoyDefend\convoyDefend_init.sqf"; }; }; sleep (50 + (random 50)); is obviously random sleep between 50 and 100 seconds. -
Dialogs: Is it possible to make specific controls\elements hidden from beginning?
samatra replied to samatra's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Good idea, thanks a lot! -
Creating the appearance of scorched ground
samatra replied to kalelovil's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Which will result in "CraterLong" objects and #crater objects which will delete pretty fast. -
Creating the appearance of scorched ground
samatra replied to kalelovil's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Yeah, just checked it and typeOf returns "#crater". Tried to spawn it and it returned <no shape> object while original crater had some model. Apparently ArmA lacks scripting commands to create custom craters and bare "#crater" object is useless. -
fn_spawnVehicle.sqf error line 70
samatra replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
for "_i" from 0 to 10 do { _grp2 = []; _spawn2 = getMarkerPos "E_Patrol"; _offset2 = [30,50,70,80,120,200,250] call BIS_fnc_selectRandom; _offset3 = random 100; _prec2 = random 100; _exp2 = "(1 - houses) * (1 - houses)"; _bestplace2 = selectBestPlaces [_spawn2,_offset2,_exp2,_prec2,1]; _spot4 = _bestplace2 select 0; _spot3 = _spot4 select 0; _safespawn2 = []; _attempts = 10; while {(count _safespawn2 == 0) && (_attempts > 0)} do { _safespawn2 = _spot3 findEmptyPosition [10 + ((10 - _attempts) * 10), 75 + ((10 - _attempts) * 10), "tank"]; _attempts = _attempts - 1; } if(count _safespawn2 == 3) then { _randomvehicle2 = ["T34_TK_EP1","BRDM2_ATGM_TK_EP1","LandRover_MG_TK_EP1","T72_TK_EP1","ZSU_TK_EP1"] call BIS_fnc_selectRandom; _direction2 = random 359; _vehicleCreated =[_safespawn2, _direction2, _randomvehicle2, EAST] call BIS_fnc_spawnvehicle; _vehiclegroup = _vehicleCreated select 2;//group [(units _vehiclegroup) select 0, "E_Patrol","spawned","nofollow","random","nowait","delete:",120] execVM "scripts\upsmon.sqf"; }; }; Here is how I would do it. Basically it attempts to find safe position 10 times and increases radius and search distance by 10 meters each attempt. And it creates group only if position was found. (You can get rid of all "10 attempts" thing actually and just skip group creation if no position was found) (I did not test the code, let me know if it will throw an error.) -
fn_spawnVehicle.sqf error line 70
samatra replied to hogmason's topic in ARMA 2 & OA : MISSIONS - Editing & Scripting
Try to add hint format ["%1", _safespawn2]; and notice that findEmptyPosition is not reliable and not always finds position.