Script Help.
-
- Immortal
- Posts: 889
- Joined: 16 May 2009, 06:14
- GH nick: BenMillard
- Location: London, UK
- Contact:
Re: Script Help.
Guide to GTA2 gang scripting, including special arrows. The arrow_id part is where the phone arrow colour is set.
In multiplayer games, these coloured arrows point to other players. So it's a bad idea to use this type of arrow in normal multiplayer games. But in a game with 2 colour-coded teams you will have 4 spare colours.
In multiplayer games, these coloured arrows point to other players. So it's a bad idea to use this type of arrow in normal multiplayer games. But in a game with 2 colour-coded teams you will have 4 spare colours.
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.)
Gran Turismo 6 custom track club(Sign in with PSN details, then follow link again.)
-
- Lunatic
- Posts: 456
- Joined: 19 Jul 2008, 14:14
- GH nick: Razor, R
- Location: Poland / Szczecin
- Contact:
Re: Script Help.
im creating sp missions and i need arrows to red,green,yellow phones not just to zone of gang declared by Set_gang_info
Re: Script Help.
SET_ARROW_COLOR
wont it help you?
/////////////////////////////////////////////////////////////
Should I ask my questions about scripting in here or open a new topic for them?
wont it help you?
/////////////////////////////////////////////////////////////
Should I ask my questions about scripting in here or open a new topic for them?
- Gustavob
- Immortal
- Posts: 407
- Joined: 18 May 2009, 21:40
- GH nick: Gustavob
|Gustavob| - Location: Nowhere.
- Contact:
Re: Script Help.
I think they're made with General Trigger zones, named with the first letters of the words of the phone name or with the phone name itself. But I'm not sure
You just lost the game.
-
- Lunatic
- Posts: 456
- Joined: 19 Jul 2008, 14:14
- GH nick: Razor, R
- Location: Poland / Szczecin
- Contact:
Re: Script Help.
you can set phone arrows by zone i think and if you correctly create phone + zone then arrows should show themselfs
- ALPINE
- Car Jacker
- Posts: 36
- Joined: 03 Jan 2010, 12:47
- GH nick: ALPINE
- Location: Togliatti, Russia
- Contact:
Re: Script Help.
I'm going to write a mission. I wrote scripts before (and built a map), but it was a long time ago...
It's normal to use WHILE block like this?
It's correct? It's good style of coding for gta2 or there must be another concept of script?
It's normal to use WHILE block like this?
Code: Select all
COUNTER mission_stage = 0
COUNTER TRUE = 1
WHILE (TRUE = 1) // infinite loop
IF (mission_stage = 1)
/* big code implements mission stage #1
contains a lot of checks like IF (LOCATE_CHARACTER_BY_FOOT(...) ...
contains similar blocks IF (mission_substage = 1)... = 2.... =3...
and set "mission_stage" to 2 when it's needed */
ENDIF
IF (mission_stage= 2)
/* big code implements mission stage #2 */
/* etc */
ENDIF
/* some code here, that must be executed anyway
(checking death of important persons,
messaging "Mission Failed" and reset mission_stage to 1, etc) */
ENDWHILE
.4LPINE
Re: Script Help.
That style is normal.
- ALPINE
- Car Jacker
- Posts: 36
- Joined: 03 Jan 2010, 12:47
- GH nick: ALPINE
- Location: Togliatti, Russia
- Contact:
Re: Script Help.
Is here function to check distance between object A and B? Something like LOCATE_CHARACTER_ANY_MEANS(), but takes another object as second parameter, not (x,y,z) coordinate.
.4LPINE
- Gustavob
- Immortal
- Posts: 407
- Joined: 18 May 2009, 21:40
- GH nick: Gustavob
|Gustavob| - Location: Nowhere.
- Contact:
Re: Script Help.
There's no command for checking if an object is somewhere or to check if "this object is at X blocks of distance of that object", although theres a command that checks if an item (object, character, car etc) is onscreen.
You just lost the game.
- ALPINE
- Car Jacker
- Posts: 36
- Joined: 03 Jan 2010, 12:47
- GH nick: ALPINE
- Location: Togliatti, Russia
- Contact:
Re: Script Help.
Great.
I want to bring bastard-character to attack player only if he is near the defined object. So I if this object is onscreen, that means player is near it. Check will be fine.
One more question:
I need AI Character that will be follow the player. I found objective GOTO_CHAR_ON_FOOT, but if player takes a car, character must enter this car as passenger. Must I manually write this behaivor? Or there is easy way to bring the character follow player?
I want to bring bastard-character to attack player only if he is near the defined object. So I if this object is onscreen, that means player is near it. Check will be fine.
One more question:
I need AI Character that will be follow the player. I found objective GOTO_CHAR_ON_FOOT, but if player takes a car, character must enter this car as passenger. Must I manually write this behaivor? Or there is easy way to bring the character follow player?
.4LPINE
- Gustavob
- Immortal
- Posts: 407
- Joined: 18 May 2009, 21:40
- GH nick: Gustavob
|Gustavob| - Location: Nowhere.
- Contact:
Re: Script Help.
You can make the character follow the player in another car (create a car and set bastard-character's objective to enter the car, then check if he is in car before setting his objective to FOLLOW_CAR_IN_CAR) or you can make this:
This will check if player is in any car and store it as if it was scripted with car_data and make the bastard character enter player's car as passenger.
I think it works. If it dont tell us.
Code: Select all
IF ( IS_CHARACTER_IN_ANY_CAR ( player ) )
STORE_CAR_CHARACTER_IS_IN ( player , player_car )
SET_CHAR_OBJECTIVE ( bastard , ENTER_CAR_AS_PASSENGER , player_car )
ENDIF
I think it works. If it dont tell us.
Last edited by Gustavob on 03 Jan 2010, 19:51, edited 1 time in total.
You just lost the game.
- ALPINE
- Car Jacker
- Posts: 36
- Joined: 03 Jan 2010, 12:47
- GH nick: ALPINE
- Location: Togliatti, Russia
- Contact:
Re: Script Help.
OK but he must leave car if player leaves (he just copy player actions). I'll write this behaivor myself. Thank you
I'm writing COOPERATIVE mission for Industrial (bil). No map change (same GMP file), location of all stuff is taken from example bil.mis file. I hope mission will be good.
I'm writing COOPERATIVE mission for Industrial (bil). No map change (same GMP file), location of all stuff is taken from example bil.mis file. I hope mission will be good.
.4LPINE
- Gustavob
- Immortal
- Posts: 407
- Joined: 18 May 2009, 21:40
- GH nick: Gustavob
|Gustavob| - Location: Nowhere.
- Contact:
Re: Script Help.
Just check if player exit car with IF ( NOT ( IS_CHARACTER_IN_CAR ( player , player_car ) ) and set the bastard-character's objective to exit car and go to player. Might work
EDIT: Also, I forgot something:
EDIT: Also, I forgot something:
Code: Select all
ADD_GROUP_TO_CHARACTER ( player )
ADD_EXISTING_CHAR_TO_GROUP ( bastard )
You just lost the game.
-
- Lunatic
- Posts: 456
- Joined: 19 Jul 2008, 14:14
- GH nick: Razor, R
- Location: Poland / Szczecin
- Contact:
Re: Script Help.
use that command it is better and easierGustavob wrote:Just check if player exit car with IF ( NOT ( IS_CHARACTER_IN_CAR ( player , player_car ) ) and set the bastard-character's objective to exit car and go to player. Might work
EDIT: Also, I forgot something:
Code: Select all
ADD_GROUP_TO_CHARACTER ( player ) ADD_EXISTING_CHAR_TO_GROUP ( bastard )
- ALPINE
- Car Jacker
- Posts: 36
- Joined: 03 Jan 2010, 12:47
- GH nick: ALPINE
- Location: Togliatti, Russia
- Contact:
Re: Script Help.
I asked exactly about trick like this ThanksADD_GROUP_TO_CHARACTER ( player )
ADD_EXISTING_CHAR_TO_GROUP ( bastard )
.4LPINE
- ALPINE
- Car Jacker
- Posts: 36
- Joined: 03 Jan 2010, 12:47
- GH nick: ALPINE
- Location: Togliatti, Russia
- Contact:
Re: Script Help.
Now I have some problems with FIRE_AT_OBJECT_FROM_VEHICLE.
If I try to fire a car or another character, game crashes. Firing object like FOOTY (ball) not crashes the game. Any suggestions?
If I try to steal firing tank, game crashes, because character with "FIRE_AT_OBJECT_FROM_VEHICLE" objective is now on foot (kicked from tank by me). So tank must be unstealable...
AI Characters can only shoot using TANK? That about GUNJEEP, FIRETRUK with water cannon or flame thrower?
If I try to fire a car or another character, game crashes. Firing object like FOOTY (ball) not crashes the game. Any suggestions?
If I try to steal firing tank, game crashes, because character with "FIRE_AT_OBJECT_FROM_VEHICLE" objective is now on foot (kicked from tank by me). So tank must be unstealable...
AI Characters can only shoot using TANK? That about GUNJEEP, FIRETRUK with water cannon or flame thrower?
.4LPINE
Re: Script Help.
FIRE_AT_OBJECT_FROM_VEHICLE "Orders the character to fire from his current vehicle at a particular object. Really only useful when the character is inside a tank! Set ‘second item’ to be the name of the object to fire at. Only works with Tank at moment!!"
I just made script ( the characters inside tank, gunjeep, firetruck - can use the car weapons )
I just made script ( the characters inside tank, gunjeep, firetruck - can use the car weapons )
Code: Select all
// Players
PLAYER_PED p1 = ( 150.3 , 109.0 , 7.0 ) 25 270
PARKED_CAR_DATA tank_car = ( 150.3 , 111.0 , 7.0 ) 34 0 TANK
PARKED_CAR_DATA jeep_car = ( 150.3 , 107.0 , 7.0 ) 34 0 GUNJEEP
CHAR_DATA tank_char
CHAR_DATA jeep_char
COUNTER loop = 0
COUNTER step = 0
LEVELSTART
WHILE_EXEC ( loop = 0 )
IF ( step = 0)
tank_char = CREATE_CHAR_INSIDE_CAR ( tank_car ) 13 criminal END
jeep_char = CREATE_CHAR_INSIDE_CAR ( jeep_car ) 13 criminal END
SET step = 1
ENDIF
IF (step = 1)
//TANK
SET_CHAR_MAX_DRIVESPEED ( tank_char , 0.0 ) // Tank doesn't move
SET_CHAR_TO_STAY_IN_CAR ( tank_char , ON )
SET_CHAR_OBJECTIVE ( tank_char , KILL_CHAR_ANY_MEANS , p1 )
SET_CHAR_TO_USE_CAR_WEAPON ( tank_char , ON )
//JEEP
SET_CHAR_MAX_DRIVESPEED ( jeep_char , 0.1 )
SET_CHAR_TO_STAY_IN_CAR ( jeep_char , ON )
SET_CHAR_OBJECTIVE ( jeep_char , KILL_CHAR_ANY_MEANS , p1 )
SET_CHAR_TO_USE_CAR_WEAPON ( jeep_char , ON )
ENDIF
ENDWHILE
LEVELEND
Last edited by Heri on 04 Jan 2010, 11:39, edited 1 time in total.
- ALPINE
- Car Jacker
- Posts: 36
- Joined: 03 Jan 2010, 12:47
- GH nick: ALPINE
- Location: Togliatti, Russia
- Contact:
Re: Script Help.
Heri, I can read manual.
I ask about this strange bugs and maybe undocumened features of this behaivor. Check out Sektor's "Super tank" - is this function documented?
UPD: Thanks. Does it work? By the way, I didn't use SET_CHAR_TO_USE_CAR_WEAPON... maybe this was a problem.
I ask about this strange bugs and maybe undocumened features of this behaivor. Check out Sektor's "Super tank" - is this function documented?
UPD: Thanks. Does it work? By the way, I didn't use SET_CHAR_TO_USE_CAR_WEAPON... maybe this was a problem.
.4LPINE
Re: Script Help.
I tested it, it works great =]
- ALPINE
- Car Jacker
- Posts: 36
- Joined: 03 Jan 2010, 12:47
- GH nick: ALPINE
- Location: Togliatti, Russia
- Contact:
Re: Script Help.
OK It will be useful...
By the way - I sent the letter to Rockstargames about opening gta2 source Maybe they will respond
By the way - I sent the letter to Rockstargames about opening gta2 source Maybe they will respond
.4LPINE