Jump to content

JohnKalo

Member
  • Content Count

    1096
  • Joined

  • Last visited

  • Medals

Posts posted by JohnKalo


  1. Thank you very much for the detailed description. Still complicating since the only code training I have is a Python class. The rest is via simple experience with already existing scripts. This will need some time to be developed. I will see what I can do because time is short and I would really like the mission to be ready till the first days of August. In the worst case scenario I will use the initial setting with a sleep inbetween so as not to cause a lag freeze. Yes [this] is when directly added to the init of the unit. So many things to do and so hot these days 😓


  2. Has been some time since I asked. Mission 09 took a lot more work than expected. Anyways, all of the above do not work. There is no error or anything but the AI just does not go anywhere for some reason. Here is the script:

     

    if (!isServer) exitWith {};
    sleep random 1;
    
    // Set variables
    _unit 				= _this select 0;
    _maxWaitTime 		= if (count _this > 2) then {_this select 2} else {30};
    _excludedPositions 	= if (count _this > 3) then {_this select 3} else {[]};
    _startingPos 		= if (count _this > 4) then {_this select 4} else {-1};
    _debug 				= if (count _this > 6) then {_this select 6} else {false};
    
    
    _position = getPos _unit;
    _house = nearestBuilding _unit;
    _numOfBuildingPos = 0;
    _currentBuildingPos = 0;
    _lastBuildingPos = 0;
    _waitTime = 0;
    _timeout = 0;
    
    
    _name = vehicleVarName _unit;
    
    
    if (isNil _name) then 
    {
    	_name = format["Guard x%1y%2", floor (_position select 0), floor (_position select 1)]
    };
    
    
    _unit setBehaviour "SAFE";
    _unit setBehaviour "UP";
    	
    
    
    // Find number of positions in building
    while {!((_house buildingPos _numOfBuildingPos) isEqualTo [0,0,0])} do {
    	_numOfBuildingPos = _numOfBuildingPos + 1;
    };
    
    // DEBUGGING - Mark house on map, mark building positions ingame, broadcast information
    if (_debug) then {
    	for [{_i = 0}, {_i <= _numOfBuildingPos}, {_i = _i + 1}] do	{
    		if (!(_i in _excludedPositions)) then {	
    			_arrow = "Sign_Arrow_F" createVehicle (_house buildingPos _i);
    			_arrow setPos (_house buildingpos _i);
    		};
    	};
    	player globalChat format["%1 - Number of available positions: %2", _name, _numOfBuildingPos]; 
    	if (count _excludedPositions > 0) then
    	{
    		player globalChat format["%1 - Excluded positions: %2", _name, _excludedPositions]; 
    	};
    	
    	_marker = createMarker [_name, position _unit];
    	_marker setMarkerType "mil_dot";
    	_marker setMarkerText _name;
    	_marker setMarkerColor "ColorGreen";
    };
    
    // Put unit at random starting pos.
    while {_startingPos in _excludedPositions || _startingPos < 0} do {
    	_startingPos = floor(random _numOfBuildingPos);
    };
    
    if (_startingPos > _numOfBuildingPos - 1) then {
    	_startingPos = _numOfBuildingPos - 1
    };
    
    if (_numOfBuildingPos > 0) then {
    	_unit setPos (_house buildingPos _startingPos); 
    	_unit setPos (getPos _unit);
    };
    
    // DEBUGGING - broadcast starting position
    if (_debug) then {
    	player globalChat format["%1 - starting at building pos %2", _name, _startingPos]
    };
    
    // Have unit patrol inside house
    while {alive _unit && (_numOfBuildingPos - count _excludedPositions) > 0} do {
    
    	if (_numOfBuildingPos < 2) exitWith {};
    	
    	while {_lastBuildingPos == _currentBuildingPos || _currentBuildingPos in _excludedPositions} do	{
    		_currentBuildingPos = floor(random _numOfBuildingPos);
    	};
    	
    	_waitTime = floor(random _maxWaitTime);
    	_unit doMove (_house buildingPos _currentBuildingPos);
    	_unit moveTo (_house buildingPos _currentBuildingPos);
    	sleep 0.5;
    	_timeout = time + 50;
    	waitUntil {moveToCompleted _unit || {moveToFailed _unit || {!alive _unit || _timeout < time}}};
    	if (_timeout < time) then {_unit setPos (_house buildingPos _currentBuildingPos)};
    	
    	// DEBUGGING - move marker to new position
    	if (_debug) then {
    		_name setMarkerPos position _unit; 
    		_text = format["%1: moving to pos %2", _name, _currentBuildingPos]; 
    		_name setMarkerText _text;
    	};
    	
    	sleep _waitTime;
    	_lastBuildingPos = _currentBuildingPos;
    };
    
    // DEBUGGING - Change marker color if script ends
    if (_debug) then {
    	player globalChat format["%1 - ended house patrol loop", _name];
    	_name setMarkerColor "ColorRed";
    };

    I should again mention that the script is not mine but by Tophe of Östgöta Ops [OOPS] . In usual circumstances the above would not be needed since for realism all units load at the start but with Mission 10 it will be needed. Oh and the directions of the author:

     

    Quote

    HOW TO USE:
    Place unit close to a house and put this in the init field:  
    guard = [this] execVM "HousePatrol.sqf"

     

    The above script has been changed a bit. There were many other optional settings for the patrol but they had optimization issues while not offering anything so with my spectacular scripting skills I just erased all parts that were not needed 😂


  3. It is indeed way too complicated. Them taking of and being in formation is nearly impossible. Only way would be to have them in the air with a disable simulation and when the time comes careless mode and the bomb waypoint. There is however high chance the planes will crash into each other. Then after the bomb run you will have to equip them with bullets ammo so as for them to start fighting. Then have a waypoint created for them to land when bullets are out. Then a trigger rearming them. Then a take off waypoint which is full of glitches.  And then the same in a loop.

     

    So in short it will be a masochistic process which will most likely have not good enough results. 

    • Like 3

  4. @BenFromTTG Hello, sorry for the late reply. Had to open the editor and I am in an exam period. I encountered a similar issue. Here is how I solved it:

     

    DistanceToReach = 50; 
      
    this addAction   
    [   
        "Turn On",   
        {   
            params ["_target", "_caller", "_actionId", "_arguments"];   
      {   
      [_x, "ON"] remoteExec ["switchLight",0,true];    } forEach (nearestObjects [_caller, [], DistanceToReach]); 
      _target animateSource ["switchposition",-1];   
      _target animateSource ["light",1];   
      _target setDamage 0;   
        },   
        [],   
        1.5,   
        true,   
        true,   
        "",   
        "alive _target",   
        3,   
        false,   
        "",   
        ""   
    ];

    About the light I have not noticed. All seemed to work as intended.

    • Like 2

  5. Mission Updates!

     

    As we are slowly approaching the final mission we want everything to be as good as it can be. Due to that Missions 01, 05 and 08 have been updated. By accident I discovered a way to make the video media files much better. Due to that no more pixel looking videos! All video qualities have been greatly enhanced while the mission sizes are still good. The biggest mission is about 75 Mb. A quality change example:

     

    33.png

     

    As it can be clearly seen the one on the right is the old pixel version. But the quality enhacements are not the only news we have ready!

     

    The Defying the Odds Campaign has just acquired an official trailer! Any comments and feedback regarding it is more than welcome! Enjoy!

     

     

    • Like 2

  6. Completely untested maybe this could work:

     

    TAG_Voices = ["Male01FRE","Male02FRE","Male03FRE","Male01ENGFRE","Male02ENGFRE"];
    
    {
    
      _unit = _x;
    
     if ((group (side _unit)) == "INDEPENDENT") then
    
     {
    
      _voice = selectRandom TAG_Voices ;
     [_unit, "_voice"] remoteExec ["setSpeaker", 0, _unit];
    
      };
    
     } forEach allUnits;

    For the textures you can try using the obj setObjectTextureGlobal [selection, texture] through a trigger. Triggers are meant to work for all clients and hosts so you can place a condition true trigger and place the texture lines you want there. That will most likely work. The two textures corespond to the "selection" of the command. The selection can be 0 or 1 or 2 if I recall correctly. Hope the above work as intended!!! 


  7. 22 hours ago, fin_soldier said:

    But I figured a way for the animations work with this:

    
    [villager, "Acts_AidlPsitMstpSsurWnonDnon_out"] remoteExec ["playmove", 0];

     

    18 hours ago, fin_soldier said:

    By the way, I think the arsenal problem got solved. Thanks!

    Glad to hear that!

     

    22 hours ago, fin_soldier said:

    I tried to execute the voices remotely by placing the command below in unit init:

    
    [this, "Male01FRE"] remoteExec ["setSpeaker", 0, this];

    Since the wiki says to run the above on the server you can try placing the above in the initServer.sqf . If you have not got one you can create one. With this being the name of each unit. Either seperately or with a forEach command.

     

    22 hours ago, fin_soldier said:

    Now the textures I'm using setObjectTextureGlobal, but there's something interesting going on.

    The error pops up always in the beginning, but some textures are visible for the client and the ones that are not shown are visible to the host, and vice versa.

    What does the error say please? And the setObjectTextureGlobal is used for a screen, a vehicle, a unit or something else? Does it refer to a .jpg file or something else.


  8. Quote

    Interestingly, boxes which I've added ammo into through the equipment category is able to be taken.

    Found this and in the buttom there is a solution:

    https://feedback.bistudio.com/T126030

    Seems to be caused by using the Arsenal when in the editor for some reason. Interesting indeed because it happens only to certain people. But Arma 3 has such things 🙂

     

    Quote

    For the textures I'm using:

    Okay and for what sort of textures are we talking about please? A screen, a car or something else?

     

    Quote

    There was a particular SQF that didn't seem to run, in which the players rescue a bunch of villagers being held captive:

    A simple solution would be to create or add at the end of the initPlayerLocal.sqf :

     

    waitUntil {condition of the trigger goes here};

    and then copy paste what you have in the .sqf file. Extra care because the waitUntil means that the rest of the initPlayerLocal.sqf will not run before the condition is met. So for conditions that will be met prior to the rescue hostages one should be before the particular waitUntil command.

    Quote

     

    It's funny because, it worked earlier in testing. It's like it sometimes runs and sometimes not.

    How should I go about making the animations play for the AI villagers?

     

    In Arma 3 strange things happen. A few days back in the description.txt I had a path "\images\image.jpg" and it did not work. For music and other images it does but for the particular image it needed "images\image.jpg". You mean the animations in the .sqf file? By the method above. If not still the same method. Hope all works 👍


  9. Quote

    - Not being able to pick up ammo from dead unit's inventory, except for the host.

    Really strange. Might be an addon issue?

     

    Quote

    - Custom textures don't seem to load always, but sometimes.

    Are you using this one:

    object setObjectTexture [selectionNumber,texture];

    or this one:

    obj setObjectTextureGlobal [selection, texture];

     

    Quote

    - It seems like some triggers / SQF files don't fire at all, breaking some tasks.

    Triggers should work for all in most cases. What do those .sqf files have in them though?
     

    Quote

     

    - AI speech doesn't seem to match what I set in the identity of units.

     

    Seeing the other post too I do not think there is vanilla French. Maybe a mod issue here. In any case you can try this:

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

    Quote

     

    - playMove / enableAI "move" doesn't seem to execute. 

     

    PlayMove, taking as granted that it works in the Eden editor, needs to be run in the initPlayerLocal.sqf so as to run for all. Otherwise it only works for the host. A remoteExec might work too. The enableAI seems strange. Once that it was reported on one of our missions it was an addon issue as well. You can try a PATH instead of MOVE or a Simulation if the MOVE does not work.

     

    Hope it all goes well in the end! Spending dozens of hours for a mission and seeing it is yet to work is really a pain   :smash:

    • Like 2

  10. No mission release here but .... an update!

     

    • To start with Episode 09 is ready for testing! It took some extra time with adding extra ingame content but everything should be sweet and running.
    • As for the last misison, Episode 10, we are having some issues with some scripts and overall optimization. While classes and exams do cause delays.
    • The date of delivery remains however the same. Somewhere around the coming August.
    • Last but not least, there will be two possible endings according to your ingame choices. No spoilers here but it would be nice to keep a close eye on how the story develops

    go.jpg

     

    • Like 1

  11. Are we talking about a human player that you cannot get him in the helicopter? Because if so this is confusing:

     

    Quote

    Once the Ghosthawk lands, I can't get the player in the helo for the extraction. I've tried the On Activation (helicopter name) land "get in" script on the land waypoint but it doesn't work. I've also tried the load waypoint after the land waypoint which didn't work either. 

     

     

     

×