Jump to content

champ-1

Member
  • Content Count

    434
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by champ-1

  1. champ-1

    CH Mobile Headquarters

    CH Mobile Headquarters v0.91 Download Description: Here you go guys, now you can have any virtual boxes and arsenals attached to any objects. I hope you like it :D Changelog: v0.91 - added: ability to execute code for every object in composition (for more information read section "for advanced users") - added: algorithm to measure object composition size and check for suitable conditions only in that radius - changed: removed dummy unit inside deployed HQ until (forever?) I learn how to make him invisible and stop from getting out of the vehicle - fixed: marker names not having a proper ID - fixed: disabled simulation for some objects in composition Download
  2. champ-1

    CH Mobile Headquarters

    Yeah, thanks---------- Post added at 17:23 ---------- Previous post was at 16:44 ---------- Just tested it on dedicated server. There are some bugs, but nothing as serious as you described. At least for me. It works with JIP and JIP can teleport to HQ.
  3. champ-1

    CH Mobile Headquarters

    I'll double check it again, but last time I checked everything worked in MP. This doesn't seems like its a bug with the script. Maybe you have major desync on server? ---------- Post added at 15:48 ---------- Previous post was at 15:44 ---------- I thought so. :D There is always two reasons: slope too steep or there are some objects nearby that may interfere with deployed HQ.In the next update I will improve this part. It will check radius based on current object composition for HQ. So if you have really small HQ, you will be able to deploy it almost everywhere.
  4. I want to create unique variable based on object's ID, but I don't know how to get them. There is a command for multiplayer that returns unique ID for objects and groups. But it doesn't work in singleplayer. Empty objects always specified like this: "3fcbc100# 14: heli_light_01_f.p3d". There is some sort of uniqued (?) id at the beggining. But players, AI and manned vehicles doesn't return that id. Is there a way to get it? Or maybe there is some other way how I can generate unique ID based on object?
  5. Ok, but I really don't know much about perfomance. For me it seems if there are less code it performs better. But I guess it's not always the case. :)
  6. That's just example. What if some other random script calls setVehicleVarName?---------- Post added at 15:02 ---------- Previous post was at 15:01 ---------- God damn it :D
  7. Yeah. :D Second try: KK_fnc_netId = { if (isMultiplayer) exitWith {netId _this}; if (typeName _this != "OBJECT") exitWith {""}; private "_netId"; _netId = _this getVariable "_netId"; if (isNil "_netId") then { KK_var_globID = (missionNamespace getVariable ["KK_var_globID", []]); KK_var_globID pushBack _this; _netId = format ["0:%1", count KK_var_globID]; _this setVariable ["_netId", _netId]; }; _netId }; KK_fnc_getObjectFromNetId = { if (isMultiplayer) exitWith {getObjectFromNetId _this}; if (typeName _this != "STRING") exitWith {objNull}; private ["_obj"]; { if (_x getVariable ["_netId", ""] isEqualTo _this) exitWith { _obj = _x; }; } forEach (missionNamespace getVariable ["KK_var_globID", []]); _obj };
  8. It doesn't work for community missions where millions random scripts from different authors running. _vehicle1 = createVehicle [bla, bla, bla]; _vehicle1 setVehicleVarName "car"; _vehicle1 call BIS_fnc_objectVar; _vehicle2 = createVehicle [bla, bla, bla]; _vehicle2 setVehicleVarName "car"; _vehicle2 call BIS_fnc_objectVar; _vehicle1 call BIS_fnc_objectVar; // returns "car" _vehicle2 call BIS_fnc_objectVar; // returns "car" Not unique at all. ---------- Post added at 14:47 ---------- Previous post was at 14:37 ---------- Killzone_Kid, great job. But I like your first function better. KK_fnc_netId = { if (isMultiplayer) exitWith {netId _this}; if (typeName _this != "OBJECT") exitWith {""}; private "_netId"; _netId = _this getVariable "_netId"; if (isNil "_netId") then { (missionNamespace getVariable ["KK_var_globID", []]) pushBack _this; _netId = format ["0:%1", count KK_var_globID]; _this setVariable ["_netId", _netId]; }; _netId }; KK_fnc_getObjectFromNetId = { if (isMultiplayer) exitWith {getObjectFromNetId _this}; if (typeName _this != "STRING") exitWith {objNull}; private ["_obj"]; { if (_x getVariable ["_netId", ""] isEqualTo _this) exitWith { _obj = _x; }; } forEach (missionNamespace getVariable ["KK_var_globID", []]); _obj }; Wouldn't this be faster and all?
  9. Yeah, this is cool. Why do you use format "number:number"?---------- Post added at 13:32 ---------- Previous post was at 13:24 ---------- I guess we need function to retrieve object from net ID, too :D ---------- Post added at 13:38 ---------- Previous post was at 13:32 ---------- Maybe it would be better to add objects themself to "KK_var_globID", instead of count ?
  10. DreadedEntity, I'm not very familiar with "addPublicVariableEventHandler", so I can't judge how good is your method. Seems kinda complicated, maybe that's just me.
  11. So what's worse? if (isServer) then { gameLogic setVariable ["SOMECODE", { //alot of code here }, true]; }; call (gameLogic getVariable ["SOMECODE", {true}]}; or [{ //alot of code here }, "BIS_fnc_spawn", true, true] call BIS_fnc_MP;
  12. What if I create ID on server and then assign it publicly to the object? Would that cause alot of lag?Although I was asking in general about public setVariable. It's persistant same way as BIS_fnc_MP. Does it create game logic objects and attach variable to them like BIS_fnc_MP? Or is it more efficient? ---------- Post added at 01:51 ---------- Previous post was at 01:50 ---------- Here...
  13. I wrote on the first page I need this for marker system. Also I had some problems related to this at the time I created this thread, but I don't remeber what exactly I was doing. :DBut you are free to explain your method, maybe it will be useful for someone. :) Also I was wondering about this thing called "hash", not really sure what's that. But I heard cool guys using it. And i'm not talking about drugs :D
  14. Ofcourse I want something universal.It doesn't seems all that complicated. Btw, is it really that network intensive making public variables with setVariable? I read that making persistent BIS_fnc_MP is not recomended at all. Is it similar to that?
  15. No not really. It's impossible to retrive this ID from manned vehicles.Anyway, Sa-matra's solutions would work for me. Thanks.
  16. There is a ton of things you can't do by scripts and can be easily done by pressing one button.Recent example: player and AI sitting in heli, player is a driver and AI is a gunner. I want to take control (remoteControl) over AI and turn on gunner camera instantly. When you take control over AI using command switchCamera changes view back to player. So you have to move out player from the heli, take control over AI, switch camera, move player back to heli... or just press right mouse button.
  17. Does anyone know is it possible to send key presses to client, which he actually didn't press?
  18. champ-1

    CH Mobile Headquarters

    In the second post, yes. Obviously you have an idea :DUpdated function above. Nothing is fliped now. Check it out. ---------- Post added at 19:16 ---------- Previous post was at 19:12 ---------- All objects spawned by HQ removed when HQ is removed. You can add any notifications you like outside of this script. Some respawn scripts already have such notifications. Lol dude, it's just an "immersive" way to teleport from base. It's not like its real HQ or anything :D---------- Post added at 19:31 ---------- Previous post was at 19:16 ---------- By the way, really cool FOB (although I didn't see any moded objects), I hope it works on rugged terrain.
  19. champ-1

    CH Mobile Headquarters

    Dude, you saying you cant grab compisition correctly from placed objects and then you give me that wrong composition. Why would I need that? I asked you for your FOB placed in editor, but whatevs. Fixed couple things, try it now: CHHQ_fnc_getComposition = { _radius = _this select 0; _veh = if (vehicle player isEqualTo player) then {objNull} else {vehicle player}; if (isNull _veh) exitWith {systemChat "You need to be inside the vehicle to grab object composition around it."}; _objArray = []; _vehPos = getPosASL _veh; _vehDir = getDir _veh; { if (_x != _veh && !(_x isKindOf "Man")) then { _pos = getPosASL _x; _dir = getDir _x; _type = typeOf _x; _offset = [ (_vehPos select 0) - (_pos select 0), (_vehPos select 1) - (_pos select 1), (_pos select 2) - (_vehPos select 2) ]; _diroffset = _dir - _vehDir; _objArray pushBack [_type,_offset,_diroffset]; }; } forEach nearestObjects [_veh, ["all"], _radius]; copyToClipboard str _objArray; }; [15] call CHHQ_fnc_getComposition; // radius in meters from vehicle to grab objects
  20. champ-1

    CH Mobile Headquarters

    I think you uploaded wrong mission. There are only two objects on the map. ---------- Post added at 18:11 ---------- Previous post was at 18:07 ---------- It's not only limitation of this function that grabs object composition, but of the CHHQ script iteself. If your FOB composition bigger then 15 meters in radius, some objects may end up inside houses, rocks, trees, etc. Because they are spawned outside of the range that checked for empty terrain.
  21. champ-1

    CH Mobile Headquarters

    Flies are fine, they are spawned by the game near houses and trees and some other objects. You can filter them or just ignore. For my function to work properly you need to sit in the HQ truck, I'm guessing you didn't do that? For now this function copies objects around truck in radius of 15 meters. That's because when you deploy HQ it checks for empty and flat terrain around HQ. You may have troubles finding flat and empty land for such a big FOB you've build._MaSSive, I called that category "for advanced users" for a reasons. You have to understand what you are doing. Post you mission with object composition here. Will see what's up with it.
  22. champ-1

    CH Mobile Headquarters

    I might add some virtual ammo box feature in the future. Although I don't see much point in that. You teleporting from base to HQ you just got all ammo and weapons at the base. Why would you need more at the HQ?
  23. There is always place for improvments and both my methods are not ideal. So yeah... Not really solved.
  24. champ-1

    CH Mobile Headquarters

    You mean Arsenal?My guess is that when you place object in editor it has different process of initialization from when you spawn it with command. In other words: I DUNNO LOL
  25. Method "A": + helicopter keeps speed, pitch, bank and everything + player visible at the pilot sit - some scripts for helicopters (like AGM FCS) doesn't work with this method CH_fnc_controlGun = { _heli = vehicle player; _engineState = isEngineOn _heli; _gunner = (createGroup playerSide) createUnit [typeOf player, [0,0,0], [], 0, "NONE"]; _gunner hideObjectGlobal true; _gunner moveInGunner _heli; moveOut player; player remoteControl _gunner; _heli switchCamera "GUNNER"; player moveInDriver _heli; _heli engineOn _engineState; waitUntil {cameraView != "GUNNER"}; objNull remoteControl _gunner; deleteVehicle _gunner; }; Method "B": + should work with any scripts - player visualy switches seats when takes control over gun fixed - helicopter stops and hovers in air no metter what - sometimes helicopter turns randomly like its scared or something lol CH_fnc_controlGun = { _heli = vehicle player; _engineState = isEngineOn _heli; _pilot = (createGroup playerSide) createUnit [typeOf player, [0,0,0], [], 0, "NONE"]; removeAllAssignedItems _pilot; _pilot forceAddUniform (uniform player); _pilot addVest (vest player); _pilot addHeadgear (headgear player); _pilot linkItem (goggles player); _pilot setFace (face player); player hideObjectGlobal true; player action ["moveToGunner", _heli]; _pilot moveInDriver _heli; {_pilot disableAI _x} forEach ["TARGET","AUTOTARGET","MOVE","ANIM","FSM","AIMINGERROR","SUPPRESSION"]; _heli engineOn _engineState; _heli switchCamera "GUNNER"; waitUntil {cameraView != "GUNNER"}; _engineState = isEngineOn _heli; player action ["moveToDriver", _heli]; deleteVehicle _pilot; _heli engineOn _engineState; player hideObjectGlobal false; }; You can add action for this functions like this: CH_validHeliArray = ["B_heli_Attack_01_F"]; player addAction ["Control gun", "_this spawn CH_fnc_controlGun", [], 99, false, true, "", "{toLower typeOf vehicle player isEqualTo toLower _x} count CH_validHeliArray > 0 && {isNull (gunner vehicle player)}"];
×