Jump to content

Tuliq

Member
  • Content Count

    118
  • Joined

  • Last visited

  • Medals

Posts posted by Tuliq


  1. There is another way to do this which i feel is probably the best way. Use setmarkerposlocal to set the position of a marker locally on a players computer, independent from all other players. Just make a simple "if" check, and if the player is a pilot, then do a "respawn_west" setmarkerposlocal [your pilot spawn coordinates].

    ---------- Post added at 11:41 ---------- Previous post was at 11:38 ----------

    F.ex "respawn_west" setmarkerposlocal getpos player will make units respawn at the same position you placed them in the editor


  2. You could make a trigger and write in the condition field

    !alive anton

    then in on activation write

    hint "Anton is dead. He is with us no more. Anton was a brave man who fought with great honor for his country. We shall never forget his memory or his boundless sacrifice to our common cause. Viva la Anton!";

    I hope this helps!


  3. You have to make sure that the script only runs on the killers machine dude.

    player addMPEventHandler ["MPKilled",{
    
    _killer = _this select 1;
    
    	if (_killer == player) then {
    	 	_killer execVM "killed.sqf";
    		};
    }
    ];

    alt:

    player addMPEventHandler ["MPKilled",{
    
    _killer = _this select 1;
    
    	if (_killer == player) then {
    	 	mymoney = mymoney + 100;
    		};
    }
    ];


  4. if(isNil "myIcons") then {
     myIcons = addMissionEventHandler["draw3d",{
         {
           if(side _x != side player) then {
             drawIcon3D ["", [1,0,0,0.7], visibleposition _x, 1, 1, 45, (format ["%2:%1m",player distance _x, name _x]), 1, 0.03, "default"];
           } else {
             drawIcon3D ["", [0,1,0.5,0.4], visibleposition _x, 1, 1, 45, (format ["%2:%1m",player distance _x, name _x]), 1, 0.03, "default"];
           };
         } foreach allunits;
       }
     ];
    };

    Maybe that would work? I am not sure. Worth a shot!

    I also replaced position _x with visibleposition, learned that from KK, and it gives it a lot smoother updating.

    Eh, made a mistake. fix'd it!


  5. You might be right. That is what I am using though. Here is my resource definition.

    class RscTitles {
    
    class sniperList {
    	idd = -1;
        fadeout=0;
        fadein=0;
    	duration = 1;
    	name= "sniperList";
    	onLoad = "uiNamespace setVariable ['sniperList', _this select 0]";
    
    	class controlsBackground {
    		class sniperListText:RscStructuredText
    		{
    			idc = 6000;
    			type = CT_STRUCTURED_TEXT;
    			size = 0.047;
    			x = 0.856875 * safezoneW + safezoneX;
    			y = 0.686927 * safezoneH + safezoneY
    			w = 0.3; h = 0.5;
    			colorText[] = {1,1,1,1};
    			lineSpacing = 4;
    			colorBackground[] = {0,0,0,0};
    			text = "";
    			font = "PuristaMedium";
    			shadow = 2;
    			class Attributes {
    				align = "right";
    			};
    		};
    
    	};
    };
    
    };
    

    I stole the gist of it from another script, so I am not sure about if this is the proper way to make a simple list resource. I am a total noob at dialogs..

    ---------- Post added at 16:03 ---------- Previous post was at 15:59 ----------

    For now I have just moved the resource a tiny bit more to the left, so that if a player is using the normal interface size, he will see it.


  6. So I have a UI resource which I want to place in the lower right corner of the screen. It's a vertical list of the names of players connected to the game. I want this list to be displayed at the same relative position on the screen through all aspect-ratios and interface-sizes. Right now, it looks good and sits in place when I am in the "small" interface size, but my friend who has interface size set to "normal" will have this list of names cut off on his screen. What would I have to do to ensure that this list stays at the same relative spot on the screen for both of us?


  7. Hmm, have a look at bis_fnc_param. It is a function used inside a lot of BIS functions to handle function parameters.

    ---------- Post added at 01:04 ---------- Previous post was at 00:56 ----------

    you should place the marker name / spawn pos as the first index of the passed array, and the model type second, or vice versa, since they are the most important parameters passed. Also, you can do away with the _minNumberOf var. Just pass _numberOf as an array if you want random amount of objects (like [4,19] four being the min, 19 the max), or as a number for an exact amount.

    ---------- Post added at 01:08 ---------- Previous post was at 01:04 ----------

    Also, while I can see that having an option to name all your placed objects according to a formula is great, you might have an easier time just returning an array of all the created objects at the end of the function. then you could call it like this:

    _myWonderfulArrayOfObjects = [YOUR ARGUMENTS] call fnc_ranPos 

    _myWonderfulArrayOfObjects would then be an array of all the objects.

    ---------- Post added at 01:11 ---------- Previous post was at 01:08 ----------

    For super easy-peasy mode, make the spawnpos parameter only accept a position array [x,y,z]. Then you don't have to rely on only using markers and units to spawn.

×