Leaderboard
Popular Content
Showing content with the highest reputation on 09/10/21 in Posts
-
This quickguide covers how you can remove objects like night lights and wires. SAMP editor method To install SAMP editor, simply drag and drop the packaged contents into your GTA SA installation. Run the application. https://www.moddb.com/downloads/san-andreas-multiplayer-map-editor Code for removing object in video removeWorldModel ( 16745, 1, 392.9141, 1511.5625, 21.5859 ) ^This is for the script.Lua file <meta> <script src="script.Lua" type="server" /> </meta> ^This is for the meta.xml file For those who want to load it into a .map file, the below code can be edited with your coordinates, ID and radius. <removeWorldObject id="removeWorldObject (objectname) (1)" radius="100" interior="0" model="9934" posX="-1724" posY="765" posZ="24" rotX="0" rotY="0" rotZ="0"></removeWorldObject> ^This is for the .map file if you rather use map editor format Note: SAMP editor doesn't want to run if MTA (gta exe) is already running. Therefore you'll want to add SAMP editor into a separate gta sa installation. I use 3 (1 for playing, 1 for samp editor, 1 as clean backup) on my PC. This requires 12gb disk space. This lets you boot up MTA and SAMP editor without conflicting issues. Prineside method Prineside is a site containing IPL and IDE information about objects, it also serves a GTA map with position pinpoint functionality, allowing you to get the object ID easily by clicking a spot in the map. Use Prineside's Model search by location to pinpoint the location closest to the object of interest. This generates a list of objects within 500 meters from the pin, closest to farthest. Clicking an object page gets you its object name and ID. At the bottom of an object page you can get the position export. Repeat the steps from SAMP editor method for adding the coordinates to the code. Transcluent/transparent objects like shadows, telewires and small flowers may not have any clear thumbnail, in which case it's actually easier to spot them as they're the ones with an empty thumbnail. https://wiki.multitheftauto.com/wiki/RemoveWorldModel https://dev.prineside.com/en/gtasa_samp_model_id/1 point
-
There are quite a few tools to help make scripting and mapping easier. Sadly they seem to get little attention. Instead of creating a big list of stickies we will list all tools here. Please note some of these may be outdated! Let us know so it can be noted... If you see something that should be in this list reply to let us know. Any resources in development that cause conflict with project goals of MTA will not be included. A prime example would be unofficial map editors. Scripting: HIGHLY RECOMMENDED Browse the MTA scripting wiki offline and much more quickly: offline wiki copy General movement around GTASA: SUPERMAN! Context menu to start/stop/restart resources: Resources Menu (YAML) Run multiple clients for testing: Virtual Machines Script Editor Stuff Sublime Text 3 - 50p's MTA Editor (package) Notepad++ Syntax Highlighting & Auto Completion by JR10 LuaForWindows - Good default theme and anti-theft compiling integrated More Info Here Notepad++ Notepad++ Lua (NOT MTA function) Syntax Checker by Talidan Unofficial MTA Script Editor General Scripting dxGUI - Alternative to MTA GUI Textlib: Create and stylize dxText easily Custom Blips by Talidan Slothbot AI generator by Slothman mabako-services by mabako/XX3 - Interiors, ammunation, food shops and pay n spray house_system by DakiLLa - Create houses ingame Stage - Movie making script with advanced camera control and ped recorder by vovo4ka Wiki: Useful Functions (These are small copy-paste functions to accomplish common tasks) Note: There are a lot of candidates for this section. Whatever else goes here should be flexible, functioning well and NOT DEPRECATED! GUI Creation: Qt to Lua - Create your MTA GUI outside of MTA GUI Editor 3.1.2 (now with DX support) GUI Classes v1.0 (scripting GUI MADE EASY!) YAML - Yet Another Menu Library v1.1.0 Resource Theft and Usage Protection How to make client scripts exist only in memory Mapping and Modelling: Map Editing: Proper Map Editor Plugins Editor Loop Generator (MTA Official loop generator plugin) Editor racemap loader RCG - Roller Coaster Generator plugin for editor TeleportEditor (create teleport shortcuts) by Wojak DrCrazy's vehicle movement record/draw Arezu's Mapping Toolbox (Google this) NeXTreme's Editor Tools (Google this) Fernando-A-Rocha's newmodels map editor Improper Mapping Tools Map elements mass mover online PARC - Puma's Automatic Road Creator - MTA Mapping MAP <-> IPL Converters by Aeron *Race mod syntax! Manual conversion required. Mass Object Adder By YWA *Race mod syntax! Manual conversion required. Custom Model Creation: 50p's MTA:SA Map Exporter (3DS MAXScript) Custom vehicle resource creator online Custom peds skin resource creator online Conversion: MTA <-> SA-MP Object, Vehicle, Pickup converter GTA Map Converter (MTA <-> SAMP) by deLUX Server Tools: User Management (webpanel) Web Admin panel by mawej (login_panel) Login Panel by NeXTreme (P-Login) Login System by B!ERPuNK (C-panel) Admin Panel by castillo14 (sqlitebrowser) SQLite Browser and editor by driver2 Nick Protection by driver2 Resource Management Ingame Current Map Deleter IRC Echo IRC Server Echo (by VRocker) VRocker's IRC Echo Advanced LUA Scripts (Modified by AlienX) [Mini-Missions] Irc Echo System Socket Module & IRC Resource (by MCvarial)1 point
-
Understandable. I am hoping for a modding API a'la plugin-sdk in the new GTA SA version. In some rumors there was talk of a comparison to high fidelity mods in the community. To not confuse the public I have, cautiously in advance, edited the Wiki page on how to buy GTA SA that the new game version on digital markets will not be compatible with MTA. This might of course change but it is unlikely to happen fast. I sure hope so! As vague as our participation in the upcoming game release is, as vague is also the modding capability of it. Due to the recent crossfire between GTA modding community and R* Games/Take-Two especially. But I am hoping for a more stable and capable engine that would not require those ugly assembly hacks anymore to get the game to multiplayer fruition.1 point
-
Yep, there's been a barrage of discussions on this in our Discord server with various topics e.g whether MTA should move to the new engine, how will player count look on trilogy release etc - everything is very much vague at this point.1 point
-
Maybe something like this? local is_mode_running = false; local kill_last_timer = false; addEventHandler("onGamemodeMapStart", root, function(startedMap) -- Clean up from previous runtime. if (kill_last_timer) then killTimer(kill_last_timer); kill_last_timer = false; end is_mode_running = true; outputChatBox("started mode!"); end ); local function on_mode_end() outputChatBox("end of mode!"); end local function on_last_survivor(survivor) kill_last_timer = setTimer( function() killPed( survivor ); kill_last_timer = false; end, 2000, 1 ); end addEventHandler("onPlayerWasted", root, function() local alivePlayers = getAlivePlayers(); if (is_mode_running) and (#alivePlayers <= 1) then is_mode_running = false; on_mode_end(); if (#alivePlayers == 1) then on_last_survivor(alivePlayers[1]); end end end );1 point
-
Thanks The_GTA i am thankful and I am almost there. However, the problem with this for loop I get is that it returns 1 msg if i am alone in the server, and it returns the message twice (in two different colors) if there is one more player in game. I am a beginner scripter, if you instead of suggesting functions help me a bit by editing this code, It will really really be helpful and timesaving. function sendMessageToNearbyPlayers(message, messageType) if messageType == 0 then cancelEvent() senderName = getPlayerName(source) local posX, posY, posZ = getElementPosition(source) local nearbyPlayers = getElementsWithinRange(posX, posY, posZ, 10, "player") for key, item in pairs (nearbyPlayers) do if item == source then outputChatBox ( getPlayerName(source).." says: "..message, source, 255, 255, 255, true ) else outputChatBox ( getPlayerName(source).." says: "..message, nearbyPlayers, 255, 255, 0, true ) end end end end addEventHandler("onPlayerChat", getRootElement(), sendMessageToNearbyPlayers) Thank you once again for your time, hope we can fix it this time.1 point
-
Thank you for sharing the script with us! From the script excerpt that you have given us there appears to be no problem. I have several questions to you: Is there another script that does use the givePlayerMoney or takePlayerMoney function running on your server? Why do you pass the parameter "1" to getAliveGuys? Is there a second function definition somewhere that is different? Did you collect debug logs?1 point
-
The map editor can now remove collisionless world objects, if you toggle "Enable collision patches" in the options. This will also make these models selectable when placed as objects. https://mirror.multitheftauto.com/mtasa/resources/1 point
-
Glad to be of help. Since you are asking so kindly I want to give you ideas how to continue with your inventory system. I absolutely recommend going with dx because it is more powerful than CEGUI. So these are the functions that should be used: dxDrawImage - drawing inventory icons as well as general GUI images dxDrawText - displaying the item names and descriptions as well as GUI text dxDrawRectangle - styling of the inventory window/grid/whatever bindKey function - opening the inventory with a button onClientRender event - drawing the dx UI each frame onClientClick event - clicking on items in inventory for selection and action onClientMouseMove event - hovering over items to display the description, highlighting, etc triggerServeEvent - asking the server to use an item or update the inventory in some way (throw away item, reordering the inventory, etc) triggerClientEvent - transmitting the inventory to the client Here is how I imagine an inventory to look. Code on requesting the inventory from the server: server.Lua addEvent("onRequestInventory", true); addEventHandler("onRequestInventory", root, function() triggerClientEvent(client, "onClientReceiveInventory", root, player_inventories[client], item_definitions); end ); client.Lua addEvent("onClientReceiveInventory", true); addEventHandler("onClientReceiveInventory", root, function(player_inventory, item_definitions) -- TODO: use the data somehow. end ); local function send_inventory_request() triggerServerEvent("onRequestInventory", root); end Feel free to ask more questions when you have some code done already1 point
-
Introduction This guide intends to teach 3ds Max users the basics, and more advanced ways, of working with (environment) animations and rigs to enhance atmosphere of the game. Animations, moving images or however you name it, they are there, everywhere in games. GTA San Andreas and its predecessors do utilize animations, however to a limited extent; most environment models were kept frozen in the dark days of PC games to save computer resources. Few objects like mechanical oil drills and food store mascots are animated. Today we're past those days and have advanced in technology to exceed limits, and integrate known resource demanding features into our games without much of a performance impact. It's important to keep in mind that the Renderware engine has various limitations associated with models/3D assets. These limitations do apply very harsh on what this guide covers. Table of contents Demo reel - Custom rigs and animations Prerequisites Recommended Character skeleton Basics to skinning Simulation conversion to bones workflow Demo reel - Custom rigs and animations Prerequisites Must have Autodesk 3ds Max of any desired version. 2017+ needed to speed up cloth rigging. Must have Kam's Maxscripts. Must have Animation Manager tool. Recommended You can use virtually any modeling or animation software e.g Blender or Cinema 4D to do 90% of the work. 3ds Max is required to export to GTA formats IFP and DFF. It's recommended to have experience in game modding and 3D modeling software of choice. It's highly recommended to use Shagg_E's anim/char helper for easy setup of bones and animation. For those who calculate bone hierarchy, add SPunknown = 4 to Root bone's object property. It's possible to use ARKTOS Tools VertexToBones for converting vertex-baked animations to bone animations. It should be noted however that this does not create bone hierarchy the desired way. It creates bones that aren't linked to each other, only the root, so it generates the animation for each bone to move, not rotate, and thus the majority of the animation relies on position keys, where SA animations only support rotation keys. Character skeleton San Andreas uses bones for its character animations. These bones are linked together, forming a skeleton with joints that can be rotated. Motion capture data can be transferred onto bones to ease the creation of character and more detailed animations. This was done for GTA cutscene models primarily. On 3ds Max, bones can be virtually anything, ranging from camera's to dummies. When exporting to GTA formats, the bone objects are automatically converted into dummies (helpers). This is how bones worked in early 2000's and/or 90's. If you desire to convert a helper or model into a dummy, follow this CGTalk post's instructions. For creating a skeleton, place all bones around the inner mesh of the model. Everything must be in a hierarchy and bones can have as many children as desired. Naming conventions are only recommended for easier overview, however they can be named according to one's desire e.g Bone_0 - Bone_12. To have the bones show the way the imported skins ones do, head to Display Panel under Links, and check both boxes. Make sure this is done for every bone. This will display joint links in correct hierarchy in viewport. Some games may use vertex baked animations, thus negating the need for bones. This is often seen on models such as all types of clothing. For game engines that do not support vertex animation or dynamic cloth, bones will be used instead. Below is a spoiler of valid bone ID's for regular ped models. There are 31 functional bone ID's, 32 with Root included. Once again, bones does not have to use same naming convenience as presented below. They also don't have to use same order of ID's or bone hierarchy, so for instance, Pelvis and Jaw ID's can be exchanged, as long as Root ID = 0. Or, the Head bone can be child of R Hand, not necessarily the Neck. Basics to skinning Although not hugely covered in this guide; Skinned models use a different system from vehicles and map objects. Besides having their 3D mesh, they have a skeleton. A skeleton is made of bone joints linked to each other, so that when the shoulder moves, the lower arm does as well. A bone will only affect part of the mesh that it's weighed to. If you weigh all vertices of the player's hat to the Head bone, then the hat will move according to the head bone. If you weigh all of the hat's vertices to the Pelvis bone, then the hat will stay static in air while the head moves. All vertices must be affiliated with at least one bone. Although a skin can have 32 bones, it'll work just fine if you weigh all vertices to only 3 bones. Not all bones require to be affiliated with a vertex. If you try to export a skinned model where 1 vertex is not weighted, the exporter will reject your request to export or your game will crash. A skin can have as few as 2 bones (root and children), so if your model has only 8 vertices, there's really no point having 32 bones when only 8 are functional. Below image (credits: IamObama) shows the basics to weighing joints to a character mesh. While this doesn't show all of the bones, it can prove very helpful as a lookup while weighing vertices to your skin. You can also load in a GTA ped to reference its miscellaneous bones e.g facial and fingers. Simulation conversion to bones workflow Note: The following process or techniques may apply for Blender/Maya users as well. 3ds Max has inbuilt cloth physics. These can simulate with help of gravity, wind, etc. and is a great way to generate animations for cloth-like elements. With help of tracking markers, you can track a bone to follow the orientation of a marker, which can then be baked into keyframes. The process is incredibly simple, you just have to understand the basics of cloth physics and object constraints. Video tutorial: Text tutorial: Create your model simulation model Be mindful about geometry and bone count when creating your model. The fewer polygons, the more rough the animation will be. The more polygons, the more cloth-like it'll look. The more bones with keyframes, the larger the file size (lots) of your IFP. For flags, one bone should never have full influence of a vertex. A vertex should always be affected by 2 or more different bones for a nice blend. It may be an idea to load in a GTA model so that you can somewhat reference the scale, if you don't have access to a dimension ruler. For the purpose of the guide (assuming you follow along the video), create a plane (primitive) with 8 segments in both directions. Make it length: 1,280 meter, width: 848 millimeters. Prepare your simulation model Convert the primitive to either editable mesh or editable poly. Polygon mode is more sustainable for modeling, but it needs to be in Mesh mode once you export it. Enable angle snap (default: A) and rotate it so it stands vertically. On the Hierarchy tab, reset transform to reset rotation values to 0. Add a Cloth modifier to your model. Go to sub-object level group of cloth modifier. Select the vertices that you want to act as solid points (e.g ones attached to flagpole). Click Drag as group mode. Simulate the model Head to Create tab > Space warps. Create a wind. Its position doesn't matter, only the rotation which represents the direction, matters. The default settings of the wind are usually too high. Try setting strength: 0,12, Turbulence: 0,8, Frequency: 0,05. Select the simulation model. On the cloth modifier, select Cloth forces and choose the wind. On the same interface, select Object properties. Select the model's name, then select Cloth, then pick a preset of your preference. Try silk or cashmere. You can optionally use Edge springs. I'm not fully sure what it represents, but I believe it's got to do with keeping the edges intact and not stretching them (which you don't want for bone animations). Try simulating the model. You may want to increase the timeline to a more reasonable duration, but be cautious as the higher it goes, the more your potato will suffer. If you aren't happy with the simulation, erase it and it'll let you try resimulate it. If you're unlucky enough to get the infamous error message dT increased/decreased you may want to start a new 3ds max project file... Create your real model In most cases you'll simply clone the simulated model, name the clone skin_mesh (name can be anything, but for easier scene management, name it something related). Remove the cloth modifier from your "real" model. For the simulated model, select the create keys button in cloth modifier. This will collapse your modifier and bake animation into keyframes, can NOT be reverted! Move the simulated model a bit away from the skin mesh, so that it'll make it significantly easier for a later procedure. Make sure to center the skin mesh to 0,0,0 or you'll get real trouble later. Convert the model to editable mesh. When you need to export later, it doesn't want it as editable poly. Create bones for your model Apply a Skin modifier to your model. This is used to carry the skeleton bones for later on. To make the bone creation and setup a whole lot easier, run Shagg_E's animation tools (link in top of thread). If you simply choose to create a set of dummies, his script won't recognise them as bones and you'll have to add all the object properties manually. So do yourself a favor and use his tool. Navigate to the Char helper section on the interface. Click create root, this'll create a dummy in center of the scene, assuming it corresponds to the model's center. Click create children, this'll create a dummy linked to the root. Drag it out from the model and title it "Pelvis" (again naming doesn't matter, can be "sampsucks" and samp modders will know once they load in your skin!). This bone is usually needed to keep part of the model's verts (abbreviation for vertices) in place, e.g flag pole attachments. Keep creating children bones until you reach your desired amount. It's a good idea to enable snaps (to vertex) so that you can magnet position bones directly onto the vertices. Select any bone in hierarchy and click Calculate for all hierarchy. This calculates bone ID's, bone index and bone type. If you were to set this yourself, you would need to understand how they work, on top of this it would be very time consuming. So we can all thank Shagg_E for making this wonderful script. Select the root bone, head to object properties, in user defined add to the string SPunknown = 4 or else your skin won't work as intended. Prepare motion tracking Create motion tracking markers. Head to create tab -> helpers -> point helper. Keep their scale at .2 or so. Spawn the amount equivalent to the amount of functional bones (excluding root and pelvis). Select all of the point helpers. Under the Animation rollout, select constraint -> attachment constraint -> select the simulated model. Go to Motion tab. The positions are based on triangle points, so you have to insert either 0 or 1 on A and B, then pick a face. It'll make more sense if you watch the video. You need to position the point helpers to the vertices where the bones are positioned at. I don't know of any more efficient way of doing this. On the model's skin modifier, add all functional bones (except root and pelvis). If you're running Max 2017+, you can use Voxel Solver to automate rigging (rough solution) and works great for simulated models. Use setting: falloff 0,2, max influence 3, max resolution 128. Try rotating some bones and hopefully they should affect the skin mesh. Now add the rest of the bones which you didn't rig to the model. If the model is a flag, then select a few vertices that you want to be solid in place, and weight those to pelvis at 100 weight. Track the motion of the simulated model Select all point helpers, click E for rotate, click F12 for rotate transforms and reset all 3 axis to 0. If you don't, some of your bones will be rotated massively (undesired). Apply an orientation constraint to all of your bones, 1 by 1, to their point helper counterpart. This tracks the rotations of the point helpers onto the dummy bones. You can add a shortcut to speed this up a tad... Select all the functional bones. Go to motion tab, click trajectories. This is where you bake the orientation constraints into keyframes for your bone animation. Settings below. Start time = 0 by default, or the first frame of your timeline End time = last frame of timeline OR whenever you desire Samples = amount of keys for the animation. If Start = 0, End = 1500, you can add 1500 samples to have 1500 keys generated, or 150 to have 150 keys generated. Don't use much more than 200 samples or you'll get in serious trouble. You'll have to optimize your keyframes at some point. You can change the keyframe tangent mode (i prefer auto or spline) to change the velocity of the keyframes. Once everything is set, click collapse. This generates keyframes. Animation is now made. Making the cloth simulation seamless/loop is another story. Finishing up Custom model and custom IFP is essentially done now. In order to export animation from 3ds Max, simply select all bones, find an IFP file on your computer and clone it, on 3ds Max run the IFP script, click "load IFP" and then save your custom animation to the cloned IFP file. You can remove excess IFP animations from the IFP archive by using Animation Manager Tool. Have fun with it! There was a recent update where MTA made a couple dozens of unused ped ID's available for servers to use. This is what inspired me to make this guide, since you could use those ID's to "add" new models, of which could be environment models to bring life to the world. Custom IFP's can simply be added into the server, they don't need to replace existing ID's. It's important to note that by changing bone ID's, you change the way that the custom model reacts to default animations. As such, models like banners will appear incredibly distorted. In those cases it's suggested to create some idle, walkstyle and run animations. It's also important to note that you can create LOD animations, since there's really no limit for how many IFP's a server can have. LOD animations may be very handy for animations that have highly dense simulations applied, so the further away the player goes, the less keyframes will be processed.1 point
-
1 point
