Return to index
Printable Version Abbreviations
GOURANGA! Forums > Editing > General > GTA2 scripting
Post 1 | New
Tyyppi
  • Joined: Aug '05
  • Posts: 9
Hi. I've been trying to make some missions for GTA2 and was wondering that does the HAS_CHAR_BEEN_ARRESTED  (  char name   ) command actually work? I've tried to use it to check if the player has been arrested but it doesn't seem to do anything.
Post 2 | New
Cerbera
Ben 'Cerbera' Millard

Cerbera's Avatar


  • Joined: Feb '03
  • Posts: 1,800
Tyyppi wrote:
Hi. I've been trying to make some missions for GTA2 and was wondering that does the HAS_CHAR_BEEN_ARRESTED  (  char name   ) command actually work? I've tried to use it to check if the player has been arrested but it doesn't seem to do anything.
Have you placed it inside a valid loop statement?  Is it in the correct section of the .mis file?  Have you compiled that file into a .scr?

------------------
My Grand Theft Auto Handling Editor
My GTA Tutorials
http://projectcerbera.com/button.png
Post 3 | New
Tyyppi
  • Joined: Aug '05
  • Posts: 9
I figured it out. It was in a wrong loop but I just didn't spot it. Stupid me. Thanks anyway.
Post 4 | New
Tyyppi
  • Joined: Aug '05
  • Posts: 9
Now I have another scripting question. Is there any way to make an "insane" ped who just randomly attacks other peds? I tried to use PSYCHO occupation for the ped but it didn't really do anything, or maybe I'm just doing it wrong.

Code:
unguided = CREATE_CHAR (148.5 , 151.5 , 2.0) 11 270 PSYCHO END
GIVE_WEAPON (unguided , machine_gun)
SET_CHAR_THREAT_REACTION (unguided , REACT_AS_NORMAL)
SET_CHAR_THREAT_SEARCH (unguided , LINE_OF_SIGHT)
SET_CHAR_OBJECTIVE (unguided , NO_OBJ)


That's the code, but I haven't seen any random attacks.
Post 5 | New
Pyro
GTA2 Scripter & Mapper

  • Joined: Jun '03
  • Posts: 247
I've never actually used those 'special' character types. The only ones I normally use are:

  • CRIMINAL_TYPE1 (very rarely)
  • CRIMINAL_TYPE2
  • POLICE
  • SWAT
  • DUMMY
  • NO_OCCUPATION


I've never actually tried 'PSYCHO', but I'm sure he's supposed to go around punching people, rather than using a gun. Also, the way I do my character coding is (as if I were creating a character mid-game):

Code:
character = CREATE_CHAR ( 123.5 , 123.5 , 2.0 ) 10 90 NO_OCCUPATION END
SET_CHAR_THREAT_SEARCH ( character , NO_THREATS )
SET_CHAR_THREAT_REACTION ( character , NO_REACTION )
SET_CHAR_OBJECTIVE ( character , WAIT_ON_FOOT )


This basically makes a normal character who simply stands around waiting. Notice I put the threat search before the reaction (makes sense really), so not sure if that makes any difference.

If you want to make this character look like a ped instead of a beefy character (like the player, gang members etc), then you can use this code:

Code:
SET_CHAR_GRAPHIC_TYPE ( charactername , graphic type , remap )


The available graphic types are:

  • DUMMY_GRAPHIC (used for peds only)
  • EMERG_GRAPHIC (for cops, SWAT and army. I think the medic is actually made by using the DUMMY one IIRC. Set the remap to -1 for the SWAT graphic that I found a while back)
  • GANG_GRAPHIC (for gang types, but this is the default if you dont set it)


Maybe I'll have a go and see if I can get a psycho to work!

------------------
http://www.storm.elxx.net/Pyro/images/gta2pyro.png

Quote:
"Side effects may include: dry mouth, nausea, vomiting, water retention, painful rectal itch, hallucination, dementia, psychosis, coma, death, and halitosis. Magic is not for everyone. Consult your doctor before use."


Quote:
"Sharper than one of Oscar Wilde's witticisms rolled up, dunked in lemon juice and stabbed in someones eye..."
Post 6 | New
[SRS]wraith-53
Please Place Item In Bagging Area.

[SRS]wraith-53's Avatar


  • Joined: Nov '05
  • Posts: 14
is there any way to edit the original .scr files in the game? like..decompile them?
Post 7 | New
Delfi
Programmer

Delfi's Avatar


  • Joined: Feb '03
  • Posts: 844
[SRS wrote:
wraith-53]is there any way to edit the original .scr files in the game? like..decompile them?

 
No, since we got their offical compiler nobody actually went to create its own compiler or decompiler.

you can edit scr files with a hex editor to modify coordinates of things..

------------------
www.mathpudding.com
Post 8 | New
[SRS]wraith-53
Please Place Item In Bagging Area.

[SRS]wraith-53's Avatar


  • Joined: Nov '05
  • Posts: 14
but..it could be possible to decompile an .scr, right? though i dont think anyone will. id be nice, though!..so many things could be improved in gta2...
Post 9 | New
Pyro
GTA2 Scripter & Mapper

  • Joined: Jun '03
  • Posts: 247
There probably is a way, but it would be far too complex. Besides, some of the missions in the main levels are pretty straight forward, and given a chance I could probably re-code them into .mis format, but obviously there would be alterations and wouldnt be an exact replica.

Did you actually manage to fix your problem btw? smile

------------------
http://www.storm.elxx.net/Pyro/images/gta2pyro.png

Quote:
"Side effects may include: dry mouth, nausea, vomiting, water retention, painful rectal itch, hallucination, dementia, psychosis, coma, death, and halitosis. Magic is not for everyone. Consult your doctor before use."


Quote:
"Sharper than one of Oscar Wilde's witticisms rolled up, dunked in lemon juice and stabbed in someones eye..."
Post 10 | New
[SRS]wraith-53
Please Place Item In Bagging Area.

[SRS]wraith-53's Avatar


  • Joined: Nov '05
  • Posts: 14
Pyro wrote:
Did you actually manage to fix your problem btw? smile


if youre refering to me, i had no problem!
but..now i have another question..if i started a new script for either the bil, ste or wil.scr file, could i tell it to "link" to the other missions already in the game while adding more parked cars, criminals, lights and weapons?
Post 11 | New
Sektor
Sektor's Avatar


  • Joined: Feb '03
  • Posts: 288
The singleplayer .mis files for the Industrial level (bil) are included with the official compiler, so easy to add  to that.  For the other levels it would be much harder.  Maybe you could make a dummy wil_le1.mis, call it from your own script (you would need to know what flags to send to it), compile it and then copy the existing wil_le1.SCR over your compiled copy.  I haven't tried that but the small mission scripts would often rely on something that is created in the main script, it would be very difficult.

Just get the official compiler and add to the example bil.mis.

------------------
Stealing cars is the easy part
Post 12 | New
[SRS]wraith-53
Please Place Item In Bagging Area.

[SRS]wraith-53's Avatar


  • Joined: Nov '05
  • Posts: 14
hey, thanks! ill try that.
didnt know the bil file came with the official compiler.
Printable Version Abbreviations
IceyBoard 1.6.2 © 2002-12 Icey