Jump to content

General Barron

Member
  • Content Count

    972
  • Joined

  • Last visited

  • Medals

Everything posted by General Barron

  1. General Barron

    My Dialog??

    Your dialog isn't missing anything. When you are in other aspect ratios, you just get "more screen" on which to display your dialogs. So x=0 is no longer the left edge of the screen, rather it is somewhere roughly 25% in as you have found out. If your dialog were to be automatically stretched across the entire screen, then it would look distorted. Imagine having a triple-head setup, and having the briefing stretched across all three monitors. It just wouldn't look right. If you are trying to black out / cover the entire screen, then you need to use something like x=-3; w=6, so that you can cater for up to triple-head aspect ratios.
  2. Most likely the muzzle or optics memory points for your turret are not properly set, for the weapon you are trying to fire. Check the following values in your turret's config, and make sure they are properly set up in your model too: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> memoryPointGunnerOptics memoryPointGunnerOutOptics gunBeg gunEnd memoryPointGun missileBeg missileEnd
  3. General Barron

    #include

    While I'm sure that we are all impressed, do remember that this is a public forum, not a PM. So posts that I make are not only intended for you, but for the benefit of everyone else. If you already know the things I am describing, then good for you; but boasting to the world isn't gonna stop me from trying to write posts that others might find useful. ------- Anyway, I think I'm venturing into the realm of flaming, so the mods can feel free to slap me if I'm out of place. I have nothing more to add to the current thread, I've already given my thoughts, and apparently they don't work.
  4. General Barron

    #include

    How am I supposed to know what you do and do not know? Also, I like to include extra information for the sake of others that might be browsing the topic. Ok, that sucks. Sounds like a problem with BinPBO not passing the right info to binarize, just to configConvert? I dunno. Maybe try using the -prefix switch when running BinPBO, with a prefix of "P:". http://community.bistudio.com/wiki/BinPBO_Manual
  5. General Barron

    #include

    Yes, you are right, I should have been more specific. If you are using BIS's pbo packer, it runs a program called cfgConvert. This program will "rapify" and preprocess your config, which means it will resolve all #includes, #defines, EXECs, etc when you pack. If you don't use BIS's pbo packer (or a 3rd party program that does config conversion), then Arma will do this process when you load the game. In this case, the #includes are resolved at load-time, and obviously changes in the those files will change the way the config is loaded. Both methods have their uses. Obviously, the load time for Arma will be a tiny bit slower if it has to preprocess a config or binarize a model. If the whole BIS content was like this, then it would most likely be very noticeably slower to load; but for a user addon here and there, I don't think it matters enough to worry about. ------ edit ------ For the benefit of searchers/others, here is how you #include a file that is outside of a pbo: #include "\whatever\something.hpp" Now, the thing to remember is that the game will start looking for the file relative to your Arma installation directory. So, lets say Arma is installed at C:\arma. In the above example, the game would look for the following file: C:\arma\whatever\something.hpp The same goes for any other file; for example, you can run a script out of your Arma directory using: [] exec "\whatever\myscript.sqs" (Or you could point to a picture for a dialog, etc etc.) When referring to stuff inside of a pbo, the pathing process is a bit different. In this case, use the instructions in my first post: basically, you use its path in the P: drive, minus the "P:" prefix.
  6. General Barron

    Inherit BIS Model and Skeleton def

    It doesn't work that way. Synide knows what he is talking about and has said it all, but I'll just try saying it a different way. The model.cfg info is "baked" into the model during binarization. It doesn't work like configs, which are dynamically loaded / built when you start the game. All the data is stored when you binarize the addon, and it can not be changed by other addons you may have installed when you run Arma. Nor can the data in your model change the data in someone else's model. To put it another way, your Arma install has no influence on the model during binarization. Binarize itself doesn't have any info stored inside of it, since it is designed to be flexible (you can define your own skeletons, they aren't hardcoded into binarize). So all the info needs to be in your P: drive, in the form of model.cfg's, when you run binarize. Where does that info need to be? Luckily, it doesn't all have to be in the folder you are packing. Binarize will first look in the folder you are packing; then it will look in its parent folder, then its parent's parent folder, and so on until it reaches the root directory. Note: binarize only bakes the info into a model that you tell it to. If you inherit from the car base class, then it will ONLY bake the car data into your model; even if you have a person base class in the same model.cfg. (The person base class just gets ignored in this case, until you binarize a model that inherits from the person base class) So the simplest thing to do is to put all of your base model.cfg definitions into your root directory, or in your highest level directory (eg: P:\ca). You then make a smaller model.cfg in your addon's directory, and inherit from the appropriate base class, and only add the things that make THIS addon unique from the base class. Again, see the sample BIS stuff; this is how they are set up. It's not the easiest thing in the world to get your head around, but the system is designed so you can make a whole lot of content in an organized manner. This is how BIS made all of the Arma content. If you are only making a single addon, then I could see how the whole structure could seem like more work then its worth. But it is designed to make content for an entire mod / game, not a single addon.
  7. General Barron

    #include

    Another alternative. Let's say your addon is located at P:\ca\myAddon, and your common defines are located at P:\ca\commonDefs.hpp. At the top of your config, you would write: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">#include "\ca\commonDefs.hpp" Note it is basically the path to the file, without the P: suffix (you already have told configConvert that P: is your root folder somewhere else during the setup process). Also, remember that the include happens when you PACK the addon, not when you start the game. So in this example, "commonDefs.hpp" doesn't have to exist inside of "ca.pbo" for your config to load correctly when you run Arma. On the flip side, if commonDefs.hpp does exist in ca.pbo, changing it AFTER you have packed your addon will not change your addon's config.
  8. General Barron

    Inherit BIS Model and Skeleton def

    You should be able to extract the BIS model.cfg's into your P: drive. When packing, Binarize will automatically spider up the directory tree, looking for model.cfg's. Ex: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">P:\ca\yourAddon //your addon goes here P:\ca\model.cfg //all BIS model.cfg's crammed into this file
  9. Not possible. All crew must be the same (unless you use some kind of scripting workaround).
  10. General Barron

    Model Binarization

    Use a proper P drive setup and the BIS packing tool, and it might fix your problems. (I'm not even sure how you can binarize models without the BIS packer?) This way, you can place the BIS model.cfg's in your P drive, and you'll be able to use them as a base for your own (like you are trying to do with the "plane" class). To all modders: USE THE PROPER P DRIVE SETUP!!!
  11. General Barron

    House elevation

    There is a config parameter called "autocenter". If it's false, then the center will be [0,0,0]. If it's true, then the center of the model won't be [0,0,0], but rather it will be calculated from the faces / points in all the LODs. So if you add another story to a building like this, it will sink down half of the height you added. There is also an autocenter property in the model itself, I'm not sure about the relation between the two though...
  12. General Barron

    Model Binarization

    Are you using the BIS pbo packer? It will binarize and then automatically place it in the pbo for you. Or are you working out of a non-standard development environment? (i.e., not using a P: drive)
  13. General Barron

    How to maintain picture proportions?

    in your dialog class? No. That doesn't do anything. I believe it pauses the simulation, for dialogs like the escape menu, but it doesn't work in "normal" dialogs. i0n0s's suggestion is a great idea: To add to this: if you place all your controls within one control group, then you'll only have to move the one control, and everything inside it will move as well. You'd obviously also want to use the onMouseDown/onMouseUp events, so the dialog only moves when the player is holding the mouse button.
  14. General Barron

    How to maintain picture proportions?

    You must use a 3d dialog control (they are configured in the "objects[]" part of the dialog, not "controls[]" or "controlsBackground[]"). This is a whole 'nother topic, do some searching in the OFP forums and you should find info. Or, look at the BIS configs for the compass and GPS device. Or look in my old ofp vietnam mission (in my signature), as it also has an example. Note, however, that not all dialog controls can be placed inside of a 3d object. Multi-line text boxes come to mind as one example; I think listboxes might be another.
  15. General Barron

    How to maintain picture proportions?

    Use the ST_KEEP_ASPECT_RATIO style, in combination with the picture style: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> #define ST_KEEP_ASPECT_RATIO 0x800 #define ST_PICTURE 48 style = ST_PICTURE + ST_KEEP_ASPECT_RATIO; Alternatively, you could use a listbox that only has room for one element, since listbox pictures also keep their aspect ratio. You can also take advantage of the eventhandlers available to LBs for scripting if you choose this route.
  16. General Barron

    CfgNonAIVehicles

    If the proxy isn't supposed to do anything special, like disappear during the game (i.e., it is just a normal visual part of the model), then you don't need to configure anything. Only special proxies like missiles, crew members, or weapons (for people) need a config.
  17. ---------------------------------------------------- *Updated 20 June 2008* FIXED: Possible divide-by-zero error in get function FIXED: Bank wasn't being set or retrieved accurately Big thanks to vektorboson for correcting my math! ---------------------------------------------------- Hello all! I don't know about you, but personally I've struggled quite a bit with the setVectorDir, setVectorUp, and setVectorDirAndUp commands. I'm sure they are quite perfect for certain uses; but personally, I want to work in degrees, and I want it to be relative to the object's facing. So, after MUCH struggle (I'm sure it would have been easy for someone good at math), I've created the following function. I hope you find it useful! This function lets you set an object's pitch and bank, in degrees: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> /************************************************************ Set Pitch and Bank By General Barron (aw_barron@hotmail.com) and vektorboson Parameters: [object, pitch, bank] Returns: nothing Rotates an object, giving it the specified pitch and bank, in degrees. Pitch is 0 when the object is level; 90 when pointing straight up; and -90 when pointing straight down. Bank is 0 when level; 90 when the object is rolled to the right, -90 when rolled to the left, and 180 when rolled upside down. Note that the object's yaw can be set with the setdir command, which should be issued before using this function, if required. The pitch/bank can be leveled out (set to 0) by using the setdir command. ************************************************************/ //extract parameters private ["_obj","_pitch","_bank","_yaw","_vdir","_vup","_sign","_rotate"]; _obj = _this select 0; _pitch = _this select 1; _bank = _this select 2; //find the yaw (direction) of the object //map compass directions go CW, while coordinate (vector) directions go CCW, so we need to flip this //if we don't flip this, the object will face backwards _yaw = 360-(getdir _obj); //---------------------------- //function to rotate a 2d vector around the origin //---------------------------- _rotate = { private ["_v","_d","_x","_y"]; //extract parameters _v = +(_this select 0); //we don't want to modify the originally passed vector _d = _this select 1; //extract old x/y values _x = _v select 0; _y = _v select 1; //if vector is 3d, we don't want to mess up the last element _v set [0, (cos _d)*_x - (sin _d)*_y]; _v set [1, (sin _d)*_x + (cos _d)*_y]; //return new vector _v }; //---------------------------- //find vector dir (pitch) //---------------------------- //find sign of pitch _sign = [1,-1] select (_pitch < 0); //cut off numbers above 180 while {abs _pitch > 180} do {_pitch = _sign*(abs _pitch - 180)}; //we can't use pitch that is exactly equal to 90, because then the engine doesn't know what 2d compass direction the object is facing if(abs _pitch == 90) then {_pitch = _sign*(89.9)}; //we can't pitch beyond 90 degrees without changing the facing of our object //(pitching beyond 90 degrees means that the object's eyes will point in the 2d compass direction that its back used to point) if(abs _pitch > 90) then { //we are rolling upside down; flip our direction (yaw) _obj setdir (getdir _obj)-180; _yaw = 360-(getdir _obj); //use bank to flip upside down _bank = _bank + 180; //and adjust our original pitch _pitch = (180 - abs _pitch)*_sign; }; //find appropriate vdir according to our pitch, as if we were facing north _vdir = [0, cos _pitch, sin _pitch]; //then rotate X & Y around the origin according to object's yaw (direction) _vdir = [_vdir, _yaw] call _rotate; //---------------------------- //find vector up (bank) //---------------------------- //find sign of bank _sign = [1,-1] select (_bank < 0); //cut off numbers above 360 while {abs _bank > 360} do {_bank = _sign*(abs _bank - 360)}; //reflect numbers above 180 if(abs _bank > 180) then {_sign = -1*_sign; _bank = (360-_bank)*_sign}; //find appropriate vup according to our bank, as if we were facing north _vup = [sin _bank, 0, cos _bank]; //rotate Y & Z elements according to pitch _vup = [_vup select 0] + ([[_vup select 1, _vup select 2], _pitch] call _rotate); //rotate X & Y around origin according to yaw _vup = [_vup, _yaw] call _rotate; //---------------------------- //apply the vectors //---------------------------- _obj setVectorDirAndUp [_vdir, _vup]; ----------------------------------------- An example of use: -Save the code as "setPitchBank.sqf" in your mission directory. -In init.sqf, write the following: setPitchBank = compile preprocessfile "setPitchBank.sqf" -In a script somewhere, write something such as: [player, 45, -15] call setPitchBank ----------------------------------------- This function lets you GET an object's pitch and bank, in degrees. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> /************************************************************ Get Pitch and Bank By General Barron (aw_barron@hotmail.com) and vektorboson Parameters: object Returns: [pitch, bank] Returns the pitch and bank of an object, in degrees. Yaw can be found using the getdir command. Pitch is 0 when the object is level; 90 when pointing straight up; and -90 when pointing straight down. Bank is 0 when level; 90 when the object is rolled to the right, -90 when rolled to the left, and 180 when rolled upside down. ************************************************************/ //extract parameters private ["_obj","_pitch","_bank","_yaw","_vdir","_vup","_sign", "_rotate"]; _obj = _this; //find the yaw (direction) of the object //note that map compass directions go CW, while coordinate (vector) directions go CCW //so when we rotate vectors by this much (below), we are actually adjusting the vector as though the object were pointing north _yaw = getdir _obj; //---------------------------- //function to rotate a 2d vector around the origin //---------------------------- _rotate = { private ["_v","_d","_x","_y"]; //extract parameters _v = +(_this select 0); //we don't want to modify the originally passed vector _d = _this select 1; //extract old x/y values _x = _v select 0; _y = _v select 1; //if vector is 3d, we don't want to mess up the last element _v set [0, (cos _d)*_x - (sin _d)*_y]; _v set [1, (sin _d)*_x + (cos _d)*_y]; //return new vector _v }; //---------------------------- //find pitch //---------------------------- //get vector dir (pitch) _vdir = vectordir _obj; //rotate X & Y around the origin according to the object's yaw (direction) //we will then be left with the objects vectordir if it were facing north _vdir = [_vdir, _yaw] call _rotate; //if we reverse the process we used to set pitch when facing north, we can now get pitch if ((_vdir select 1) != 0) then { _pitch = atan ((_vdir select 2) / (_vdir select 1)); } else { //we need a fail-safe here to prevent divide-by-zero errors //if X is zero, that means pitch is +/-90, we just need to figure out which one if ((_vdir select 2) >= 0) then {_pitch = 90} else {_pitch = -90}; }; //---------------------------- //find bank //---------------------------- //get vector up (bank) _vup = vectorup _obj; //rotate X & Y around the origin according to the object's yaw (direction) //we will then be left with the objects vectorup if it were facing north _vup = [_vup, _yaw] call _rotate; //rotate Y & Z around according to the object's pitch _vup = [_vup select 0] + ([[_vup select 1, _vup select 2], 360-_pitch] call _rotate); //if we reverse the process we used to set bank when facing north, we can now get bank if ((_vup select 2) != 0) then { _bank = atan ((_vup select 0) / (_vup select 2)); } else { //we need a fail-safe here to prevent divide-by-zero errors //if Z is zero, that means bank is +/-90, we just need to figure out which one if ((_vdir select 2) >= 0) then {_bank = 90} else {_bank = -90}; }; //if we are rolled over (abs bank > 90), we need to adjust our result if((_vup select 2) < 0) then { _sign = [1,-1] select (_bank < 0); _bank = _bank - _sign*180; }; //---------------------------- //return value //---------------------------- [_pitch, _bank];
  18. Is there a consolidated list of bugs anywhere? Perhaps the problem is a lack of documentation, not bugs?
  19. General Barron

    Roads and their proper sounds

    You added the texture in the roadway LOD? Meaning, a texture that you don't actually see. This is how it works with objects, I'm not sure if roads work the same way, as they are a bit "special"... So doesn't it mean if i use this code <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">... access = ReadOnly; files = "sil*"; rough = 0.000; dust = 0.005; soundEnviron = "gravel" ... in config.cpp that all existing "sil" texture files will have that particular sound? The "files" parameter needs a direct path, AFAIK. So, the parameter should look more like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">files = "\ca\roads\data\sil*"; But, this texture needs to be in the roadway LOD, placing it in any of the visual LODs will have no effect regarding sound. Again, this is how it works for objects, I'm not sure if roadways are the same. There is a limit of only 4 different ground texture types in a given terrain cell. However, this is different from the sounds which are used in objects. They are both configured in the same way though (in CfgSurfaces), so it is a bit confusing. The difference is *where* the texture is applied: an object's roadway LOD or on the map?
  20. General Barron

    Roads and their proper sounds

    AFAIK, the CfgSurfaces class refers to textures, not p3d models. That is to say, textures that you place in the roadway LOD of your models. But, I may be wrong, it might also be different when referring to roads...
  21. General Barron

    config variables??

    Unfortunately, the config class name for island objects is hard-coded to use the p3d model name. So, no, you can't have multiple "land_" classes, and have them all point to the same model. You basically need to duplicate the model, with different textures each time.
  22. Impossible, AFAIK. It is an extremely frustrating limitation of user actions. Scripted actions offer more flexibility though, you might want to add one of them in via the init event handler.
  23. General Barron

    Combing config problem

    Don't apologize, the whole point of the forum is for people to help each other on problems like this.
  24. General Barron

    Combing config problem

    #1: NEVER NEVER NEVER place a class CfgModels or class CfgSkeletons in your config.cpp! I've seen many addons which do this, and mess up a default install because they didn't do it correctly. Place it in your model.cfg instead, so it gets binarized into the addon! This should make your addon load faster anyway. #2: line 159 has an error. It looks like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class euro_has_3 : shelter When it should look like: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class euro_has_3 : shelter {} #3: You seem to include a "class cfgSounds" into your vehicle's configs. This does nothing, class cfgSounds is it's own super-class, just like class cfgVehicles. There may be other problems in there, I didn't look the whole thing over.
  25. General Barron

    Set pitch / bank functions

    Big, big, big, huge thanks to vektorboson, who actually knows math and corrected the bugs in my functions! I've updated the first post, the functions are now 100% correct, there were bugs before with the getting and setting of bank, depending on pitch. Again, major thanks to vektorboson for the help!
×