Jump to content

john_doe

Member
  • Content Count

    30
  • Joined

  • Last visited

  • Medals

  • Medals

Posts posted by john_doe


  1. On 9-1-2018 at 7:05 PM, code34 said:

    hi

     

    Just a simple modification, the type of oop object is code not object :)

     

    
    #include "..\..\lib\OOP\oop.h"
    
    CLASS("ItemList")
    
    PRIVATE VARIABLE("array", "items");
    
    PUBLIC FUNCTION("", "constructor") {
    	MEMBER("items", []);
    };
    PUBLIC FUNCTION("nil", "deconstructor"){
    	DELETE_VARIABLE("items");
    };
    PUBLIC FUNCTION("code", "addItem"){ // Object: Item
    MEMBER("items", nil) pushBack _this;
    };
    PUBLIC FUNCTION("", "getItems") FUNC_GETVAR("items");
    
    ENDCLASS;

     

    On 9-1-2018 at 7:11 PM, code34 said:

     You should now use this forum thread with the new OOP version :) cause this one is no longer maintain since few years

     

     

     

    Thanks alot!
    I'll try this later..


  2. On 26-9-2017 at 10:14 PM, code34 said:

    you can retrieve oop.h (temporary version) on this url :

    https://github.com/code34/combat_assault.altis/blob/1.35/warcontext/objects/oop.h

     

    i add a _self local variable to retrieve the pointer of the object itself

     

    you can use it like this

    
    PUBLIC FUNCTION("", "getThis") { _self; };
    
    MEMBER("getThis", nil);

    or directly using the _self variable in the code of object as it a reserved variable :)

     

    How would i go about adding a class object to an array ?

    If it can not be done, i can add the item ID's to the list but i'm not sure how i would get the "item details" (ex: name) from the ID...
     

    I have this 'Item' class:

    #include "..\..\lib\OOP\oop.h"
    
    CLASS("Item")
    
    PRIVATE STATIC_VARIABLE("scalar","lastItemID");
    PRIVATE VARIABLE("scalar", "id");
    PRIVATE VARIABLE("string", "name");
    
    PUBLIC FUNCTION("string", "constructor") { // String: ItemName
    	private ["_id"];
    	MEMBER("name", _this);
    
    	_id = MEMBER("lastItemID", nil);
    	if (isNil "_id") then {_id = 0};
    	MEMBER("id", _id);
    
    	INC_VAR("lastItemID");
    };
    PUBLIC FUNCTION("nil", "deconstructor"){
    	DELETE_VARIABLE("id");
    	DELETE_VARIABLE("name");
    };
    PUBLIC FUNCTION("", "getItemId") FUNC_GETVAR("id");
    PUBLIC FUNCTION("", "getItemName") FUNC_GETVAR("name");
    
    ENDCLASS;

     

    And this 'ItemList' class:

    #include "..\..\lib\OOP\oop.h"
    
    CLASS("ItemList")
    
    PRIVATE VARIABLE("array", "items");
    
    PUBLIC FUNCTION("", "constructor") {
    	MEMBER("items", []);
    };
    PUBLIC FUNCTION("nil", "deconstructor"){
    	DELETE_VARIABLE("items");
    };
    PUBLIC FUNCTION("object", "addItem"){ // Object: Item
    	private ["_items", "_index"];
    	_items = MEMBER("items", nil);
    	_index = count _items;
    	_items set [_index, _this];
    };
    PUBLIC FUNCTION("", "getItems") FUNC_GETVAR("items");
    
    ENDCLASS;

     


  3. Hi guys,

     

     

    I need to make a moving 3D sound for a Jet.

     

    - The sound needs to be played global

    - Attached to a high speed vehicle

    - Sound needs to be played in 3D

    - Needs to be repeated after it is finished

     

    How can i achieve this?

     

    I tried different commands like "say3D" and "playSound3D", but it seems that these positions are not dynamic..

     

     

    Thanks for any help!

    • Like 1

  4. Hi mate,

     

    I'm not as experienced as some on the forums, but I'll try to help you out!

     

    I believe this might be caused by your Geometry LOD. To correctly configure your Geometry LOD, ensure that all components are individually labelled using the component naming convention (component_1, component_2 - if memory serves me well!). Then, make sure the components are triangulated, have sharp surfaces, and are completely closed​. Then run the component convex hull modifier. 

     

    Good luck, hope you get there!

     

    Thanks man! I am not going to be able to test this out soon (last month of school ;) ), but atleast you gave me something to investigate.

     

    Thanks again!


  5. Okay so i did some testing..

     

    I excluded the rvmat's from the binarizing so that they would get copied over directly. This didnt give me an in-game error, but gave me a specific error in my RPT about my rvmat's.

    Appearently i forgot a semicolon somewhere (File: all my rvmat's, Line: 66)

     

    After this i started my game and spawned my building, no errors :)

     

    Now i removed the .rvmat file extension from the exclude list and binarized them..

    Started my game and spawned my building, the errors are back :(

     

    Now this makes me wonder, can you actually binarize rvmat's and use them? Is there a different way to reference them then

    "jdoe_test\Data\window_broken_glass.rvmat"

  6. Hi guys!
     
    I'm having a really hard time with RVMAT's..
    I'm trying to give my glass windows a correct RVMAT like how they did in the ArmA 3 Samples (Test_House_01), but somehow things do not work in my favour..
     
    So this is what i want to achieve:

    • A glass window with my own texture that is see through, has 2 textures (one for full health and one for health >0% && <50%) and breaks when health is below or eq to 0.

    What i got so far:

    • My own texture for 100% health
    • See-through
    • Window break effect on health <= 0

    What i still need:

    • Texture for health >0% && <50%
    • Grenades need to collide with glass and/or break them instantly

    I'm using the Test_House_01 Sample from ArmA 3 Samples for a guide reference.
     
    Here is my folder structure:
    aWxP6Td.png
    Nc63y3Q.png
     
    The stages for the window texture are:

    • full health = window_dirty_glass
    • 50% health = window_broken_glass
    • 0 health = window_broken_glass (this one can probably go, because it's fine if my whole window dissappears after breaking (dont need glass pieces on the edges))

     

    Here is my window_dirty_glass.rvmat (the other rvmat's are direct copies from this one)


    #define _ARMA_
    
    //Class structures_f_data : windows\window_set.rvmat{
    ambient[] = {2.2,2.2,2.2,1};
    diffuse[] = {1,1,1,1};
    forcedDiffuse[] = {0,0,0,0};
    emmisive[] = {0,0,0,1};
    specular[] = {1,1,1,1};
    specularPower = 800;
    //renderFlags[] = {"NoZWrite"};
    PixelShaderID = "Super";
    VertexShaderID = "Super";
    class Stage1
    {
    	//texture = "A3\Structures_F\Data\Windows\window_set_NOHQ.tga";
    	texture = "#(argb,8,8,3)color(0.5,0.5,1,1,NOHQ)";
    	uvSource = "tex";
    	class uvTransform
    	{
    		aside[] = {1,0,0};
    		up[] = {0,1,0};
    		dir[] = {0,0,0};
    		pos[] = {0,0,0};
    	};
    };
    class Stage2
    {
    	texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)";
    	uvSource = "tex";
    	class uvTransform
    	{
    		aside[] = {1,0,0};
    		up[] = {0,1,0};
    		dir[] = {0,0,0};
    		pos[] = {0,0,0};
    	};
    };
    class Stage3
    {
    	texture = "#(argb,8,8,3)color(0,0,0,0,MC)";
    	uvSource = "tex";
    	class uvTransform
    	{
    		aside[] = {1,0,0};
    		up[] = {0,1,0};
    		dir[] = {0,0,0};
    		pos[] = {0,0,0};
    	};
    };
    class Stage4
    {
    	texture = "#(argb,8,8,3)color(1,1,1,1,AS)";
    	uvSource = "tex";
    	class uvTransform
    	{
    		aside[] = {1,0,0};
    		up[] = {0,1,0};
    		dir[] = {0,0,0};
    		pos[] = {0,0,0};
    	};
    };
    class Stage5
    {
    	//texture = "A3\Structures_F\Data\Windows\window_set_SMDI.tga";
    	//uvSource = "tex";
    	uvSource = "none"
    	// class uvTransform
    	// {
    		// aside[] = {1,0,0};
    		// up[] = {0,1,0};
    		// dir[] = {0,0,0};
    		// pos[] = {0,0,0};
    	// };
    };
    class Stage6
    {
    	texture = "#(ai,64,64,1)fresnel(1.4,0.3)";
    	uvSource = "tex";
    	class uvTransform
    	{
    		aside[] = {1,0,0};
    		up[] = {0,1,0};
    		dir[] = {0,0,0};
    		pos[] = {0,0,0};
    	};
    };
    class Stage7
    {
    	useWorldEnvMap = "true";
    	texture = "A3\data_F\env_land_co.tga";
    	uvSource = "tex";
    	class uvTransform
    	{
    		aside[] = {1,0,0};
    		up[] = {0,1,0};
    		dir[] = {0,0,0};
    		pos[] = {0,0,0};
    	};
    };
    //};
    
    

    And this is my config.cpp


    /* This building only has one stage (undamaged) and has no doors or windows */
    #include "basicdefines_A3.hpp"
    #include "config_macros_glass.hpp"
    #include "cfgPatches.hpp"
    
    class CfgVehicles
    {
    	// Parent class declarations
    	class House;
    	class House_F: House
    	{
    		//class DestructionEffects;
    	};
    	class Ruins_F;
    
    	// Class of the house in good state
    	class JDOE_Test_Model: House_F
    	{
    		scope = 2; // 2 = public = shown in editor
    		displayName = "JDOE Test Model"; // Name in editor
    		model = jdoe_test\JDOE_Test_Model.p3d; // Path to model
    
    		vehicleClass = Structures; // category in editor; "Structures" value is a class defined in CfgVehicleClasses
    		mapSize = 20.27; // Scale of icon in editor
    		cost = 40000; // Score penalty for destroying the house
    
    		//selectionDamage = DamT_1; // Selection which will have textures and materials switched (according to "class Damage definitions") based on total damage of the house
    		//replaceDamagedHitpoints[] = {Hitzone_1_hitpoint, Hitzone_2_hitpoint}; // Array of hitpoints (subclasses in "class Hitpoints") that can trigger switch to the damaged version when destroyed
    		replaceDamaged = "JDOE_Test_Model"; // Classname of the damaged version
    
    		// class DestructionEffects: DestructionEffects
    		// {
    		// 	class Ruin
    		// 	{
    		// 		simulation = ruin;
    		// 		type = jdoe_test\JDOE_Test_Model.p3d; // Path to model of ruin used when total damage of the house reaches 1
    		// 		position = "";
    		// 		intensity = 1;
    		// 		interval = 1;
    		// 		lifeTime = 1;
    		// 	};
    		// };
    		class HitPoints // Entities representing destructible subparts of the house
    		{
    			// Hitpoint of each window, defined using macros from config_macros_glass.hpp to avoid a giant wall of text due to having 14 particle effects each.
    			// In practice they are defined in the same manner as the hitpoints above. These follow Glass_#_hitpoint naming trend.
    			// First parameter being number id, second being a value for armor parameter and third being a value for radius parameter.
    			NORMAL_GLASS_HITPOINT(1,0.01,0.175)
    			NORMAL_GLASS_HITPOINT(2,0.01,0.175)
    			NORMAL_GLASS_HITPOINT(3,0.01,0.175)
    			NORMAL_GLASS_HITPOINT(4,0.01,0.175)
    			NORMAL_GLASS_HITPOINT(5,0.01,0.175)
    			NORMAL_GLASS_HITPOINT(6,0.01,0.175)
    			NORMAL_GLASS_HITPOINT(7,0.01,0.175)
    		};
    		class Damage
    		{
    			// Texture pairs (below 0.5 health and 0.5+) for switching visuals (can also use generated)
    			tex[] =
    			{
    				// Window textures
    				//"A3\Structures_F\Data\Windows\window_set_CA.paa",
    				//"A3\Structures_F\Data\Windows\destruct_half_window_set_CA.paa"
    				"\jdoe_test\Data\window_dirty_glass_ca.paa",
    				"\jdoe_test\Data\window_broken_glass_ca.paa",
    
    				// Grey color
    				"#(argb,8,8,3)color(0.501961,0.501961,0.501961,1.0,co)",
    				"#(argb,8,8,3)color(0.294118,0.294118,0.294118,1.0,co)",
    
    				// Brown color
    				"#(argb,8,8,3)color(0.501961,0.25098,0,1.0,co)",
    				"#(argb,8,8,3)color(0.392157,0.196078,0,1.0,co)",
    
    				// Yellow color
    				"#(argb,8,8,3)color(1,1,0.501961,1.0,co)",
    				"#(argb,8,8,3)color(0.513725,0.513725,0.203922,1.0,co)",
    
    				// Light grey color
    				"#(argb,8,8,3)color(0.752941,0.752941,0.752941,1.0,co)",
    				"#(argb,8,8,3)color(0.478431,0.478431,0.478431,1.0,co)",
    
    				// Red color
    				"#(argb,8,8,3)color(1,0,0,1.0,co)",
    				"#(argb,8,8,3)color(0.701961,0,0,1.0,co)"
    			};
    
    			// Unlike textures, materials are not in pairs but in triplets (health: 0 - 0.49, 0.5 - 0.99, 1)
    			mat[] =
    			{
    				 //"A3\Structures_F\Data\Windows\window_set.rvmat",
    				 //"A3\Structures_F\Data\Windows\destruct_half_window_set.rvmat",
    				 //"A3\Structures_F\Data\Windows\destruct_full_window_set.rvmat"
    				"\jdoe_test\Data\window_dirty_glass.rvmat",
    				"\jdoe_test\Data\window_broken_glass.rvmat",
    				"\jdoe_test\Data\window_no_glass.rvmat"
    			};
    		};
    		class AnimationSources
    		{
    			// Animation sources for windows
    			class Glass_1_source
    			{
    				source = Hit; // "Hit" = value of this source is the health of an entity
    				hitpoint = Glass_1_hitpoint; // Specifies health of what is the control value of this animation; "Glass_1_hitpoint" being the class defined in class Hitpoints
    				raw = 1;
    			};
    			class Glass_2_source: Glass_1_source
    			{
    				hitpoint = Glass_2_hitpoint;
    			};
    			class Glass_3_source: Glass_1_source
    			{
    				hitpoint = Glass_3_hitpoint;
    			};
    			class Glass_4_source: Glass_1_source
    			{
    				hitpoint = Glass_4_hitpoint;
    			};
    			class Glass_5_source: Glass_1_source
    			{
    				hitpoint = Glass_5_hitpoint;
    			};
    			class Glass_6_source: Glass_1_source
    			{
    				hitpoint = Glass_6_hitpoint;
    			};
    			class Glass_7_source: Glass_1_source
    			{
    				hitpoint = Glass_7_hitpoint;
    			};
    		};
    	};
    };
    

    The problem i'm having, with this setup, is that it cant find my rvmat files, when i spawn my building it spits out this error:


    Cannot load material file \jdoe_test\data\window_dirty_glass.rvmat

    same case for all the other rvmat's
     
    When i try the ones they use in the Test_House_01 sample it works, but these have different textures and the health 50% texture doesnt show up..
    These are the ones they use:

    A3\Structures_F\Data\Windows\window_set.rvmat
    A3\Structures_F\Data\Windows\destruct_half_window_set.rvmat
    A3\Structures_F\Data\Windows\destruct_full_window_set.rvmat

     
     
    Can anyone help me with this problem?
     
    BTW, i'm a total noob when it comes to RVMAT's. I've tried some guides out there but haven't found one for buildings and glass windows..
     
     
    ~JohnDoe


  7. First resize your texture to get a *2 format (256*256, 512*512, 1024*1024 and so on).

    Then you need to have an alpha channel in your .tga, which is a greyscale layer where all parts of your texture that are colored in black will be 100% transparent and those in white will be 100% visible. All the values between full black and full white (aka grey values) will define the visibility strengh of these parts.

    Ah thanks! I think i know how to fix it now :)

     

    You can also export your texture in the .png format without compression and with transparency, and then TexView2 will detect the alpha channel.

    This didn't work.. But i think that is because my image size wasn't *2..

     


  8. Hi guys!

     

    I've been fiddling around with creating a texture for glass windows in ArmA 3.

    Now i've come to the point where i know i need a .tga with transparency and convert it to a DXT5 .paa file...

    But somehow my paa file changes to ARGB1555 and in-game its a solid kind of blue color.. (so not see-through)

     

    My texture is just a simple brown color RGBA(112,78,0,143).

    Here is my rvmat: http://pastebin.com/WMUmUVbE

    (i have done some research on the rvmat, but most of it is kinda out of my league because i dont know alot about color management and stuff like that, so it may look like a mess...)

     

    Does anyone know why this happens?

     

     

    ~ JohnDoe


  9. Hi guys!

     

    Somehow my camera goes trough my building walls and floors (when i turn around while standing near a wall) and i can not figure out why this happens..

     

    I'm using the ArmA 3 House Sample for a reference guide, but i cant find anything in there that relates to my problem.

    I suspect it is a LOD that i may have misconfigured, but i don't know which one it is and how i should properly configure it..

     

    Thanks in advance for any answers! :)

     

     

    ~ JohnDoe


  10. 1. do not import all lods at the same time. The naming convention works only in 50% of the cases. Import each individual LOD by itself in a separate OB than your work OB for the entire .p3d, and copy paste it in it.

    It worked 100% for me... But i see why it could be usefull to have it in a seperate OB

     

     

    2. FBX cannot move to OB points (memory and hitpoints are simple points). Either use some simple planes and delete these on import, or try with dummy objects (i wasn't able to do it that way).

    Yeah i just found out about it.. I just cut/paste all the points that do not form a face together.


  11. I found out that the Memory and Hitpoints LODs are being converted to a plane in my 3Ds Max and have a "LOD__1.000" suffix..

    This means that when i export these as FBX and import them in O2, they will not turn into Memory and Hitpoints LODs...

    You'll need to change these in 3Ds Max to the right LOD suffix, so:

     

    "object_NNN200_LOD__1.000" ("Glass_1_effect" in Memory LOD)

    becomes

    "Glass_1_effect_LODMemory" in 3Ds Max

     

    Havent figured out how that "random" naming works with NNN.

    Not sure if i'm missing some settings for this...


  12. Hi guys!

     

    I'm making a building for ArmA 3, but somehow units can spot me through my walls.. The weird thing is that they can see me, but they wont shoot..

     

    On the bohemia wiki all they say about the View Geo is:

    The visible geometry of the model.

     

    As an example: If you have an object with this LOD properly configured, you will not be able to spot other units through the model. AI will not be able to spot other units through the model.

    (https://community.bistudio.com/wiki/LOD)

     

    as you can see this is not really explaining HOW to properly configure this LOD.

     

    So how does one "properly" configure a View Geometry LOD in O2?

     

     

    ~ JohnDoe


  13. Hi guys!

     

    So i just found out a pretty nice feature of O2 when importing/exporting FBX files (have not tested other file types).

     

    My workflow for creating a building in ArmA3 looked like this:

    1. Make model in 3Ds Max
    2. Export as FBX
    3. Import FBX in O2
    4. Setup LODs
    5. Pack as addon

    Now the problem with this is whenever i change something to my model, i have to redo all my LODs in O2..

    I was using a Building from the Arma 3 samples, as a guide to learning "Building creation" for Arma 3, and noticed that whenever i exported the O2 model (.p3d) as an FBX and imported it in my 3Ds Max, that all the names for the objects where different from the names in O2..

     

    3Ds Max: http://prntscr.com/axf6qb

    O2: http://prntscr.com/axf73s

     

    Now as you can see the ones in 3Ds Max are actually all the LODs from O2. So i thought okay cool it shows from which LODs they came, but the cool thing is when you follow these "naming rules" (couldn't find a official document for this, so if anyone has a link that would be great) you can already setup your LODs in 3Ds Max.

     

    When you export your model as FBX (haven't tested other types) and import it in O2, your LODs are automatically created for you!

     

    I am not sure what the exact rules are for this naming but it looks something like this:

     

    "objectname_lodname"

    "objectname_lodname_distance" (for LODs that require a distance)

     

    Again i have found no official rules here and i'm not sure if this is already known by alot of guys here, but i was pretty excited when i found out so i just wanted to leave this here ;)

     

     

    ~ JohnDoe

    • Like 1

  14. Hi guys!

     

    Somehow my grenades go through my building...

     

    I have a working Geo (+ Phys + Fire) LOD setup and normal collision between player works (also it stops bullets and rockets), but it doesnt stop my grenades..

     

    Is there a different LOD for grenades?

     

    EDIT: Found out that my RoadWay LOD's do stop grenades.. But dont think this is the way to go here..

     

    ~ JohnDoe

×