Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 29/02/20 in all areas

  1. Your topics are alright, I don't think there's such a thing as "too many questions". You ask reasonable questions and give full detail in an articulated manner - and I also seen you come back to describe solutions when you find them. This is helpful for other users that will run into the same issue one year or so from now - allowing them to solve their own problems and others to learn from the answers you get. In my opinion other medium like e.g. Discord falls short in this respect, volatility is way too high there and language is often netspeak. You'll find solutions there as well (faster than here probably) but there's less of a benefit for the community from it. Hope I make sense.
    2 points
  2. Fiz um básico aqui pra vc testar. Server-side: local greenzones = { {2441.173, -1721.99, 1, 130, 120, 100}, -- Grove Street {304.336, -1836.197, 1, 130, 120, 100}, -- Praia Los Santos {1154.833, -1385.175, 1, 70, 100, 115}, -- Los Santos Hospital } local colShapes = {} addEventHandler ("onResourceStart", resourceRoot, function () for i, v in ipairs (greenzones) do colShapes[i] = createColCuboid (v[1], v[2], v[3], v[4], v[5], v[6]) createRadarArea (v[1], v[2], v[4], v[5], 0, 255, 0, 150) addEventHandler ("onColShapeHit", colShapes[i], function (hitElement) if (getElementType (hitElement) == "player") then setElementData (hitElement, "greenzone", true) outputChatBox ("Você está protegido na zona verde.", hitElement) elseif (getElementType (hitElement) == "vehicle") then setVehicleDamageProof (hitElement, true) end end) addEventHandler ("onColShapeLeave", colShapes[i], function (leaveElement) if (getElementType (leaveElement) == "player") then setElementData (leaveElement, "greenzone", false) outputChatBox ("Você não está mais protegido.", leaveElement) elseif (getElementType (leaveElement) == "vehicle") then setVehicleDamageProof (leaveElement, false) end end) end end) Client-side: (copiei o seu e arrumei a última função) -- Protect greenzone'd players from getting attacked etcetera function onDamage() if getElementData(source, "greenzone") then cancelEvent() end end addEventHandler("onClientPlayerDamage", localPlayer, onDamage) -- Prevent people from being knifed while in greenzone function onStealthKill(target) if getElementData(target, "greenzone") then cancelEvent() end end addEventHandler("onClientPlayerStealthKill", localPlayer, onStealthKill) -- Render the "Greenzone protected" text above their heads function renderGreenzoneTag() local streamedPlayers = getElementsByType("player", root, true) if streamedPlayers and #streamedPlayers ~= 0 then local lpos = {getElementPosition(localPlayer)} for _, p in ipairs(streamedPlayers) do if p and isElement(p) then if getElementData(p, "greenzone") then local ppos = {getElementPosition(p)} if getDistanceBetweenPoints3D(lpos[1], lpos[2], lpos[3], ppos[1], ppos[2], ppos[3]) <= 20 then local x, y = getScreenFromWorldPosition(ppos[1], ppos[2], ppos[3] + 1.2) if x and y then dxDrawText("Voce esta protegido", x + 1, y + 1, x, y, tocolor(0, 0, 0), 0.5, "bankgothic", "center") dxDrawText("Voce esta protegido", x, y, x, y, tocolor(0, 220, 0), 0.5, "bankgothic", "center") end end end end end end end addEventHandler("onClientRender", root, renderGreenzoneTag) -- The next 4 functions are for ghostmode (vehicles ramming greenzone'd players on foot, lifting them off, etcetera) -- This protection is important; they usually try to forklift you out of greenzone, spawn a vehicle on you and catch you inside/annoy-ram you, then TP off to a clear zone to kill you, etcetera. function onStreamIn() if not getElementData(localPlayer, "greenzone") then return end if getElementType(source) == "vehicle" then setElementCollidableWith(localPlayer, source, false) end end addEventHandler("onClientElementStreamIn", root, onStreamIn) function cleanUp() if not getElementData(source, "greenzoneveh") then return end if getElementType(source) == "vehicle" and isElementCollidableWith(localPlayer, source) == false then setElementCollidableWith(localPlayer, source, true) end end addEventHandler("onClientElementStreamOut", resourceRoot, cleanUp) function enterGreenzone() local x, y, z = getElementPosition(localPlayer) local nearbyVehicles = getElementsWithinRange(x, y, z, 300, "vehicle") for i, v in ipairs(nearbyVehicles) do setElementCollidableWith(localPlayer, v, false) end end addEvent("onEnterGreenzone", true) addEventHandler("onEnterGreenzone", localPlayer, enterGreenzone) function leaveGreenzone(p) local x, y, z = getElementPosition(localPlayer) local nearbyVehicles = getElementsWithinRange(x, y, z, 300, "vehicle") for i, v in ipairs(nearbyVehicles) do setElementCollidableWith(localPlayer, v, true) end end addEvent("onLeaveGreenzone", true) addEventHandler("onLeaveGreenzone", localPlayer, leaveGreenzone) -- This 'bug' is not expected to happen without some sort of interference, but is a generic safeguard. -- If player exits the greenzone after incidentally having the bugfix applied to them, all controls will be automatically re-enabled anyways (that mechanism is in serverside). function antiGreenzoneBug() if getElementData(localPlayer, "greenzone") then setPedWeaponSlot (localPlayer, 0) toggleControl("fire", false) toggleControl("action", false) toggleControl("aim_weapon", false) toggleControl("vehicle_fire", false) toggleControl("vehicle_secondary_fire", false) end end addEventHandler("onClientPlayerWeaponFire", localPlayer, antiGreenzoneBug)
    1 point
  3. Não era esse o problema do veiculo indestrutivel, você colocou true quando sai da área, e false quando entrar, era somente isso mesmo. Sem problemas hehe, faz parte, já já você aquece e volta no ritmo, e bem vindo novamente, agora +1 pra ajudar o pessoal hehe
    1 point
  4. putssss... eu não percebi essa IF if isElement(h) and getElementType(h) == "vehicle" then que falta de atenção da minha parte... desculpe @Angelo Pereira to voltando na ativa agora, depois de 3 anos mais ou menos.. acabei esquecendo de muita coisa ah... faz parte Rsss
    1 point
  5. 1 point
  6. Sim, e o mais dahora é que da pra "hackear" esse código compilado dele facilmente, já vi que tem fileExists, fileOpen, fileGetSize, fileClose, md5
    1 point
  7. Introduction This guide intends to teach 3ds Max users how maps are converted and imported/exported through 3D applications, to then be used in professional renders, visualizations, machinma's or to utilise 3ds Max as a precise map editor. The below video demonstrates some of the possibilities that are being taught through this guide. There is a download link in the video description to IPL's that I have decompiled and filtered. Table of contents Prerequisites Access to GTA SA assets (read https://forum.multitheftauto.com/topic/119240-mta-modding-in-3d/ on how to extract, etcetera) Converting/decompiling GTA SA assets for compatibility Caution for performance and processing Importing IPL and IDE to 3D application Model issues and solutions Solution: Alpha is severely broken or has the wrong material applied on faces Solution: Random polygons appear black with flipped normals (.001 weld + reset/adjust smoothing groups) Common uses Converting to FBX Mental Ray adaption Designing and rendering a scene Mapping using Max Prerequisites Must have Autodesk 3ds Max of any desired version. Must have Kam's Maxscripts. Must have The Hero's RW importer. Must have GIMS EVO (Max 2016 or below). The beauty of this tool is it can convert various types of materials containing diffuse texture, into standard or GTA 5 material. It supports Kam's and RW material to be converted to standard. It is recommended to add the tool to a secondary copy of 3ds Max due to the heavy size of it. It is possible to have multiple copes of 3ds Max under 1 Student License. IPLs_for_download.rar Access to GTA SA assets This guide assumes you have already extracted the entirety of the .img archives found in \models directory of your GTA SA installation. Extracting the interior and cutscene archives is ideal as well. I'm not going to cover the process in this guide, instead please read my MTA Modding in 3D guide. The following files are needed and has a description for where they're stored. - DFF (gta3.img, cutscene.img, gta_int.img @ Grand Theft Auto San Andreas\models) - TXD (gta3.img, cutscene.img, gta_int.img @ Grand Theft Auto San Andreas\models) - IPL (gta3.img, gta_int.img @ Grand Theft Auto San Andreas\models) - IPL [binary] (Grand Theft Auto San Andreas\data\maps) - IDE (Grand Theft Auto San Andreas\data\maps - these are optional as they store 2dfx etc.) - IFP (Grand Theft Auto San Andreas\anim - these .img archives contain IFP archives which stores a good bunch of animations each. It's possible that gta3.img and cutscene.img contains IFP files too.) Converting/decompiling GTA SA assets for compatibility Before certain data can be processed by 3ds Max, it needs to be decompiled and cleaned up. Fortunately there are modding tools available which can partially get it done, leaving only small bits of work to be done by hand. GTA SA has a set of binary and non-binary IPL files. Every IPL found in gta3.img and gta_int.img are binary, meaning they're in a non-readable format and cannot be read by 3ds Max, as opposed to IPL files found in \maps\ which can be read. IPL files found in .img archives do not contain LOD models, whereas ones in \maps\ does. To help identify a LOD, you can look for lines that ends with -1, although not all of these are LOD's. If you want to load in LOD's separate from high detail's, you'll have to filter out LOD's by hand. In order to decompile binary IPL's you need the Binary decompiler tool from gtainside and the IPL name restorer from GTAforums. By simply decompiling the IPL files, they'll rename all of the model names to "unknown" but retain the ID's. The IPL name restorer tool will then restore the ID's by cross searching IDE files. There are cases where the tool fails to perform the rename, this namely happens for models which are animated such as burger shot, mills, signs etcetera. To correct this, simply use Prineside, look up the ID and get the model name associated with the ID. For those who care to keep LOD's separate from high detail's, simply use a coding editor e.g Notepad++ and use the search function and disable "case dependant" and search "lod". You'll want to have 2 versions of every non-binary IPL, one for LODs and one for high details. For high detail IPLs, delete anything with "lod" in their lines, and opposite for LOD IPLs. The first video in the thread contains decompiled IPL's, sorted with LOD's and without LOD's, and has interior world decompiled as well. Several IPL's can be merged together if so desired, although it may be wise to keep them separate to avoid overloading your scene with thousands of objects. Caution for performance and processing For anyone who doesn't have experience with game model conversion and import of game maps, it's crucial to know that a single part of the map, where that part of the map is not even half of a city, can have fatal consequences for your 3D application and cause shutdowns or hour long freezes if not optimised and dealt with. Your computer will not be very welcoming to thousands of objects and especially materials/textures. It can take 1 IPL district for your viewport to reduce to 5 FPS even without materials visible in viewport. Ways to go about this is using instances and xref/proxies. It seems that IPL imports instances, but at times they lose their instance status and become unique from eachother. If this issue is encountered, you'll want one model to be the parent of a lot of other instances. To do this, either check this Autodesk forum post or open Maxscript listener and add the following code. for obj in selection do instancereplace obj $foo Replace "foo" with the name of the model that you want to use as instance parent. For example you have 11 palm trees, 10 of which are named palm_tree and 1 is named palm_tree_parent. Select those 10 and then replace the word "foo" with "palm_tree_parent". Whenever you make geometry changes to "palm_tree_parent" the 10 others will be affected. Instanced models is a good start on scene optimisation, but is far from great. Deleting objects not seen by the camera or shadows, reflections, etc. can do a great deal of change for your viewport and render speed. Do yourself a favor and google scene/render optimization. I learned a lot for my demoreel through the following articles: https://evermotion.org/tutorials/show/10105/optimizing-3d-scenes-for-faster-rendering https://cgtricks.com/save-memory-when-working-with-big-scenes-3dsmax/ That being said, it's important to be aware of how big an impact these 16 year old maps can have on your $2000 workstation. Your computer won't take the maps lightly. If needed, consider splitting map parts into several max project scenes to avoid overload and rendering/work issues. Be extremely cautious with detail of reflection, refraction, shadows, lighting as these REALLY eat up rendering time from a solid 2 minute to 10 minutes+ if done by somebody without sufficient knowledge. Sometimes alpha materials may also slow down the renderer. There are also ways to enhance rendering speed (if using Mental Ray) by choosing IBL (Image based lighting), this can cut down rendering time by 2-6 times rather than using Final gather, however the quality can degrade so it's really a question about whether a shorter render time is desired at the expense of render quality. Importing IPL and IDE to 3D application Certain GTA scripts such as Kam's vanila and Kam's Goldfish editions comes with IPL import functions titled as "Map IO". These functions can handle not only IPL and IDE import with several settings, but also export. Exporting as .IPL can prove useful for mappers who then convert their IPL to MTA map editor format. I have just found that Goldfish's Map IO allows to to import not only standard materials (negating the need to convert gta material to standard scanline) but also allows to import binary IPL by specifying a local .dat file. This guide however focuses on the traditional way of importing and handling maps using vanilla scripts, not Goldfish's, so that those who want to know more in depth about the formats gets the option to do so. Nevertheless, below spoiler contains a quick overview of doing it using Goldfish's latest script. The below image shows how data files can be imported into 3ds Max along with models, by using Kam's orginal script "Map IO". Path to your DFF files. Ideally, you've extracted all of the IMG archive's contents into 1 folder. Version of the game models. Some DFF models are different depending on game to game (III, VC, SA) Select desired image format. Choose the one that your TXD files were extracted as, in my case it's TGA. Import IPL file. Import IDE file. Import ZON file. Import 2dfx data (after IDE is imported). For the vast majority of binary IPL's, only props, buildings and roads are included. The regular IPL's found in GTA SA installation\maps\ usually contain the land masses and such. The binary IPL's contain stream numbers, so they're split into several different IPL's presumably to put less strain on the GTA streamer. These can be merged into one if desired, but not ideal. Model issues and solutions There aren't any perfect GTA scripts and tools available to public to flawlessly import maps. For all of them there are either limitations or incorrections. Same applies to Blender. This guide contains some of the issues and possible solutions, but they're far from perfect. A minor issue which doesn't deserve any header is where IPL doesn't import anything, or an error message appears. This is usually the case when a different GTA script has been opened in the current 3ds Max instance. Simply close 3ds Max and run again. If it still happens, repeat the step but try on a new project scene, then save as new project file and merge into the main project scene. Solution: Alpha is severely broken or has the wrong material applied on faces All editions of Kam's scripts has issues with importing face or material index correctly. What this means for imported models is that they have randomly flipped faces (identified by black faces) or have the wrong material applied on the wrong place, e.g wall bricks on a house roof or tree bark on tree leaves. To fix these issues, use either CJ2000's RW importer or The Hero's RW importer. These two import materials and normals nearly correctly, although by looking at the models in viewport there's still black (flipped) faces. This is not the case when rendering the model, however. It's important to note that RW does not always import the rockstar models perfectly. There are cases where faces must be manually flipped, or enable doublesided for particular models. Disabling backface culling (on render) solves it most of the times. It's possible that neither of the above scripts imports 2dfx data unlike Kam's. In which case, it may be necessary to import map with Kam's, preserve the 2dfx positions and then replace corrupted models with RW imported ones. If several models are corrupted, it may be a good idea to look into using some object replacement scripts or functions if they come with 3ds Max. This can speed up with auto-aligning correct models to the corrupted ones. These articles may help: https://jamiesjewels.typepad.com/jamies_jewels/2011/10/85-3ds-max-quicktip-substituting-objects.html https://knowledge.autodesk.com/support/3ds-max/learn-explore/caas/CloudHelp/cloudhelp/2017/ENU/3DSMax/files/GUID-2CABA3D7-ECFA-4D0D-A8C2-E86600BEFBE4-htm.html Solution: Random polygons appear black with flipped normals (.001 weld + reset/adjust smoothing groups) The "Alpha is severely broken or has the wrong material applied on faces" section explains part of why this occurs. A way to fix the viewport issue is welding all vertices at 0.001 threshold. This removes any overlapping vertex. The model's smoothing groups can then be reset or adjusted, provided the model is imported with 1 total group which makes for a very smooth and unrealistic appearence. To correct the black polygons, use the "Flip normal" function. Simply flip any black polygons which are supposed to be white. This is not relevant to fix if your end goal is to render the map. Simply follow the method for "RW" scripts from the above section. It's only ideal to flip the faces if it annoys you to view the models corrupted in viewport. Common uses A lot of things are possible by importing GTA map into 3ds Max. For instance, film makers are able to integrate their own models with ease, customized animations and even physics, FX and much more. MTA mappers can also use the program to create mappings in 3D with a lot of powerful tools to ease the workflow. This can prove exceptionally useful for race maps due to Max's array functions to instance an object a thousand times along a curve to generate roads, loops and what not. Converting to FBX Instead of being restricted to Renderware and DFF formats, modelers can now import GTA map and then convert materials and the model components to be suitable with other programs and engines such as Cinema 4D, Unreal Engine and Unity. The conversion to FBX is in fact very simple. In order for DFF models to be converted, their material and lights needs to be converted too. GTA/RW material needs to be converted to standard scanline material. Normally it's only a matter of changing the material to standard and copying over the diffuse texture, and in rare cases, a specular and environment image as well. Lights may need to be adjusted to show the color that they're given in their IDE (if they import as dummies). Once that's done, the models may be exported as FBX (or any other model format). To correctly save as FBX format, follow the below steps. Go to File -> Export -> Export selected. This ensures that only the selected assets are being added to the FBX file, and that none other e.g non-converted models interferes and breaks the file. Next, find a location for the FBX file and name it to your liking. Below are the ideal settings for a GTA map to be exported as FBX. Smoothing Groups - enable if your lighting won't rely on vertex colors. You'll instead want to use smoothing groups to define model's shading. Preserve instances - enable if your scene utilises instances, disable if your scene only contains unique models. Preserve edge orientation Embed Media - Max will reference the textures used in the models, search for them in your texture folder, then paste the ones used in the scene into the FBX file. Very useful to cut down on texture folder size as it'll only use the ones that are used by your map. Can save some computer disk space. This can be useful if your client or member doesn't have access to your global texture folder. Units - normally you'll want metric/meters as that's the system used by SA. Axis Conversion - SA is Z-up whereas VC is Y-up (wrong?), so keep as Z-up. It's optional whether you should export lights or not. Look through the settings just to ensure that everything adapts to your preferences. If it does, hit OK and it will export. If you get an error message, make sure you've only selected the models with standard material. Mental Ray adaption For those who own a 3ds Max copy of version 2017 or higher, has the ability to change standard scanline materials to Physical among other material types within a few clicks using the Scene Converter (through the Rendering menu). For simple materials with diffuse maps, there are also other tools and 3rd party plugins that can convert between Vray/Corona/Arnold/Mental Ray and so forth. Having Standard Scanline materials in a Mental Ray scene can add to performance and render speed; it's always a good idea to keep materials corresponding to the active renderer. Arch & Design material also has a lot more functionality than Scanline does. In order to convert Scanline to Arch & Design, install the Material Converter from the following site. https://www.motivacg.com/downloads/scripts-3dsmax/. With this tool, simply choose the materials type according to their renderer. On conversion, all standard materials including multimaterials are converted into Arch & Design for use with the Mental Ray renderer. Designing and rendering a scene 3D rendering can be a beneficial way of visualizing a project or simply create art out of San Andreas. The above was shot on 3ds Max using Mental Ray as renderer in a scene lit by daylight system and parti volume shader as means of environment fog. A separate render pass was exported on the graphics card for Ambient Occlusion. The beauty and AO map were composited together and then color corrected. I tried to imitate "Welcome to the 80's" style of his GTA SA remastered CG shots. Down below I'll have a video and few lines of text on what I did to achieve part of what you see. It will by no means be the perfect guide to produce this exact image, but it hopefully will help people get started and troubleshoot issues through the process of setting up a scene. In the below video's description there are additional links and information. It's important to pause the video once a new subtitle appears, as they do not show for a very long duration. For those looking to add character animations to their project: Own GTA Anim Manager. Minor program that allows you to dig into IFP archives and change/modify their contents. Useful for adding/removing IFP animations in IFP archives. Own Kam's IFP scripts (comes with the DFF IO etc). Allows you to import animations onto skin rigs. It is a good idea to make necessary changes to rigs before applying animations. Necessary changes could be subdivision/smooth, material setup etcetera. After an animation is applied it's recommended to parent the Root bone to a dummy, so the new dummy can rotate the rig without the rig getting deformed while posing it. Mapping using Max Over the years a few community contributors have designed tools which export map files from Max, as well as internet converters which convert IPL to MTA. Which one to use really boils down to user preference. The most common however would be Kam's Map IO. This has the functions to export position/rotation data through IPL and IDE file types. These can be parsed/converted through 3rd party tools not necessarily related to Max. Another Max method of generating MTA maps is exporting using 50p's Map exporter. The beauty of creating maps in Max versus MTA map editor, is the ability to work in 3D and really isolate the mapping from everything else with a few clicks. It also offers great scene management, granting users options to import SA map for position reference, hide the SA map while creating their custom map etcetera. It also allows for visualizations of mappings using modern 3D graphics engines. 3ds Max has a lot of tools to create arrays or scatter objects around the surface of another object, those objects' pos and rot data can then be converted to MTA map file format. Mapping in Max can prove exceptionally handy for race mappers, or for those looking to group objects and move them all together, map with attention to precision or instance thousands and thousands of objects.
    1 point
  8. @Thalysson não reviva tópicos antigos. Veja as regras do fórum aqui. Sobre aumentar o volume da voz do jogador: setSoundVolume (localPlayer, 1)
    1 point
  9. Introduction Modding is a term used when modifying components, files and what not, in this particular case modifying game installation files in order to achieve unique results not seen in the vanilla game. GTA:SA is 3D era, where modding the game requires special 3D packages. Older games such as GTA:II uses a 2D engine, which means that modding the game was commonly done with image editing applications. We will cover some aspects of modding game textures and models. This guide intends on introducing those inexperienced with modding and 3D as a whole, on how to obtain 3D software and their recommended tools. It also introduces ways to import and export models, basic workflows for 3ds Max, texturing and creating models. TOC 3D packages, helpful tools and how to obtain them Extracting game assets How each type of game model works Limitations - MTA vs GTA Working with 3ds Max Texturing a game-ready cube 3D packages, helpful tools and how to obtain them There are various applications being used for modding. Although some has more tools available, there really isn't one that tops the others. In this section there'll be lists of a few 3D packages and tools used for modding. 3ds Max, arguably the most used program with the greatest amount of third-party plugins and scripts for various games. For GTA:SA, this program is favored by many modders due to it having 3rd party scripts for dealing with animations, collisions, lighting, modeling etcetera. There isn't much that 3ds Max can't, that other programs can, when it comes to GTA:SA modding. Although this can be expensive to run on a longer term, there are education licenses available which last for 3 years. These do not allow commercial use, and is marked purely as "educational use only". View more. Kam's (vanilla) max scripts, the first official script package for modding GTA:SA with 3ds Max. After the release of his scripts, a lot of others has developed scripts of their own, some of which are more optimized and less prone to issues. Even despite Kam's scripts having overseen issues, it is still to this day widely used for tasks such as, but not limited to; IPL map generation and import, collisions, animations, characters, vehicles, environment modeling. View more. Kam's (2018) max scripts, a modified version of Kam's vanilla scripts for 3ds Max. Notable features that were added are; DK22pac's Normal map plugin support, reflection map support for environment models, 2dfx panel for lights such as aircraft lights or street lamps. View more. The Hero's RW importer/exporter, a modern plugin that works extremely well with vehicles and environment models. Due to its simplified layout it is very easy to get used to. It's far recommended to use for vehicle model import/export due to its quality handling and materials, which are based on RW formats (renderware, the engine GTA:SA runs off). With the plugin using different model material formats from Kam's, it comes with a maxscript to convert scene materials from GTA_MTL to RW_MTL and vice versa, if needed by the modeler. View more. Deniska's max scripts, a pack for various types of GTA:SA modding, some features are obsolete for MTA users due to IPL and IDE modification required. Although, the pack does come with a few tools that may be useful to MTA modders, such as prelight tools to set the vertex colors and illumination to fixed values. View more. DexX's 2dfx export script, a standalone 3ds Max script that exports Omni and Dummy informations to .sae file formats, to then be added to the .dff using RW analyzer. With this script it's possible to integrate lights and particles into custom models, e.g flashing aircraft lights, street lights, fire and smoke, etcetera. With the release of Kam's 2018 scripts, this script is used less as using Kam's may be less work for some cases. View more. Blender 3D, a freeware (yes, completely free, no paid watermarks or any limitations), not as favored by modders throughout the years until recently, where a developer has released his script 'DragonFF' on GTAforums. Although it is WIP, modders has already binned 3ds Max and moved permanently to Blender. Although Blender is free, it actually combines several programs into one, allowing a Blender user to sculpt, paint, do lighting, professional rendering and modeling in one. A recent update in 2019 changes the RMB selection to LMB and UI among other things, making for a potential alternative to 3ds Max. View more (Blender). View more (Blender GTA script) Zmodeler, not as commonly used as the aforementioned programs, although it is being used very frequently by modders in various games, most notably for GTA:games. It does not have support for skinned characters, although it is being commonly used for vehicles, and sometimes environment modeling as well. This is a fairly inexpensive solution, but lacks tools for more broad modding. View more. Sketchup, a 3D application that focuses on architecture. For modding, it is a rather uncommon, though has a free and paid version and can be used for seemingly OK modeling. It does not have access to any 3rd party scripts for GTA:SA, hence its only use is modeling and then exporting model files to then import into 3ds Max or Blender. View more. Photoshop, mainly used for graphic design, but can also produce 3D models, video, GIF and textures for assets. Photoshop is the most favored by modders in regards to working with textures e.g paintjobs and retexturing. Although there are alternative image editors in the market, Photoshop definitely hits the top in terms of usable scripts (user-customized scripts as well) and ease of workflow. View more. DFF Viewer, a 3D graphics engine that is used for visualising GTA:SA models and supports .DFF and .TGA formats. Only single dff's can be loaded at a time. Though this is rarely used by those who has access to 3ds Max and Blender, it is commonly used for troubleshooting/testing work that involves retexturing a model e.g changing the clothing textures of a character. This program is entirely free and available from various GTA modding sites. View more. TXD Workshop, a texture dictionary editor that has been around for years, only since recent years to be succeeded by Magic TXD. Though TXD Workshop may not be the best for setting up TXD files, it has a built-in IMG archive editor, allowing one to browse all of the contents of gta3.img. View more. MagicTXD, a new texture dictionary editor with features for mass exporting .TXD contents from folders into image subfolders, texture compression, mipmaps, resizing textures etcetera. This is broadly used for .txd files and almost took over TXD workshop when it comes to working with texture dictionaries. View more. RW Analyze, a multi-use program with notable features being; ability to lock/unlock game files, add data to game models e.g 2dfx and vertex colors information extracted from other DFF files. View more. Extracting game assets In order to start modding GTA, access to the files is required. The files in question are commonly found in parent files that require some sort of program to open. In this case, TXD Workshop or any IMG editor and optionally Magic TXD for later on will work just fine. The below steps shows one way to extract all models and their texture dictionaries. For IMG editors (e.g Alci's IMG Editor): Open the editor. Under File, select Open. Find gta3.IMG stored in GTA SA directory\models. Highlight the first file in the list, then scroll down to the very bottom and SHIFT+LMB click the file on the bottom. This highlights every file in GTA3.IMG. Right click the list of files and select Export. On the popup window, find and select, or create a new folder on desktop called GTA SA ASSETS. Click enter to proceed. ((For cases where specific files are wanted, use the search field to find the necessary files and export them individually)) For TXD Workshop users: Open TXD Workshop. In the toolbar it says Open IMG. Click this, then find and select gta3.IMG stored in GTA SA directory\models. Highlight the first file in the list, then scroll down to the very bottom and SHIFT+LMB click the file on the bottom. This highlights every file in GTA3.IMG. Right click the list of files, select Extract. On the window, find and select, or create a new folder on desktop called GTA SA ASSETS. Click enter to proceed. ((For cases where specific files are wanted, use the search field to find the necessary files)) Now the folder GTA SA ASSETS contains nearly every .dff, .col, .txd and so on used by the game. Assuming one would like having all of the textures in PNG, DDS, TGA or any other common image format, they may follow the below steps using Magic TXD. Inside GTA SA ASSETS create a new folder named IMAGES. Open any .txd file found in GTA SA ASSETS using Magic TXD. Navigate to the toolbar. On Tools, click Mass export. Export settings are as following. Game root = root folder containing TXD's Output root = folder where images goes Image format = self explanatory With texture names only = exports images directly to folder and duplicate named ones gets replaced by one another Pre-pended with TXD name = exports images with TXD prefix In separate folders = makes new folder(s) for every TXD's contents Hit export. This process may take some time. Note that this process is the same for other .IMG archives such as player.img. There are also .txd and .dff files elsewhere, such as \models\generic\generic.txd, which is the vehicle shared texture dictionary file. How each type of game model works Models used on GTA SA uses different rendering techniques and data hierarchy than others. This section will introduce the features that some models has that others don't. Vehicles: Vehicle model components utilises hierarchies, where each component is linked to a dummy (helper) and each dummy is linked to parent dummies e.g chassis_dummy, for them to be registered in the hierarchy. In order for vehicles to not look flat or cartoon, a few steps are made in the model; Diffuse material is given a grunge texture or AO map, this helps telling the depth of the vehicle as well as giving it a feel of realism, so it isn't just clean. A specular lighting image is applied to the vehicle surface material, giving it a fake shine when looking from certain angles. If the vehicle has hard edges (smoothing), this image can increase the visibility of the normals, retaining its original look rather than being flat without visible difference in geometry. An environment (ENV) map is applied to the vehicle surface material, producing a fake reflection that is animated horizontally as the vehicle travels. Vehicles also has a lot of hardcoded features such as headlights, brake lights, emissive lights, taxi/aircraft lights, rotatable components and dynamic collisions for special vehicles like Forklift. Vehicles are also the only dff models that uses baked collisions, which means they are stored in the .dff itself. Below is a detailed hierarchy used for cars, and special components used by a number of vehicles (click the spoiler). Skin characters: Ped skin characters uses bones (dummy objects) that are connected to each other and linked to the character model. These bones are not visible in-game. In order for the bones to know what part of the 3D model they're responsible for, the skin needs to be rigged. Character rigging for GTA:SA is done by applying weigh on vertices. Using heatmap display, colors go through blue-red, low-high respectively. Values go from 0 to 100. If the value is 0, it means that the vertex is not used for any bone. This can cause issues. If the value is < 100, it means that the vertex is used for multiple bones. This results in smooth animations ingame, as the 3D model transitions smoothly through each bone. If the value is 100, it means that the vertex is only responsible for one bone. Skin rigging is generally something that is being avoided by modelers and makes Skin modeling the most difficult on GTA. Bones are as shown: CJ character: Carl Johnson's 3D model is split into several pieces in order to be compatible with the clothing script used to let the player customize CJ. These models uses a function known as multiclump to support 3 meshes per dff; normal, ripped and fat. This is for CJ's health stats to physically show in-game. Other than multiclump and additional bones, modding CJ skin is essentially the same as any other ped skin. Map environment: World objects .dff contains only single models, though they do support omni and dummy objects for 2d effects. These types of models uses Vertex Colors/Face Colors. This requires the modeler to paint colors onto the model which is then stored in the vertex colors channel (daytime) and vertex illumination channel (nighttime). Although uncommonly used by R*, these models do support reflection maps like vehicles use. Goldfish's modified version of Kam's scripts is excellent for exporting with reflection maps. GTA SA utilises multiple collision archives (.col) for every IPL district, being responsible for all of the world objects' collisions. However, on MTA, collision archives are not supported, so custom collision files are single models per .col. Not every object uses collisions though, some merely has their bounding space. These objects can not be selected with MTA map editor, thus requires additional scripting or modding. Limitations - MTA vs GTA Speaking of native support, MTA currently is behind in several places. Notable features that aren't available on MTA, but on GTA are as following. Item Placement (IPL) - another type of mapping file, but contains a lot more functions such as zones for real-time reflections as seen in interiors. Item definition (IDE) - a file used to but not exclusively, define settings for models, enabling alpha flags, disabling backface cull, enable breakable effect and much more. Limit adjuster - a rework of the game that allows for adding more ID's and bypass common limits. This however is being developed by one of MTA's contributors. There are various limitations such as polys per model, max dimensions for models and collisions, (very) strict size limits for collisions and CPU usage that can easily cause issues for modders. Not to mention the majority of the game data files which most MTA servers likes to force original, else the player won't be able to connect. These limits all has potential solutions being developed as with the limit adjuster. Working with 3ds Max As described above, 3ds Max is without a doubt the most common program for GTA modding. It's also used by professionals within architecture and visualisation and film industry. What's amazing about this program is that whatever is created in 3ds Max can ultimately be added to the game. A modeler made a square - it can get added right away, no adjustments required. That's the charm of 3ds Max. There's no need for additional tools to process the model for it to be compatible with GTA. It is also the primary program that Rockstar's developers used for creating the environment in GTA:SA. At a first glance, the program may seem rather intimidating. The main functions of the program that a beginner should be aware of are listed below. Shows the default home screen with 4 viewports. Left, Top, Front and Perspective. The 3 side ones are Orthographic viewports while Perspective is in regular mode. It is also the most common one to use. Highlighting a viewport and pressing (left)ALT W will full screen the viewport. In order to rotate camera view, the user must click and drag the square in the upper right corner. Its face also tells which side the camera is viewing e.g Top. If one wishes to see viewport statistics such as polygons per model, vertex amount etc., clicking: [ + ] icon on the upper left side > Configure Viewport > Statistics > Total + Selection > Apply > Clicking 7 on keyboard shows the statistics. This feature is extremely useful for modelers who are limited in polygons per model, or simply wants to see how many polys a car is. Common keyboard shortcuts F1: Opens Autodesk help section in new browser tab F2: Displays blue overlay on models F3: Displays models in wireframe F4: Displays edges on models F10: Opens render setup 9: Shows viewport statistics Q: Select objects W: Select and move E: Rotate R: Select and (mode) scale U: Orthographic viewport mode P: Perspective viewport mode A: Toggle angle snap S: Enable snap D: Disable viewport G: Enable/disable grid J: Display bounding edges LALT X: Xray mode for model Ctrl Z: Undo action Ctrl Y: Redo action In a heavy program like 3ds Max, being able to change preferences to one's likings is important. Do so by going to Customize > Preferences. Performance, file settings and such can all be configured in there. For GTA:SA modding, knowing how to subdivide and add geometry to existing GTA models is very important. Below is a list with actions that may come in handy. No-brainer: Editable Mesh is inferior to Editable Poly. Use Poly, poly, poly, poly... Editable mesh modeling Vertex selection mode Edit Geometry section Attach: attaches another model in the scene to the selected mesh Chamfer: chamfer selection of vertices; creates additional geometry Weld: merges vertices together within a specified threshold Surface Properties section Edit Vertex Colors: sets the color and illumination of selected vertices Edge selection mode Edit Geometry section Divide: divides an edge, adding a new vertex where it was divided/split Extrude: create and pull a new face out from existing edges (keyboard shortcut: LSHIFT + LMB-drag) Face selection mode Edit Geometry section Divide: creates a new face Extrude: pulls the select face(s) outwards or inwards and creates new geometry off that Bevel: essentially an Extrude followed by scaling of the face Surface Properties section Flip: flips a face 180 degrees Smoothing groups: defines the smoothing of the model. Autosmooth is in many cases OK, but may not fulfil everyone's expectations Editable poly modeling Vertex selection mode Edit Vertices Connect: selecting 4 verts on a box side and using this function will triangulate the side. Edge selection mode Edit Edges Connect: creates an edge between the selected edges, as in a bridge between two cliff sides (use the 'Settings' to choose between multiple or one edge on creation) Polygon selection mode Edit Polygons Inset: places a new polygon inside the selected, allowing to be scaled Bridge: connects two opposing polygons by creating a bridge between them (can be used for walls and gaps) Edit Geometry Slice Plane: enables the user to create a perfect cut on the model, can be rotated by degrees Rendering scene Modelers working on projects for companies or friends might want to show what they've accomplished, but a regular screenshot may not suffice. Talking of a screenshot like this: Instead, the modeler might want to show the scene with textures. Perhaps more than just textures - lighting? reflections? transparency? - this is where 3D rendering comes into play, and can be done by simply pressing SHIFT + Q on the keyboard. This can also by default use alpha channel. However, the quality could improve. The quality of the render depends on the scene assets (models, materials, lights), the Renderer and its settings. By default, 3ds Max utilises Scanline Renderer. This is not a production quality render, but rather meant for test shots and demos. Though the quality isn't great, it's still possible to produce seemingly interesting renders. The following render took merely 8 seconds. Using 3ds Max allows modders to bring GTA:SA into modern graphics, easily comparable or even superior to ENB's. It also enables modelers to share visualizations of their models to help the customer understand how it could potentially look for their game. In the above render, a Skylight is used with Scanline Renderer. A very basic render, though interesting and contains lots of depth. In order to replicate this result, below are the steps to follow: On the Create panel, where one would normally find boxes and spheres, click the toolbar Lights. Where it says Photometric change that to Standard. Click the Skylight and place it in the 3ds Max scene. Settings for Skylight explained Multiplier: intensity of the light Sky color: the color of the light Cast shadows: enable to produce shadows, though this is more of an Ambient Occlusion than actual shadows Rays per sample: quality of the shadow, ideally keep at <5 for tests and 15-20 for final shots In the actual render above, a sample of 5 was used, creating grainy shadows but quick render. Backface culling was enabled to avoid slowing down the render time. Skylight is great light source and is generally used to illuminate an entire scene and not particular models. In the same Lights tab, one may find use of Omni or Free lights, which both works great. These are great point lights, which as opposed to skylight, are able to illuminate parts of the scene e.g acting as street lights. Modifiers When modeling, modifiers can come in use and save the modeler a lot of time. The following modifiers are highly suggested for beginners to know about. Bend: bends the model, effect depends on the differences in the geometry Mirror: copies the mesh and mirrors it on the other side, commonly used for vehicles using symmetrical geometry Smooth: generates and applies smoothing to the model, generally the lower values makes for higher file sizes Symmetry: essentially the same modifier as 'Mirror' Turbosmooth: Smoothens the mesh, adding geometry, uses iterations Unwrap UVW: advanced UV editing, commonly used for preparing textures for models like characters and game assets UVW map: basic UV editing, X/Y/Z projection mapping as well as spherical, box and planar mapping Vertexpaint: allows for painting colors onto vertices and faces, these colors are rendered during either ingame or night time Texturing a game-ready cube Modeling has to start somewhere. Using standard 3D primitives is a good place to start. For the purpose of this guide, a Cube will be created in 3ds Max and textured in Paint.net, a free image editing software. Video tutorial: To start off, navigate to 3ds Max's Create tab on the right hand side panel, as shown below. Shows the Create tab on the panel. For this guide, click on Box (Cube). Use LMB and click and drag the mouse in the viewport to create the cube. Now that the Cube primitive is spawned in the viewport, on the same panel that it was created from, go to Modify tab and set its dimension parameters to 5,0, 5,0, 5,0 and 1 segment for all 3. Convert the model to Editable Poly by right clicking it in the Viewport > Convert to > Editable Poly. Go into Polygon selection mode and scroll down until the following buttons are visible: With viewport selected, on the keyboard press `CTRL A` to select all faces on the cube. Now, where it says `Color`, click the bar and on `Value` set it to 100, then do the same for `Illumination` but value at 35. What this does is it sets the vertex colors so that the model won't be overexposed during day/night time. Exit polygon selection mode and on Modifier List, click that and find Unwrap UVW. This applies a modifier stacked on top of the Editable Poly mesh. Under Edit UVs click Open UV Editor. This allows the user to make changes to the UV coordinates which tells the model how textures are projected onto the model. On the editor, ensure that Polygon selection is enabled. While in the UV editor, press `CTRL A` to select all UV islands. On the top of the editor click Mapping, then Unfold Mapping.... Keep it as Walk to closest face and enable Normalize Clusters. Click OK. The result should remind the user of how a simple cardboard box in real life looks when it's yet to be folded into a box. With the model unwrapped, on the toolbar on the UV editor, click Tools > Render UVW Template. The export settings below are ideal for this particular task. If one wishes to know exact dimensions of each square, enable Seam Edges. After exporting, on the modifier stack, press Collapse to. This saves the new UV's. The width and height should be on a 1:1 ratio to avoid stretching issues. 1024x1024 is more than enough. On the rendered image window, click the Save button and find a location to save it in, name it Cube_unwrapped and use Alpha channel (optionally). Now open Paint.net and insert the image. Once happy with the result, export as cube_diffuse. Diffuse map generated with the help of a UVW template. In order to apply the texture on the model, simply drag and drop the image from file browser onto the model in the Viewport. Although the example above is not textured properly in regards to rotations, it shows what can be done by using UVW templates, and how easy it really is to produce textures for models made from scratch. The model can be directly exported as DFF. Materials are not required to be GTA or RW, they can be standard and still show ingame. Some exporters wants the model in Editable Mesh however, so converting it may be required. Thanks for reading this guide, we hope it helps and we wish you the best of luck with modelling! For questions on modding, please refer to MTA's modding FAQ or MTA discord #modelling channel. KAM_s_GTA_Scripts_Upd_by_GF_v0.3.7.zipKAM_s_GTA_Scripts_Upd_by_GF_v0.3.7.zip
    1 point
  10. testa de novo Server.Lua
    0 points
  11. amigo agente não costuma fazer isso.. mais eu estava com o meu editor aberto aqui e resolvi adiciona-lo para você e aproveitando a função que o @Lord Henry deixou aqui resolvi fazer, veja se resolve o seu problema. só não esquece de clicar ali, e deixar um THANKS. Server.Lua
    0 points
×
×
  • Create New...