Jump to content
RS30002

cant get HQ to work

Recommended Posts

talkactionsmglr = fuelsmuggler addAction ["Talk to the smuggler", {fuelsmuggler removeAction talkactionsmglr; HQ4 sidechat "You're late!";}, [], 6, true, true, "", "(fuelsmuggler distance player)<5"];

 

What must i do so that the HQ4 does the sidechat? Action gets removed, but there is no sidechat. HQobject named HQ4 is placed in editor, this action is attached through  scripts outside of the editor. (spawn script that spawns all the objects, makes a task etc etc)

 

ty for any insights!

Share this post


Link to post
Share on other sites

Hi, make sure that player has radio in his inventory and HQ4 is on the same side as player, otherwise sideChat won't appear.

Share this post


Link to post
Share on other sites
11 hours ago, soldierXXXX said:

Hi, make sure that player has radio in his inventory and HQ4 is on the same side as player, otherwise sideChat won't appear.

 

 

Yes, i have the radio. And the speaker is civilian. The other 3 civilians work (HQ, HQ2, HQ3) if set up with the HQ entity module. It's something with the code....

Share this post


Link to post
Share on other sites

Code is alright, but may i ask you how exactly you set up HQ entities ? Pictures/Video would be ideal so we can see where might be the problem. if you do it via module, just assign HQ4 variable to module itself and it should work. If you want to have unit as HQ you can put in it's init

[this] call BIS_fnc_moduleHQ;

that should also work. Only one unit/module can be set per side. What unit/module is assigned as HQ entity you can check with

missionnamespace getvariable ["BIS_fnc_moduleHQ_HQs",[objnull,objnull,objnull,objnull]];

or for specific side only 

[civilian] call BIS_fnc_moduleHQ;

Basically when you read through the code you'll see that only one object can be set as HQ entity, that means when you place two HQ entity modules or assign more than 1 unit per side only one will be used as HQ entity.

Share this post


Link to post
Share on other sites
2 hours ago, soldierXXXX said:

Code is alright, but may i ask you how exactly you set up HQ entities ? Pictures/Video would be ideal so we can see where might be the problem. if you do it via module, just assign HQ4 variable to module itself and it should work. If you want to have unit as HQ you can put in it's init


[this] call BIS_fnc_moduleHQ;

that should also work. Only one unit/module can be set per side. What unit/module is assigned as HQ entity you can check with


missionnamespace getvariable ["BIS_fnc_moduleHQ_HQs",[objnull,objnull,objnull,objnull]];

or for specific side only 


[civilian] call BIS_fnc_moduleHQ;

Basically when you read through the code you'll see that only one object can be set as HQ entity, that means when you place two HQ entity modules or assign more than 1 unit per side only one will be used as HQ entity.

 

Ugh...i went to do the screenshots and noticed that the dude that doesn't work (HQ4) is actually CSAT (east)....so i gave you wrong info....imma try to make him a civilian and dress him up as CSAT and see what happens.

 

ty for the responses (might need more help, depending how it goes!)

Share this post


Link to post
Share on other sites

so i tried it with a dressed up civilian and it still doesn't work....

 

relevant part of script...as for the pictures, not sure what use they would be? i can make a screenshot of the spot where this civilian spawns and thgere's a HQ entity module there and that's it.

 

Like, i suspect it's getting messed up with the combo of a spawned unit and the HQ module doesn't get "attached" to it somehow? but idk for sure...tried synchronizing them in the script,  but no success...

 

_makeTask1 = [["VTask01","VParentTask01"],player,["Meet the corrupt officer selling fuel. Use the vehicle your contact has provided.","Obtain fuel.",""],[3788.16,37133,0],"ASSIGNED",1,true,true,"refuel"]; 
fuelsmugglertruck ="O_T_Truck_02_fuel_F" createVehicle [3788.16,37133,0];
sleep 0.1;
fuelsmugglertruck setDir 0;
fuelsmugglertruck setVehicleLock "LOCKED";
fuelsmugglertruck setFuel 0;
fuelsmugglers = creategroup civilian;
sleep 0.2;

fuelsmuggler = fuelsmugglers createUnit ["C_Man_casual_8_F_asia", [3786.71,37127.7,0], [], 0, "NONE"];
fuelsmuggler disableAI "path";
HQ4 synchronizeObjectsAdd [fuelsmuggler];

