GTAMP.com

Grand Theft Auto Media Press
It is currently Tue Dec 12, 2017 11:51 pm

All times are UTC




Post new topic Reply to topic  [ 60 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Tue Dec 15, 2015 4:52 pm 
Offline
Psycho

Joined: Wed Aug 08, 2012 9:25 pm
Posts: 51
Quote:
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.

In my opinion the next/first step would be adding this feature in B-$hep and your's compiler. Add get_framecount as an internal declared function which will converted to the right bytecodes :) Not sure if adding the JS layer would be worth all the trouble.


Top
 Profile  
 
PostPosted: Thu Dec 17, 2015 1:56 am 
Offline
Car Jacker

Joined: Wed Dec 09, 2015 2:18 pm
Posts: 30
Has anyone tried to get the address of the memory at the time of the declaration of a new Object in the script, it is possible?

It would be very helpful to declare the Objects COUNTERS/DOORS/OBJECTS/CARS/CHARS in the game. You can then create an external engine and load your scripts without compilation.

I have previously suggested is here viewtopic.php?f=4&t=815#p9571
Quote:
16. There was more epic question: Is it possible to create an external engine (for multiplayer) that will use their scripts and work through the memory game (server -> client-side)?

We need to find addresses Declaration objects to create/delete dynamically through memory. Then you can forget about the complexities of the language syntax: add many missing features to work with files (load/save data to a file) and make full GTA2 base for mods.

I think this is the most important step to create something new in GTA2

_________________
[GTA2 Map] F-Industry-Live
[GTA2 FAQ] Help for scripters


Top
 Profile  
 
PostPosted: Thu Dec 17, 2015 3:40 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
We already have the memory addresses to change the coordinates of existing objects. New object creation is best done by hooking GTA2 and executing the existing functions, rather than just writing to memory. I don't know how to execute existing functions from external code but I know it's possible.


Top
 Profile  
 
PostPosted: Thu Dec 17, 2015 2:24 pm 
Offline
User avatar

Joined: Fri Jan 29, 2010 3:00 pm
Posts: 950
Location: F21B3EED
Sektor wrote:
I've only seen a few other people even attempt to use these memory addresses but making it easier might attract some more scripters.

Indeed! Its too tedious currently, so not many people dare to mess with the code.

_________________
My GTA2 related projects:


Top
 Profile  
 
PostPosted: Thu Dec 17, 2015 6:13 pm 
Offline
User avatar

Joined: Fri Apr 24, 2009 9:43 pm
Posts: 512
Location: Estonia
If i could have memory addresses and examples how each can be used then i could add single or two commands into mis2 syntax and write this all into .scr file.

So users dont have to mess with direct memory. But can just script it.

_________________
Always wear safety glasses while programming.


Top
 Profile  
 
PostPosted: Sat Jan 02, 2016 6:42 pm 
Offline
Lunatic

Joined: Sat Jul 19, 2008 2:14 pm
Posts: 456
Location: Poland / Szczecin
Quote:
We need to find addresses Declaration objects to create/delete dynamically through memory. Then you can forget about the complexities of the language syntax: add many missing features to work with files (load/save data to a file) and make full GTA2 base for mods.

I think this is the most important step to create something new in GTA2


Can't WAIT! I would definitely back to gta2 if there was no desync and you just could join to servers :)

I'll just stay here and stalk those changes

B-$heep - I agree some mapmakers like kamil/heri would definetly use that.

Cheers!


Top
 Profile  
 
PostPosted: Mon Aug 22, 2016 7:29 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
Run faster than Usain Bolt!

pedsprite + 57 = walk/run speed. Speed 1 to 3 walk, 4 and above run. Any faster than 12 and you will outrun the camera.

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
IF (NOT(IS_CHARACTER_IN_ANY_CAR(p1)))
  COUNTER speed = 12
  COUNTER speed_addr
  COUNTER pedsprite_ptr
  COUNTER pedsprite_addr
  SET pedsprite_ptr = (p1+360)
  CHANGE_GANG_CHAR_RESPECT (pedsprite_ptr, pedsprite_addr, 104) //read pedsprite address
  SET speed_addr = (pedsprite_addr+57)
  CHANGE_GANG_CHAR_RESPECT (speed_addr, speed, 114) //write player speed value
ENDIF
Parsed in 0.009 seconds, using GeSHi 1.0.8.10


Top
 Profile  
 
PostPosted: Sat Jan 14, 2017 11:59 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
p1car + 88 = car pointer + 64 = car X speed
p1car + 88 = car pointer + 68 = car Y speed

Slide a car to the right (change carspeed=100 to a higher value to increase slide speed or set it to a negative to go left)

GTA2 only reads this memory address if a ped is in the car or if there's a collision, so I put a ped in there to make the sprite update.
Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
PLAYER_PED p1 = (137.0, 150.8, 255.0) 6 180
CAR_DATA p1car = (135.5, 154.0, 255.0) 1 180 T2000GT

COUNTER loop = 1
COUNTER car_addr
COUNTER car_ptr
COUNTER carspeedaddress
COUNTER carspeed

LEVELSTART

GIVE_DRIVER_AND_BRAKE (p1car)

WHILE_EXEC (loop = 1)

SET car_ptr=(p1car+88)
CHANGE_GANG_CHAR_RESPECT (car_ptr,car_addr,104)
SET carspeedaddress = (car_addr+64)
SET carspeed=100
CHANGE_GANG_CHAR_RESPECT (carspeedaddress, carspeed, 114)

ENDWHILE //main while

LEVELEND
 
Parsed in 0.009 seconds, using GeSHi 1.0.8.10


Top
 Profile  
 
PostPosted: Sat Feb 11, 2017 11:51 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
Play a vocal without displaying a message by writing 4 bytes to 5E202C. 1 to 62.

1 INSANE STUNT BONUS!
2 GRAND THEFT AUTO!
3 WIPEOUT!
4 EXPEDITIOUS EXECUTION!
5 GENOCIDE!
6 COP KILLA!
7 CAR JACKA!
8 ELVIS HAS LEFT THE BUILDING!
9 ACCURACY BONUS!
10 BACK-TO-FRONT-BONUS!
11 MEDICAL EMERGENCY!
12 KILL FRENZY!
17 BUSTED!
18 FRENZY FAILED!
19 FRENZY PASSED!
20 FRYING TONIGHT!
22 [1124] JOB COMPLETE!
23 [1125] JOB FAILED!
24 AND REMEMBER, RESPECT IS EVERYTHING!
25 SHOCKING!
26 MMM... SOMETHIN'S COOKIN!
27 [5015] TIME'S UP, PAL!
28 TOASTED!
29 WASTED!
30 bombarmed.wav (weird one)
31 laugh6.wav
32 LAUGH (changes each time you play it)
33 [5501] RACE OVER!
34 [5502] SECOND LAP!
35 [5503] FINAL LAP!
36 [5504] RACE ON!
37 [5505] HEY! 30 PEOPLE DOWN! MULTIPLIER X2
38 [5506] OOH! 60 PEOPLE DOWN! MULTIPLIER X3
39 [5507] NICE! 90 PEOPLE DOWN! MULTIPLIER X4
40 [5508] GREAT! 120 PEOPLE DOWN! MULTIPLIER X5
41 [5509] OUTSTANDING! 150 PEOPLE DOWN! MULTIPLIER X6
42 [5510] TIME OUT!
43 [5000] YOUR TIME IS EXTENDED!
44 [5015] TIME'S UP, PAL! (duplicate)
45 [5031] Oh, sorry about that... Did that hurt?
46 [5032] Nice work!
47 [5050] CHOCTASTIC!
48 [5051] RASPBERRY RIPPLE!
49 [5052] YOU SHOT YOUR LOAD!
50 [5053] OOH... DID THAT HURT?
51 [5054] DEATH TO ICE-CREAM VANS!
52 [5055] CRISPY CRITTER!
53 [5056] YOU'RE TOAST, BUDDY!
54 [5057] EAT LEADEN DEATH, PUNK!
55 [5058] THAT'S GOTTA HURT!
56 [5059] SORRY ABOUT THAT!
57 [5060] XIN LOI, MY MAN!
58 [5061] DAMN SUNDAY DRIVERS!
59 [5062] SUCK IT AND SEE!
60 [5063] TASTE MY WRATH, ICE-CREAM BOY!
61 HALLELUJAH, ANOTHER SOUL SAVED!
62 DAMNATION, NO DONATION, NO SALVATION!

So now we can finally play the unused vocals "FRYING TONIGHT!", "MMM... SOMETHIN'S COOKIN!" and "BOMB ARMED!"

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
PLAYER_PED p1 = (117.0,133.5,2.0) 10 270

COUNTER vocaladdr = 6168620
COUNTER vocalvalue = 1

LEVELSTART

SET vocalvalue = 26 // something's cooking!
CHANGE_GANG_CHAR_RESPECT (vocaladdr,vocalvalue, 114)

LEVELEND
Parsed in 0.008 seconds, using GeSHi 1.0.8.10


Still don't know how to play gameover.wav.


Top
 Profile  
 
PostPosted: Mon Mar 06, 2017 3:33 pm 
Offline

Joined: Sat May 16, 2009 6:14 am
Posts: 887
Location: London, UK
Sweet, didn't know about those two audio announcements.

_________________
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: Fri Jun 16, 2017 1:45 am 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
I've been having fun getting Invisibility to work on scripted Assassins, as well as varying health increments for scripted characters. I wanted to know, what is the address to give a Ped electrofingers? I'd love to have fun with that. & can Peds be given Fast Reload/Double Damage? That'd be intense.

Also, do you guys think it'd be possible to create custom occupations with proper hacking? Scripted FBI guys always prefer to shoot the player from half a block away, but committing a crime in front of them will give you a wanted level. It'd be cool to be able to create characters that behave similarly but don't give you a wanted level when you attack in front of them. Same thing with someone who acts like a Cop, firing at you when you're in a vehicle but punching you when you're on foot.
I noticed a nifty thing about non-scripted FBI guys the other day too- We usually think there's one with a Silenced Machine Gun & one with a Shotgun. I noticed that the Special Agents who get out of cars, the one's with the silenced Machine Gun will shoot you with a shotgun when they're in range. If it wasn't the ones in cars than it was the road block ones. It'd be cool if there could be an occupation who uses a shotgun on you at close range. Are custom occupations like that doable or do you have to edit the .exe directly?

EDIT: FBI guys & presumably other scripted LEO occupations won't give you a wanted level if you commit a crime in front of them if they have an objective, like killing you on foot. So I assume standard behavior only defaults when they're set to NO_OBJ. It'd still be cool for that behavior without a wanted level though. My script involves objective changes once the player dies, the assassins don't despawn, they level up & wander the city aimlessly.


Top
 Profile  
 
PostPosted: Fri Jun 16, 2017 2:03 am 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1068
Devastator wrote:
It'd be cool if there could be an occupation who uses a shotgun on you at close range. Are custom occupations like that doable or do you have to edit the .exe directly?


i think you can just remove the smg when he is close enough and give him a shotgun instead. when hes far anough away give him a smg again. that should work even if he is on patrol which i found is much more stable when the character should respawn multiple times. if you want him to move closer and closer you can toggle smg and shotgun as long as he is too far away for shotgun so he will run, shoot, sun, shoot which makes him less predictable. and if you want him to be extremely dangerous toggle punch(no weapon) and shotgun as well

_________________
yur sa'nok ngeyä


Top
 Profile  
 
PostPosted: Fri Jun 16, 2017 3:46 am 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
That sounds like it'd actually be pretty cool to implement, but what commands would I use to do that? I'm looking at the Gta2 scripting tutorials on Ben's website & I'm not sure what commands to use.The possibility of an NPC cycling between 3 weapons? That'd be awesome.


Top
 Profile  
 
PostPosted: Fri Jun 16, 2017 12:14 pm 
Offline
User avatar

Joined: Sat Dec 26, 2009 11:53 pm
Posts: 1068
GIVE_WEAPON
REMOVE_WEAPONS
maybe CHECK_CHAR_CURR_WEAPON

i dont know about a command that checks for the distance between 2 characters. i dont know if i missed it or if it doesnt exist but it can be done with pointer magic viewtopic.php?f=4&t=700 the first post has an example for reading coordinates of chars. then calculate sqrt((x1-x2)²+(y1-y2)²) for the distance.

if sqrt doesnt work then it can be done without too viewtopic.php?p=9585#p9585

_________________
yur sa'nok ngeyä


Top
 Profile  
 
PostPosted: Sat Jun 17, 2017 10:27 pm 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
I know you guys have been able to create new commands in the scripting document. I just tested it out & the damage type ANY_ELECTRO_WEAPON doesn't work for the electro baton. (I'm not sure about Electro Fingers). Could you guys create a damage type for the electro baton? I have some ideas I could use for it, including usage of the laser trip wire. Maybe BY_TASER_BULLET & BY_TASER_ARC?

