Jump to content
Official BF Editor Forums


  • Posts

  • Joined

  • Last visited

Everything posted by Bad_santa12345

  1. C++ and Directx9 APIs I think this could be achieved quite easily with the hooked Directx9 interfaces of RFX.dll. IIRC I already have some custom rendering done just before the 1p scene is rendered. I will look into it when I have spare time.
  2. I did some work on this and released a new dll on GitHub. https://github.com/BadSanta12345/RFX/releases/tag/0.02 Exposed more hudItems functions to con scripts. hudItems.getBool std::string -> bool hudItems.getInt std::string -> int hudItems.getFloat std::string -> float hudItems.getString std::string -> std::string hudItems.setInt std::string int -> void hudItems.createBool std::string -> void hudItems.createInt std::string -> void hudItems.createFloat std::string -> void hudItems.createString std::string -> void Exposed functions for manipulating shader uniform variables from con scripts. shadermanager.setFloatBySemantic std::string std::string float -> std::string shadermanager.setFloat2BySemantic std::string std::string D3DXVECTOR2 -> std::string shadermanager.setFloat3BySemantic std::string std::string D3DXVECTOR3 -> std::string shadermanager.setFloat4BySemantic std::string std::string D3DXVECTOR4 -> std::string For the shaderManager functions the first argument is the shader file name, second is the semantic and third is the new value. It only works for shaders which are not conditionally compiled / cached in the profile folder. The commands should work from any .con/.tweak file or from hud buttons etc.
  3. Only thing modified in the RFX.exe compared to vBF2.exe is the import address table so that the first thing it does is load the RFX.dll. The IAT modification can be done to any .exe. I used CFF Explorer to do it.
  4. Ah I forgot that one it should be on there now. You might still need some Microsoft Visual C++ runtimes. I will have to check which ones are actually required and upload a copy of those as well.
  5. https://github.com/BadSanta12345/RFX/releases/tag/Test here are the build binaries for testing that the code even runs. You should copy both RFX.exe and RFX.dll to your BF2 install directory. Then if you run RFX.exe with shortcut parameters "+fullscreen 0" and "+szx 1920 +szy 1080" (adjust to your resolution). Then you should be able to toggle fullscreen with Alt+Enter. Thats pretty much the only feature this version has.
  6. Here is a bare bones version of the source code https://github.com/BadSanta12345/RFX It doesn't have any actual features yet but at least I got it to GitHub so it should be faster to add them in. I do have the code for all the stuff presented in my YouTube videos and for the shader variable thing but I have to do some cleaning up before I am ready to add them to the GitHub project for everyone to see.
  7. Just a little update: I have been working on making the code more portable so if someone else wants to compile it they have to download as few libraries as possible. Now I got it to the point where the only needed library is actually the directx9 sdk which is a must for the shader functionality to work. Also it has to be compiled with Visual studio 2015 because it uses some of the new fancy C++ 11/14 features. I still have to find out why the game always crashes when exiting instead of shutting down and freeing resources correctly.
  8. Yeah. I think the terrain is rendered in 6 passes or so, one for each detail texture. At the moment the system can only pass sort of global data. For example if you pass a texture to a custom texture variable in the bundledmesh shader the texture will be the same for all bundledmesh instances. I think I can make it more clever so that it could pass different textures for different terrain detail layers. PS. I am currently doing some work on the dynamic shadow maps. I already got rid of the horrible shimmering edge when you move or rotate the camera. I think it might be possible to do cascaded shadow maps in BF2. Cascaded shadow maps is the method most modern game engines use for dynamic shadowing.
  9. Textures and samplers work just like any other variable. You can add new or use existing ones. When using existing ones there is a change that BF2 overrides your changes. I don't have the system hooked into BF2's texture manager so there are some differences to regular textures. Textures are loaded on demand instead of deferred loading. Textures don't have to/can't be inside .zip files. Texture path must contain the mods/[modname] because the path is relative to the working directory of BF2.exe instead of the mod directory Textures are unloaded only when BF2.exe is shut down
  10. No you still need the .exe and .dll hack. I also got custom textures working. I just joined Github and started working on cleaned up open source version of the .dll so all my work doesn't go to waste.
  11. I got it working I even exposed the functionality to the .con files so it is easier to experiment. I only added support for float vectors for now. shadermanager.setShaderFloatBySemantic [ShaderName] [ParameterSemantic] [float] shadermanager.setShaderFloat2BySemantic [ShaderName] [ParameterSemantic] [D3DXVECTOR2] shadermanager.setShaderFloat3BySemantic [ShaderName] [ParameterSemantic] [D3DXVECTOR3] shadermanager.setShaderFloat4BySemantic [ShaderName] [ParameterSemantic] [D3DXVECTOR4] For example to pass the sun direction to the terrain shader you could add this to the sky.con or almost any other .con file. var v_sundirection lightManager.sunDirection -> v_sundirection shadermanager.setShaderFloat3BySemantic TerrainShader.fx SUNDIRECTION v_sundirection You can change any parameter but most of those will be overridden by the game so it is better to just add new parameters with different names. This works for shaders where the first line looks something like this #line 2 "TerrainShader.fx"
  12. With my .exe .dll hack it is certainly possible to pass any information to the shaders but in this case it would require a bit of work. BF2 uses the ID3DXEffect interface for managing the shaders so if you could somehow get a pointer to the right effect interface. You could use functions like GetParameterBySemantic and SetFloat, SetFloatArray... to pass any info to the shaders even textures. The problem is how to get the pointer to the terrain shader effect interface. BF2 also uses quite old version of the DX9SDK which may cause some trouble with the interface. I might look into this when I have some spare time
  13. I don't think it is possible with python or with any build in command. I do know a way to change the geom or lod of any object at runtime but as most of my experiments it requires modifying the actual game code (.exe) Proof of concept video https://youtu.be/X3F-9HCbly0
  14. I haven't tested this but instead of an emitter and particle you could use an ObjectSpawner to spawn the sinking ship as a PCO.
  15. Is it done throught python or entirely from HUD?
  16. The object has to have networkable info. To add networkable info to a SimpleObject without any errors you have to add mobile physics to it. But IMO the best way is to just change the object from a SimpleObject to a DestroyableObject and add armorcomp with maxHitPoints set to 99999.
  17. It is basicaly the same as exporting a soldier. You first need to rig the meshes to the appropriate skeletons/bones using the skin modifier and then export as a skinnedmesh. It is a pain in the butt if you ask me. http://www.moddb.com/games/battlefield-2/tutorials/how-to-export-a-soldier
  18. If you have 3dsmax with POE tools it is quite simple but time consuming. - First you import the weapon animation "scene" (skeleton and the mesh) - Setup a camera to the postition of the camerabone. - Import the animation you want to edit. - Then just move a bone called "torus" until the weapon looks good on the camera. - Write down the postiton of the torus. - Export the animation and repeat for all other animations for that weapon. (For each animation move the torus to the position you wrote down.) Someone with experience in maxscripts could propably make a script that would to this automatically. EDIT: Important thing before exporting is to create a selection set called ANIMATED !!!
  19. init.con, sky.con, gamelogicinit.con, skydome.con which ever you want it doesn't really matter as long as the .con file gets loaded.
  20. Increase "shadowmanager.shadowmapsize" and decrease "shadowmanager.shadowmapdepthdistance" The default values are "shadowmanager.shadowmapsize 1024" and "shadowmanager.shadowmapdepthdistance 40" The shadowmap depth distance is basically the size of the shadowmap in meters so decreasing it increases resolution but decreases draw distance.
  21. This is just a picture node added to block you from seeing the enemy death state but it does what you asked. rem -------------------------------EnemyDeathStateBlocker-------------------- hudBuilder.createPictureNode Scoreboard EnemyDeathStateBlocker 405 96 19 419 hudBuilder.setPictureNodeTexture Ingame\GeneralIcons\full.dds hudBuilder.setNodeColor 0.745 0.729 0.58 0.9 Just add that piece of code to the END of your "HudElementsScoreboard.con" Edit: nvm you can still figure out who is dead based on the color of his name and AFAIK the colors of the names are hard coded.
  22. The path to the object should start with "objects/" no matter if it is mounted from a map specific archive or from the main objects archives. So devilmans method should work if the hierarchy is correct.
  23. Yes it is possible but AFAIK not when the mag is empty. The closest thing you can get to realistic reload system like in BF3 is to use the "PrimaryAmmoBlink" variable, which is active when you have 30% or less ammo on your mag. With that you could get a different animation when you have less than 10 bullets on a 30 bullet mag. It will activate at 0 bullets if your mag capacity is less than 3. Changing the reload time itself would have weird side effects on dedi because the hud is only client sided the reload time on the server would still be the same. Kind of like my item http://www.youtube.com/watch?v=ARSq2c4v9Ks&list=UU6MLv8WTgXpTiYrxaIlSmAw&index=1&feature=plcp system. When on dedi i change my kit to have a flashbang instead of smoke grenade in my view i have a flashbang but from another players view i still have a smoke nade and then when i throw the flashbang a smoke nade spawns because spawning the projectiles is done by the server and the server still sees me with a smoke nade even thought i client sidedly edited the kit to have a flashbang.
  24. Changing the reload time through hud would not work on dedi but you can change the animations and sounds. I have actually tested that it works i used "PrimaryAmmoBlink" as a variable it activates when there is 30% of your ammo left. I havent found a variable that activates when the ammo is 0. I tried hudBuilder.setNodeLogicShowVariable EQUAL PrimaryAmmoString 0 and hudBuilder.setNodeLogicShowVariable EQUAL PrimaryAmmo 0 but those didnt work
  • Create New...