MISI

Anything to do with GTA1/GTA2 modding (tools, scripts and more).
Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

MISI

Post by Logofero » 12 Feb 2018, 15:05

MISI
Library for executing custom scripts
Image

Version: v0.4.2
Release: 1 may 2018
MD5 ce9555ae13ba1f206b93c183e5b15133 MISI.ASI

License:
  • This MISI library (hereinafter "application") is distributed by
    license (Public Domain) free software "as is"
    without any guarantees.

    This application (hereinafter "project") is
    public domain of the GTAMP community.
    All source codes, logos, texts, project names are open,
    are the combined work of people united by a common idea and a dream.

    Everyone can use this project without restrictions
    at its discretion:
    Compile, modify, correct, supplement, update, sell,
    distribute under its own brand and mark.

    http://gtamp.com/forum/viewtopic.php?f=4&t=1136#p10506
What is it?
  • Library for running LUA scripts in GTA2.
    The library is loaded at the start of the game and gives you access
    to the game world (as much as the author knows
    useful addresses in the memory of the game).

    The name MISI came to
    me from the derived word of the initial scripts * .MIS
    (which in translation probably means a mission) and together with
    extension ASI (which is used in the game) it turned out
    quite in tune with MISI.ASI.

Documentation:
  • All documentation is inside the installer, you can get it by installing the DOC component,
    where EN (English) and RU (Russian) languages. This component is selected when installing MISI.
    Also you can download it in a separate archive by the link misi_docs.7z
Example:
  • Examples of scripts can be selected when installing MISI by selecting the "Examples" component.
    Also you can download all the examples in a separate archive by the link misi_examples.7z

Modules:
  • Additional scripts/plug-ins that extend the capabilities of MISI. Modules of can be selected when installing MISI by selecting the "Modules" component.
    Also you can download all the modules in a separate archive by the link misi_modules.7z

Installation:
  • * Requires the installed game GTA2 v11.44
    1. Run the installer misi_setup.exe
    2. Select the installer language
    3. Read and accept the license agreement
    4. Select the root directory of the game
    5. Select components to install
    6. Confirm the installation
    7. Installation complete
What is this for?
  • For easy and
    quick creation/editing of game missions, trainers.
    Thanks to the simple LUA syntax, anyone can use it
    To study and write the unpretentious script for GTA2 without spending
    thus it is a lot of time. It is enough to install MISI in the game,
    create a text * .TXT or * .LUA file (name it as
    wish), throw in the root folder script located
    in the root directory of the game (where gta2.exe is located),
    After that, you can run the game and enjoy your
    creation.
Thanks: Contributers: System requirements:
  • OS Windows XP/7/8/10 32 bit
    Archiver with support 7z
ATTENTION: The library has become stable, but there is no guarantee that there will be no fly. At the start of the game there is a download of scripts on this may slow down a little. Wait for the full download after the game will work as usual. The library is designed for single-player game, but there is the possibility of scripting for multiplayer however most changes in multiplayer lead to out of sync.

DOWNLOAD:
Final version MISI v0.4.2 (stable) (Language: EN, RU)
MISI v0.4.1 (stable) (Language: EN, RU)
MISI v0.3.3b (no stable) (Language: EN, RU)

