Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×

samatra

Member
  • Content Count

    652
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by samatra

  1. 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.
  2. Had no idea what script returns and thought it was vehicle itself because of how OP used the script in his example.
  3. 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.
  4. 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:
  5. 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.
  6. 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
  7. 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";
  8. Removeallweapons will also remove all magazines. I would recommend you to store and remove primaryWeapon and secondaryWeapon.
  9. 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.
  10. 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.
  11. 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.
  12. samatra

    ctrlSetText problem

    Do diag_log _dam; If it will return "scalar" then getDammage didn't return damage value (_object is not valid object pointer).
  13. 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.
  14. What tool are you referring to? May I take a look?
  15. http://community.bistudio.com/wiki/CfgVehicles_Config_Reference How original modules config looks like: http://pastie.org/pastes/4793504/text
  16. Most likely it will require a mod, new logic vehicle definition which will do something on load.
  17. You can't. You have to look into server_console.log or write side application which will do it for you.
  18. 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.
  19. Which will result in "CraterLong" objects and #crater objects which will delete pretty fast.
  20. 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.
  21. 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.)
  22. Try to add hint format ["%1", _safespawn2]; and notice that findEmptyPosition is not reliable and not always finds position.
×