Jump to content

blasturbator

Member
  • Content Count

    106
  • Joined

  • Last visited

  • Medals

Community Reputation

10 Good

1 Follower

About blasturbator

  • Rank
    Sergeant

Recent Profile Visitors

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

  1. Yes i tried it and no it didn't work because the code isn't doing what you think it is. It doesn't add a usable addAction. It runs automatically, as i have described prior to this. I am aware that it shouldn't do that; but it does. Knowing that it does that however did let me know in advance that your solution wasn't going to work and lo it did not. The fact you are still writing things like this tells me you are not reading my whole posts and are still stuck on the idea that the script is actually behaving in a normal way despite my statements to the contrary. If it was behaving normally, i wouldn't need to ask for help. There is a reason I refer to it as "an enigma". Anyway, it is clear that it is not just me that doesn't understand the problem and to be honest i don't want to deal with it anymore. I have spent too much time trying to fix someone else's broken script already. At this point it is no longer worth the time investment when i could just use a different script. On that note; thread closed. I'm probably just going to write a new script from the ground up because something in this one is obviously broken and leaving it in there even if i found a workaround is a bad idea. I don't know if this is an engine bug or just because the script is years out of date and there have been major updates to the game since; but it is clearly not behaving like it should and working around that and pretending it's fine is not the right way to fix this problem. I don't know who wrote this script originally but it has been in the hands of several others since and it has become so bastardised in format and scripting style that it's horrible to work with; seriously you should see the rest of it, a mess of over-nested shite, bugger all commentation and poor formatting practice in general. It's best for everyone that this junk just goes back into the recesses of the internet and hopefully is not used by anyone again.
  2. Well about that, i'm not sure why it does, it's a bit of an enigma and frankly i just don't understand that line. What happens in game, when this script is run with the old code (using BIS_fnc_MP), is that addAction within "addActionMP" doesn't actually add an addAction in a normal sense, it somehow just runs immediately and calls newIntel then the object actually deletes itself once newIntel is called so the player never gets the chance to see the addAction the function adds. Maybe this is the part which doesn't work with remoteExec and is causing the script to fail... if its only purpose is to call newIntel then I don't see why it can't just be: call newIntel; ? I just want to reiterate from my first post that I didn't write this script it's an old script from years ago i'm just trying to fix it. I'm well aware that BIS_fnc_MP is outdated and that is why i'm making these posts to begin with... No need to repeatedly tell me to stop using it when it's quite obviously my intent to not use it.
  3. @Schatten Thank you for the suggestion, but the function has to run from an addAction; "addActionMP" doesn't add an addAction, it's just a weird name the original script writer gave the function. Passing those params through remoteExecCall to addActionMP wouldn't really do anything at all. For clarity, addActionMP is this: addActionMP={ private["_object","_screenMsg"]; _object=_this select 0; _screenMsg=_this select 1; if(isNull _object)exitWith{}; _object addAction[_screenMsg,"call newIntel"];}; and that calls newIntel which is this: newIntel={ private["_intelItems","_intel","_used","_ID","_cases","_case","_cache"]; _intelItems=["Land_Laptop_unfolded_F","SatPhone","Land_Suitcase_F","EvMoscow","EvMap","Land_PortableLongRangeRadio_F","Land_MobilePhone_old_F","Land_HandyCam_F","CUP_radio_b"]; _intel=_this select 0; _used=_this select 1; _ID=_this select 2; _cases=nearestObjects[getPosATL player,_intelItems,3]; if(count _cases==0)exitWith{}; _intel removeAction _ID; _case=_cases select 0; if isNull _case exitWith{}; deleteVehicle _case;player groupChat "I have obtained the intel";//call addIMkr;call iHint; _cache=cache; if(isNil "_cache")exitWith{hint "Intel suggests this place is clean. Better check elsewhere.";}; [nil,"iHint",true,false]spawn BIS_fnc_MP; [_cache,"addIMkr",false,false]spawn BIS_fnc_MP;}; which calls iHint and addIMkr which respectively are: iHint={ hint parseText format["<t align='left' color='#e5b348' size='1.2'><t shadow='1'shadowColor='#000000'>INSURGENCY</t></t> <img color='#ffffff' image='core\modules\cacheScript\Images\img_line_ca.paa' align='left' size='0.79' /> <t color='#eaeaea'>New intel acquired. Check map for clue markers within the vicinity of a cache.</t> <img color='#ffffff' image='core\modules\cacheScript\Images\img_line_ca.paa' align='left' size='0.79' />"]}; addIMkr={ private["_i","_sign","_randX","_sign2","_randY","_radius","_cache","_pos","_range","_intelRadius"]; _cache=cache; _intelRadius=1200; _i=0; while{(getMarkerPos format["%1intel%2",_cache,_i]select 0)!=0}do{_i=_i+1;}; _sign=1; if(random 100>50)then{_sign=-1;}; _sign2=1; if(random 100>50)then{_sign2=-1;}; _radius=_intelRadius-_i*(random 50); if(_radius<50)then{_radius=50;}; _randX=(random _radius); _randY=(random _radius); _pos=[(getPosATL _cache select 0)+_sign*_randX,(getPosATL _cache select 1)+_sign2*_randY]; _imkr=createMarker[format["%1intel%2",_cache,_i],_pos]; _imkr setMarkerType"hd_unknown"; _range=round sqrt(_randX^2+_randY^2); _range=_range-(_range%50); _imkr setMarkerText format["%1 m",_range]; _imkr setMarkerColor"ColorRed"; _imkr setMarkerSize[0.5,0.5]; iMkrs pushBack _imkr;}; As i've mentioned above, this series of functions does work just fine when called by the BIS_fnc_MP command. The only problem is that it isn't adding the addAction to JIP clients and i wanted to change it to remoteExec to see if that would fix it. Sadly, Cyberpunk 2077 just came out so i'm not really going to have much time to address this in the near future. I'm sure everyone will understand 😁
  4. Pierre; thank you for replying, The addActionMP function does a bunch of stuff and i suppose anything in there could be the reason it isn't working with remoteExec. It works with the old BIS_fnc_MP command except the addAction isn't added to JIP clients and i figured updating the old script to use remoteExec would fix that, a deeper rabbit hole than i thought initially... Is it likely to be something within the function even though it works using BIS_fnc_MP? are remoteExec and BIS_fnc_MP that different? I'm not really versed in the actual differences between the commands, all i know is that in this use case they're both meant to add an addAction and they're both meant to facilitate JIP clients. It's late now and i can't do any testing, but i'll look at moving the remoteExec into the same .sqf as the function as you've suggested and see how it goes. Failing that, i'll be back with the rest of the code 😁
  5. Hi all, Been a long while since i last posted on these forums. I'm having a problem converting an old script that uses BIS_fnc_MP to use the newer remoteExec. For the most part i've understood how the process works and previous things i've done have worked just fine, but in this example the script is adding an addAction that calls a function and for some reason it just won't work: The original is this (which does work but not with JIP clients, which i thought was the purpose of BIS_fnc_MP but whatever, that is why i want to update it): [[_case,"<t color='#FF0000'>Gather INTEL</t>"],"addActionMP",true,true] spawn BIS_fnc_MP; (addActionMP is the name of the function, i didn't name it 😂, the function itself works fine though, it just seems to be my implementation of remoteExec that isn't working) From this i glean that we have a call to BIS_fnc_MP with the syntax as follows: params = [_case,"<t color='#FF0000'>Gather INTEL</t>"] functionName = "addActionMP" target = true (execute on each machine) isPersistent = true (will be called now and for every JIP client) (but it doesn't...) isCall = default (false) This is what i have "updated" it to which i thought would work and i can't figure out why it doesn't: [_case, ["<t color='#FF0000'>Gather INTEL</t>",addActionMP]] remoteExec ["addAction", 0, true]; The syntax for this remoteExec i have written, as i understand it is this: remoteExec: params = [_case, ["<t color='#FF0000'>Gather INTEL</t>","addActionMP"]] functionName = addAction targets = 0 (execute globally) JIP = true in which the addAction params are (breakdown of the params for the remoteExec): object = _case title = "<t color='#FF0000'>Gather INTEL</t>" script = addActionMP So what happens is this succesfully adds the addAction, but it doesn't call the function "addActionMP" when activated. Basically i can't figure out why this won't execute the function "addActionMP" called by the addAction. I assume i've made a rookie mistake somewhere and would be grateful for some pointers.
  6. Edit: Nvm close this please. i just fixed the dedicated server issue (forgot to do an isDedicated check) so now putting the script in the vehicle init isn't required. Hey guys, i've been away from the ArmA scene for a while but it's all coming back pretty quick. I feel like ArmA is lying to me; in the init of a vehicle i have the following: nul = [this] execVM "scripts\mhq\respawnmhq.sqf"; and the first two lines of respawnmhq.sqf are: _mhqveh = _this select 0; _vehiclepos = getPos _mhqveh; So then when i launch the mission to test in the editor it has the gall to say respawnmhq.sqf has an: "Error getpos: Type Array, expected Object,Location". Correct me if I'm wrong, but there is no damn array in there right? [this] is an array with a single item from what i know but it's in the vehicle init not the script, _mhqveh is defined as the 'this' from within the array so is that causing it to think _mhqveh is an array? If so is there another way to execVM that script from the vehicle init? I'm doing this to avoid putting this script in the Init.sqf because really it doesn't need to go in there and if i do that it activates twice on dedicated servers but that's another issue entirely (which I'm pretending doesn't happen).
  7. blasturbator

    Enemy occupation system (eos)

    Does anyone know how you can define the init of the units spawned by EOS? ALiVE has (or had) a similar array style spawning method and i did it in that before but i got a new computer since then and don't have my old HDD with the script i made on it :(
  8. So i'm trying to get ace insurgency 1.50 takistan by pogoman, fireball and kol9yn working, but the server will only show up when ran as a dedicated server. Everything works fine on dedicated except the gear crates which spawn with the MHQ. On closer examination it seems the gear box is placed in the mission and named "stuffbox" which is then filled by another script. I assume it moves to the location the mhq is deployed at once the mission loads, so i am now looking for that script instead as that seems to be what isn't working. Found it (marked with a comment saying Here it is): westVehicleChecker = { private ["_vcl","_pos","_range","_driver","_plrs","_str"]; if (!alive MHQ && startLocation == MHQ) exitWith { _vcl = createVehicle [MHQTYPE, spawnPos, [], 0, "None"]; _vcl setVehicleInit format["this setVehicleVarName ""%1""; %1 = this;", "MHQ"]; processInitCommands; HQ setDir (getDir vehicleServicePoint + 90); _pos = vehicleServicePoint modelToWorld [10,0,0]; _pos set [2,0]; HQ setPosATL _pos; }; if (startLocation != HQ) exitWith {}; _pos = startLocation modelToWorld [3,20,0]; _pos set [2,0]; if (getMarkerPos "USFLAG" distance (helipad modelToWorld [0,0,0]) > 50) then { helipad setPosATL _pos; helipad setDir (getDir startLocation - 90); }; _pos = startLocation modelToWorld [0,-10,0]; _pos set [2,0]; if (getMarkerPos "USFLAG" distance (vehicleServicePoint modelToWorld [0,0,0]) > 50) then { vehicleServicePoint setPosATL _pos; vehicleServicePoint setDir (getDir startLocation - 90); vehicleServicePoint setCaptive true; }; _pos = vehicleServicePoint modelToWorld [-8,0,0]; _pos set [2,0]; if (getMarkerPos "USFLAG" distance (repairarea modelToWorld [0,0,0]) > 50) then { repairarea setPosATL _pos; repairarea setDir (getDir vehicleServicePoint); }; _pos = startLocation modelToWorld [-3,-8,0]; _pos set [2,0]; if (getMarkerPos "USFLAG" distance (baseflag modelToWorld [0,0,0]) > 50) then { baseflag setPosATL _pos; baseflag setDir (getDir startLocation); }; _pos = startLocation modelToWorld [8,0,0]; _pos set [2,0]; if (getMarkerPos "USFLAG" distance (HQ modelToWorld [0,0,0]) > 50) then { fieldHospital setPosATL _pos; fieldHospital setDir (getDir startLocation); fieldHospital setCaptive true; }; _pos = vehicleServicePoint modelToWorld [0,4,0]; _pos set [2,0]; if (getMarkerPos "USFLAG" distance (stuffbox modelToWorld [0,0,0]) > 50) then { stuffbox setPosATL _pos; //////////////////Here it is///////////////////// stuffbox setDir (getDir vehicleServicePoint - 180); }; for "_i" from 0 to (count westVehicleStrings - 1) do { _str = westVehicleStrings select _i; // isNil _str check if the vehicle is undefined // note that, _str does NOT get wrapped in quotes because _str contains the vehicle name // and we are checking for the presence of the vehicle, I assume _str whill always be a valid string if (isNil _str) then { _i call resetWestVehicle; } else { _vcl = call compile _str; // _vcl should not be NIL here .... due to ( isNil _str) protecting us // but it could be anything, so ... check its an object if (typeName _vcl=="OBJECT") then { if ( isNull _vcl) then { _i call resetWestVehicle; } else { call checkVehiclesNearbyCampObjs; if (!alive _vcl) then { _i call resetWestVehicle; } else { scopeName "main"; _range = 400; if (typeOf _vcl == ATVTYPE) then { _range = 100; }; if (typeOf _vcl == HELITYPE && heliRC == 1) exitWith { breakTo "main"; }; _plrs = nearestPlayers(getPosATL _vcl,SPAWNRANGE,false,"array"); if (alive _vcl && !arrCanSee(_plrs,_vcl,45,_range) && _vcl distance startLocation > 100) then { _driver = driver _vcl; _gunner = gunner _vcl; if (!isNull _driver || !isNull _gunner) then { if (alive _driver || alive _gunner) exitWith { breakTo "main"; }; }; { moveOut _x; } forEach (crew _vcl); _i call resetWestVehicle; }; }; }; }; }; sleep 0.01; }; }; And this is the only script that calls that function (included in the initserver.sqf): private ["_PGroup","_WCTime","_BCTime"]; _PGroup = group pilotController; _WCTime = time; _BCTime = time; while { true } do { call westVehicleChecker; if (heliRC == 1) then { call pilotAI; }; call quickCleanup; call longCleanup; if (livesLeft == 0 && time > 30) then { if (nearestPlayers(CENTERPOS,AORADIUS,true,"count") == 0) then { endMission "LOSER"; }; }; sleep 1; };
  9. blasturbator

    Medkits and a trigger bug

    Thanks for the tip, i'll see what i can do with these :)
  10. Two seperate issues again this time. I'll start with medkits, is it possible to make it so all players an use a medit to 100% heal a friendly rather than just the combat medic, without making all player slots combat medics? And secondly can anyone see why this trigger activation wouldn't work (its in a function so _this is necessary) _this setTriggerStatements ["player in thislist","nul = [intel,thistrigger] execVM 'core\modules\cacheScript\intelPickup.sqf' ", ""];
  11. blasturbator

    creating public variables

    Yeah i got this working hours ago, but thanks for replying. The hard way was necessary because i also needed to give the vehicle a varName for use as string storage so i could delete and recreate it in a function with the same name and public variable by calling on the varName to define both. Was a pain to get going but it works now :)
  12. blasturbator

    creating public variables

    That... doesn't quite answer my question or show that you even read the script snippet.
  13. blasturbator

    Description.ext CTD

    OR SO I THOUGHT. So the triggers don't want to activate for some reason. Using hints to debug i narrowed it down to that, they get created, they just wont activate. this is the statements line: _this setTriggerStatements ["player in thislist","nul = [intel,thistrigger] execVM 'core\modules\cacheScript\intelPickup.sqf' ", ""]; What i don't understand is how that suddenly doesnt work when it did work that one time. It's worked twice actually, but the rest of the time it hasn't and i didnt change a single thing in the trigger statements.
  14. would this work to make 8 things that have numbered names i.e. name1, name2, name3, etc and have a public variable for each also named name1, name2, name3, etc? for "_i" from 0 to 8 step 1 do { call compile format ["_name = 'name%1'", _i]; obj createVehicle [the createVehicle stuff]; obj setVehicleVarName _name; obj call compile format ["%1=_This ; PublicVariable '%1'",_name]; }; Also is there any way to retrieve the name of a unit? like getVehicleVarName or some magic. edit: found the answer to second question, still wondering if first would work.
  15. blasturbator

    Description.ext CTD

    It's a classname? I thought it was just the trigger name edit: Object = createTrigger [type, position] no shit, guess i shouldnt have changed that then xD I have much to learn edit: Yay it's working! man that was a hassle. Thanks very much for your help magirot, i'll put you in the mission credits ;) Now i only have one other problem to deal with and my mission is all set, until i try to add stuff to it again xD
×