Jump to content

PYL

Member
  • Content Count

    41
  • Joined

  • Last visited

  • Medals

Everything posted by PYL

  1. Hello all, I somehow finally got the permissions to start new threads so I wanted to ask, how do I draw a 2D texture on the screen, given its XY coordinates? For example I want to draw this texture from file m1.paa or m1.tga or whatever its name is at _x and _y (in this example _x = 1800 and _y = 900) In another game I used to: 1. load the archive containing all the textures; 2. load the texture by its index name; 3. draw on screen at x,y with rotation 0-360, alpha 0-255, etc..; 4. relase the texture dictionary. Image example:
  2. Hello, if I run the following code: _missile = createVehicle ["M_Titan_AT", [4000, 4000, 2], [], 0, "NONE"]; a running missile with its engine on will be created. Is there a way to create a missile that is turned off? For examples, the one hanging at aircrafts' pylons. What should I type instead of M_Titan_AT? Or, is there a different way?
  3. I don't know if it's relevant to the Visual Upgrade but since it's a similar problem I would like to share it: what if BIS replaced completely stencil shadows, which are bad looking and draw a lot of resources, with soft shadows which are closer to reality, more beautiful and less stressful for the CPU since they're generated by the video card?
  4. 3D particles a la FumeFX would be amazing for me.
  5. Completely replace shadow volume (aka stencil shadows) with shadow mapping (aka soft shadows) for: 1. Performance: being able to shift CPU work to the GPU in ArmA would be a nice thing; 2. Aesthetics: one can't deny soft shadows are way better than stencil shadows. Discuss!
  6. @ruPal I saw all your youtube videos regarding edits of blastcore 2 and I should admit they're coming pretty well. Do you know if it's possible to further enhance the realism in particles a la battlefield 1 or star wars battlefront?
  7. Looking forward to this patch since I'm a graphics/VFX enthusiast :)
  8. Native command to calculate acceleration of an object, like: vector = acceleration (vehicle player); It's already in VBS, https://resources.bisimulations.com/wiki/acceleration :)
  9. Good evening guys. How does the physics simulation, like velocities, positions, etc... work? Are calculations updated on every frame (e.g. 60 fps -> 60 physics updates @ second) or do they have a fixed pause between them (e.g. 33 updates at second regardless of frame rate)? In other words, what is the interval between, for example, object position updates (e.g. t1 = [0,0,0], t2 = [0,1,0], t3 = [0,3,0], ...; interval between each update: 50 ms). Thanks!
  10. After some tests with accTime and diag_tickTime I managed to get the delay between two update which is roughly accTime * delay = 0.00329716 * 5 = 0.0164858, which means the frequency is 1/time = 1/0.0164858 ≈ 60 times @ seconds. Now, I don't know if it's 60 for every PC or just in my case since my display has a frequency of 60 Hz. Could somebody confirm it's either 60 physics updates @ seconds or it's FPS updates @ seconds? Hope this will be useful for future modders. Thank you very much! Edit: did a further test @ 12 Fps and it still looks to update 60 times @ seconds.
  11. Hello, I've got the following in-line function: fnc_test = { private ["_a","_b","_c","_d"]; _a = _this select 0; _b = _this select 1; _cx = cos(_a); _cy = sin(_a); _cz = _cx * _cy; _cx2 = cos(_b); _cy2 = sin(_b); _cz2 = _cx2 * _cy2; _c = [_cx,_cy,_cz]; _d = [_cx2,_cy2,_cz2]; [_c,_d] }; To call it I run: _one = ([_delta, _tetha] call fnc_test) select 0; _two = ([_delta, _tetha] call fnc_test) select 1; hintSilent format ["Vec. One: %1 \nVec. Two: %2 \nV.O. Type: %3 \nV.T. Type: %4", _c, _d, typeName _c, typeName _d]; With the final script being: _delta = 45; _tetha = 45; _one = ([_delta, _tetha] call fnc_test) select 0; _two = ([_delta, _tetha] call fnc_test) select 1; hintSilent format ["Vec. One: %1 \nVec. Two: %2 \nV.O. Type: %3 \nV.T. Type: %4", _c, _d, typeName _c, typeName _d]; fnc_test = { private ["_a","_b","_c","_d"]; _a = _this select 0; _b = _this select 1; _cx = cos(_a); _cy = sin(_a); _cz = _cx * _cy; _cx2 = cos(_b); _cy2 = sin(_b); _cz2 = _cx2 * _cy2; _c = [_cx,_cy,_cz]; _d = [_cx2,_cy2,_cz2]; [_c,_d] }; The output is: Vec. One: any Vec. Two: any V.O. Type: V.T. Type: Instead of: Vec. One: [0.7071067812,0.7071067812,0.5] Vec. Two: [0.7071067812,0.7071067812,0.5] V.O. Type: ARRAY V.T. Type: ARRAY Does somebody know why? Thanks and have a nice day! P.S. I always run my test scripts in the local exec editor (the one when you press Escape)
  12. I meant something like: accel = (vehicle player) call PYL_fnc_acceleration; instead of: _accel = (vehicle player) call PYL_fnc_acceleration;
  13. So the final function would be: // // 1 - object; // 2 - true (convert to km/h^2) // - false (default, m/s^2) // example: [(vehicle player), false] call PYL_fnc_acceleration // params ["_object","_mskmh"]; private ["_ret"]; _dt = (1/diag_fps); _xA = vectorMagnitude (velocity _object); sleep _dt; _xB = vectorMagnitude (velocity _object); _dx = _xB - _xA; _ret = _dx/_dt; if (isNil _mskmh) then {_mskmh = false;}; if (_mskmh) then {_ret = _ret * 12960;}; _ret ? And what if the output of the function will not be stored in a local variable? Will I need to include it inside params?
  14. Could you explain a little bit more what should be the structure of the folder Addon builder will take the files from? I got this error:
  15. I managed to make this Config.cpp file: class CfgFunctions { class PYL { class Geometry { file = "myPath"; class acceleration {returns the acceleration of an OBJECT;}; }; }; }; How do I further proceed so i can finally pack this as a pbo, just like ArmAIII's vanilla functions pbo (functions_f, functions_f_gamma, etc)?
  16. Thanks, i've already seen that and posted here since i understood nothing.
  17. Hi again! How can I add a custom-made, stand-alone (not bound to a mission) function to the official ArmAIII function library so that I can call it like: result = [p1,p2,...,pn] call function; Just like you would do with, let's say: nil = [getPos player, 0, "B_APC_Wheeled_01_cannon_F", EAST] call BIS_fnc_spawnVehicle; The function I would like to "make official" is: // // 1 - object; // 2 - true (convert to km/h^2) // - false (default, m/s^2) // example: [(vehicle player), false] call PYL_fnc_acceleration // params ["_object","_mskmh","_ret"] _object = _this select 0; _mskmh = _this select 1; _dt = (1/diag_fps); _xA = vectorMagnitude (velocity _object); sleep _dt; _xB = vectorMagnitude (velocity _object); _dx = _xB - _xA; _ret = _dx/_dt; if (isNil _mskmh) then {_mskmh = false;}; if (_mskmh) then {_ret = _ret * 12960;}; _ret What is the best way to compile this following BIS template and guidelines to, for example, share with you guys on ArmaHolic? P.S. do you think is it worth "wasting" computing power to add a variable check like: if ((typeName _object) == OBJECT) then { // the script above } else { ["Wrong variable data type (%1)!!!",(typeName _object)] call BIS_fnc_error; };
  18. Hello, to calculate an object acceleration I made this little function: [] spawn { while {alive player} do { dt = 0.001; xA = getPosVisual player; sleep dt; xB = getPosVisual player; dx = xB vectorDiff xA; d = dx vectorMultiply (1/dt); hintSilent format ["Derivative speed km/h = %1 \nOfficial speed km/h = %2", 3.6*(vectorMagnitude d), 3.6*(vectorMagnitude(velocity player))]; }; }; Actually this works for the speed but it's the same to get the acceleration: I chose speed because we know what sould be the real speed (velocity X). Does somebody know what could be the problem? I think it's in the sleep command since the game looks like it's waiting a different time than the one you divide to get the derivative... Please test this script in the VR editor to check yourself, maybe creating a car or plane. Cheers!
  19. Hi and thanks for the detailed explanation. Do you know the difference between diag_frameNo and diag_tickTime? To me it looks like diag_frameNo is 1000*diag_tickTime? I would like this feature to wait 1 frame to get the derivative and I was unsure what was the difference since I tested both and they looked like the same..
  20. Hello all! Where could I find the algorithm used by the game which guides our beloved guided missiles? I tried to look into weapons.pbo (with the hope to find it into the folder of the Titan AA or AT) but found nothing. :) Thanks!
  21. When spawning a test missile model with missile = createVehicle ["M_Titan_AT", [4000, 4000, 2], [], 0, "NONE"]; the missile comes with its engine already turned on so it's got some force already applied. Is there a way to spawn it without the burning engines? Tried with setFuel 0 but nothing...
  22. Thanks! If there is really no way to "copy" the code which BIS'developers used then I will make my own and maybe, once I will be done, post the result here , if somebody is interested :)
  23. I wanted to see how they implemented the guidance since I wanted to create a vertical launched ballistic missile and I needed to know how to guide it :)
  24. It was " direction = player call function; " Think dreadedentity provided me a good explaination :)
×