Jump to content

Ramsen IV

  • Content Count

  • Joined

  • Last visited

  • Medals

Community Reputation

2 Neutral

About Ramsen IV

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Ramsen IV

    Issue with multiple cams

    Thanks for the explanation guys! BTW the script is far from perfect as issues arise when a 'later' spawned group attempts to take control of another groups 'camera feed' (or more accurate its the setObjectTexture code) the screen just goes black until another later group spawns and takes control of that same 'camera feed'... but i did expect this but of course my first goal was to solve the first riddle!! To partially solve the black screen issue though, i can do two things: 1) If I'm spawning a maximum amount of groups (say 4 groups max) I will have 5 free camera feeds/monitors. So group leader dies > new group arrives and there's always a spare camera feed/monitor for them. 2) For point 1 to work properly though I must use 'camDestroy' upon that group leaders death thus freeing up that camera feed/monitor for the next group - so either some kind of while alive loop, wait until death or just an event handle on the leaders death will solve this. Have not got this far yet... For larger battles where I can have up to 10+ groups its more difficult as I would have to have tonnes of monitors to make sure every spawned group has an assigned monitor - additionally the more PIP's I have the more performance hit they generate so this is prob best for small scale 'high command' type missions. (Although 'high command' usually has preplaced groups attached to the HC module but I could still pass them groups to this camera function - but I think years ago i used to spawn groups continuously and add them to the high command module via script somehow? But not sure if I ever got that to work... it was too long ago to remember.) But anyhow the original issue is now solved! Cheers.
  2. Ramsen IV

    Issue with multiple cams

    SOLVED! Yep, was as suspected and pointed out by grumpy and the error line and my suspicion in using a string such as groupID. Here is the now working code: // INIT numb = 0; tvarray = [[tv1,0],[tv1,1],[tv2,0],[tv2,1],[tv3,0],[tv3,1],[tv4,0],[tv4,1]]; // Function spawn: [_grp] spawn Cole_fnc_cams; // Cams Function params ["_group"]; numb = numb + 1; // creates unique number for each group _lead = leader _group; _str = str numb; tvarray select (tvarray pushBack (tvarray deleteAt 0)) params ["_object","_monitor"]; _object setObjectTexture [_monitor,format["#(argb,512,512,1)r2t(%1,1)",numb]]; // yay!! _lead lockCameraTo [_object, [0]]; _cam = "camera" camCreate [0,0,0]; _cam cameraEffect ["Internal", "Back", _str]; _cam attachTo [_lead, [0.35,-0.08,0.08], "neck"]; _cam camSetFov 0.75; So thanks again grumpy for helping, you pointed me to the error and finally I solved it! cheers. p.s does placing a variable (with a value such as 10 or hello) into quotes automatically make that string?? (e.g _value = 10 ; "_value" now a string??)
  3. Ramsen IV

    Issue with multiple cams

    Thanks again for the reply grumpy. Yes, I finally worked that out after several tests and you were 100% correct with your suspicion in your first post. After tests I found that I cannot use a string nor even a _variable as the value for the setObjectTexture so it has to be along the line of the format code posted above - but perhaps with a value instead of a string. e.g 1, but I cannot in anyway use groupID as the result is a string. If the issue is solved then this will not be a problem as I can simply use an ascending value using '_cannotDoThis = _cannotDoThis + 1' to create a unique value for each group spawned. As you said grumpy this must be a string but as the setObjectTexture value CANNOT be a string I therefore had to convert the value to a string using str (_str = str _cannotDoThis;) this worked perfectly when converting a predefined value for the setObjectTexture so this line is no longer a problem but the two lines (setObjectTexture & cameraEffect) are entwined. So bottom line is I need someway to solve the _cannotDoThis issue in the setObjectTexture code ... Your 'format' idea was very close but did not work with a string - I suspect it was because i was inserting a string (groups id) into a string? or quotes into quotes if you want to look at it that way, I dont know...but perhaps if I try your format idea with just a value? Anyway, I will try it out latter but any ideas in the meantime will be most helpful. cheers.
  4. Ramsen IV

    Issue with multiple cams

    Thanks for the reply Grumpy. Sadly the code threw an error: Another error quickly displayed before this one regarding _text but disappeared before I could read and the one above displayed instead... it did not show again? I'm further altering the code you, larrow and few others helped me out with a few years back: This used to create a cam feed on a single screen and then destroy the cam (before creating a new one) every time 'add action' was used to switch between groups, so now I'm trying to create a more automated and lite version using multiple screens but without add action. cheers. EDIT: I spawn the camera function as i need the script that spawns it to complete but i tried 'sleep 5; camDestroy _cam' and so the camera stops following the lead unit, but STILL the new camera just is a copy of the first? So camDestroy does not solve the duplicate issue either. Also here is the tvarray so you know what that refers to: tvarray = [[tv1,0],[tv1,1],[tv2,0],[tv2,1],[tv3,0],[tv3,1],[tv4,0],[tv4,1]]; And the function is spawned thus: [_grp] spawn Cole_fnc_cams; This might help...
  5. Hi. I'm having an issue with the below script/function, the issue is that all additional group leaders that spawn after the first use the same camera as the first groups leader? So the first group (alpha1_0) spawns and and the shoulder cam shows on the left screen of the first dual monitor... all good... The second group (alpha1_1) spawns (runs the function separately) and the 'stream' correctly shows (now on the right screen) but its the same shoulder cam as the first group alpha 1_0 (attached to the same group leader) I don't understand?? All variables are local aside from tvarray which just chooses next available monitor and i even attempted to create a unique r2t name so each r2t name is alpha1_0 alpha1_1 etc etc. So what have I done wrong? Also what exactly is 'r2t' there is very little information about what that actually is and same goes for 'turretPath' I cannot find much info on the Biki for that? (turretPath: Array - path to the turret with required camera.... what does that actually mean?) Any help appreciated. Cheers.
  6. Thx Beno that worked nicely. If there was more than one of the same type (say 4 spotters) can I use rand in addition to select 0,1,2 or 3? e.g _spotter = ((units _grp) select {typeOf _x == "I_Spotter_F"}) select rand; or more like... _spotter = ((units _grp) select {typeOf _x == "I_Spotter_F"}) selectRandom;
  7. I'm trying to locate a specific unit in group by type: (I_Sniper_F and I_Spotter_F) _spawn = selectRandom ["snipe1_0","snipe1_1","snipe1_2"]; _grp = [getMarkerPos _spawn, RESISTANCE, (configfile >> "CfgGroups" >> "Indep" >> "IND_F" >> "Infantry" >> "HAF_SniperTeam")] call BIS_fnc_spawnGroup; _grp setBehaviour "STEALTH"; _grp setCombatMode "YELLOW"; _array = units _grp; _sniper = {_x isKindOf ["Man", configfile >> "CfgVehicles" >> "I_Sniper_F"]} forEach _array; // _x is general error so this way did not work _spotter = allUnits select {typeOf "I_Spotter_F" in _array}; // type string expected object - For what? the _array or typeOf? Anyhow no luck. I finally found out how to select all flag poles by 'Type' and I tried to implement that above with soldier types for the spotter but no luck either. _types = ["Flag_AAF_F","Flag_NATO_F","Flag_White_F"]; _poles = allMissionObjects "all" select {typeOf _x in _types}; I want to do similar but for specific soldiers in groups. Cheers.