Jump to content


  • Content Count

  • Joined

  • Last visited

  • Medals

  • Medals

Everything posted by quantenfrik

  1. hello, currently I am trying to get my AI artillery assets to point their guns at a certain direction with a certain elevation. I tried both dowatch and lookat, but they each take around 15 seconds to stabilize on a static target, and as the reload time of the SPA is only around 9 seconds and because I'd like to include spread and MRSI, this is not really a solution. Would it be somehow possible to animate the turret ( with the animate command)? I searched for animation related topics, but I don't really have an understanding of this one as this is my first bigger project, and they mainly concern infantry animations. Also the animations viewer ingame also only shows infantry animations. If anybody has an idea, please help me with this issue. Thanks in advance
  2. quantenfrik

    set gun elevation

    As I searched further, I came accross another idea: My problem could also be about inheriting and referencing. I came to this like this: I modified the code to this class CfgPatches { class fixed_scorcher { units[] = {B_MBT_01_arty_F}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"A3_Armor_F"}; }; }; //class B_MBT_01_arty_F; class Turrets; class MainTurret; class AnimationSources; //class muzzle_rot_cannon; //class elevation; //class MainGun; //class lead; class CfgVehicles { class B_MBT_01_arty_F; class B_MBT_01_arty_F2: B_MBT_01_arty_F { displayName = "nananana"; artilleryScanner = 0; class AnimationSources: AnimationSources { /*class MainTurret { type="::"; source="::"; memory = ::;//by default animPeriod = ::;//Unknown selection="::"; axis="::";//*possibly* minValue = -::;//rad -360.0 maxValue = ::;//rad 360.0 minPhase = ::;//rad -360.0 maxPhase = ::;//rad 360.0 angle0 = ::;//rad 0.0; angle1 = ::;//rad 0.0; }; class MainGun { type="::"; source="::"; memory = ::;//by default animPeriod = ::;//Unknown selection="::"; axis="::";//*possibly* minValue = -::;//rad -360.0 maxValue = ::;//rad 360.0 minPhase = ::;//rad -360.0 maxPhase = ::;//rad 360.0 angle0 = ::;//rad 0.0; angle1 = ::;//rad 0.0; };*/ class MainTurret2 { type="rotationY"; source="user"; memory = 1;//by default animPeriod = 6;//Unknown selection="otocvez"; axis="otocvez_axis";//*possibly* minValue = -6.2831855;//rad -360.0 maxValue = 6.2831855;//rad 360.0 minPhase = -6.2831855;//rad -360.0 maxPhase = 6.2831855;//rad 360.0 angle0 = 0.0;//rad 0.0; angle1 = 0.0;//rad 0.0; }; class MainGun2 { type="rotationX"; source="user"; memory = 1;//by default animPeriod = 6;//Unknown selection="otochlaven"; axis="otochlaven_axis";//*possibly* minValue = -6.2831855;//rad -360.0 maxValue = 6.2831855;//rad 360.0 minPhase = -6.2831855;//rad -360.0 maxPhase = 6.2831855;//rad 360.0 angle0 = 0.0;//rad 0.0; angle1 = 0.0;//rad 0.0; }; /*class elevation { source = "user"; animperiod = 6; };*/ /* class lead { source = "::user"; animperiod = ::6; }; */ }; class Turrets: Turrets { class MainTurret: MainTurret { body = "MainTurret2"; gun = "MainGun2"; animationSourceBody = "MainTurret2"; animationSourceGun = "MainGun2"; //turretInfoType = "RscOptics_MBT_01_commander"; //gunnerOpticsModel = "\A3\weapons_f\reticle\Optics_Gunner_02_F"; elevationMode = 3; }; }; }; }; which doesn't work as it should, but provided some interesting finds: I basicly redefined the animations for the gun (I also tried to overwrite the original animations, hence all the colons but in this version they are not active) with MainTurret2 and MainGun2, however, ingame I was still able to animate the Turret and Gun with _Tank animate ["MainGun", 0.5]; So it still took the animations from the model.cfg, but somehow made the source to user, as I could animate them (although it was only visual, like described in my post above). But this brought me to the thought that he would not replace the animations because class Turrets; class MainTurret; and class AnimationSources; are defined outside cfgvehicles. I tried to define them then inside cfgvehicles but came to the following problem: I cannot reference them like B_MBT_01_arty_F, of which I basicly created a new instance. When I make something like this: class AnimationSources; class AnimationSources: AnimationSources , I get the member already defined error when starting the game. I also tried a setup found in here http://www.ofpec.com/forum/index.php?topic=31815.0 : class B_MBT_01_arty_F{}; class AnimationSources: B_MBT_01_arty_F{}; class Turrets: B_MBT_01_arty_F{}; class MainTurret: Turrets{}; and also this, which looks like the beginning of the config.cpp of vehicles: class B_MBT_01_arty_F{ class AnimationSources: B_MBT_01_arty_F{}; class Turrets: B_MBT_01_arty_F{ class MainTurret: Turrets{}; }; }; But neither of them work like they should, what I think they do is only take the parts I specially defined (those I want to change), so I can't inherit later B_MBT_01_arty_F2 from B_MBT_01_arty_F, because everything else is missing (icon, vehicleclass etc). Anybody who knows a way to solve this? Also this isn't really a mission editing question anymore, so I guess this could be moved to addons and scripting, but I don't really know how this is handled...
  3. quantenfrik

    set gun elevation

    Thanks a lot! It looks really nice already! I also experienced the strange shooting behaviour, but unfortunately it was not caused by the artillery computer, I switched it off like you suggested and it didn't change much. I now spent some hours on trying all the different possibilities to make the gun not only point but also shoot in the right direction, but I haven't gotten anywhere, although I must have tried at least 50 variations. What I also don't understand is how it is still possible to move the gun at all after gun, body, animationsourcebody and turret have been erased. I tried to overwrite the source of mainTurret and mainGun as described here https://community.bistudio.com/wiki/Model_Config but with no result. What also came to my mind was changing the turretInfoType, because I thought there was some kind of connection between this and the gun, but this only screwed up the optics. I have also noticed that it is still possible to lay the gun with pgup/pgdown, this won't change the visual direction of the barrel but this will determine the direction in which the shell is shot, also the elv number in the hud will change. Maybe there is another animation defined in the model.cfg, is there anyway to access it? The AI also completey ignores the laying of the gun, it will shoot, even if the direction is horizontally changed, to the front at a low angle (~1°), even if it's like set to 10°. The player shoots in the horizontal direction if (that is really strange, but maybe i observed it incorrecty) the point the optics are pointing to is in range of a high firing solution, otherwise he will also shoot straight up front too. weaponDirection will return a value independent from these, so there are 3 different elevation values in total :S.
  4. quantenfrik

    set gun elevation

    Thank you very much! But I still could use some help to get it working, because my knowledge and understanding of configs and inheritance is still very limited. I'm trying to get this working on the Scorcher, so I won't be able to access the model.cfg, if I understand correctly; I read it's somehow "baked" into the p3d. But not being able to use the gun in direct fire would be an acceptable trade off in my opinion, because the Scorcher still has the HMG/GMG turret and the cannon is at the moment useless anyways for engaging targets in sight, until a FCS is implemented. But I can't get this to work. I use this code: class CfgPatches { class fixed_scorcher { units[] = {B_MBT_01_arty_F}; weapons[] = {}; requiredVersion = 0.1; requiredAddons[] = {"A3_Armor_F"}; }; }; class B_MBT_01_arty_F; class Turrets; class MainTurret; class AnimationSources; class muzzle_rot_cannon; class CfgVehicles { class B_MBT_01_arty_F; class B_MBT_01_arty_F2: B_MBT_01_arty_F { class Turrets: Turrets { class MainTurret: MainTurret { body = ""; gun = ""; }; }; class AnimationSources: AnimationSources { class muzzle_rot_cannon: muzzle_rot_cannon { source = "user"; animperiod = 16; }; }; }; }; I pbo it with binPBO and it doesn't give me any errors in the log file. It creates a second instance of the Scorcher (B_MBT_01_arty_F2), but I am still able to move the gun manually and can't animate it. Reyhard, I hope I implemented what you said correctly (leaving blank, or better said erasing, body and gun), but as I tried to create a class MainTurret under AnimationSources, it gave me the "member already defined" error, I think because it's already the name the of the turret, so I tried muzzle_rot_cannon, with no success. Am I overlooking something completely obvious or is my entire approach messed up (you didn't mention creating a new addon, but I could think of no other way to change the config entries)?
  5. quantenfrik

    Range Tables for Mortars

    unfortunately it's not that easy (range tables) with the self propelled artillery due to two reasons: 1. the turret is not completely horizontal, if you aim to the front and it says 10° in reality you shoot at 11,6 degrees, same if you shoot to the back, it's around 8,4. degrees. 2. although the gun itsself is stabilized, the elevation number is not, which means if you face an hill upward and set your gun to 10° degrees you will get a different angle than if you face a hill downwards. there is also another absurdity i discovered: because the gun is stabilized, the shell is shot in the direction you look (and not the weapon direction), this is negligible at normal situations but produces some interesting outputs when you place a concrete ramp in the editor and drive with one track on it, you can actually see the shell leaving the barrel at a different angle than the one it is pointing at. To get the real elevation of the gun you can use this code _somevariable = vehicle player weaponDirection (currentWeapon vehicle player); _n = 3; _var1 = (_somevariable select 0); _var2 = (_somevariable select 1); _var3 = (_somevariable select 2); _flach = sqrt (_var2*_var2 + _var1*_var1); _angle = atan (_var3/_flach); _anglerounded = round (_angle * (10 ^ _n))/(10 ^ _n); hint format ["%1", _anglerounded]; But basicly because of this (and the lack of low angle fire solutions and MRSI) I decided to learn scripting and write some workarounds, but currently I am stuck at animating the barrel :/
  6. quantenfrik

    set gun elevation

    I've searched further, but still found no solutions, only new questions, which maybe someone can answer: I had a look into the config viewer, and for the Scorcher there are some "Animation Sources", called "muzzle_hide_arty", "muzzle_rot_cannon" and similar. does anybody have an idea what these do? I tried animationPhase on them but they always returned zero, and strangely it will also return zero if the animation doesn't exist at all :S. I also had a look at the awesome m109a6 paladin mod for arma 2 (which I hope is allowed, but I think so because the files are publicly available, right?), and found that they used animate to lay the gun, just as I plan to do too. However, their code works...I found the following in the lay script: _m109 animate ["turret", _deflectionNeeded]; and _m109 animate ["gun", (_elevationNeeded min 1333)]; . I can find no difference to my code; "turret" and "gun" are defined in the AnimationSources as classes, the corresponding entries for the scorcher are "muzzle_hide_arty", "muzzle_rot_cannon" etc. If anyone has an idea why my code doesn't work, please post it. Another approach I had in mind was to "analyze" the scripting commands. I thought in dowatch (which works, but takes too much time) there has to be a part that changes the gun direction, so if I could see the whole code of it, I might be able to understand how it works.
  7. quantenfrik

    M109A6 Paladin v1.1 (UPDATED)

    Hi, I'm currently working on my first mod for Arma 3, which some day may become an improvement for the artillery system. But currently I am still struggling with laying the gun (can't get animate to work), so I wanted to ask if it is allowed to have a look at the scripts to find out how you guys did it?
  8. quantenfrik

    set gun elevation

    Thanks for the reply! But after some further research, I think it might be possible that vehicles have indeed animations, because they're defined in the model.cfg, and I can also access them ingame via animationphase. _Tank = vehicle player; _angle = (_Tank AnimationPhase "mainturret"); hint str _angle; this works without problems, giving me (I think) an angle in radians. However when I run this code _Tank = vehicle player; _Tank animate ["mainTurret", 0.5]; nothing happens. Also this code _Tank = vehicle player; _state = animationState _Tank; hint str _state; just returns an empty string when I'm in a vehicle (which would be an indicator that there are no animations, but why does animationphase then return a value?). To get here I found this old thread http://forums.bistudio.com/showthread.php?63918-Animations, it was hard to read but worth it. So if someone has any further experiences with animations please help me out.
  9. quantenfrik

    problem with remote fire

    Update: Fortunately, "fire" works without problems when an AI is in the turret, so I got that going for me, which is nice.
  10. hi, I'm currently working on an artillery script for the 155mm SPA, and this includes that they should fire when i give the command. But I can't get it to work the way I want: I can't use forceWeaponFire, nothing happens if I use this command, which is also descriped in the wiki article at the bottom: "Currently this command is not available for land vehicle remote fire". I don't know why this is the case but I guess there's a reason for it. I also tried fire, but whatever combination I try the projectile goes straight up in an angle of around 60-70 degrees, ignoring the direction of the barrel. If I switch to third person and view around the scorcher, the barrel will go straight up after it fired the round. If I don't view around, the barrel will stay in position but the shell will still fly at an high angle. I also can't use doArtilleryFire because I want to set the charge and angle manually, and doArtilleryFire doesn't allow that. Another thing I tried but have absolutely zero experience with was to use a gamelogic (see code), but it didn't work either. Also what buggers me is that when I use fire with a different firemode (e.g. Single2) than the one which is currently selected (e.g. Single1), it will wait until I changed to the corresponding fire mode and not change it on its own. this is the code I currently use, of course I can't post all the different versions I tried. 45 and 46 are x and c. MY_KEYDOWN_FNC = { switch (_this) do { case 45: { vehicle gunner player fire [(currentWeapon vehicle player), "Single1"]; }; case 46: { hint format ['%1\n%2', currentWeaponMode player, currentWeapon vehicle player]; MyGameLogic action ["useWeapon",(currentWeapon vehicle player),vehicle gunner player,0]; }; }; }; waituntil {!isnull (finddisplay 46)}; (findDisplay 46) displayAddEventHandler ["KeyDown","_this select 1 call MY_KEYDOWN_FNC;false;"]; Anybody got an idea that could help me?
  11. quantenfrik

    problem with remote fire

    Thank you for your answer! What I hove to achieve in the end is that my script outputs an angle and direction to which (likely) an AI will align its artillery gun to, and another button press would be the firing command. it's the latter part I struggle currently with, until now I've mainly worked on the UI but now I wanted to finally see some action. So at the moment I'm still sitting in the gunner seat when i trigger my script above, in the end though it'll be an AI. But if "fire" and "forcweaponfire" don't work for me, I doubt they'll later do for AI.
  12. quantenfrik

    addMagazines for

    not sure if that's what you are looking for, but maybe could you use this? _magazine_names = magazines player; {player removeMagazine _x;} forEach _magazine_names; {player addmagazine _x;} forEach _magazine_names; It returns all the magazines a unit has, not just "30Rnd_9x21_Mag","9Rnd_45ACP_Mag","16Rnd_9x21_Mag", saves them in an array, deletes them, and readds them from the array. A strange bug I found though was that chemlights and smokeshells were heavily multiplying at the "magazines" command, in the end replacing all other mags so you only had like a 100 chemlights, so either don't use them at all or somehow remove them fromt the _magazines_names. It will also ignore how many bullets are left in a magazine, it will just give a fresh full one, and also ignore the magazine that is currently loaded in the weapon, but if you check the wiki I think there some commands to get these features in too if you need them.
  13. quantenfrik

    problems with the mapzoom inside a dialog

    Although it doesn't exactly solve your problem with the slider that zooms the map, I still thought I post what I have found here, first because it's a similar issue and second because I would not have been able to achieve it if not for this post. Long story short, I managed to make the dialog map zoomable with the mouse wheel, although it's not perfect which you'll see if you decide to test this. this is the code I use in my OnLoad.sqf (executed onLoad). mouse_position_2d = _ctrl_map ctrlAddEventHandler ["MouseMoving", " _dialog = findDisplay 1200; _ctrl_map = _dialog displayCtrl 1300; _mouse_position_x = _this select 1; _mouse_position_y = _this select 2; _position = _ctrl_map ctrlMapScreenToWorld [_mouse_position_x, _mouse_position_y]; position_2d_array_world = [_position select 0, _position select 1]; " ]; zoom_map = _ctrl_map ctrlAddEventHandler ["MouseZChanged", " _dialog = findDisplay 1200; _ctrl_map = _dialog displayCtrl 1300; mapscale = ctrlMapScale _ctrl_map; if ((_this select 1) <= 0) then { mapscale = mapscale * 0.8; } else { mapscale = mapscale * 1.2; }; _ctrl_map ctrlMapAnimAdd [0, mapscale, position_2d_array_world]; ctrlMapAnimCommit _ctrl_map; " ]; the problem is that ctrlMapAnimAdd sets the selected position to zoom to in the middle of the map control, so if the point you're zooming to is not exactly in the middle the map will "jump". Now the coursor isn't pointed to location you originally intended to zoom to, and if you move your mouse now the position_2d_array_world will update and the next zoom step will be to a location you didn't intended to zoom to. this means if you use this method you'll have to get used to a slightly different way of zooming the map. Anyways, I still hope this can be useful, at least it'll be for me.
  14. quantenfrik

    GPS script create dialog

    I'm pretty new to scripting, but if I understand you correctly you want to have a map in your dialog, right? you might want to have a look at this https://community.bistudio.com/wiki/Dialog_Control_Map , but it's "outdated", meaning the symbol paths still relate to Arma 2. This is the map I have in my dialog, I don't really know how it works but it gets the job done. part of my defines.hpp: I don't know you open your dialog, at the moment i open mine via a radio trigger, this seems to cause a bug that you cannot scroll with the mousewheel, in this case you have to use numpad + and -. this also works if you don't have a map equipped.
  15. hi, does anybody know if it is possible to set a listbox to scroll automatically to the bottom entries? I currently have a dialog with many buttons, and I would like to give the players some feedback when they press one, e.g. one button press the text "you pressed button x" would appear. I made this by creating a listbox, and each button press adds a new entry to it. But after about 6 button presses my listbox is full, and the scrollbar stays at the top entries, so I have to scroll down manually so see the newer entries. there are some entries in the defines.hpp called autoscrollspeed, autoscrolldelay and autoscrollrewind, I changed them a bit but I could see no difference in the behavior. I understand this question is not really urgent or too important, but solving it would make using the dialog a bit more convenient, so if anyone has an idea, i would highly appreciate it. thanks in advance
  16. quantenfrik

    scroll listbox automatically?

    thanks a lot, works like a charm!
  17. I'm pretty sure you can find them when you go into the config viewer, cfgweapons, mortar_155mm_AMOS. there are burst 1-5, and each has a different artillery charge, i'm quite sure it's a value multiplied with the initspeed to achieve different muzzle velocities, e.g. the lowest one is 810 (initspeed) * 0,19 (artillerycharge of burst 1) = 153,9 m/s.
  18. hello, I need to get the location of the cursor so I can use it in ctrlMapScreenToWorld. I can get it as a hint by writing onMouseButtonDown = hint format ["%1\n%2", _this select 2, _this select 3]; in my dialogs.hpp, but how can I run it in a script so that I can assign it to a variable? I've tried to mess around with DisplayAddEventHandler, but I don't understand how they work at all. Anybody got an idea? Thanks in advance
  19. found a solution: disableSerialization; //reduces errors _location = findDisplay 1200; //accesses the dialog _ctrl2 = _location displayCtrl 1300; //accesses the map control box, assigns it to ctrl2, which is control "object" _varx = _ctrl2 ctrlSetEventHandler ["MouseButtonDown","if (true) then { _location = findDisplay 1200; _ctrl2 = _location displayCtrl 1300; _varx2 = (_this select 2); _varx3 = (_this select 3); _position = _ctrl2 ctrlMapScreenToWorld [_varx2, _varx3]; _dialog = findDisplay 1200; _ctrl = _dialog displayCtrl 1000; _ctrl ctrlSetText format ['pos: %1', _position]; }"];
  20. quantenfrik

    display variables/values in dialog?

    thank you! it works, exactly what i was looking for!
  21. Hello, I'm sorry if this question is really dumb, but i'm new to scripting and after 2 hours of googling and trying i didn't find a solution: All I want is to display variables with their values in my dialog. I've read through this thread (http://forums.bistudio.com/showthread.php?154084-Values-and-Variables-in-Dialog-RscText), and it works fine if I just want to directly access one parameter, in this case my location, but I also need to be able to do some calculations with it. my dialogs.hpp my hello2 script the only way it works, gives me my position in the dialog my hello2 script how I would like it to work: in the latter case it won't show up at all in my dialog. anybody got an idea how to solve this? thanks in advance
  22. hi, I would like to create markers on my dialog map, but I have no idea how to get there, as I'm fairly new to scripting. I would like to be able to just double click and then a marker appears. anybody got an idea how to do this or if this is possible at all? defines.hpp dialogs.hpp thanks in advance
  23. thanks a lot! i thought it was enough if it was closed, didn't know about the convex thing (also didn't know what it meant until now). now i also understand why the sample model fire geo lod has 100+ components. will rework my model tomorrow then. thanks again i really thought i was stuck on this issue!
  24. although i have a geometry lod which has the outeriors of my model and a fire geometry with rvmats for the body, engine and fuel, I can still walk through most parts of my vehicle. i can also shoot through the hull, but not through the engine and the fueltank, which block my bullets exactly as they should. but i can't get this to work for the body, i tried editing the config.cpp in various ways but none worked. if anyone wants to have a look or has any ideas: https://www.dropbox.com/sh/1ff5d9lxq71ib2x/AAB3qtyeHkN8B7g_YhnCLEWra thanks in advance
  25. quantenfrik

    Wheels wont spin

    i'm pretty new (also trying to get a car working) :) but maybe i can help :) : do you have an axis for each wheel in the memory lod, and according entries in the model.cfg?