GTAMP.com

Grand Theft Auto Media Press
It is currently Sun Nov 19, 2017 9:32 pm

All times are UTC




Post new topic Reply to topic  [ 60 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Wed Nov 19, 2014 7:53 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1287
Location: GTAMP.com
ped ID is ped+512. There's a show ped/car ID option in gta2manager. I wrote a script that reads the health value of each ped and writes it to the ped ID.

Image

Instant gang has 50 health
Dummy peds have 50 health
Dummy drivers have 100
National guards have 50
Jeep blokes that chase you have 250 health. Most jeeps just have normal defenseless dummy peds in them with 100 health.
Police have 100
Roadblock FBI have 200
FBI has 250
SWAT has 400

http://i.imgur.com/MlqOQU0.png
http://i.imgur.com/O6CtP8v.jpg


Top
 Profile  
 
PostPosted: Wed Nov 19, 2014 12:26 pm 
Offline
User avatar

Joined: Wed Mar 17, 2010 4:07 am
Posts: 413
Location: Wales, UK
Impressive, nice work!

Maybe with this we can make 'proper' strength SWAT guys of our own.

One thing - on the second picture, all the peds, gang members and player show '666', what's that about?

_________________


Top
 Profile  
 
PostPosted: Wed Nov 19, 2014 1:53 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1287
Location: GTAMP.com
Yes we can create peds as strong or stronger than swat.

Pyro wrote:
One thing - on the second picture, all the peds, gang members and player show '666', what's that about?

[sm-evil] Ignore that! [sm-evil]


Top
 Profile  
 
PostPosted: Wed Nov 19, 2014 9:06 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 895
Nice work. I like (little) hacks like that. What is the code that you used? I perhaps want to try it myself.

_________________
"Mmmm, your eyes are so beautiful."


Top
 Profile  
 
PostPosted: Wed Nov 19, 2014 11:17 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1287
Location: GTAMP.com
Image

The screenshot is just for fun. The attached code displays ped's real health but you must tick show PED IDs in gta2manager debug tab. Cars will just show their normal ID since I haven't added car health/ID changing yet.

The player needs to have a unique ID or the game will treat every ped as if friendly fire is disabled. You can still kill them with electrogun or explosions just like instant gang. I don't update the player ID in this example but I could set it to 1000+actual player health, if you wanted to display it but still keep a unique ID.

Attachment:
healthtest.7z [3.54 KiB]
Downloaded 506 times
Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
//Sektor GTAMP.com 2014
//Do whatever you want with this code
//healthtest.scr
//ste.gmp
//ste.sty

PLAYER_PED p = (  149.0 , 195.0 , 255.0 ) 10  270
PLAYER_PED p2 = (  150.0 , 195.0 , 255.0 ) 10  180
PLAYER_PED p3 = (  151.0 , 195.0 , 255.0 ) 10  180
PLAYER_PED p4 = (  152.0 , 195.0 , 255.0 ) 10  180
PLAYER_PED p5 = (  153.0 , 195.0 , 255.0 ) 10  180
PLAYER_PED p6 = (  154.0 , 195.0 , 255.0 ) 10  180

COUNTER idaddress
COUNTER healthaddress
COUNTER healthvalue
COUNTER true = 1
COUNTER charpointer = 660 // if you want to ignore player 2-6, set to 3960 ( 6 x 660 )
COUNTER cars = 0
CHAR_DATA c
CAR_DATA p1car

GENERATOR instantgang =  ( 149.0 , 194.0 ) 0 COLLECT_40 0 0
CAR_DATA  parked  =   (  149.0  , 196.0 ) 0 0 BUG

MAP_ZONE cityinfo = (600, 300, 200, 100, 200, 100, 100, 50, 200, 300, 100)
MAP_ZONE s08 = (100, 500, 200, 100, 250, 0, 0, 0, 999, 100, 100)
MAP_ZONE m16 = (600, 400, 100, 0, 500, 0, 0, 100, 900, 0, 200)
MAP_ZONE m17 = (600, 400, 100, 0, 500, 0, 0, 100, 900, 0, 200)
MAP_ZONE m23 = (600, 400, 100, 0, 500, 0, 0, 100, 900, 0, 200)
MAP_ZONE m24 = (600, 400, 100, 0, 500, 0, 0, 100, 900, 0, 200)
MAP_ZONE m25 = (600, 400, 100, 0, 500, 0, 0, 100, 900, 0, 200)
MAP_ZONE m26 = (600, 400, 100, 0, 500, 0, 0, 100, 900, 0, 200)
MAP_ZONE m20 = (600, 400, 100, 0, 500, 0, 0, 100, 900, 0, 200)
MAP_ZONE m21 = (600, 400, 100, 0, 500, 0, 0, 100, 900, 0, 200)
MAP_ZONE m22 = (600, 400, 100, 0, 500, 0, 0, 100, 900, 0, 200)
MAP_ZONE m19 = (100, 0, 0, 0, 500, 0, 0, 100, 1000, 0, 1000)
MAP_ZONE s07 = (100, 500, 200, 100, 500, 0, 0, 100, 900, 0, 100)
MAP_ZONE s06 = (100, 500, 200, 100, 500, 0, 0, 0, 1000, 0, 100)
MAP_ZONE m18 = (100, 300, 0, 0, 500, 0, 0, 100, 900, 0, 300)
MAP_ZONE s04 = (100, 500, 200, 100, 500, 0, 0, 0, 1000, 0, 100)
SET_GANG_INFO (redngang, 5, PISTOL, MACHINE_GUN, MOLOTOV, 4, 47.50, 49.50, 255.00, 1, PICKUP, 3)
SET_GANG_INFO (sciegang, 7, PISTOL, MACHINE_GUN, FLAME_THROWER, 5, 211.50, 219.50, 255.00, 1, STRATOSB, 10)
SET_GANG_INFO (zaibgang, 8, PISTOL, DUAL_PISTOL, MACHINE_GUN, 3, 199.00, 25.50, 255.00, 1, VTYPE, 2)
SET_GANG_INFO (almagang, 22, NO_WEAPON, NO_WEAPON, NO_WEAPON, 3, 224.50, 20.50, 255.00, 0, VTYPE, 2)
SET_GANG_INFO (poligang, 0, PISTOL, PISTOL, PISTOL, 3, 224.50, 20.50, 255.00, 0, VTYPE, 2)

LEVELSTART

//show ped and car ID
COUNTER showpedid = 6204833
COUNTER one = 1
CHANGE_GANG_CHAR_RESPECT (showpedid, one, 111)

SWITCH_GENERATOR ( instantgang, on )

DECLARE_POLICELEVEL (6)
SET_STATION_INFO (trak01, 4, 0, 0)
SET_AMBIENT_LEVEL ( 0.3 , 0 )
SET_SHADING_LEVEL ( 27 )

WHILE_EXEC ( true = 1 )

GIVE_WEAPON (p,ROCKET_LAUNCHER)
GIVE_WEAPON (p,ELECTRO_GUN)
GIVE_WEAPON (p,FLAME_THROWER)
GIVE_WEAPON (p,MOLOTOV)
GIVE_WEAPON (p,SILENCED_MACHINE_GUN)

SET c = ( p + charpointer )

SET healthaddress=(c+534) //health
CHANGE_GANG_CHAR_RESPECT (healthaddress, healthvalue, 102)
SET idaddress=(c+512) //ID
CHANGE_GANG_CHAR_RESPECT (idaddress, healthvalue, 112)

SET charpointer = ( charpointer + 660 )

IF ( charpointer > 32340 ) // 49 x 660 (each character has a struct of 660 bytes)
  SET charpointer = 660 // If you want to ignore player 2-6, set to 3960 ( 6 x 660 )
ENDIF

ENDWHILE

LEVELEND
Parsed in 0.016 seconds, using GeSHi 1.0.8.10


Top
 Profile  
 
PostPosted: Sun Nov 23, 2014 2:12 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1287
Location: GTAMP.com
byte cardamage=carstruct+75h (0 = 0% damage, 125 = 100% damage). You can make wrecks drivable by changing this.
word carid=carstruct+6Ch

This will change the car ID to the car damage
Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
COUNTER cardamageaddress
COUNTER cardamagevalue
COUNTER caridaddress
SET cardamageaddress=(p1car+117)
CHANGE_GANG_CHAR_RESPECT (cardamageaddress, cardamagevalue, 104)
SET caridaddress=(p1car+108)
CHANGE_GANG_CHAR_RESPECT (caridaddress, cardamagevalue, 112)
Parsed in 0.008 seconds, using GeSHi 1.0.8.10


Top
 Profile  
 
PostPosted: Wed Dec 24, 2014 6:27 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1066
does anyone know the address for the player x y and z?

_________________
yur sa'nok ngeyä


Top
 Profile  
 
PostPosted: Thu Dec 25, 2014 5:53 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1287
Location: GTAMP.com
It's in the first post if you can decipher it.

http://gtamp.com/maps/superman.7z probably has script example


Top
 Profile  
 
PostPosted: Thu Dec 25, 2014 8:39 am 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1066
ah its right there. i overread it somehow becasue of "angle".
now i just need fast reload. i'll check if its ar p1+21Ch.

btw: the superman script is fun and you can even fly out of the map

_________________
yur sa'nok ngeyä


Top
 Profile  
 
PostPosted: Fri Dec 26, 2014 12:58 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1066
additional info for the player coordinates: they have to be divided by 16384 in order to match the gta2 coordinate grid.

_________________
yur sa'nok ngeyä


Top
 Profile  
 
PostPosted: Sat Jan 03, 2015 12:29 am 
Offline
Car Jacker

Joined: Mon Apr 22, 2013 10:48 pm
Posts: 48
Here are the addresses I'm using in my mod: https://github.com/Bytewerk/gta2-hacker ... ddresses.h

This includes a rumble byte, which I have documented here.

If someone could find good pointers to the displayed text (WASTED!, Shotgun!, Player xy left the game!), it would be really helpful. I've started looking for these, see the comments in the file.

EDIT: I've managed to permanently show the ESC text and modify that, it's all documented here: http://git.io/g2hr-esc-text

_________________
GTA2 Hacker's Remix
...also check out my blog!


Last edited by robotanarchy on Fri Aug 07, 2015 9:46 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Mar 05, 2015 10:32 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:03 pm
Posts: 895
Do we also got the memory addresses for the head lights, alarm, dents etc. for the car you are driving at the moment (in the game)?

_________________
"Mmmm, your eyes are so beautiful."


Top
 Profile  
 
PostPosted: Tue Apr 28, 2015 8:36 pm 
Offline
Psycho

Joined: Wed Aug 08, 2012 9:25 pm
Posts: 51
After some digging with IDA Disassembler in the "source code" :geek: :
coplevel
coplevel = peek dword [p1 + 20Ah] 522
600 = level 1
1600
3000
5000
8000
12000 = level 6

threat reaction
reaction= peek dword [p1 + 28Ch ] 652
0 NO_REACTION
1 POLICE maybe? or same as 2
2 REACT_AS_NORMAL
3 RUN_AWAY

occupation
occupation= peek dword [p1 + 240h] 576
22 elvis?
51 no_occupation
3 dummy
8 walking cop
35 instant gang
23 medic

camera
camera x=peek dword [p1 + 1ACh] 428
camera y=peek dword [p1 + 1B0h] 432
camera z=peek dword [p1 + 1B4h] 436

char remap value
char remap value=peek byte [p1 + 244h] 580
0 police
10 red
11 green


Last edited by Jones on Tue May 05, 2015 8:20 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Mon May 04, 2015 1:27 pm 
Offline
Car Jacker

Joined: Mon Apr 22, 2013 10:48 pm
Posts: 48
Good findings Jones, I'll definatelly try out the camera x,y,z addresses for my splitscreen mod!

_________________
GTA2 Hacker's Remix
...also check out my blog!


Top
 Profile  
 
PostPosted: Sun Sep 06, 2015 12:22 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1287
Location: GTAMP.com
Thanks Jones. I might as well complete the occupation list.

The occupations listed in the compiler:

00 PLAYER
01 EMPTY
03 DUMMY
05 DRIVER
14 PSYCHO
15 MUGGER
16 CARTHIEF
17 BANK_ROBBER
18 CRIMINAL
22 ELVIS
24 POLICE
25 SWAT
26 FBI
27 ARMY
28 GUARD
32 GUARD_AGAINST_PLAYER
33 CRIMINAL_TYPE1
34 CRIMINAL_TYPE2
35 SPECIAL_GROUP_MEMBER
36 TANK_DRIVER
38 FIREMAN
39 ROAD_BLOCK_TANK_MAN
41 DRONE
43 STAND_STILL_BLOKE
44 ELVIS_LEADER
45 REFUGEES
46 ANY_LAW_ENFORCEMENT
47 ANY_EMERGENCY_SERVICE_MAN
48 ANY_GANG_MEMBER
49 ANY_ELVIS
51 NO_OCCUPATION

This list below isn't in the official compiler, so can't be set using SET_CHAR_OCCUPATION command. You might be able to set them by changing the memory or patching the SCR files or making your own compiler. I made the names up based on some quick observations. I knew which peds had which occupation number because I put the number on their heads instead of their ID number.
04 wait for bus ped?
07 walk anticlockwise dummy?
08 walking cop and sometimes wait for bus dummy?
09 some peds that get off the train. Most train peds just use DUMMY 3.
10 driving ped, 10 when I throw them out of car and then 11 when they run away.
19 seems to be a walking gang member, if they have a gun they walk around with it. Prison gang doesn't have guns but they still have some 19 occupation.
23 medic
29 maybe walking cops that start off walking anticlockwise.
42 gang car driver, will attack you if you steal their car


Top
 Profile  
 
PostPosted: Sun Sep 06, 2015 10:15 pm 
Offline

Joined: Sat May 16, 2009 6:14 am
Posts: 887
Location: London, UK
That list is now linked in my Character AI tutorial.

_________________
GTA5 Race, DM & Capture | GTA2 Levels & Coding | GTA2 YouTube Videos
Gran Turismo 6 custom track club(Sign in with PSN details, then follow link again.)


Top
 Profile  
 
PostPosted: Sun Sep 13, 2015 3:31 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1287
Location: GTAMP.com
pedstruct + 364 (0x16C) = pointer to the ped's current car. It will be 0 if they are on foot.


Top
 Profile  
 
PostPosted: Fri Dec 11, 2015 3:43 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1287
Location: GTAMP.com
0x5E8108 = frame count address = frame count value since the game started

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
// example script to show how many frames WHILE takes compared to WHILE_EXEC.  Add more DO_NOWT and the frame count will increase.
COUNTER framepointer = 6193416
COUNTER frameaddress
COUNTER frame
ONSCREEN_COUNTER time

LEVELSTART

WHILE (true=1)
  ADD_ONSCREEN_COUNTER (time,frame)
  DO_NOWT
  DO_NOWT
  DO_NOWT
  DO_NOWT
  DO_NOWT
  CHANGE_GANG_CHAR_RESPECT (framepointer, frameaddress, 104)
  CHANGE_GANG_CHAR_RESPECT (frameaddress, frame, 102)
  SET true=0
ENDWHILE

LEVELEND
 
Parsed in 0.009 seconds, using GeSHi 1.0.8.10


Top
 Profile  
 
PostPosted: Mon Dec 14, 2015 3:14 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:00 pm
Posts: 950
Location: F21B3EED
Sektor, Is there some hidden meaning for those 5x DO_NOWT commands?

Does the first post have all the known hacks? Would be nice if there was a single paper for all the knowledge we have so far!

I would want so much to wrap those messy hacks into one function call, such as: frame = get_framecount(). I thought this could be done in JavaScript, so you write the new style code there and "compile" it into MIS file which contains all those ugly hacks and temporary variables etc. When it is made in JS, anyone could tamper with the code and develop further easily without needing to dl any tools, also insta cross-platform.

Is there something against implementing this? I havent been around for long time so maybe things changed or i simply forgot something :)

_________________
My GTA2 related projects:


Top
 Profile  
 
PostPosted: Mon Dec 14, 2015 4:00 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1287
Location: GTAMP.com
The only reason for the 5x DO_NOWT is because I copied it from an example that compares the speed/frames of WHILE and WHILE_EXEC.

It's not the best example or best practical use for reading the framecount. I used it for a pseudo random number example too but even that wasn't needed.

I don't think I added everything to the first post yet. Your idea could be useful. I've only seen a few other people even attempt to use these memory addresses but making it easier might attract some more scripters.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 60 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 4 guests


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