Sources:
Sources MISI v0.4.2 (Stable version)
Setup pack MISI v0.4.2 (Resources for the installer)
Sources MISI v0.4.1 (Stable version)
Setup pack MISI v0.4.1 (Resources for the installer)
Sources MISI v0.3.3b (License: Public Domain)
Setup pack MISI v0.3.3b (Resources for the installer)
LUA Lib v5.3.4 (Ready LUA lib is used on project MISI)
LUA sources (http://www.lua.org)

This is the final version.
Work on the project is completed. Perhaps later the fixes will be released if I receive reports or I find bugs.
To all who left their feedback and words of support, thank you. Support is a great incentive to develop.
I hope for someone MISI has become a useful opportunity for the realization of his creative ideas.


Last update: Added in thanks list author Pyro's for GTA2 Scripting tutorial.
Attachments
misi_setup.7z
(657.75 KiB) Downloaded 384 times
setuppack_MISI_v0.4.2.7z
(1.63 MiB) Downloaded 323 times
misi_docs.7z
(23.33 KiB) Downloaded 333 times
misi_examples.7z
(11.03 KiB) Downloaded 338 times
misi_modules.7z
(9.14 KiB) Downloaded 351 times
sources_MISI_v0.4.2.7z
(436.52 KiB) Downloaded 312 times
setuppack_misi_v0.4.1.7z
(1.57 MiB) Downloaded 302 times
sources_misi_v0.4.1.7z
(435.73 KiB) Downloaded 333 times
misi_setup.7z
(594.69 KiB) Downloaded 349 times
sources_misi_v0.3.3b.7z
(434.86 KiB) Downloaded 337 times
setuppack_misi_v0.3.3b.7z
(1.56 MiB) Downloaded 347 times
sources_lua_lib.7z
(420.58 KiB) Downloaded 333 times
misi_setup.7z
(589.63 KiB) Downloaded 354 times
misi_logo.png
misi_logo.png (23.13 KiB) Viewed 19500 times
Last edited by Logofero on 28 Aug 2019, 21:36, edited 35 times in total.

User avatar
Sektor
Boss
Boss
Posts: 1369
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: MISI

Post by Sektor » 12 Feb 2018, 22:26

Nice work. Now the hard part of adding every single GTA2 script command and more. It should still be useful with the limited commands.

How is misi.asi started? What is telling GTA2 to load that DLL on startup? How does it work?

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 13 Feb 2018, 04:49

Sektor wrote:Nice work. Now the hard part of adding every single GTA2 script command and more. It should still be useful with the limited commands.

How is misi.asi started? What is telling GTA2 to load that DLL on startup? How does it work?
Thank you for your feedback, Sector.

It loads as a DLL and becomes part of the game process, after which we can work with the memory of the game as with its memory. The sound engine Miles Sound System, which is used in GTA2, loads MISI on game start.
Last edited by Logofero on 14 Feb 2018, 05:08, edited 3 times in total.

User avatar
Sektor
Boss
Boss
Posts: 1369
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: MISI

Post by Sektor » 13 Feb 2018, 05:20

Yes I tested it and it worked but I didn't know Miles Sound System loaded all those files at startup, that's helpful.

Are most of the commands just for the player? I'm curious how it will handle all the other characters/peds in the future.

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 13 Feb 2018, 06:37

Sektor wrote:Yes I tested it and it worked but I didn't know Miles Sound System loaded all those files at startup, that's helpful.

Are most of the commands just for the player? I'm curious how it will handle all the other characters/peds in the future.
I tried to handle other characters, but so far it's only come from the 6th (in theory, since I do not have the ability to test more than 1 player on the computer). Ideally, teams should work with all characters including ped's and cars on the specified id. The same with other objects. I need more useful methods and examples of working with structures then there will be updates. Now I need to find out how MISI works for different users, on which API it drops (since I did not check all my GET/SET methods - this requires a lot of testing). The second task after testing: how to refer to the structures ped, cars, objs, etc in the cycle, also find out how many of them are in the game: the ID's ranges - from which ID to all the objects in the game, the maximum weight of the structures (their offset in bytes). Example: players 1-6, then peds 7-200, cars 201 -... and so on.

Add:
Another thing worth mentioning is that now all MISI methods work with the player's structure under id 1, if you spawn under this id then everything will work as it should, but if you are another id like 2..6, the script probably does not load and displays a syntax error in MISI.log: Error in LUA: <script file> ... 'nil' value. Maybe the game will crash or nothing will happen but the script with this method will be unloaded. Or if you are a host in multiplayer, you may be able to change the player's data to id 1, but this is only a theory (because in practice I did not check MISI's work with other players in the game in multiplayer).

In order for your script to work only in a single player and not run in multiplayer, I recommend doing a test:

Code: Select all

-- Since: v0.2b
while(true) do
   if (GetNetwork() > 0) then 
      if (IsKeyDown(13)) then -- Press enter for set skin
         SetPlayerSkin(0)
      end
   end
   wait(200)
end
Edited: Fixed code example
Last edited by Logofero on 26 Feb 2018, 18:49, edited 4 times in total.

User avatar
elypter
Immortal
Posts: 1119
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: MISI

Post by elypter » 13 Feb 2018, 12:51

that looks very promising. about running multiple games at once: you can do that by playing in window mode and creating a game with gta2.exe -c and join with -j with as many players as you want as long as your computer is fast enough which should not be a problem with multi core systems. im curious if the network game stays in sync. that would be really great.
yur sa'nok ngeyä

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 13 Feb 2018, 21:35

elypter wrote:that looks very promising. about running multiple games at once: you can do that by playing in window mode and creating a game with gta2.exe -c and join with -j with as many players as you want as long as your computer is fast enough which should not be a problem with multi core systems. im curious if the network game stays in sync. that would be really great.
I'll try when I get back to working out. Thank you.

I also wanted to warn you there are unsolved moments: If set SetPlayerHealth(0) health is removed, the sex of the heart does not remain completely. I do not know why it is so. Why the player does not die. Maybe it's protection from cheating through memory. I also tried to change the position of the player but instead the position of the camera changed, the addresses might be confused:
  • ped+1AC=x coordinate (coordinates are 0 to 255 multiplied by 16384)
    ped+1B0=y coordinate
    ped+1B4=z coordinate
Also wanted to find out who found out the addresses of give money, weapons and car remap

Added:
If you have found addresses and structures, write me here and I will add them to MISI next update

Added2:
When you change the health of the car, it does not light up/stew if it burns. It has not been decided yet and I'm not sure that it will be possible to solve it somehow. It is possible to update the status of the structure with an additional call, but the address of this method is not known to me and how to find it, too

User avatar
elypter
Immortal
Posts: 1119
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: MISI

Post by elypter » 13 Feb 2018, 22:46

i assume the code to kill the player works like

Code: Select all

take_damage_bullet(p, angle){
 play_blood_animation(p,angle)
 p.health=p.health-5
 if p.health(<=0){
  kill_player(p)
 }
}
if you just decrease health then the if loop does not get executed.

with cars its probably similar. if i remember correctly running over cars with a tank also doesnt make them burn and even removes fire.

the sex of the heart does not remain completely
i dont quite understand that sentence. do you mean that the last heart icon doesnt disappear if you have 0 health?
yur sa'nok ngeyä

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 14 Feb 2018, 04:56

elypter wrote:i assume the code to kill the player works like

Code: Select all

take_damage_bullet(p, angle){
 play_blood_animation(p,angle)
 p.health=p.health-5
 if p.health(<=0){
  kill_player(p)
 }
}
if you just decrease health then the if loop does not get executed.

with cars its probably similar. if i remember correctly running over cars with a tank also doesnt make them burn and even removes fire.

the sex of the heart does not remain completely
i dont quite understand that sentence. do you mean that the last heart icon doesnt disappear if you have 0 health?
Yes. The heart does not decrease.

To implement the death and explosion, the addresses of these procedures are needed. If there are fans of the cheat engine they will be able to cope and find them. I can add them to MISI if they are found. If not someone does not do this, then everything will remain as it is now Create a text file kill.txt in the scripts folder and paste the following code into it:

Code: Select all

while(true) 
    if (IsKeyDown(1)) then -- Press Left Mouse Button to kill self        
       SetPlayerHealth(0)    
    end    
    wait(200) 
end 
Last edited by Logofero on 14 Feb 2018, 06:17, edited 1 time in total.

User avatar
elypter
Immortal
Posts: 1119
Joined: 26 Dec 2009, 23:53
GH nick: elypter

Re: MISI

Post by elypter » 14 Feb 2018, 06:08

Yes. The heart does not decrease.
i assume it works like this internally:

Code: Select all

case health==100:
 display_5_hearts()
case 90<health<100:
 display_4_and_a_half_hearts()
...
default:
 display_half_a_heart()
i havent played it in a while but this should be testable by exploding with low health. getting hit by an explosion makes you lose health but it is the explsion that kills you but not instantly if you fly through the air. if a hit by a rocket launcher costs 3 health and you have less than 3 there should be 0 hearts left but if i remember correctly there is always half a hear left. i could be totally wrong thoguh.
yur sa'nok ngeyä

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 14 Feb 2018, 06:15

Updated:
I found what I was looking for. As well as calling the "death" procedure, the player will die. You do not even need to reset hp. In this case there is animation id 9. Animation found by BeepBooop http://gtamp.com/forum/viewtopic.php?f=4&t=1123
Thanks to him for this
Last edited by Logofero on 15 Feb 2018, 08:22, edited 2 times in total.

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 14 Feb 2018, 06:39

Flashmen
MISI example script for GTA2

Author: DenLover
Update: 1 may 2018
Mod version: v0.3
MISI since version: v0.4.2

Description:
  • This script gives you speed when you press "SPECIALKEY1".
Installation:
Last edited by Logofero on 02 May 2018, 18:24, edited 7 times in total.

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 14 Feb 2018, 08:51

Spawning car
MISI example script for GTA2

Author: DenLover
Update: 1 may 2018
Mod version: v0.3
MISI since version: v0.4.2

Description:
  • Make new car area is player when down key "1" and delete it car if down key "2" .
Installation:
Last edited by Logofero on 02 May 2018, 18:24, edited 5 times in total.

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 14 Feb 2018, 09:26

I found the reason why the player did not change position. The addresses are confused.

This is not a player's position but a camera position http://gtamp.com/forum/viewtopic.php?f=4&t=700 Maby this pos x,y,z
  • dword[player+128h] = game camera x,y,z

User avatar
Sektor
Boss
Boss
Posts: 1369
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: MISI

Post by Sektor » 14 Feb 2018, 09:44

Yes sorry, I added the word camera to that part of the memory address topic now.

for moving a ped:

Pedsprite = peek dword [p1 + 168h] 360
anglepointer = peek dword [pedprite + 80h] 128
peek word [anglepointer]
peek word [anglepointer] + 20 = x
peek word [anglepointer] + 24 = y
peek word [anglepointer] + 28 = z

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 14 Feb 2018, 14:18

Make obj
MISI example script for GTA2

Author: DenLover
Update: 1 may 2018
Mod version: v0.3
MISI since version: v0.4.2

Description:
  • Make new obj area is player when down key "7" and delete it obj if down key "8" .
Installation:.
Last edited by Logofero on 02 May 2018, 18:24, edited 3 times in total.

User avatar
Sektor
Boss
Boss
Posts: 1369
Joined: 04 Mar 2008, 06:51
GH nick: Sektor
Location: GTAMP.com
Contact:

Re: MISI

Post by Sektor » 15 Feb 2018, 04:14

Logofero wrote: Sektor, player is 0x5EB4FC + 0x1C? So what is the offset for x, y, z in this structure 4 bytes?
I don't understand the question.

Here's a LUA example for writing to the player coordinates.

[syntax=lua]
-- left mouse button teleports player to 44.5 , 103.125 , 2 , intended for Industrial

function setPed(x, y, z, a)
local p = {addr, ptr, id, coord_addr, x, y, z, a, speed_addr, speed, car_ptr, car, sprite_ptr, sprite_addr, key_ptr, key, jump_addr, jump, count}
local pinfo_ptr = tonumber("0x5EB4FC")
local pinfo_addr = 0
local arrayofplayerptrs
local player_info
local temp
pinfo_addr = ReadProcessMemory(pinfo_ptr, 4)
arrayofplayerptrs = pinfo_addr + 0x4
player_info = ReadProcessMemory(arrayofplayerptrs, 4)
if (player_info ~= NIL) then
p.ptr = player_info+0xC4
p.addr = ReadProcessMemory(p.ptr, 4)
p.sprite_ptr=p.addr+360
p.sprite_addr = ReadProcessMemory(p.sprite_ptr, 4)
temp = p.addr+512 -- ped ID
p.id = ReadProcessMemory(temp, 4)
temp = p.sprite_addr+128 -- ped coord addr
p.coord_addr = ReadProcessMemory(temp, 4)
end

if (p.coord_addr ~= NIL) then
p.a = ReadProcessMemory(p.coord_addr, 4)
WriteProcessMemory(p.coord_addr + 20, x * 16384, 4)
WriteProcessMemory(p.coord_addr + 24, y * 16384, 4)
WriteProcessMemory(p.coord_addr + 28, z * 16384 +1, 4)
WriteProcessMemory(p.coord_addr, a, 4) -- angle write doesn't seem to work on the player
end
end

while(true) do
if (IsKeyDown(1)) then
setPed(44.5 , 103.125 , 2, 180)
end

wait(200)
end
[/syntax]

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 15 Feb 2018, 07:00

Sektor wrote:
Logofero wrote: Here's a LUA example for writing to the player coordinates.

[syntax=lua]
-- left mouse button teleports player to 44.5 , 103.125 , 2 , intended for Industrial

function setPed(x, y, z, a)
local p = {addr, ptr, id, coord_addr, x, y, z, a, speed_addr, speed, car_ptr, car, sprite_ptr, sprite_addr, key_ptr, key, jump_addr, jump, count}
local pinfo_ptr = tonumber("0x5EB4FC")
local pinfo_addr = 0
local arrayofplayerptrs
local player_info
local temp
pinfo_addr = ReadProcessMemory(pinfo_ptr, 4)
arrayofplayerptrs = pinfo_addr + 0x4
player_info = ReadProcessMemory(arrayofplayerptrs, 4)
if (player_info ~= NIL) then
p.ptr = player_info+0xC4
p.addr = ReadProcessMemory(p.ptr, 4)
p.sprite_ptr=p.addr+360
p.sprite_addr = ReadProcessMemory(p.sprite_ptr, 4)
temp = p.addr+512 -- ped ID
p.id = ReadProcessMemory(temp, 4)
temp = p.sprite_addr+128 -- ped coord addr
p.coord_addr = ReadProcessMemory(temp, 4)
end

if (p.coord_addr ~= NIL) then
p.a = ReadProcessMemory(p.coord_addr, 4)
WriteProcessMemory(p.coord_addr + 20, x * 16384, 4)
WriteProcessMemory(p.coord_addr + 24, y * 16384, 4)
WriteProcessMemory(p.coord_addr + 28, z * 16384 +1, 4)
WriteProcessMemory(p.coord_addr, a, 4) -- angle write doesn't seem to work on the player
end
end

while(true) do
if (IsKeyDown(1)) then
setPed(44.5 , 103.125 , 2, 180)
end

wait(200)
end
[/syntax]
Yep. Im also already experimented with teleport. Now we need to find a way to update the camera. Player cam moves very slowly towards at tp point

Edited: Question
Last edited by Logofero on 02 May 2018, 17:44, edited 3 times in total.

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 15 Feb 2018, 09:45

Found a useful procedure for kill player (address found by BeepBoop http://gtamp.com/forum/viewtopic.php?f=4&t=1123). The method will be added to the next MISI update.

Edited: It's more like a task than an animation. Therefore changed to task
Last edited by Logofero on 26 Feb 2018, 18:48, edited 1 time in total.

Logofero
Serial Killer
Serial Killer
Posts: 258
Joined: 09 Dec 2015, 14:18
GH nick: Logofero

Re: MISI

Post by Logofero » 15 Feb 2018, 15:33

News of project MISI:

All MISI documentation is inside the installer. If you want to write a script in LUA, download the archive attached to the main header and install it on the PC after that you will be available MISI docks in text format. Enjoy!
Last edited by Logofero on 30 Apr 2018, 01:21, edited 1 time in total.

Post Reply