megaman54 Posted January 5, 2012 Share Posted January 5, 2012 (edited) I am asking where in MTA source code i can find the part that prevents the client from spawning clientside NPCs. I am asking this because i want to remove that prevention. I want the client to spawn driving and walking NPCs, i dont care if the NPCs arent synced to other players because there will be only me and my friend playing in my private server. I hope someone will give me a proper answer. Thanks in advance. Edited January 6, 2012 by Guest Link to comment
Towncivilian Posted January 5, 2012 Share Posted January 5, 2012 Pedestrian and vehicle multipliers are controlled by two SCM opcodes: 01EB: SET_CAR_DENSITY_MULTIPLIER 03DE: SET_PED_DENSITY_MULTIPLIER SCM is disabled in MTA:SA. You can find the opcode addresses and call them directly to achieve the same result as the opcodes. Link to comment
megaman54 Posted January 6, 2012 Author Share Posted January 6, 2012 Could you explain more about this? Like how to call it and in what part of the source code. Link to comment
Towncivilian Posted January 6, 2012 Share Posted January 6, 2012 Well, I found where the values for car and ped density multipliers are stored: 0x8A5B20 and 0x8D2530 respectively. Both are shared floats; the former is referenced by the opcode handler, obviously, as well as traffic functions, emergency vehicle spawning, and CMissionCleanup. The latter is also referenced by CMissionCleanup and during cutscenes. You can add a function to work with these addresses yourself, it shouldn't be awfully difficult - just don't modify them directly. Whether it'll actually work as intended in MTA just by changing those two memory addresses alone is another story. I tested these two addresses in GTA:SA single-player and they worked as desired (once you move outside of any currently spawned peds/vehicles, no more will spawn). I'm also not a developer, so I have no idea if the above will work in MTA. Link to comment
megaman54 Posted January 7, 2012 Author Share Posted January 7, 2012 Thank you for the info . Now i got a problem with building the client. I did everything as instructed here: https://wiki.multitheftauto.com/wiki/Compiling_MTASA and when i try to open the client it gives me this error: Multi Theft Auto has not been installed properly, please reinstall. [Registery key not present]. And should it always put the _d at every filename? According to wiki that stands for debug. I'm using Microsoft Visual Studio 2008 with SP1 on Windows 7 Link to comment
megaman54 Posted January 12, 2012 Author Share Posted January 12, 2012 Any way to convert this CLEO mod i made into MTA source code? //-------------MAIN--------------- thread 'NPC' :NPC_11 wait 0 01EB: SET_CAR_DENSITY_MULTIPLIER 3.0 03DE: SET_PED_DENSITY_MULTIPLIER 3.0 jump @NPC_11 Link to comment
Towncivilian Posted January 12, 2012 Share Posted January 12, 2012 CLEO is not usable in MTA. Also, I'm fairly sure that the values for 01EB and 03DE are restricted to between 0.0 and 1.0. I don't know anything about your compilation errors, but I'll try to have someone look at your post and see if they have any suggestions. Link to comment
megaman54 Posted January 13, 2012 Author Share Posted January 13, 2012 Thank you! I really appreciate your help Link to comment
Otto Posted January 14, 2012 Share Posted January 14, 2012 CLEO is not usable in MTA. Also, I'm fairly sure that the values for 01EB and 03DE are restricted to between 0.0 and 1.0.I don't know anything about your compilation errors, but I'll try to have someone look at your post and see if they have any suggestions. Is there any kind of program that allows CLEO in MTA? Link to comment
Towncivilian Posted January 14, 2012 Share Posted January 14, 2012 CLEO is not usable in MTA. Also, I'm fairly sure that the values for 01EB and 03DE are restricted to between 0.0 and 1.0.I don't know anything about your compilation errors, but I'll try to have someone look at your post and see if they have any suggestions. Is there any kind of program that allows CLEO in MTA? Nope. CLEO is an .asi file loaded by GTA at startup. MTA disallows such modifications for obvious reasons. CLEO mods have access to GTA's opcode handler and also adds certain opcodes, some of which deal with memory access. Link to comment
megaman54 Posted January 28, 2012 Author Share Posted January 28, 2012 CLEO is not usable in MTA. Also, I'm fairly sure that the values for 01EB and 03DE are restricted to between 0.0 and 1.0.I don't know anything about your compilation errors, but I'll try to have someone look at your post and see if they have any suggestions. Have you found anything/anyone yet who could know more? Link to comment
LooooP Posted February 6, 2012 Share Posted February 6, 2012 Go to MTA IRC, most of time Developers don't pay attention to the forums. Link to comment
Recommended Posts