Jump to content

HazJ

Member
  • Content Count

    2756
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by HazJ


  1. Moi,

    Make sure the speaker is valid. Try with another to make sure just in case. It could be the Wiki just doesn't have all the speakers listed. I'm not able to go in-game to fetch them all currently. The error is because you are wrapping the _variable inside quotes.

    {
        if (side _x isEqualTo independent) then {
            _voice = selectRandom ["Male01GRE", "Male02GRE", "Male03GRE", "Male04GRE", "Male05GRE"];
            [_x, _voice] remoteExec ["setSpeaker", 0, _x];
        };
    } forEach allUnits;

    The Wiki lists the following:

    Male01_F - Male01ENG(B) - Male01GRE - Male01PER
    Male02_F - Male02ENG(B) - Male02GRE - Male02PER
    Male03_F - Male03ENG(B) - Male03GRE - Male03PER
    Male04_F - Male04ENG(B) - Male04GRE - Male01PER
    Male05_F - Male05ENG - Male05GRE - Male02PER
    Male06_F - Male06ENG - Male02GRE - Male03PER
    Male07_F - Male07ENG - Male03GRE - Male01PER
    Male08_F - Male08ENG - Male04GRE - Male02PER

     

    • Like 2

  2. Moi 🙂

    These are locality issues.

    We are going to need some more code before we can help you further. For the action, you can setup the actions either on the server or add them for JIP. As for your code above, some tips:

    Use a forEach loop for repeated actions. (small snippet) e.g.

    v9 setBehaviour "CARELESS";
    v2 setBehaviour "CARELESS";
    v7 setBehaviour "CARELESS";
    v9 playMove "Acts_AidlPsitMstpSsurWnonDnon_out";
    v2 playMove "Acts_AidlPsitMstpSsurWnonDnon_out";
    v7 playMove "Acts_AidlPsitMstpSsurWnonDnon_out";
    
    {
    	_x setBehaviour "CARELESS";
    	_x playMove "Acts_AidlPsitMstpSsurWnonDnon_out";
    } forEach [
    	v9,
    	v2,
    	v7
    ];

    You need to broadcast animations over the network using the remoteExec command. setObjectTexture has a global version, setObjectTextureGlobal as JohnKalo said. How are you creating your triggers? Eden or scripted? What is in the cond and on act fields?

    • Like 1

  3. 22 minutes ago, Varathius said:

    Dear moderator,

    Instead of hiding/editing every post regarding bugs due to potential spoilers, how about edit the main topic thread title (WARNING SPOILERS), because no wonder nobody is giving any feedback nor helping with getting answers if you moderators keep editing and hiding all the posts, seriously. There's basically no other platform to discuss these bugs and the one there is you guys are editing and making the problems inadvertent not being noticed by others that could help. 

    I'm not trying to "back-seat moderate" here but...

    If you read one post up from yours, you would know that you can simply put your post in spoiler tags. It is also in the forum rules. That way, everyone is happy. You can report bugs and people don't see spoilers (unless they choose to).

     

    It is too much hassle for moderators to be editing every potential thread that contains spoilers. Some people just want to provide feedback and have a quick read/catchup.

     

    People are providing feedback, go back a few pages and you'll see.

    • Like 1

  4. What's wrong with storing the position/object as the player looks at it and commands the unit? If I have understood correctly. You call an action, the object you are looking at is the thing that will be climbed. By the time the AI unit gets there to climb, there's no longer a reference because the player isn't looking at the object anymore? Do you have any code to share?

     

    As Pierre said. You can pass arguments to the addAction command.

     

    // Placed a unit down named Bov
    // Looked at a building, selected the "Climb it" action then looked away
    // Bov successfully moves to the correct building
    
    // This method will be fine though obviously you'll want to do your checks such as valid position/object, is it a position or object, etc, etc
    player addAction ["Climb it", {
        _object = getPosATL cursorObject;
        systemChat str _object;
        uiSleep 2;
        player setPos _object;
        Bov commandMove _object;
    }];
    
    // Not ideal as cursorObject is never updated
    player addAction ["Climb it", {
        _object = (_this#3)#0;
        systemChat str _object;
        uiSleep 2;
        player setPos getPosATL _object;
        Bov commandMove getPosATL _object;
    }, [cursorObject]];

    One thing I did notice is that, sometimes it failed to get the object I was directly looking at, despite my cursor revealing the object. Make sure the object is properly revealed.

     

    Please provide some code so we can help better. Perhaps some code optimisation / refactoring will do the trick.

    • Like 1
    • Thanks 1

  5. Moi,

    You can use the format command.

    https://community.bistudio.com/wiki/format

    _townName = "Kavala";
    _taskTitle = format ["Task at %1", _townName];
    
    [west, ["task2"], ["Good luck finding this cookie", format ["Find the cookie at %1", _townName], "cookiemarker2"], objNull, 1, 3, true] call BIS_fnc_taskCreate;

    You'll need to figure out how to get the the actual town name itself. If you have the a marker or position. You could use nearestLocation and text commands. There are many ways to do it. You need to provide more information.

    https://community.bistudio.com/wiki/nearestLocation

    https://community.bistudio.com/wiki/text

    • Like 1

  6. You could use a simple trigger. When the man is not inside, it completes. You could sync it to a task. I'm not sure how you have things setup. Could you provide some more information? I don't really use the Editor for anything other than playable units and respawn markers. I'm on mobile at the moment so I can't be much help. Search the Wiki for 'in' and 'list'.

     

    !unit1 in thislist

    • Like 1

  7. Hi all,

    I have this little function that creates booby traps on doors. I can't seem to figure out how to return the direction of a door though. Any ideas?

    /*
    	Code written by Haz
    */
    
    scriptName "fn_doorBoobyTraps";
    #define __FILENAME "fn_doorBoobyTraps.sqf"
    
    // #include "..\..\..\includes.sqf"
    
    // __tky_starts;
    
    CQBCleanupArr = [];
    pt_tripmines = [];
    
    // TODO: Code refactoring
    
    // (?) TODO: Switch to a blacklist approach rather than whitelist?
    _eligibleBuildings = [
    	/*
    	"Land_building_Big_01_F",
    	"Land_building_Small_01_F",
    	"Land_building_Small_02_F",
    	"Land_building_Small_03_F",
    	"Land_building_Small_04_F",
    	"Land_building_Small_05_F",
    	"Land_building_Small_06_F",
    	"Land_Shed_02_F",
    	"Land_Shed_05_F",
    	"Land_Shop_Town_01_F",
    	"Land_Shop_Town_03_F",
    	"Land_Slum_01_F",
    	"Land_Slum_03_F",
    	"Land_i_building_Big_01_V2_F",
    	"Land_i_building_Big_02_V1_F",
    	"Land_i_building_Big_02_V2_F",
    	"Land_i_building_Big_02_V3_F",
    	"Land_i_building_Small_02_V2_F",
    	"Land_i_building_Small_02_V3_F",
    	"Land_i_Shed_Ind_F",
    	"Land_i_Stone_buildingSmall_V1_F",
    	"Land_i_Stone_buildingSmall_V2_F",
    	"Land_i_Stone_buildingSmall_V3_F",
    	"Land_u_building_Big_01_V1_F",
    	"Land_u_building_Small_02_V1_F"
    	*/
    ];
    
    _fnc_getDoors = {
    	params ["_building"];
    	_buildingPositions = _building buildingPos -1;
    	_buildingPosition = selectRandom _buildingPositions;
    	hintSilent str selectionNames _building;
    	{
    		_arrow = "Sign_Arrow_Cyan_F" createVehicleLocal _x;
    		_arrow setPosATL _x;
    	} forEach _buildingPositions;
    	_doors = [];
    	_doorPositions = [];
    	_worldPos = [];
    	_inModelPosition = [];
    	{
    		if (_x find "door" >= 0 and _x find "handle" < 0) then {
    			_doors pushBack _x;
    			_inModelPosition = _building selectionPosition _x;
    			hintSilent str _inModelPosition;
    			_arrow = "Sign_Arrow_Yellow_F" createVehicleLocal [0, 0, 0];
    			_arrow setPos (_building modelToWorld _inModelPosition);
    			// _doorPositions pushBack (getPosATL _arrow);
    			_doorPositions pushBack [getPosATL _arrow, 0]; // TODO: Figure out how to return the direction of a door
    		};
    	} forEach selectionNames _building;
    	_doorPositions
    };
    
    _fnc_createMine = {
    	params ["_pos", "_dir"];
    	_building = nearestBuilding _pos;
    	_m = createMine ["APERSTripMine", _pos, [], 0];
    	_m setDir _dir;
    	CQBCleanupArr pushBack _m;
    	pt_tripmines pushBack _m;
    	// [_m, "mymine"] call fnc_setVehicleName;
    	_m
    };
    
    {
    	_doors = _x call _fnc_getDoors;
    	{
    		_x params ["_pos", "_dir"];
    		systemChat format [":: %1", _x];
    		[_pos, _dir] spawn _fnc_createMine;
    	} forEach _doors;
    } forEach nearestObjects [player, _eligibleBuildings, 500];
    
    // __tky_ends;

    There are some elevation issues that I haven't addressed yet. Though that isn't the focus at the moment.

     

     

    • Like 2
×