removeAllWeapons fuelsmuggler;
fuelsmuggler forceAddUniform "U_O_T_Officer_F";
/*fuelsmuggler unassignItem "O_NVGoggles_ghex_F"; 
fuelsmuggler removeItem "O_NVGoggles_ghex_F";  
fuelsmuggler unassignItem "V_HarnessOGL_ghex_F"; 
fuelsmuggler removeItem "V_HarnessOGL_ghex_F"; */
fuelsmuggler addHeadgear "vn_o_helmet_nva_03";
fuelsmuggler dowatch OPFORscramble;


csatester setpos [3786.09,37122.6,0];
csatester setDir 0;

talkactionsmglr = fuelsmuggler addAction ["Talk to the smuggler", {fuelsmuggler removeAction talkactionsmglr; call{HQ4 sidechat "You're late!"};}, [], 6, true, true, "", "(fuelsmuggler distance player)<5"];

 

Share this post


Link to post
Share on other sites

HQ module can't work with synchronized objects. The code is not adjusted for it. What module does is simply creates the HQ entity on itself. If you want to set unit as HQ entity you need to add line [fuelsmuggler] call BIS_fnc_moduleHQ; to your code. This way there shouldn't be HQ module present in the mission (would be useless). Also you would have to change HQ4 sidechat "You're late!" to fuelsmuggler sidechat "You're late!", but i don't see any benefit of setting unit as HQ entity.

Share this post


Link to post
Share on other sites
1 hour ago, soldierXXXX said:

HQ module can't work with synchronized objects. The code is not adjusted for it. What module does is simply creates the HQ entity on itself. If you want to set unit as HQ entity you need to add line [fuelsmuggler] call BIS_fnc_moduleHQ; to your code. This way there shouldn't be HQ module present in the mission (would be useless). Also you would have to change HQ4 sidechat "You're late!" to fuelsmuggler sidechat "You're late!", but i don't see any benefit of setting unit as HQ entity.

 

 

idk, doesn't seem to be working. the remove action part of the code works, just the HQ thingy doesn't. (yes, i removed the module, put the createHQ line in the script and am calling it as fuelsmuggler sidechat in the script.

 

found this tho, gonna try it, if someone can tell me how to initialize it as fuelsmuggler's module (probably in the setvariable line)

 

 

private _moduleGroup = createGroup sideLogic;
"ModuleSmokeWhite_F" createUnit [
	getPosATL player,
	_moduleGroup,
	"this setVariable ['BIS_fnc_initModules_disableAutoActivation', false, true];"
];

 

Share this post


Link to post
Share on other sites
[] spawn {
if !("ItemRadio" in assignedItems player) then {player linkItem "ItemRadio";};
fuelsmugglertruck ="O_T_Truck_02_fuel_F" createVehicle position player; 
sleep 0.1; 
fuelsmugglertruck setDir 0; 
fuelsmugglertruck setVehicleLock "LOCKED"; 
fuelsmugglertruck setFuel 0; 
fuelsmugglers = creategroup civilian; 
sleep 0.2;
fuelsmuggler = fuelsmugglers createUnit ["C_Driver_4_F", position player, [], 0, "NONE"]; 
fuelsmuggler disableAI "path";
removeAllWeapons fuelsmuggler; 
fuelsmuggler forceAddUniform "U_O_T_Officer_F"; 
fuelsmuggler unassignItem "O_NVGoggles_ghex_F";  
fuelsmuggler removeItem "O_NVGoggles_ghex_F";   
fuelsmuggler unassignItem "V_HarnessOGL_ghex_F";  
fuelsmuggler removeItem "V_HarnessOGL_ghex_F";
fuelsmuggler addHeadgear "vn_o_helmet_nva_03";
[fuelsmuggler] call BIS_fnc_moduleHQ;
talkactionsmglr = fuelsmuggler addAction ["Talk to the smuggler", {fuelsmuggler removeAction talkactionsmglr;fuelsmuggler sidechat "You're late!";}, [], 6, true, true, "", "(fuelsmuggler distance player)<5"];
};

Last try. Can you start the game without any mod, open virtual reality map, place any civilian as player and execute this code from debug console to see if it works the way you intended ? Because if not, then i'm pretty sure it's not the code that is causing this.

Share this post


Link to post
Share on other sites
1 hour ago, soldierXXXX said:

Last try. Can you start the game without any mod, open virtual reality map, place any civilian as player and execute this code from debug console to see if it works the way you intended ? Because if not, then i'm pretty sure it's not the code that is causing this.

 

It's working here. (the error is related to the object the npc is supposed to look at, it's not in this map). The sidechat does appear.

 

 

dsdsdsd.jpg

 

So, i took that whole block that's working in the virtual reality and pasted it into the script on the live map and it didn't work lol

 

