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.
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 ObjectsCOUNTERS/DOORS/OBJECTS/CARS/CHARS in the game. You can then create an external engine and load your scripts without compilation.
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
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.
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.
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.
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.
[mis]
PLAYER_PED p1 = (137.0, 150.8, 255.0) 6 180
CAR_DATA p1car = (135.5, 154.0, 255.0) 1 180 T2000GT
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)
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.
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
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.
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 http://gtamp.com/forum/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.
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.
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.
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.