Jump to content

jshock

Member
  • Content Count

    3059
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by jshock


  1. Here is a small update to it, to check for any that return "", and it will place a marker on that position, so you can visually see where and what it is so possibly you can find the classname elsewhere:

    _buildingClasses = [];
    _trackerVar = 0;//just so you can see progression of the script, as well as how many classnames there are in the end
    _unknown = 0;
    _buildings = nearestObjects [[0,0,0],["Building"],(worldSize/2)];
    
    {
    	if !(typeOf _x in _buildingClasses) then
    	{
    		_buildingClasses pushBack (typeOf _x);
    		_trackerVar = _trackerVar + 1;
    	};
    	if (typeOf _x == "") then
    	{
    		_unknown = _unknown + 1;
    		_mrk = createMarker [format["building%1",_forEachIndex],(getPos _x)];
    		_mrk setMarkerShape "ICON";
    		_mrk setMarkerColor "ColorBlack";
    		_mrk setMarkerType "hd_dot";
    	};
    	hintSilent str(_trackerVar);
    } forEach _buildings;
    
    diag_log str(_buildingClasses);//rpt
    copyToClipboard str(_buildingClasses);//clipboard
    
    hintC format ["Building Search Complete. Buildings Found: %1\nUnknown Found: %2",_trackerVar,_unknown];
    
    • Like 2

  2. You could try something like this, I'm not sure if it works, and it probably isn't very efficient overall, but it is a one and done deal so...:

    _buildingClasses = [];
    _trackerVar = 0;//just so you can see progression of the script, as well as how many classnames there are in the end
    _buildings = nearestObjects [[0,0,0],["Building"],(worldSize/2)];
    
    {
    	if !(typeOf _x in _buildingClasses) then
    	{
    		_buildingClasses pushBack (typeOf _x);
    		_trackerVar = _trackerVar + 1;
    	};
    	hintSilent str(_trackerVar);
    } forEach _buildings;
    
    diag_log str(_buildingClasses);//rpt
    copyToClipboard str(_buildingClasses);//clipboard
    
    hintC format ["Building Search Complete. Buildings Found: %1",count _buildingClasses];
    
    • Like 2

  3. No need to setPosATL after the unit is already created on that position in the first place, and just for sake of, since I'm not sure if it makes a difference or not, the "special" parameter options are in all caps, so lets make that so:

     

    _pos = [14745.541,17.91,16732.02];
    guard1 = guardgrp createUnit ["Exile_Guard_01", _pos ,[],0,"FORM"];
    guard1 setDir 270;

  4. Ok, with further testing, it seems the "center" of the flag pole is not at ground level, but halfway up the pole itself, therefore, on the distance check, the action doesn't show up until you are basically right on top of the flag pole, so for sake of it working, take out the distance check in the condition, leaving just the variable check:

    "(_this getVariable ['allowRecruitment',false])"
    • Like 1

  5. hey jshock first I never give up second yes I am a bit crazy and third thank you I see your example does work for sure. I am going to see why it did not work using Bon's Infantry Recruitment Redux script.

     

    It's not the script, I don't believe, the flag pole itself doesn't allow actions to be added....so....I have no clue if it's me or what, but it's definitely weird.


  6. still no good all units can use the addaction still :(

     

    Well, I would give up, call you crazy, and just leave this thread be.....however......I just made a quick test mission, and it seems addAction doesn't work on flag poles for whatever particular reason. I have a flag pole and an ammo crate with the same exact code in their init's, and two playable characters one with the variable "allowRecruitment" set to true, and the other without, yet, the pole had no action and the ammo crate had it.

     

    https://www.dropbox.com/s/8oskh3xrimkx2le/addAction_Test.VR.zip?dl=0


  7. Yea sorry, was working from my phone when I replied, hoping that you could figure it out :P:

    //in SL's init field
    this setVariable ["allowRecruitment",true];
    
    
    //action
    this addAction
    [
    	"Acquisition Request for Personnel", 
    	"recruitment.sqf", 
    	nil, 
    	6, 
    	true, 
    	true, 
    	"", 
    	"(_target distance _this) < 4 && _this getVariable ['allowRecruitment',false]"
    ];
    
    

    And with what I said earlier I wasn't whole-fully clear on what you had done, but get/set variable would have been my preferred method anyhow.


  8. 1. As long as you don't have 1000's upon 1000's of objects, it shouldn't be an issue.

    2. This would be the main kicker, disabling simulation would help yes. But so long as simulation is enabled, FSMs will be running, which means those units are essentially "thinking", which each "brain" needs its own chunk of the pie that is the server/your machine.

    3. Overall most scripts are relatively light and/or if they are heavy they aren't looped and are more of a "one and done" execution on init or on a particular event. As long as scripts are written correctly, looped or no, there shouldn't be an issue, but overall, I would avoid scripts that need to be looped constantly to provide a desired effect (particle effects for example).

    And for most of this I refer mostly to performance in multiplayer, singleplayer you have a lot more leeway when it comes to this stuff, and as with any multiplayer mission, the more clients, this less leeway.

    • Like 2
×