Thought i'd mention this too, am constantly getting this error when i use the script, but up until now i thought it's because i haven't really written the code to specify how one of the objectives gets done, i just wrote the variable for the completion.  Now im thinking it may have to do something with this.dsdsdsdsdsdsdsd.jpg

 

 

relevant bits of rpt (i think)

16:55:12 "VCOM: Loaded CBA settings"
16:55:13 Error in expression <};

private ["_text"];

{
    _text = _txt param [_forEachIndex,"",["",[]]];
    if (t>
16:55:13   Error position: <param [_forEachIndex,"",["",[]]];
    if (t>
16:55:13   Error Type Object, expected Array,String
16:55:13 File /temp/bin/A3/Functions_F/Tasks/fn_setTask.sqf..., line 210
16:55:13 [ACE] (repair) INFO: O_T_Truck_02_fuel_F: hitlbwheel no selection: using armorComponent wheel_1_4_hide
16:55:13 [ACE] (repair) WARNING: [O_T_Truck_02_fuel_F: hitlbwheel: wheel_1_4_hide] armorComponent does not exist?
16:55:13 [ACE] (repair) INFO: O_T_Truck_02_fuel_F: hitrbwheel no selection: using armorComponent wheel_2_4_hide
16:55:13 [ACE] (repair) WARNING: [O_T_Truck_02_fuel_F: hitrbwheel: wheel_2_4_hide] armorComponent does not exist?
16:55:14 No face for C Base:1
16:55:14 unable to get word:'Ready' in protocol:'radioprotocolgre'

In any case, ty for your time and patiernce.

Share this post


Link to post
Share on other sites
27 minutes ago, Rok Stuhne said:

(the error is related to the object the npc is supposed to look at, it's not in this map)

I overlooked that 😄 Corrected.
I still can't see what might cause this not to work. I would probably require full code and possibly structure of the mission folder to fully understand, but i don't think anything should be able to do this. The second picture is different problem.

Share this post


Link to post
Share on other sites
21 hours ago, soldierXXXX said:

I overlooked that 😄 Corrected.
I still can't see what might cause this not to work. I would probably require full code and possibly structure of the mission folder to fully understand, but i don't think anything should be able to do this. The second picture is different problem.

 

ait, last try for me too, before i scrap it all and make the NPC permanent along the lines of the other talking civilians and just attach tasks to him.......but, could this be relevant? 

16:55:14 No face for C Base:1
16:55:14 unable to get word:'Ready' in protocol:'radioprotocolgre'

like, i keep getting this guy out of the spawn, even if i specify its a civilian Asian from vanilla game or a Viet civilian from the dlc.

 

dfdfdfdf.jpg

 

for full transparency, this is the setup of the others:

 

civilian init:

call{fisherman2active = false; talkaction2 = fisherman2 addAction ["Talk to The Fisherman", {fisherman2active = true}, [], 6, true, true, "", "(fisherman2 distance player)<4"];}

condition of the trigger next to it:

call{fisherman2active};

and activation of said trigger: 

 

call{HQ2 sidechat "You want the passcard to the chopper eh? Take the inflatable to the shipwrecks out west and bring me a few fish."; fisherman2 removeAction talkaction2; [this] execVM "JBOY_FISH\JBOY_FishSubQuest.sqf"; fishpbx setVehicleLock "UNLOCKED";}; 

 

its how i found it working in a composition. There is an HQ module next to it, called HQ2 and it results in: 

 

khhfhd.jpg

  • Like 1

Share this post


Link to post
Share on other sites

I don't think this is relevant. No Face is cfgIdentity config error with identity that moduleHQ function automatically assigns to logic/unit because in config is face = ""; nothing serious.
Unable to get word, again it's config error somewhere in RadioProtocolGRE. You can't do anything about it.
what might be relevant is 

16:55:13 Error in expression <};

private ["_text"];

{
    _text = _txt param [_forEachIndex,"",["",[]]];
    if (t>
16:55:13   Error position: <param [_forEachIndex,"",["",[]]];
    if (t>
16:55:13   Error Type Object, expected Array,String
16:55:13 File /temp/bin/A3/Functions_F/Tasks/fn_setTask.sqf..., line 210

that points to wrong syntax used with BIS_fnc_setTask.
Not sure if you put anything else between removeAction and sideChat. If there is other code between that might fail silently (no error message) it would stop the code and that would be the reason you might not see sideChat appearing. You might try to switch 

fuelsmuggler sidechat "You're late!";fuelsmuggler removeAction talkactionsmglr;

and see if the action get's removed. Also you can try to insert debuging hint after each command to see how far the code reaches before it fails. That's the only thing that got on my mind that would cause this behavior 😄 If not then i have to say, i don't know 😄

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×