GTAMP.com

Grand Theft Auto Multiplayer
It is currently Mon Aug 19, 2019 6:09 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Chaos% mod project
PostPosted: Thu Aug 08, 2019 11:34 am 
Offline
Ped

Joined: Tue Apr 16, 2019 2:09 pm
Posts: 2
Hello.

I'm currently on a project to create chaos% mod for GTA2. For those who don't know what Chaos% is in general, its a "common" mod among GTA speedrunners where the game will trigger random effects and events during the speedrun attempt. Here's an example that was made for Vice city: https://github.com/Lighnat0r-pers/gta-vc-chaos/blob/master/GTA%20VC%20Chaos%25%20Readme.txt

I'm currently trying to figure out a solid way to create this, although I'm not a great of programmer yet. I cannot do anything with DLL's yet (dont know how use them tbh), and been mainly just using game addresses to change values randomly. Then I remembered that GTA2 manager has plenty of debug options that could be useful to trigger whilst in game. The issue here is that I'm not sure how to access those debug options by script, so this is where I ask if anyone has advice here. Also asking help in general, what would be good way to approach this situation overall?

What I've done so far is I've had invincibility and invisibility trigger on and off in cycles by changing the address values. It's kinda tedious to work with addresses but that's what im using now. Obviously the chaos% mode should have a lot of effects and even multiple that are on at same time, so this project has long way to go, but gotta start from somewhere.


Top
 Profile  
 
 Post subject: Re: Chaos% mod project
PostPosted: Thu Aug 08, 2019 9:05 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1111
Word of Wind wrote:
The issue here is that I'm not sure how to access those debug options by script, so this is where I ask if anyone has advice here.


Depends on how you want to activate them. afaik all of them are registry values and i think for changes to take effect you have to restart the game. if you want to change them in game you have to figure out the addresses. then you can change them with an external application like cheat engine or your own script or internally with vikes peek and poke commands in mission scripting.

there is this thread about known memory addresses which might help as a starting point. i dont have any expierience with memory poking but vike, sektor or rick might be able to help.

_________________
yur sa'nok ngeyä


Top
 Profile  
 
 Post subject: Re: Chaos% mod project
PostPosted: Thu Aug 08, 2019 11:44 pm 
Offline
Serial Killer

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 218
Hi, Word of Wind.

To work with the virtual memory of the game, MISI can help you with this. You do not need to recompile the library if you are not going to add new functions to it. Link to the MISI topic: viewtopic.php?f=4&t=1136

To create a mod, you need to learn the LUA syntax - this will give you more freedom for creativity. Link to LUA official documentation: http://www.lua.org/docs.html

To start working with MISI, you need:

1. Install patch v11.44 at this link: http://gtamp.com/forum/viewtopic.php?f=4&t=73

2. Download misi_setup.7z at this link: http://gtamp.com/forum/download/file.ph ... ew&id=1887 (I recommend downloading version v0.4.2 - this is the latest update with all the features and fixes)

3. Unzip the archive to any place (for example, to the desktop)

4. Run the installer misi_setup.exe, then specify the root directory of the game GTA2. After successful installation, the scripts pack and the MISI.ASI library will appear in your directory.

Here is an example of changing game memory through the LUA script:

1. Open notepad create a new text file, named it firstmod.txt, save it in the root of the game in the folder "Here is your path to GTA2"/scripts

2. Add this code to the text file firstmod.txt:

Warning: This code was not tested by me in the game so it may not work correctly!

Code:
--[[
-- Mod Name
-- Author: Your Name
-- Mod version: v1
-- MISI since version: v0.4.2
]]--

local gamestate = 0
local ped_pool = {}