& Could a STUN_CHAR command be made? That puts a character in a punch stun state.
I could do something like
IF (CHECK_WEAPON_TYPE_HIT_CHAR (Thug1, BY_TASER_BULLET))
STUN_CHAR (Thug1)
ENDIF

& If the stream fromn the electro baton could be modified to act like the Electro gun by pinning stunned characters to ground, I'd set the next command to be
IF (CHECK_WEAPON_TYPE_HIT_CHAR (Thug1, BY_TASER_ARC)
SET_CHAR_MAX_RUN_SPEED (Thug1, 0.01)
ENDIF.

I could also use it as a way to remove enemy weapons on some maps, or with laser trips remove player weapons. Or as a way to add characters to the Player's group (maybe it could be worked to act similarly to STORE_LAST_CHAR_PUNCHED so that you could add dummy peds to your group.

Have you guys found the address for the electro_baton yet?



EDIT: Would there be a way to override invulnerability using the CHECK_WEAPON_TYPE_HIT_CHAR command?

i.e.
IF (CHECK_WEAPON_TYPE_HIT_CHAR (Term2, BY_CAR_BOMB))
KILL_CHAR (Term2)
ENDIF

I just tested this out & it doesn't work, it'd be cool if I could use this to kill scripted invincible characters.

EDIT: I found a work around involving turining character invincible with certain damage types, & turning invincibility off when he's attacking.


Top
 Profile  
 
PostPosted: Mon Jul 03, 2017 6:55 am 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
What do I need to do to get the Zoom code working? I've tried it & it isn't working when my main loop starts. My map is mostly all on foot & the default camera height is a bit claustrophobic, so getting a base zoom for all players would be beneficial.


Top
 Profile  
 
PostPosted: Wed Jul 05, 2017 1:49 am 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
I'll look at the zoom code later, no time now.

Infinite armour (only works on players, crashes on bots)
Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
LEVELSTART

COUNTER loop = 1
COUNTER player_ptr
COUNTER player_addr
COUNTER armour_ptr
COUNTER armour_addr = 10

WHILE_EXEC (loop = 1)

ALTER_WANTED_LEVEL_NO_DROP (p1,6)

SET player_ptr = (p1+348)
CHANGE_GANG_CHAR_RESPECT (player_ptr,player_addr,104)
SET armour_ptr = (player_addr+1786)
CHANGE_GANG_CHAR_RESPECT (armour_ptr,armour_addr,112)

ENDWHILE

LEVELEND
 
Parsed in 0.008 seconds, using GeSHi 1.0.8.10


Top
 Profile  
 
PostPosted: Sat Jul 15, 2017 12:13 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
10 days later, here is the code to zoom the camera out:

Syntax: [ Download ] [ Hide ]
Using GTA2 Script Syntax Highlighting
//zoom camera out
PLAYER_PED p1 = (117.0,133.5,255.0) 10 270 // Red
PLAYER_PED p2 = (118.0,133.5,1.0) 09 090 // Orange
PLAYER_PED p3 = (117.5,132.5,1.0) 07 180 // Yellow
PLAYER_PED p4 = (117.5,134.5,1.0) 11 000 // Green
PLAYER_PED p5 = (117.0,132.5,1.0) 13 225 // Blue
PLAYER_PED p6 = (118.0,134.5,1.0) 08 045 // Black

COUNTER loop = 1
COUNTER camera_z_addr
COUNTER camera_z_value = 300000

LEVELSTART

WHILE_EXEC (loop = 1)

SET camera_z_addr = (p1+436)
CHANGE_GANG_CHAR_RESPECT (camera_z_addr,camera_z_value,114)

ENDWHILE

LEVELEND
 
Parsed in 0.010 seconds, using GeSHi 1.0.8.10


Top
 Profile  
 
PostPosted: Mon Jul 17, 2017 1:49 pm 
Offline
Hitman

Joined: Tue Dec 06, 2011 4:54 pm
Posts: 115
Awesome, thank you. How far is that zoom relative to the baseline on foot camera?


Top
 Profile  
 
PostPosted: Mon Jul 17, 2017 2:21 pm 
Offline
Boss
User avatar

Joined: Tue Mar 04, 2008 6:51 am
Posts: 1290
Location: GTAMP.com
Default is 32,768. You can find out by reading that address instead of writing. Change 114 to 104 to make it read and then add it to score to see it easily.

300,000 is probably too high, change that to a lower number to reduce zoom.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 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