Jump to content

pedeathtrian

Member
  • Content Count

    284
  • Joined

  • Last visited

  • Medals

Posts posted by pedeathtrian


  1. You don't really need first round. I also don't see a reason to have that change_rangetarget_distance_slider.sqf file since it only sets variable (isn't it possible from onSliderPosChanged?).

    I would do something like:

     

    dialog's onLoad:

    // don't use first two lines in call_distance_dialog_slider.sqf
    sliderSetRange [1900, 25, 2000];
    sliderSetSpeed [1900, 25, 25];
    sliderSetPosition [1900, temp_Distance_Adjust]
    ctrlSetText [1901, str temp_Distance_Adjust];
    

    onSliderPosChanged:

    temp_Distance_Adjust = 25 * (round ((_this select 1) / 25));
    ctrlSetText [1901, str temp_Distance_Adjust];
    
    • Like 1

  2. You can create a vehicle of class "Item_ItemGPS", not "ItemGPS".

    As sarogahtyp said, "you cant place stuff like weapos magazines and items on ground without something called like ground weapon holder".

    Then, what happens when you create vehicle of class "Item_ItemGPS"? "Item_ItemGPS" is a vehicle class derived from "WeaponHolder" vehicle class (through "Item_Base_F"), so "Item_ItemGPS" is "WeaponHolder". It has corresponding model and set of transported items in "TransportItems" subentry. It is a shortcut to creating weapon holder, containing item "ItemGPS". So yes, weapon holders are still involved.

    There are plenty of vehicle classes that mimick items laying on surfaces. Names of vehicle classes usually (but not obliged to be) of form "Item_className", where className is corresponding cfgWeapons subentry. Not every weapon and item presented here, check list of available classes in cfgVehicles.

     

    Difference with the code posted by JasperRab is same as between "WeaponHolder" vs "WeaponHolderSimulated", plus you don't have to specially deal with MP (createVehicle is eG).


  3. ...most of Russians support Putin. And many of them also have still strong sentiment after Stalin and USSR/communism times. Is actual truth in that or that's another Kremlin propaganda?

    Yeah. I can confirm. Unfortunately most people think something like "Putin did so much for Russia", "If not Putin, then who?", and even "No Putin -- No Russia" as said by Vyacheslav Volodin, first vice of Chief of Staff of the Presidential Executive Office, the man who actually runs domestic policy in RF. Not a surprise people think this way, considering authorities have all the media at their hands. And they even think they can control Russian part of the Internet. LMAO.

    Some people just don't see alternatives (and there are none in mainstream, i.e. in approachable information field), some just tired of shocks happened in latest decades. Sentiments after Stalin and/or USSR/communism are actually not after them, and mostly not after ideology. They are after the order existed in those times. Lower crime rates, almost no corruption, social lifts, stable future and so on. None of these are exclusive attributes of communism. But this is somehow hard to understand.

    So, in general, that Putin's support is fake. If only people knew all the truth...

    Most of romanians "supported" CeauÅŸescu. Then what? But for Putin this story will not be that short. I hope for extremely open process, with long and detailed testimonies available to everyone, so that all the truth comes out. That probably involves high-ranks from other countries, sorry guys. Some heart attacks can occur.

     

    BTW aren't you actually indeed risking now by writing, what you wrote? I hope, no one will report that anywhere, but... 

    As for the risk, that was a joke. But, according to russian proverb, "every joke is only partly a joke". Russian laws are selective. And stupid. And controversial. And unable to follow. You can apply them to almost everyone in RF. So yes, if they somehow want me to go to jail, thay actually can arrange some actions. Luckily, they have completely no system in it. Look what they persecute for. Reposts in groups of what? ten users? "Dangerous" posts with ten likes? One reposter of tens of thousands of the same post? It's like winning a lottery. I also think they can't just ask BIS for my credentials as they can with VK and other sevices that store personal data in RF (according to Russian laws).

    And from other side, conviction of such kind will never be a bad spot in biography. Not for me.

    Of course I don't go to street with poster, since this time it's a real risk, despite that article 31 of Russian Constitution clearly says "Citizens of Russian federation have right to gather peacefully without weapons, arrange gatherings (sorry for repeat, sounds better in russian), meetings and demonstrations, marches and piquets." Period. Article 15 section 1 says "Constitution of Russian Federation has the highest legal force, direct action, and applies on all territory of Russian Federation. Laws and other legal acts, adopted in Russian Federation must not contradict Constitution of Russian Federation". Period. Then parliament adopts a law (federal law No.54-FZ) obliging me to inform local authorities about my planned actions, planned route, amount of participators, do it in short term from 15 to 10 days before action (so I can't just go for meeting next day after someone killed Boris Nemtsov) and so on. Then if I get permission (which is unlikely) I can go through police corridor in my free country. Wait, what? Constitution arcticle didn't have any reference to any other laws, it's the law of direct action. Clearly this anti-constitutional law shouldn't be signed in the first place by... Putin, the guarantee of constitution in RF. Isn't Putin a criminal then? Of course, it's only one small episode, but is usually enough to convince opponent (that Putin is a criminal; not saying about economical crimes, here I have no proof).

    Sigh. Situation here gets more tense day by day. The Revolution is coming (not a joke; also, not a communistic one; also, it does not require support of most people), there are groups of people already preparing it. This time none of people taking any posts in any state orgnizations will be left in their places. Clearly representative democracy does not work well anywhere, it doesn't work at all in Russia. The goal is direct democracy.


  4. And this here must be all lies as well

    I had history classes in school and in university (2004) in Russia and it all said the same. Hitler and Stalin divided Europe and annexed corresponding parts. And that Stalin was going to start a war against Hitler in 1942 and so on.

    The important detail people usually miss is that Molotov-Ribbentrop Pact was a secret agreement arranged with soviet people knowing nothing about it (unfortunately this happens when you have dictatorship). It was never a will of russian people to annex these lands. So please, say Stalin did this, Stalin did that, or communists did, not russians. It's funny how it also applies to Putin (Putin annexed Crimea, not russians (oh, wait, +10 years in gulag for saying this, Okay.jpg)).

    Russians are very peaceful people (they are!), so please lower rate of hate and disrespect to them, and direct it to concrete personalities. Thx.

    I don't know what they teach nowadays, but I definitely don't like what is going on in media and in country in general. Anyway this is going to end soon (very soon!)

     

    PS. Please, don't report this post to KGB, I have plans for next two years other than sitting in prison.

    • Like 1

  5. The first and essential thing to do is to check if IP address your router gets from ISP is worldwide accessible. Then (if it is) there's some sense in port forwarding or uPnP.

    Checking external IP only makes no sense -- it might show ISP's NAT IP address; in that case your server will not be accessible from the Internet by this address.

    If (and only if) your router get the same IP address as what's-my-ip-address services show you, then you can set up port forwarding or uPnP (which is same port forwarding, only done by applications demand); see instructions in previous posts.

    Check your router's status page for something like "WAN IP Address" or so. If it belongs to private networks (e.g. 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12) you have no chance to run server accessible from the Internet.


  6. this is all due to this migrant crisis, this is connected , it is not nationalism when people want to walk on safe streets !!!

    it is not nationalism when people want to return alive from subway or theatre, it is not nationalism when people do not want to work on welfare checks for lazy bastards who do not work 

    talking about racism and nationalism - what other cultures think about diversity ? lol ? 

    Right. It's not nationalism. But nationalism is an easy solution for some problems.

    Get the trend. Extrapolate.

    If/when people will see their salvation in ultra-right (or ultra-anything) measures, they will for sure democratically vote for it.

    If you disagree -- change the trend. I don't see it happening yet.


  7. But it's also sadly a boost to all ultra nationalist (and far left) movements across Europe, that are gaining power at each elections and are now ruling a few Eastern countries, and aren't far to win in Western Europe too. Short memories, nobody remembers XXth century and where all those nationalist movements leaded us ?

    The trend is that you will have your new Hitler(s) eventually. The difference is this time you're on your own. There will be no commies to withstand this new threat. Don't expect any help from US either. The whole world would stay at your borders and watch while nazi (or whatever form it will take) beast reverts you to medieval. As I see it, there will be absolutely no limits for them.

     

    I totally agree, we're talking about a world of a century ago and there are people that really want to go back to live in a kind of medieval age

    Counter-modern at its best. What you will get is by far worse than medieval age. In medieval age people have had at least some progress. What you will get is regress only.


  8. No limitations on 2d/3d or slope areas.

    // returns true if position of _unit is inside real bound box of _obj
    PDTH_pointIsInBox = {
    	params ["_unit","_obj"];
    	_uPos = _obj worldToModel (getPos _unit);
    	_oBox = boundingBoxReal _obj;
    
    	_inHelper = {
    		params ["_pt0", "_pt1"];
    		(_pt0 select 0 <= _pt1 select 0) && (_pt0 select 1 <= _pt1 select 1) && (_pt0 select 2 <= _pt1 select 2)
    	}
    
    	([_oBox select 0, _uPos] call _inHelper) && ([_uPos, _oBox select 1] call _inHelper)
    };
    
    // returns distance between position of _unit and closest point suface of _obj's real
    // bound box (i.e. closest vertex, edge or point in bb's face).
    // returns 0 if inside or exactly on surface
    PDTH_distance2Box = {
    	params ["_unit","_obj"];
    	_uPos = _obj worldToModel (getPos _unit);
    	_oBox = boundingBoxReal _obj;
    	_pt = [0, 0, 0];
    	{
    		if (_x < (_oBox select 0 select _forEachIndex)) then {
    			_pt set [_forEachIndex, (_oBox select 0 select _forEachIndex) - _x];
    		} else {
    			if ((_oBox select 1 select _forEachIndex) < _x) then {
    				_pt set [_forEachIndex, _x - (_oBox select 1 select _forEachIndex)];
    			}
    		}
    	} forEach _uPos;
    	_pt distance [0, 0, 0]
    };
    
    

  9. I shoot a ray upwards from player. If it intersects a buildingobject, he is inside. I guess it's lot less calculations. Just an idea.

    And according to my experience, boundingboxes on some buildings are not too precise.

    Intersection task is much much heavier than finding point-to-box relation. The more you go in row "curve to curve", "curve to surface", "surface to surface" the heavier it gets.

    It can seem an easier task for user script (having engine caclulating stuff), but still a lof more work to be done with intersections and it is not going anywhere.


  10. who needs crossplatform support for a single-platform game?

    Your question is based on false proposition. ArmA 3 has ports for Linux and Mac, though older versions than for Win.

    Should be

    "who needs crossplatform support for multi-platform game?"

    Minority, probably, but definitely not nobody.

     

    I have successfully edited (i.e. unpacked, edited and packed; using mikero tools for Linux) missions on Linux; had those mission run on dedicated server on Linux; and played them with other Linux and Mac players.

    Unfortunately, we don't have a full stack of editing and content creation tools available on Linux and/or Mac, otherwise we would have had more serious modders and mission makers nowadays. Not everything can be done in text editor.

    Some other problems are also persist, even for players. Like, up-to-date BIS tools create up-to-date ArmA content which is incompatible with not-so-up-to-date ArmA 3 Linux and Mac versions, so you can't use new mods (e.g. p3d files version 70 in CUP mods and others). New missions contain new commands and cannot be run on older versions of ArmA, and so on. And I had an urge to fix stuff but found lack of required tools discouraging. Dat feeling when you know what to do and how to do, but you are not going to install Win because of it.

     

    So yes, there are people who could use some crossplatform support.


  11. Unfortunately, my ArmA 1.54 does not start because "Bad version 70 in p3d file ....".

    Is it really worth cutting off all Mac and Linux Users? I'm not encouraging anyone to keep some backwards compatibility or something. I just wonder what's the killer feature. I've seen too much bleeding-edge obsession (in other fields) that really gave nothing.

    Where can people find previous versions of CUP mods?

    Thanks.


  12. Or just because it's more fun to over complicate everything, why not use spherical coordinates? :D

    _radius = 2;
    _origin = (getPosASL player) vectorAdd [0,0,20];
    
    for "_i" from 1 to 300 do {
        _veh = createVehicle ["Sign_Sphere10cm_F", ASLtoAGL _origin, [], 0, "CAN_COLLIDE"];
        _veh enableSimulation false;
    
        _theta = ((2 * pi * _i)/300) * (180/pi);
        _phi = acos((2 * (random 1)) - 1);
    
        _x = _radius * sin(_phi) * cos(_theta);
        _y = _radius * sin(_phi) * sin(_theta);
        _z = _radius * cos(_phi);
    
        _veh setPosASL (_origin vectorAdd [_x, _y, _z]);
    };
    

    Produces random positions on the surface of a sphere. Not meant to be the most ideal solution  ;)

    Dude, you're overcomplicating too much :D

    This

    _theta = ((2 * pi * _i)/300) * (180/pi);
    _phi = acos((2 * (random 1)) - 1);
    

    can be easily simplified to 

     _theta = 1.2 * _i; // 360 * _i / 300;
    _phi = random 180;
    

    Though the second line gives different distribution of points. Random with one argument gives even distribution. But when acos is applied to it, you'll have non-even distribution, see pic below (left part). One might probably want even distribution of angles (right part) instead of values passed to acos. It will also remove unnecessary back and forth calculation of acos and cos on the same value.

    PifHqgh.png

     

    If, for some reasons, even distribution for acos argument is what you've always wanted, you can use something like:

    _cosPhi = -1 + random 2;
    _sinPhi = sqrt(1-_cosPhi*_cosPhi);
    

    Not meant to be the most ideal solution either :)

    • Like 2

  13. Thanks for the information guys, helps a lot. One thing I would like to ask though pedeathtrian if you wouldn't mind, would you track/save the current xp and lifetime xp separately? As i'm wanting the player to start each level at 0/whatever xp, I imagine it will be easier to keep track of current xp and reset it to 0 each time the player levels up.

    I'd save only total player exp since all other parameters can be calculated from it. They simply does not contain any new information. So you can store total exp, but show (calculated) progress for only next level-up.

    Let's continue example from previous post. Player has 450 points of experience (50 points ahead of level 3). Their level is calculated to be 3. Exp for levels 3 and 4 are 400 and 900 respectively (500 points for level-up). So you show 50/500.

    The only value to store is 450.


  14. use ln(XP) to calculate the level.

    This is cruel, assuming that

    The amount of experience the player receives for different actions such as killing a player will be the same regardless of the level as well.

     

    Most games use square root curve, that is level = floor(k * sqrt (exp)), where k is some constant.

    Given nth level, required expn = (n / k)2

    And k is just 1 divided by square root of amount of exp required for 1st level-up: k = sqrt(1 / exp1)

     

    I assumed you start with level 0, which is most like not the case. For starting with level 1 replace n with n-1 where needed:

    level = floor(1+   k * sqrt (exp));

    expn = ((n-1) / k)2

    Let's say you start with level 1 and 100 exp points required to gain 2nd level. Then k = 0.1.

    Required exp for levels 2,3,4,10:

    exp2 = ((2-1) / 0.1)2 = 100;

    exp3 = ((3-1) / 0.1)2 = 400;

    exp4 = ((4-1) / 0.1)2 = 900;

    exp10 = ((10-1) / 0.1)2 = 8100;

    Assuming player has 450 points of experience, his level will be:

    level(450) = floor(1+   0.1 * sqrt (450)) = floor (1+2.121) = 3;

    • Like 2

  15. So radians is from 0 to 2pi, right?

    Trigonometric functions in Arma take degrees as arguments.

    For compass directions (clockwise, from y axis) see the right part of figure in my post above (with β as an angle).

     

     


    I'm probably missing something and going to sound stupid, but would getPos help?

     

    _pos = _center getpos [_distance, _direction];

    That's not stupid, that's the best solution in the thread :)

    • Like 1

  16. Replace 

    _locNamePosArr set [count _locNamePosArr, _locationName];
    _locNamePosArr set [count _locNamePosArr, _locationPos];
    

    with 

    _locNamePosArr pushBack [_locationName, _locationPos];
    

    and you will have your dictionary (and use BIS_fnc_findInPairs on it). Which in turn duplicates the contents of  _locPosArr  and  _islandNamesArr. You could use find on  _islandNamesArr  to find an index which you then can use in  _locPosArr  and abandon  _locNamePosArr  totally (or vice versa).

     

     


    _nearbyLocations = nearestLocations [getPos player, text _locTypeArr, 100000];
    

    I don't get the point of text in this line; and in general, using nearestLocations might be overkill here, and probably it's better to get everything from config. Unless you use the "sorted-by-distance" property of  nearestLocations'  return (which is invalidated the moment player starts to move).


  17. Y U NO put each location in separate array item? [[String, Array], [String, Array]...] instead of [string, Array, String, Array, ...]? You can't use binary search on array you've posted above.


    _indexReturn = {_x == _requestedElement} count _array;
    

    This does not do what you think it does. It is not find, it's count. It returns amount of elements equal to _requestedElement, not their position. So 0 if there's no such element, or 1 if you have only one, and so on. It also have linear complexity on array's length, and is called on every while's iteration, so even if you were correctly comparing _mid to some index, it would give you N log N complexity. Why not just use find then? It has linear.

    If you somehow have index of required item, you don't need the binary search already.

     

    Even when you have all array items in the form [string, Array], and search using String key, you will need lessthan operator called on key values (Strings, _mid key and requested key), not indexes. And comparing strings is yet some code to call (and write).

    Taking everything in account, you will need thousands of items in array to win something with binary search against simple BIS_fnc_findInPairs call.

    • Like 3

  18. You can use global boolean variable to allow onMapSingleClick handle rto teleport player to position and ignore it otherwise.

    map_teleport_enabled = false;
    
    map_click_handler =
    [
    	"map_teleport", "onMapSingleClick",
    	{
    		if (map_teleport_enabled) then {
    			player setPos _pos; // _pos is predefined for onMapSingleClick
    			systemChat format ["Teleported to map position; %1", _pos];
    			map_teleport_enabled = false;
    			openMap false;
    		};
    	},
    	nil
    ] call BIS_fnc_addStackedEventHandler;
    
    _id = _target addAction
    [
    	"Teleport to position on map",
    	{
    		map_teleport_enabled = true;
    		if (!visibleMap) then {
    			// will probably need to check if player has map, and use forceMap if he doesn't
    			openMap true;
    			waitUntil {visibleMap};
    		};
    		mapCenterOnCamera ((findDisplay 12) displayCtrl 51);
    		waitUntil {!visibleMap};
    		if (map_teleport_enabled) then {
    			systemChat "Teleport to map position cancelled.";
    		};
    		map_teleport_enabled = false;
    	},
    	nil, 0.5, false, true
    ];
    

    If teleport is allowed, then close the map from handler and forbid teleport. So when player opens map by pressing M he will not be teleported when clicked on map.

    When action is activated, it allows handler to teleport player.

    Notice that if user did not teleport and closed the map, action checks for this case and disables teleporting on its own.


  19. No need to write stored procedures for it. MySQL already has UNIX_TIMESTAMP, which for your needs will be used like UNX_TIMESTAMP(NOW()).

     

    However, I would higly recommend you not using unix timestamps in SQF unless you're OK with its ~2 minute precision (and not 1 second like you might think).

    The reason is Arma Number type which is C float type, which has only 24 (23 real +1 implied) bits for significant orders in floating point numbers. That means you can precisely present integral numbers up to 16777216 (224), then you got only even numbers, then only 4x, then 8x and so on. At numbers like 1458868810 (the time I'm writing this) you can only present timestamps with interval of 128 seconds! If you're OK with that, then continue, but I would personally offload all datetime operations (and probably all accounting) for database (and MySQL has lots of functions for that).

     

    BTW, for the same reason Array and String types have treir size limits, you simply cannot address every array element or char in a string after 16M2. 9999999 was chosen probably because it's easier to remember for humans.

×