while (true) do
wait (0)
if (GetGameFrame()> 0) then
if (gamestate == 0) then -- If start new game
for i = 1, 6 do
ped_pool[i] = GetPedStruct(i) -- Save to array all ped struct
end
if (#ped_pool> 0) then
gamestate = 1 -- If array 0 ped not defined
end
else
if (gamestate == 1) then
for i, ped in ipairs(ped_pool) do
        If (GetPedHealth(ped) <3) then
          -- If the player’s hp is below 3 then music will play.
          WriteProcessMemory(0x5E202C, 0x2, 2) --[[ By changing the address 0x5E202C to another, you can overwrite the values ​​in the virtual memory of the game. In this example, 2 bytes are written in the address 0x5E202C as a result of this, the game play the music.
         ]]--
        end
end
end
end
else
gamestate = 0 -- If not frame to game restart or game not loaded
end
end

save the file.

3. Run the game. We check our changes, if everything is done correctly, you will see. Enjoy your modding and mastering the new!

P.S.: Now I’m looking for work, I will not be able to quickly answer all questions if they arise. For this, read Doc.txt (they are included in the misi_setup.exe installer), and also study the sources, this will help you understand the scripting device better than any teacher. In addition, in Russia in November 2019 I plan to limit the Internet. I don’t know if this will affect the entire segment, but maybe I can’t go to gtamp.com.


Top
 Profile  
 
 Post subject: Re: Chaos% mod project
PostPosted: Fri Aug 09, 2019 5:24 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1357
Location: GTAMP.com
Logofero's MISI is great and should help. Some of the MISI scripts like spawning a car will replace the SCR in memory with an empty one, so that wouldn't work with the existing missions like you need.

I haven't had a chance to test out h0x91b's work but it looks like he figured out how to spawn cars without replacing the whole script in memory. I just have to figure out how to use it.

Removing reload delay, changing ammo and run speed can easily be done with memory writes and cause a bit of chaos.

The best chaos has only been done by modifying mis files and as you know, only bil.mis was released for the official scripts.



All of that could be done without the mis source code but a lot harder and hasn't really been documented. I wrote a script once that made all cars fly towards the player like he was an electromagnet, that would be a funny chaos mod. I don't think I ever got it stable but it should be possible.


Top
 Profile  
 
 Post subject: Re: Chaos% mod project
PostPosted: Fri Aug 09, 2019 12:22 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1111
another way to quickly get results is playing with the car physics. for example setting antistrength to a high value results in cars exploding with a single hit which make collisions very unforgivable

_________________
yur sa'nok ngeyä


Top
 Profile  
 
 Post subject: Re: Chaos% mod project
PostPosted: Fri Aug 09, 2019 1:22 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1357
Location: GTAMP.com
//show ped and car ID
COUNTER showpedid = 6204833
COUNTER one = 1
CHANGE_GANG_CHAR_RESPECT (showpedid, one, 111)

That's one of the debug registry keys, so the others are probably near there.


Top
 Profile  
 
 Post subject: Re: Chaos% mod project
PostPosted: Wed Aug 14, 2019 9:50 am 
Offline
Ped

Joined: Tue Apr 16, 2019 2:09 pm
Posts: 2
Sektor wrote:
//show ped and car ID
COUNTER showpedid = 6204833
COUNTER one = 1
CHANGE_GANG_CHAR_RESPECT (showpedid, one, 111)

That's one of the debug registry keys, so the others are probably near there.


I tried it and it indeed works. However I'm not really genius on how to find the other addresses, so if you would like to drop a piece of advice that would be nice. Or if possible you could find all the others too and post them there, that would be amazing, but if its not too difficult to find the others I can try it too

so far I've only been using addresses already in this forum, haven't actually tried finding any myself


Top
 Profile  
 
 Post subject: Re: Chaos% mod project
PostPosted: Thu Aug 15, 2019 11:30 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1357
Location: GTAMP.com
I found some more near there just by trial and error in Cheat Engine memory view. I was just changing 00 to 01 and seeing if anything visible happens.

5EAD52 Show Object IDs
5EAD95 Show Counters
5EAD96 Show Traffic Light Info
5EAD9C Skip Lids (this makes most roads and tiles black, could be funny in chaos%)
5EAD9E Keep Weapons After Death
5EADA1 Show Ped/Vehicle IDs
5EADA7 Show Cycles

I was hoping they would be in a predicable order but it doesn't seem to match the order in debug manager or the text order in gta2.exe.


Top
 Profile  
 
 Post subject: Re: Chaos% mod project
PostPosted: Thu Aug 15, 2019 12:44 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1357
Location: GTAMP.com
What debug options would be useful as options in chaos% ?

My choices would be:

Get All Weapons
Keep Weapons After Death
Infinite Lives
Player Invulnerable
Free Shopping (not really needed if you give player millions)

Most of those can be done without using debug memory addresses but if it's cleaner, might as well use them.

You will need to display text and timers for a chaos% and since you can't do that with MISI, it's probably easier to just use your preferred language and make a stand alone program.


Top
 Profile  
 
 Post subject: Re: Chaos% mod project
PostPosted: Thu Aug 15, 2019 2:52 pm 
Offline
Serial Killer

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 218
Sektor wrote:
You will need to display text and timers for a chaos% and since you can't do that with MISI, it's probably easier to just use your preferred language and make a stand alone program.
During the active stage of MISI development, I came up with the idea of ​​integrating SDL into a library to display formatted text, but these were just thoughts. This update would allow to display any custom textures and create custom HUD through LUA scripts.

By the way, I saw an example of the work of SDL in the sources of the "Radar" mod from Sector's download at this link: download/file.php?id=1631 But due to the fact that MISI was supported by few people and almost no one writes about it, I decided to stay on the stable version, since the development of even 1 update took my time and a lot of energy, while not bringing feedback. And since the project is non-commercial, only a fan of other players could help keep it updated.

Everyone can continue to update MISI themselves, add to it the functions that they need. In order to continue the development of MISI, you do not need to ask anyone for permission, the sources are open and available for download in the main topic of the project at this link: http://gtamp.com/forum/download/file.ph ... ew&id=1880 (stable MISI v0.4.2)

To continue updating MISI: Create a new forum topic, name the library in your own way or indicate in the name that this is an alternative version of MISI. Enjoy modding!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group