Jump to content

Horner

Member
  • Content Count

    627
  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by Horner

  1. Just trying to grab the damn decimals in a number, but no.. _num = (100 + 0.123); _num = _num - (floor _num); player groupChat (str _num); This prints out "0.123001" When I print out "(100 + 0.123)" it prints out correctly, is it floor that isn't working? Is there any way to get a true exact value out of this? I'd just like 100.123 - 100 to evaluate properly.
  2. @panther, I'm actually working on a different number formatting system than CBA because of how the "mod" operator starts to spit out odd values after 100 billion (I've managed to fix that). But I could look into formatNumber for adding decimals. Thanks. @ceeeb, Thanks for the documentation on that, I'll read up, I'm aware now that arma uses float values but it seems to only mess up when using operators other than the standard + - * /.
  3. Urgh, hackers. You could use an animation event handler.
  4. Errr, I've never used isPlayer before, but I generally use this to check if a certain object is a player. if (_obj in playableUnits) then {};
  5. Sad thing is it doesn't fluctuate for all numbers, Squeeze, and _num mod 1 has the same effect as floor, ceeeb.
  6. http://community.bistudio.com/wiki/typeOf
  7. I was pressing arma's limits again today and came up with some other unrelated information. Whether it's just my CPU or not, it seems as though with strings (and I'm guessing with arrays aswell), when you're handling variables with data sizes up into several MB (i.e. a string with millions of characters) this is when things start to break down. And I'm talking 2-3 fps break down and almost unable to exit the game. Not sure if this is the game itself breaking down or my own personal computer. Anyone else got some documentation on this? EDIT: Alright, either something about the operators in arma is odd at higher numbers or my function is broken, I'm using this function to convert higher numbers into a readable format ext_math_fnc_addCommas = { private["_number","_modNumber","_skip","_str","_ret"]; _number = _this select 0; _modNumber = _number; _skip = 0; _str = ""; if (_number > 0) then { while {_modNumber > 0} do { if (_modNumber > 0 && _skip > 0 && (_skip mod 3) == 0) then { _str = "," + _str; }; _str = (str (_modNumber mod 10)) + _str; _skip = _skip + 1; _modNumber = floor (_modNumber / 10); }; if (_number < 0) then { _str = "-" + _str; }; } else { _str = "0"; }; _ret = _str; _ret }; And I'm using this code to calculate the numbers. num = 1000000; mod = 10; while {true} do { hintSilent ([num] call ext_math_fnc_addCommas); diag_log ([num] call ext_math_fnc_addCommas); num = num * mod; sleep 1; }; And with this code it spits this out in the rpt "1,000,000" "10,000,000" "100,000,000" "1,000,000,000" "10,000,000,000" "100,000,000,002" "1,000,000,000,024" "10,000,000,000,248" "100,000,000,002,482" "1,000,000,000,024,824" "10,000,002,684,404,084" "100,000,026,844,040,844" "1,000,000,268,440,408,440" "10,000,002,684,404,084,402" "100,000,026,844,040,844,022" "1,000,000,268,440,408,440,220" "9,999,998,426,022,400,246,466" "99,999,984,260,224,002,464,660" "999,999,842,602,240,024,646,608" "10,000,002,684,404,028,828,040,248" "100,000,026,844,040,288,280,402,486" "1,000,000,268,440,402,882,804,024,862" "10,000,002,684,404,028,828,040,248,620" "100,000,026,844,040,288,280,402,486,204" "1,000,000,268,440,402,882,804,024,862,040" "10,000,002,684,404,028,828,040,248,620,406" "100,000,026,844,040,288,280,402,486,204,044" "1,000,000,268,440,402,882,804,024,862,040,442" As you can see, all of a sudden at 100 billion it turns a 0 into a 2, is there something wrong with the math in my function that is causing this or is it the way math is handled in arma? I'm pretty sure it's the function I'm using but I fail to see why it works with lower numbers but not with higher numbers. ---------- Post added at 08:12 PM ---------- Previous post was at 07:20 PM ---------- And, problem found. The "Mod" command in arma may be sort of bugged. It seems it breaks at 100 billion because. num = 10000000000; // 10 Billion hintSilent (str (num mod 10)); Prints out 0, but num = 100000000000; // 100 Billion hintSilent (str (num mod 10)); Prints out 2. the "mod" command must be broken for higher numbers. EDIT: Okay, I came up with a way to properly format numbers with commas without using "mod", this method will be introduced in the next update of the Extended Functions Library.
  8. So.... I've got a question for all you more experienced mission makers. How many AI is too many? At what point does arma itself start to break down and make the game run slower (not speaking of overall machine abilities, but the engine abilities)?
  9. Horner

    Arma2:Co Conquest Mode [Preview]

    It's not my fault I'm not in the loop :aa: Sounds great man, might wanna add the dynamic background color changer to that main ui if you haven't already, I think it could be more useful.
  10. Horner

    Arma2:Co Conquest Mode [Preview]

    I think the background of the ui would look much better as black, just an opinion. :)
  11. It's hard for arma to detect those types of things, if you've ever noticed if you use an opening curly bracket for a function without closing it, it seems to go on forever and the function never really gets "defined" because there is no end. Very similar to a "RunAway" comment.
  12. Thanks for the links, Gunter, I'll definately check those out, I already have an allDead script running to delete dead Units, however, the Unit Caching script looks fantastic though! Currently with the way I have it set up with the enableSimulation false command for units at greater distances than 2km, I usually only take a 10fps hit when I have 100 ai spawned (this is hosting locally, i.e. acting as the client and the server) instead of a higher 20-25 fps hit when not running the script so it's doing wonders.
  13. It runs client side, as enableSimulation is a client side command, I'll upload the code in a second. EDIT: http://pastebin.com/eutVgtdg Like I said, I got the method from a guy named qbt, so this is his method I just coded it to work for me.
  14. I have a script that sets ai to enableSimulation false (idea from qbt) if they are over 2km away, that seems to help out a lot. And the headless client feature seems to be like a great idea that will revolutionize ai in the arma franchise. Thanks for the information guys :)
  15. Just gotta find the abort idc, then you can implement it alongside.
  16. This should do the trick disableSerialization; while {true} do { waitUntil {!(isNull (findDisplay 49))}; ((findDisplay 49) displayCtrl 1010) ctrlEnable false; _time = time; waitUntil {(isNull (findDisplay 49)) || time >= _time + 30}; if (!(isNull (findDisplay 49))) then { ((findDisplay 49) displayCtrl 1010) ctrlEnable true; waitUntil {isNull (findDisplay 49)}; }; };
  17. You should run the script only on the server, that should fix your problem. But the script is going to have to be changed quite dramatically.
  18. I've just opened a dev-heaven page, if you would like to use it for feature requests, bug reports, etc. I'll be keeping updated on this thread along with the DH page.
  19. Or you could use switchMove? m2 switchMove "AMOVPERCMSTPSRASWPSTDNON_SALUTE";
  20. Somebody should seriously make a model of Ezio from AC, the epicenter of badassery.
  21. Horner

    Lights

    Use code tags :) And it's because you used "createVehicleLocal", so the lightpoint is only locally created on the player :)
  22. Horner

    Arma2:Co Conquest Mode [Preview]

    Wow impressive man, keep up the good work and I hope to see this mission soon!
  23. I must have missed that, thanks.
  24. Usually this section of the forums is used for people who want to exchange ideas and knowledge, not an advertisement board. But, I'll go back to minding my own business now.
  25. Global Hint, Global GroupChat etc can be used with globalCall and globalSpawn. urgh, I wish mrCurry would have included a syntax example of his function, anyone know what the args look like? ---------- Post added at 01:07 PM ---------- Previous post was at 12:10 PM ---------- Updated to v1.04 - Added: ext_misc_fnc_filter - Added: ext_str_fnc_capitalize - Added: ext_str_fnc_strToArr - Added: ext_str_fnc_capsLeft - Added: Array Library - Added: ext_arr_fnc_pullIndex - Added: ext_arr_fnc_selectRandom
×