Scripting command questions
Posted: 27 May 2017, 22:31
I've been trying my hand at Scripting for GTA2 again, using one of the earlier renditions of Multislayer (which I played a lot in Single player many years ago).
I've been able to produce some pretty cool effects, like Suicide bombers (on foot) that explode upon reaching the player,
5 different assassins that swarm the player on level start, becoming invincible if the player dies & having a group added to their character, if each particular assassin dies that respawn as a downgraded form with no objective(plus a weaker weapon & standard gangster attire (whereas the Gang assassins have The EMERG_GRAPHIC remap, I'm using this to pretend they're the gang leaders).
I have a zombie gang in the graveyard that attacks the player on site, & a generator in the graveyard that turns all characters into muggers(Psychos) if destroyed (I used to use the buckfast cheat to pretend everyone in the city was zombies & I would play to see how long I could survive for, so this generator acts as a way to optionally turn it on at any point during gameplay).
A funny thing I noticed with this experimentation is some scripting weirdness which is actually pretty cool & you guys may have not known about;
If you have turn all characters into muggers both (ON) & (OFF) simultaneously in a loop, it'll create interesting behavior with dummy peds. The peds who spawn as Psychos don't attack the player or each other on sight, but if the player attacks the peds will rush him & punch him to the ground like a cop (or maybe they were doing that to gangsters but actually killing me). They also won't fight each other in this state so you can have like 10 dummy peds all chasing the player at once.
I also created some Terminator like characters similar to those in Snow Ball City 2; invulnerable Objectiveless guys that wander around & attack when attacked. Killing them turns on the Instant Gang generator they spawn at. I got this to work once but my latest version of the script doesn't seem to be activating the generator when I kill them.
The player starts out with an EMERG_GRAPHIC remap (Green vested Krishna), upon dying he looks like a standard Krishna. If you manage to kill a Terminator though you'll "level up" & become gang leader again by getting your Vest back.
(The Pherson Ghetto is the location of Krishna looking 'Thugs' gang)
I've also learned some cool scripting hacks you guys may or may not have known about involving NPCs with groups created for them.
Any group added to a character will have that character's remap & weapon.
However, if you create the character, create the group, & then remap the character & give the character a weapon (or different weapon) his gang can have completely different weapons & remaps then him. I've been using this to designate the gang leader with an EMERG_GRAPH remap.
One of my assassins is actually armed with an Electrobaton, & his group (following him in a chain) is unarmed, so he shoots the player to slow him down while they gang up on him & beat him up.
What I learned from all this though is when you kill a Group leader, another member of that group becomes that group leader;
Killing the leader of the gang with the electrobaton makes one of the cohorts instantly armed with it,
Similarly with a Flame thrower dude & his group.
It's the same with my Kamikaze guys, if you kill the group leader whose objective is to go to p1 on foot, causing him to explode, his lackey will continue the objective, being the one to explode instead. This is pretty cool because I have a second group comprised of 6 kamikazes who have a car bomb size explosion.
Speaking of my kamikazes, upon reaching their objective the loop caused them to explode indefinitely, which was pretty amusing as they soared through the air leaving a chain of explosions, but not what I had intended. So by setting a check to make the character have no objective upon reaching the player & then exploding, or having no objective upon dying, I was able to break the infinitely exploding corpse glitch.
Here's all the coding so far for anyone curious:
[mis](to make this more legible I removed Cerbera's original lines from the script so that only mine are visible)
OBJ_DATA Psychogen = (055.5,066.5) 0 POWERGEN
OBJ_DATA Pistcrate = (099.18,087.24) 0 Crate
OBJ_DATA Pistcrateproduct
//Gangs
MAP_ZONE Zombies //= (0,0,0,0,10,0,0,0,1000,0,0)
SET_GANG_INFO ( Zombies , 24, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , BMW , 1)
//
//MAP_ZONE Fire1
//SET_GANG_INFO ( Fire1 , 3, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
// 0.0, 0.0, 0.0, 00 , FIRETRUK , -1)
//
//MAP_ZONE Fire1
//SET_GANG_INFO ( Fire1 , 3, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
// 0.0, 0.0, 0.0, 00 , FIRETRUK , -1)
//
//
MAP_ZONE Police1 //= (500,0,0,500,100,0,0,0,500,400,500)
SET_GANG_INFO ( Police1 , 0, PISTOL, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , COPCAR , -1)
//
MAP_ZONE SubwayRats
SET_GANG_INFO ( SubwayRats , 14, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , STYPE , 1)
//
MAP_ZONE Thugs
SET_GANG_INFO ( Thugs , 9, PISTOL, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , STRIPETB , 29)
//
MAP_ZONE Shockers
SET_GANG_INFO ( Shockers , 12, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , ALLARD , 33)
////
MAP_ZONE Seniors
SET_GANG_INFO ( Seniors , 46, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , VAN , 16)
////
MAP_ZONE Reds
SET_GANG_INFO ( Reds , 30, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , ALFA , 28)
////
MAP_ZONE Bruisers
SET_GANG_INFO ( Bruisers , 22, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , DART , 32)
//
//MAP_ZONE Docks
//SET_GANG_INFO ( Docks , 33, PISTOL, NO_WEAPON, NO_WEAPON, 0 ,
// 0.0, 0.0, 0.0, 00 , PICKUP , 35)
//
//MAP_ZONE A2gang
//SET_GANG_INFO ( A2gang , 42, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
// 0.0, 0.0, 0.0, 00 , GRAHAM , 11)
//
//MAP_ZONE A4gang
//SET_GANG_INFO ( A4gang , 36, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
// 0.0, 0.0, 0.0, 00 , ISETTA , 20)
//
MAP_ZONE Pinks
SET_GANG_INFO ( Pinks , 52, PISTOL, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , MESSER , 26)
//
MAP_ZONE Sharks
SET_GANG_INFO ( Sharks , 17, SHOTGUN, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , FIAT , 17)
// Players:
PLAYER_PED p1 = (103.5,090.5,255.0) 9 90
// Char Data:
//ASSASSINS
CHAR_DATA A2
CHAR_DATA A3
CHAR_DATA A3b
CHAR_DATA A4
CHAR_DATA A5
CHAR_DATA A6
CHAR_DATA B2
CHAR_DATA B3
CHAR_DATA B4
CHAR_DATA B5
CHAR_DATA B6
CHAR_DATA Term
CHAR_DATA Term2
CHAR_DATA Term3
CHAR_DATA Term4
CHAR_DATA Kazi1
CHAR_DATA KaziSupport
//CHAR_DATA Thug2
CHAR_DATA Carbomber
CHAR_DATA Flamer
// Code Looping:
COUNTER loopage = 1
Counter Crates = 1
//COUNTER playerdead = 1
COUNTER Kazico = 1
COUNTER regenerating_characters = 1
COUNTER Zombiezone = 1
COUNTER Termcount = 1
LEVELSTART
CHANGE_GANG_CHAR_RESPECT (Zombies, p1, -5)
CHANGE_GANG_CHAR_RESPECT (Thugs, p1, 5)
SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
GIVE_WEAPON (p1, PISTOL, 20)
// Assassins
// Create the killers:
A2 = CREATE_CHAR (072.5,094.5,255.0) 42 90 CRIMINAL END
SET_CHAR_GRAPHIC_TYPE (A2, EMERG_GRAPHIC, 41)
DO_NOWT
A3 = CREATE_CHAR (193.5,107.5,255.0) 22 0 CRIMINAL END
ADD_GROUP_TO_CHARACTER (A3, 3)
SET_GROUP_TYPE (A3, CHAIN)
SET_CHAR_GRAPHIC_TYPE (A3, EMERG_GRAPHIC, 22)
DO_NOWT
A4 = CREATE_CHAR (081.5,122.5,255.0) 36 90 CRIMINAL END
SET_CHAR_GRAPHIC_TYPE (A4, EMERG_GRAPHIC, 36)
DO_NOWT
A5 = CREATE_CHAR (182.0,162.5,255.0) 30 180 CRIMINAL END
SET_CHAR_GRAPHIC_TYPE (A5, EMERG_GRAPHIC, 30)
DO_NOWT
A6 = CREATE_CHAR (128.5,189.5) 46 90 CRIMINAL END
SET_CHAR_GRAPHIC_TYPE (A6, EMERG_GRAPHIC, 46)
// Arm the killers:
GIVE_WEAPON (A2, SILENCED_MACHINE_GUN)
GIVE_WEAPON (A3, ELECTRO_BATON)
GIVE_WEAPON (A4, MACHINE_GUN)
GIVE_WEAPON (A5, DUAL_PISTOL)
GIVE_WEAPON (A6, SHOTGUN)
// Make the killers attack any nearby player:
SET_CHAR_THREAT_SEARCH (A2, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_SEARCH (A3, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_SEARCH (A4, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_SEARCH (A5, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_SEARCH (A6, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_REACTION (A2, REACT_AS_NORMAL)
SET_CHAR_THREAT_REACTION (A3, REACT_AS_NORMAL)
SET_CHAR_THREAT_REACTION (A4, REACT_AS_NORMAL)
SET_CHAR_THREAT_REACTION (A5, REACT_AS_NORMAL)
SET_CHAR_THREAT_REACTION (A6, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A2, KILL_CHAR_ON_FOOT, p1)
SET_CHAR_OBJECTIVE (A3, KILL_CHAR_ON_FOOT, p1)
SET_CHAR_OBJECTIVE (A4, KILL_CHAR_ON_FOOT, p1)
SET_CHAR_OBJECTIVE (A5, KILL_CHAR_ON_FOOT, p1)
SET_CHAR_OBJECTIVE (A6, KILL_CHAR_ON_FOOT, p1)
//Terminators
Term = CREATE_CHAR (184.0,137.0) 6 0 GUARD END
ADD_GROUP_TO_CHARACTER (Term, 2)
SET_GROUP_TYPE (Term, CHAIN)
SET_CHAR_GRAPHIC_TYPE (Term, EMERG_GRAPHIC, 6)
GIVE_WEAPON (Term, PISTOL)
SET_CHAR_THREAT_SEARCH (Term, NO_THREATS)
SET_CHAR_THREAT_REACTION (Term, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Term, NO_OBJ)
SET_CHAR_INVINCIBLE (Term, ON)
Term2 = CREATE_CHAR (131.5,130.5) 12 0 GUARD END
//ADD_GROUP_TO_CHARACTER (Term2, 8)
//SET_GROUP_TYPE (Term2, MOB)
SET_CHAR_GRAPHIC_TYPE (Term2, EMERG_GRAPHIC, 12)
GIVE_WEAPON (Term2, ELECTRO_GUN)
SET_CHAR_THREAT_SEARCH (Term2, NO_THREATS)
SET_CHAR_THREAT_REACTION (Term2, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Term2, NO_OBJ)
SET_CHAR_INVINCIBLE (Term2, ON)
ADD_CHAR_TO_GANG (Term2, Shockers)
Term3 = CREATE_CHAR (064.5,107.5) 11 0 GUARD END
ADD_GROUP_TO_CHARACTER (Term3, 4)
SET_GROUP_TYPE (Term3, MOB)
SET_CHAR_GRAPHIC_TYPE (Term3, EMERG_GRAPHIC, 11)
GIVE_WEAPON (Term3, SHOTGUN)
SET_CHAR_THREAT_SEARCH (Term3, NO_THREATS)
SET_CHAR_THREAT_REACTION (Term3, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Term3, NO_OBJ)
SET_CHAR_INVINCIBLE (Term3, ON)
Term4 = CREATE_CHAR (129.0,166.0) 13 0 GUARD END
ADD_GROUP_TO_CHARACTER (Term4, 6)
SET_GROUP_TYPE (Term4, MOB)
SET_CHAR_GRAPHIC_TYPE (Term4, EMERG_GRAPHIC, 13)
GIVE_WEAPON (Term4, MACHINE_GUN)
SET_CHAR_THREAT_SEARCH (Term4, NO_THREATS)
SET_CHAR_THREAT_REACTION (Term4, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Term4, NO_OBJ)
SET_CHAR_INVINCIBLE (Term4, ON)
Kazi1 = CREATE_CHAR (138.5,070.0) 7 0 PSYCHO END
ADD_GROUP_TO_CHARACTER (Kazi1, 1)
SET_GROUP_TYPE (Kazi1, MOB)
SET_CHAR_GRAPHIC_TYPE (Kazi1, EMERG_GRAPHIC, 7)
SET_CHAR_BRAVERY_LEVEL (Kazi1, COWARD)
SET_CHAR_THREAT_SEARCH (Kazi1, NO_THREATS)
SET_CHAR_THREAT_REACTION (Kazi1, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Kazi1, GOTO_CHAR_ON_FOOT, p1)
KaziSupport = CREATE_CHAR (055.5,075.5) 7 0 CRIMINAL END
ADD_GROUP_TO_CHARACTER (KaziSupport, 4)
SET_GROUP_TYPE (KaziSupport, MOB)
SET_CHAR_GRAPHIC_TYPE (KaziSupport, EMERG_GRAPHIC, 7)
//SET_CHAR_BRAVERY_LEVEL (KaziSupport, COWARD)
SET_CHAR_THREAT_SEARCH (KaziSupport, NO_THREATS)
SET_CHAR_THREAT_REACTION (KaziSupport, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (KaziSupport, GOTO_CHAR_ON_FOOT, p1)
Flamer = CREATE_CHAR (014.5,143.0) 10 0 MUGGER END
ADD_GROUP_TO_CHARACTER (Flamer, 3)
SET_GROUP_TYPE (Flamer, MOB)
GIVE_WEAPON (Flamer, FLAME_THROWER)
SET_CHAR_GRAPHIC_TYPE (Flamer, EMERG_GRAPHIC, 10)
//SET_CHAR_BRAVERY_LEVEL (Kazi1, COWARD)
SET_CHAR_THREAT_SEARCH (Flamer, NO_THREATS)
SET_CHAR_THREAT_REACTION (Flamer, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Flamer, NO_OBJ)
SWITCH_GENERATOR (pupgen_gang_2, OFF)
SWITCH_GENERATOR (pupgen_gang_2, OFF)
SWITCH_GENERATOR (pupgen_gang_3, OFF)
SWITCH_GENERATOR (pupgen_gang_4, OFF)
//WHILE (crates = 1)
//ENDWHILE
// Respawn each killer if they die:
WHILE_EXEC(regenerating_characters = 1)
IF (HAS_CHARACTER_DIED(A2))
A2 = CREATE_CHAR (072.5,094.5,255.0) 42 90 MUGGER END
GIVE_WEAPON (A2, PISTOL)
ADD_GROUP_TO_CHARACTER (A2, 1)
SET_GROUP_TYPE (A2, MOB)
//SET_CHAR_GRAPHIC_TYPE (A2, EMERG_GRAPHIC, 42)
GIVE_WEAPON (A2, PISTOL)
SET_CHAR_THREAT_SEARCH (A2, NO_THREATS)
SET_CHAR_THREAT_REACTION (A2, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A2, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (A2))
//REMOVE_WEAPONs (A2)
SET_CHAR_OCCUPATION (A2, MUGGER)
SET_CHAR_OBJECTIVE (A2, NO_OBJ)
ADD_GROUP_TO_CHARACTER (A2, 2)
SET_GROUP_TYPE (A2, CHAIN)
SET_CHAR_THREAT_SEARCH (A2, NO_THREATS)
SET_CHAR_THREAT_REACTION (A2, REACT_AS_NORMAL)
SET_CHAR_INVINCIBLE (A2, ON)
ENDIF
//
IF (HAS_CHARACTER_DIED(A3))
A3 = CREATE_CHAR (193.5,107.5,255.0) 22 0 CRIMINAL END
ADD_GROUP_TO_CHARACTER (A3, 5)
SET_GROUP_TYPE (A3, CHAIN)
SET_CHAR_GRAPHIC_TYPE (A3, EMERG_GRAPHIC, 22)
GIVE_WEAPON (A3, ELECTRO_BATON)
SET_CHAR_THREAT_SEARCH (A3, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_REACTION (A3, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A3, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (A3))
//REMOVE_WEAPONs (A3)
SET_CHAR_OCCUPATION (A3, MUGGER)
SET_CHAR_OBJECTIVE (A3, NO_OBJ)
//DESTROY_GROUP (A3)
SET_CHAR_THREAT_SEARCH (A3, NO_THREATS)
SET_CHAR_THREAT_REACTION (A3, REACT_AS_NORMAL)
A3b = CREATE_CHAR (193.5,108.5,255.0) 22 0 CRIMINAL END
ADD_CHAR_TO_GANG (A3b, Bruisers)
ADD_GROUP_TO_CHARACTER (A3b, 7)
SET_GROUP_TYPE (A3b, MOB)
GIVE_WEAPON (A3b, ELECTRO_BATON)
SET_CHAR_GRAPHIC_TYPE (A3b, EMERG_GRAPHIC, 22)
SET_CHAR_THREAT_SEARCH (A3b, NO_THREATS)
SET_CHAR_THREAT_REACTION (A3b, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A3b, NO_OBJ)
SET_CHAR_INVINCIBLE (A3b, ON)
ENDIF
////IF (IS_CHAR_OBJECTIVE_PASSED (B3))
////REMOVE_WEAPONs (B3)
////SET_CHAR_OCCUPATION (B3, MUGGER)
////SET_CHAR_OBJECTIVE (B3, NO_OBJ)
////DESTROY_GROUP (B3)
////SET_CHAR_THREAT_SEARCH (B3, NO_THREATS)
////SET_CHAR_THREAT_REACTION (B3, REACT_AS_NORMAL)
////ENDIF
//
IF (HAS_CHARACTER_DIED(A4))
//SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
A4 = CREATE_CHAR (081.5,122.5,255.0) 36 90 MUGGER END
GIVE_WEAPON (A4, ELECTRO_BATON)
ADD_GROUP_TO_CHARACTER (A4, 1)
SET_GROUP_TYPE (A4, MOB)
GIVE_WEAPON (A4, PISTOL)
//SET_CHAR_GRAPHIC_TYPE (A4, EMERG_GRAPHIC, 36)
SET_CHAR_THREAT_SEARCH (A4, NO_THREATS)
SET_CHAR_THREAT_REACTION (A4, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A4, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (A4))
//REMOVE_WEAPONs (A4)
SET_CHAR_OCCUPATION (A4, MUGGER)
SET_CHAR_OBJECTIVE (A4, NO_OBJ)
ADD_GROUP_TO_CHARACTER (A4, 2)
SET_GROUP_TYPE (A4, CHAIN)
//MAKE_CHAR_DO_NOTHING (A4)
SET_CHAR_THREAT_SEARCH (A4, NO_THREATS)
SET_CHAR_THREAT_REACTION (A4, REACT_AS_NORMAL)
SET_CHAR_INVINCIBLE (A4, ON)
//GIVE_WEAPON (A4, Pistol)
ENDIF
IF (HAS_CHARACTER_DIED(A5))
A5 = CREATE_CHAR (182.0,162.5,255.0) 30 180 MUGGER END
GIVE_WEAPON (A5, DUAL_PISTOL)
SET_CHAR_THREAT_SEARCH (A5, NO_THREATS)
SET_CHAR_THREAT_REACTION (A5, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A5, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (A5))
//REMOVE_WEAPONs (A5)
SET_CHAR_OCCUPATION (A5, MUGGER)
SET_CHAR_OBJECTIVE (A5, NO_OBJ)
ADD_GROUP_TO_CHARACTER (A5, 2)
SET_GROUP_TYPE (A5, CHAIN)
GIVE_WEAPON (A5, MACHINE_GUN)
SET_CHAR_THREAT_SEARCH (A5, NO_THREATS)
SET_CHAR_THREAT_REACTION (A5, REACT_AS_NORMAL)
SET_CHAR_INVINCIBLE (A5, ON)
ENDIF
IF (HAS_CHARACTER_DIED(A6))
A6 = CREATE_CHAR (128.5,189.5) 46 90 MUGGER END
GIVE_WEAPON (A6, SHOTGUN)
SET_CHAR_THREAT_SEARCH (A6, NO_THREATS)
SET_CHAR_THREAT_REACTION (A6, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A6, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (A6))
//REMOVE_WEAPONs (A6)
SET_CHAR_OCCUPATION (A6, MUGGER)
SET_CHAR_OBJECTIVE (A6, NO_OBJ)
ADD_GROUP_TO_CHARACTER (A6, 2)
SET_GROUP_TYPE (A6, CHAIN)
SET_CHAR_THREAT_SEARCH (A6, NO_THREATS)
SET_CHAR_THREAT_REACTION (A6, REACT_AS_NORMAL)
SET_CHAR_INVINCIBLE (A6, ON)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (Kazi1))
SET_CHAR_OBJECTIVE (Kazi1, NO_OBJ)
EXPLODE (Kazi1)
DESTROY_GROUP (Kazi1)
ENDIF
IF (HAS_CHARACTER_DIED(p1))
SET_CHAR_OBJECTIVE (Kazi1, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (KaziSupport))
SET_CHAR_OBJECTIVE (KaziSupport, NO_OBJ)
EXPLODE_LARGE (KaziSupport)
DESTROY_GROUP (KaziSupport)
ENDIF
IF(HAS_CHARACTER_DIED(p1))
SET_CHAR_OBJECTIVE (Kazisupport, NO_OBJ)
ENDIF
IF (CHECK_OBJ_MODEL (Psychogen, POWERGEN))
DO_NOWT
//CREATE_SOUND(055.5,066.5) GENERATOR_RUMBLE PLAY_INSTANT END
//MAKE_ALL_CHARS_MUGGERS (OFF)
ELSE MAKE_ALL_CHARS_MUGGERS (ON)
ENDIF
IF (HAS_CHARACTER_DIED(Term))
DO_NOWT
SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
SWITCH_GENERATOR (pupgen_gang_1, ON)
ENDIF
IF (HAS_CHARACTER_DIED(Term2))
DO_NOWT
CHANGE_GANG_CHAR_RESPECT (Shockers, p1, -5)
SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
SWITCH_GENERATOR (pupgen_gang_2, ON)
ENDIF
//IF (HAS_CHARACTER_DIED(Term3))
//DO_NOWT
//SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
//CREATE_OBJ (pupgen_gang_3, ON)
//ENDIF
IF (HAS_CHARACTER_DIED(Term4))
DO_NOWT
SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
SWITCH_GENERATOR (pupgen_gang_4, ON)
ENDIF
ENDWHILE[/mis]
Any suggestions on why exactly my Instant gangs may not be turning on once the respective Terminator is killed?
I also discovered some interesting things with gang zones, in that you can have multiple small boxes of different shape next to each other all under one gang name but once you've created so many gang zones the game will crash. Reworking the gang zones to all only be perfect squares/rectangles has prevented this.However, looking back at my code, I wonder if it's because I declared the fireman gang twice, when I only would have needed to declare them once despite their respective zones being across the map from each other. I'll test this out.
Currently I'm trying to make crates that produce weapons upon being broke, like in GTA1. However upon being destroyed it continues to produce the weapon indefinitely, which is not what I'm hoping for. I want it to be a one time thing. Do you know how I could go about doing this? This is my code currently,
[mis]IF (CHECK_OBJ_MODEL (Pistcrate, Crate))
DO_NOWT
ELSE Pistcrateproduct = CREATE_OBJ (099.18,087.24,003.09) 0 COLLECT_00 20 END
DELETE_ITEM (pistcrate)
ENDIF[/mis]
I look forward to your input.
(Also with Cerbera's permission I could upload the version of Multislayer I'm using here as well as the .mis script. I haven't tried this particular script yet in the latest version of MS & I know the maps a bit different in size so it may not work with it as intended)
EDIT:
So I'm pretty sure my biggest issue is I'm running all events off of one loop. This makes it impossible to say create for example a new assassin if the old one has died, because the loop keeps seeing the old guy died & then spawns a million Assassin B2s for example, crashing the game. I don't know how to make sequential events happen yet.
Also, I discovered a cool map design exploit you guys may be able to use.
I was redesigning the Mutlislayer map to make the Pherson ghetto a giant scripted survival / tower defense arena.
So, being new to GTA2 map editing, I added a few blocks to wall off the ghetto area.
The stairs to the south east I didn't delete, I just added blocks to bar it off. So, above the slope is a floating block. I was using my same .mis script for the old map, so my assassins were still spawning in the multiplayer locations & making their way towards me.
Naturally you would assume they couldn't get in, because I nor anyone else can get out.
However, due to the block hovering just above the ramp, they can come up the stairs & through the block, but not back out.
If you are ever to design arena based maps that you don't want to spawn scripted characters inside of the main area, you can use this to bring them into the arena from off screen.
Here's a screenshot demonstrating the exact layout needed,
I've been able to produce some pretty cool effects, like Suicide bombers (on foot) that explode upon reaching the player,
5 different assassins that swarm the player on level start, becoming invincible if the player dies & having a group added to their character, if each particular assassin dies that respawn as a downgraded form with no objective(plus a weaker weapon & standard gangster attire (whereas the Gang assassins have The EMERG_GRAPHIC remap, I'm using this to pretend they're the gang leaders).
I have a zombie gang in the graveyard that attacks the player on site, & a generator in the graveyard that turns all characters into muggers(Psychos) if destroyed (I used to use the buckfast cheat to pretend everyone in the city was zombies & I would play to see how long I could survive for, so this generator acts as a way to optionally turn it on at any point during gameplay).
A funny thing I noticed with this experimentation is some scripting weirdness which is actually pretty cool & you guys may have not known about;
If you have turn all characters into muggers both (ON) & (OFF) simultaneously in a loop, it'll create interesting behavior with dummy peds. The peds who spawn as Psychos don't attack the player or each other on sight, but if the player attacks the peds will rush him & punch him to the ground like a cop (or maybe they were doing that to gangsters but actually killing me). They also won't fight each other in this state so you can have like 10 dummy peds all chasing the player at once.
I also created some Terminator like characters similar to those in Snow Ball City 2; invulnerable Objectiveless guys that wander around & attack when attacked. Killing them turns on the Instant Gang generator they spawn at. I got this to work once but my latest version of the script doesn't seem to be activating the generator when I kill them.
The player starts out with an EMERG_GRAPHIC remap (Green vested Krishna), upon dying he looks like a standard Krishna. If you manage to kill a Terminator though you'll "level up" & become gang leader again by getting your Vest back.
(The Pherson Ghetto is the location of Krishna looking 'Thugs' gang)
I've also learned some cool scripting hacks you guys may or may not have known about involving NPCs with groups created for them.
Any group added to a character will have that character's remap & weapon.
However, if you create the character, create the group, & then remap the character & give the character a weapon (or different weapon) his gang can have completely different weapons & remaps then him. I've been using this to designate the gang leader with an EMERG_GRAPH remap.
One of my assassins is actually armed with an Electrobaton, & his group (following him in a chain) is unarmed, so he shoots the player to slow him down while they gang up on him & beat him up.
What I learned from all this though is when you kill a Group leader, another member of that group becomes that group leader;
Killing the leader of the gang with the electrobaton makes one of the cohorts instantly armed with it,
Similarly with a Flame thrower dude & his group.
It's the same with my Kamikaze guys, if you kill the group leader whose objective is to go to p1 on foot, causing him to explode, his lackey will continue the objective, being the one to explode instead. This is pretty cool because I have a second group comprised of 6 kamikazes who have a car bomb size explosion.
Speaking of my kamikazes, upon reaching their objective the loop caused them to explode indefinitely, which was pretty amusing as they soared through the air leaving a chain of explosions, but not what I had intended. So by setting a check to make the character have no objective upon reaching the player & then exploding, or having no objective upon dying, I was able to break the infinitely exploding corpse glitch.
Here's all the coding so far for anyone curious:
[mis](to make this more legible I removed Cerbera's original lines from the script so that only mine are visible)
OBJ_DATA Psychogen = (055.5,066.5) 0 POWERGEN
OBJ_DATA Pistcrate = (099.18,087.24) 0 Crate
OBJ_DATA Pistcrateproduct
//Gangs
MAP_ZONE Zombies //= (0,0,0,0,10,0,0,0,1000,0,0)
SET_GANG_INFO ( Zombies , 24, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , BMW , 1)
//
//MAP_ZONE Fire1
//SET_GANG_INFO ( Fire1 , 3, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
// 0.0, 0.0, 0.0, 00 , FIRETRUK , -1)
//
//MAP_ZONE Fire1
//SET_GANG_INFO ( Fire1 , 3, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
// 0.0, 0.0, 0.0, 00 , FIRETRUK , -1)
//
//
MAP_ZONE Police1 //= (500,0,0,500,100,0,0,0,500,400,500)
SET_GANG_INFO ( Police1 , 0, PISTOL, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , COPCAR , -1)
//
MAP_ZONE SubwayRats
SET_GANG_INFO ( SubwayRats , 14, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , STYPE , 1)
//
MAP_ZONE Thugs
SET_GANG_INFO ( Thugs , 9, PISTOL, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , STRIPETB , 29)
//
MAP_ZONE Shockers
SET_GANG_INFO ( Shockers , 12, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , ALLARD , 33)
////
MAP_ZONE Seniors
SET_GANG_INFO ( Seniors , 46, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , VAN , 16)
////
MAP_ZONE Reds
SET_GANG_INFO ( Reds , 30, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , ALFA , 28)
////
MAP_ZONE Bruisers
SET_GANG_INFO ( Bruisers , 22, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , DART , 32)
//
//MAP_ZONE Docks
//SET_GANG_INFO ( Docks , 33, PISTOL, NO_WEAPON, NO_WEAPON, 0 ,
// 0.0, 0.0, 0.0, 00 , PICKUP , 35)
//
//MAP_ZONE A2gang
//SET_GANG_INFO ( A2gang , 42, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
// 0.0, 0.0, 0.0, 00 , GRAHAM , 11)
//
//MAP_ZONE A4gang
//SET_GANG_INFO ( A4gang , 36, NO_WEAPON, NO_WEAPON, NO_WEAPON, 0 ,
// 0.0, 0.0, 0.0, 00 , ISETTA , 20)
//
MAP_ZONE Pinks
SET_GANG_INFO ( Pinks , 52, PISTOL, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , MESSER , 26)
//
MAP_ZONE Sharks
SET_GANG_INFO ( Sharks , 17, SHOTGUN, NO_WEAPON, NO_WEAPON, 0 ,
0.0, 0.0, 0.0, 00 , FIAT , 17)
// Players:
PLAYER_PED p1 = (103.5,090.5,255.0) 9 90
// Char Data:
//ASSASSINS
CHAR_DATA A2
CHAR_DATA A3
CHAR_DATA A3b
CHAR_DATA A4
CHAR_DATA A5
CHAR_DATA A6
CHAR_DATA B2
CHAR_DATA B3
CHAR_DATA B4
CHAR_DATA B5
CHAR_DATA B6
CHAR_DATA Term
CHAR_DATA Term2
CHAR_DATA Term3
CHAR_DATA Term4
CHAR_DATA Kazi1
CHAR_DATA KaziSupport
//CHAR_DATA Thug2
CHAR_DATA Carbomber
CHAR_DATA Flamer
// Code Looping:
COUNTER loopage = 1
Counter Crates = 1
//COUNTER playerdead = 1
COUNTER Kazico = 1
COUNTER regenerating_characters = 1
COUNTER Zombiezone = 1
COUNTER Termcount = 1
LEVELSTART
CHANGE_GANG_CHAR_RESPECT (Zombies, p1, -5)
CHANGE_GANG_CHAR_RESPECT (Thugs, p1, 5)
SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
GIVE_WEAPON (p1, PISTOL, 20)
// Assassins
// Create the killers:
A2 = CREATE_CHAR (072.5,094.5,255.0) 42 90 CRIMINAL END
SET_CHAR_GRAPHIC_TYPE (A2, EMERG_GRAPHIC, 41)
DO_NOWT
A3 = CREATE_CHAR (193.5,107.5,255.0) 22 0 CRIMINAL END
ADD_GROUP_TO_CHARACTER (A3, 3)
SET_GROUP_TYPE (A3, CHAIN)
SET_CHAR_GRAPHIC_TYPE (A3, EMERG_GRAPHIC, 22)
DO_NOWT
A4 = CREATE_CHAR (081.5,122.5,255.0) 36 90 CRIMINAL END
SET_CHAR_GRAPHIC_TYPE (A4, EMERG_GRAPHIC, 36)
DO_NOWT
A5 = CREATE_CHAR (182.0,162.5,255.0) 30 180 CRIMINAL END
SET_CHAR_GRAPHIC_TYPE (A5, EMERG_GRAPHIC, 30)
DO_NOWT
A6 = CREATE_CHAR (128.5,189.5) 46 90 CRIMINAL END
SET_CHAR_GRAPHIC_TYPE (A6, EMERG_GRAPHIC, 46)
// Arm the killers:
GIVE_WEAPON (A2, SILENCED_MACHINE_GUN)
GIVE_WEAPON (A3, ELECTRO_BATON)
GIVE_WEAPON (A4, MACHINE_GUN)
GIVE_WEAPON (A5, DUAL_PISTOL)
GIVE_WEAPON (A6, SHOTGUN)
// Make the killers attack any nearby player:
SET_CHAR_THREAT_SEARCH (A2, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_SEARCH (A3, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_SEARCH (A4, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_SEARCH (A5, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_SEARCH (A6, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_REACTION (A2, REACT_AS_NORMAL)
SET_CHAR_THREAT_REACTION (A3, REACT_AS_NORMAL)
SET_CHAR_THREAT_REACTION (A4, REACT_AS_NORMAL)
SET_CHAR_THREAT_REACTION (A5, REACT_AS_NORMAL)
SET_CHAR_THREAT_REACTION (A6, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A2, KILL_CHAR_ON_FOOT, p1)
SET_CHAR_OBJECTIVE (A3, KILL_CHAR_ON_FOOT, p1)
SET_CHAR_OBJECTIVE (A4, KILL_CHAR_ON_FOOT, p1)
SET_CHAR_OBJECTIVE (A5, KILL_CHAR_ON_FOOT, p1)
SET_CHAR_OBJECTIVE (A6, KILL_CHAR_ON_FOOT, p1)
//Terminators
Term = CREATE_CHAR (184.0,137.0) 6 0 GUARD END
ADD_GROUP_TO_CHARACTER (Term, 2)
SET_GROUP_TYPE (Term, CHAIN)
SET_CHAR_GRAPHIC_TYPE (Term, EMERG_GRAPHIC, 6)
GIVE_WEAPON (Term, PISTOL)
SET_CHAR_THREAT_SEARCH (Term, NO_THREATS)
SET_CHAR_THREAT_REACTION (Term, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Term, NO_OBJ)
SET_CHAR_INVINCIBLE (Term, ON)
Term2 = CREATE_CHAR (131.5,130.5) 12 0 GUARD END
//ADD_GROUP_TO_CHARACTER (Term2, 8)
//SET_GROUP_TYPE (Term2, MOB)
SET_CHAR_GRAPHIC_TYPE (Term2, EMERG_GRAPHIC, 12)
GIVE_WEAPON (Term2, ELECTRO_GUN)
SET_CHAR_THREAT_SEARCH (Term2, NO_THREATS)
SET_CHAR_THREAT_REACTION (Term2, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Term2, NO_OBJ)
SET_CHAR_INVINCIBLE (Term2, ON)
ADD_CHAR_TO_GANG (Term2, Shockers)
Term3 = CREATE_CHAR (064.5,107.5) 11 0 GUARD END
ADD_GROUP_TO_CHARACTER (Term3, 4)
SET_GROUP_TYPE (Term3, MOB)
SET_CHAR_GRAPHIC_TYPE (Term3, EMERG_GRAPHIC, 11)
GIVE_WEAPON (Term3, SHOTGUN)
SET_CHAR_THREAT_SEARCH (Term3, NO_THREATS)
SET_CHAR_THREAT_REACTION (Term3, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Term3, NO_OBJ)
SET_CHAR_INVINCIBLE (Term3, ON)
Term4 = CREATE_CHAR (129.0,166.0) 13 0 GUARD END
ADD_GROUP_TO_CHARACTER (Term4, 6)
SET_GROUP_TYPE (Term4, MOB)
SET_CHAR_GRAPHIC_TYPE (Term4, EMERG_GRAPHIC, 13)
GIVE_WEAPON (Term4, MACHINE_GUN)
SET_CHAR_THREAT_SEARCH (Term4, NO_THREATS)
SET_CHAR_THREAT_REACTION (Term4, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Term4, NO_OBJ)
SET_CHAR_INVINCIBLE (Term4, ON)
Kazi1 = CREATE_CHAR (138.5,070.0) 7 0 PSYCHO END
ADD_GROUP_TO_CHARACTER (Kazi1, 1)
SET_GROUP_TYPE (Kazi1, MOB)
SET_CHAR_GRAPHIC_TYPE (Kazi1, EMERG_GRAPHIC, 7)
SET_CHAR_BRAVERY_LEVEL (Kazi1, COWARD)
SET_CHAR_THREAT_SEARCH (Kazi1, NO_THREATS)
SET_CHAR_THREAT_REACTION (Kazi1, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Kazi1, GOTO_CHAR_ON_FOOT, p1)
KaziSupport = CREATE_CHAR (055.5,075.5) 7 0 CRIMINAL END
ADD_GROUP_TO_CHARACTER (KaziSupport, 4)
SET_GROUP_TYPE (KaziSupport, MOB)
SET_CHAR_GRAPHIC_TYPE (KaziSupport, EMERG_GRAPHIC, 7)
//SET_CHAR_BRAVERY_LEVEL (KaziSupport, COWARD)
SET_CHAR_THREAT_SEARCH (KaziSupport, NO_THREATS)
SET_CHAR_THREAT_REACTION (KaziSupport, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (KaziSupport, GOTO_CHAR_ON_FOOT, p1)
Flamer = CREATE_CHAR (014.5,143.0) 10 0 MUGGER END
ADD_GROUP_TO_CHARACTER (Flamer, 3)
SET_GROUP_TYPE (Flamer, MOB)
GIVE_WEAPON (Flamer, FLAME_THROWER)
SET_CHAR_GRAPHIC_TYPE (Flamer, EMERG_GRAPHIC, 10)
//SET_CHAR_BRAVERY_LEVEL (Kazi1, COWARD)
SET_CHAR_THREAT_SEARCH (Flamer, NO_THREATS)
SET_CHAR_THREAT_REACTION (Flamer, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (Flamer, NO_OBJ)
SWITCH_GENERATOR (pupgen_gang_2, OFF)
SWITCH_GENERATOR (pupgen_gang_2, OFF)
SWITCH_GENERATOR (pupgen_gang_3, OFF)
SWITCH_GENERATOR (pupgen_gang_4, OFF)
//WHILE (crates = 1)
//ENDWHILE
// Respawn each killer if they die:
WHILE_EXEC(regenerating_characters = 1)
IF (HAS_CHARACTER_DIED(A2))
A2 = CREATE_CHAR (072.5,094.5,255.0) 42 90 MUGGER END
GIVE_WEAPON (A2, PISTOL)
ADD_GROUP_TO_CHARACTER (A2, 1)
SET_GROUP_TYPE (A2, MOB)
//SET_CHAR_GRAPHIC_TYPE (A2, EMERG_GRAPHIC, 42)
GIVE_WEAPON (A2, PISTOL)
SET_CHAR_THREAT_SEARCH (A2, NO_THREATS)
SET_CHAR_THREAT_REACTION (A2, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A2, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (A2))
//REMOVE_WEAPONs (A2)
SET_CHAR_OCCUPATION (A2, MUGGER)
SET_CHAR_OBJECTIVE (A2, NO_OBJ)
ADD_GROUP_TO_CHARACTER (A2, 2)
SET_GROUP_TYPE (A2, CHAIN)
SET_CHAR_THREAT_SEARCH (A2, NO_THREATS)
SET_CHAR_THREAT_REACTION (A2, REACT_AS_NORMAL)
SET_CHAR_INVINCIBLE (A2, ON)
ENDIF
//
IF (HAS_CHARACTER_DIED(A3))
A3 = CREATE_CHAR (193.5,107.5,255.0) 22 0 CRIMINAL END
ADD_GROUP_TO_CHARACTER (A3, 5)
SET_GROUP_TYPE (A3, CHAIN)
SET_CHAR_GRAPHIC_TYPE (A3, EMERG_GRAPHIC, 22)
GIVE_WEAPON (A3, ELECTRO_BATON)
SET_CHAR_THREAT_SEARCH (A3, AREA_PLAYER_ONLY)
SET_CHAR_THREAT_REACTION (A3, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A3, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (A3))
//REMOVE_WEAPONs (A3)
SET_CHAR_OCCUPATION (A3, MUGGER)
SET_CHAR_OBJECTIVE (A3, NO_OBJ)
//DESTROY_GROUP (A3)
SET_CHAR_THREAT_SEARCH (A3, NO_THREATS)
SET_CHAR_THREAT_REACTION (A3, REACT_AS_NORMAL)
A3b = CREATE_CHAR (193.5,108.5,255.0) 22 0 CRIMINAL END
ADD_CHAR_TO_GANG (A3b, Bruisers)
ADD_GROUP_TO_CHARACTER (A3b, 7)
SET_GROUP_TYPE (A3b, MOB)
GIVE_WEAPON (A3b, ELECTRO_BATON)
SET_CHAR_GRAPHIC_TYPE (A3b, EMERG_GRAPHIC, 22)
SET_CHAR_THREAT_SEARCH (A3b, NO_THREATS)
SET_CHAR_THREAT_REACTION (A3b, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A3b, NO_OBJ)
SET_CHAR_INVINCIBLE (A3b, ON)
ENDIF
////IF (IS_CHAR_OBJECTIVE_PASSED (B3))
////REMOVE_WEAPONs (B3)
////SET_CHAR_OCCUPATION (B3, MUGGER)
////SET_CHAR_OBJECTIVE (B3, NO_OBJ)
////DESTROY_GROUP (B3)
////SET_CHAR_THREAT_SEARCH (B3, NO_THREATS)
////SET_CHAR_THREAT_REACTION (B3, REACT_AS_NORMAL)
////ENDIF
//
IF (HAS_CHARACTER_DIED(A4))
//SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
A4 = CREATE_CHAR (081.5,122.5,255.0) 36 90 MUGGER END
GIVE_WEAPON (A4, ELECTRO_BATON)
ADD_GROUP_TO_CHARACTER (A4, 1)
SET_GROUP_TYPE (A4, MOB)
GIVE_WEAPON (A4, PISTOL)
//SET_CHAR_GRAPHIC_TYPE (A4, EMERG_GRAPHIC, 36)
SET_CHAR_THREAT_SEARCH (A4, NO_THREATS)
SET_CHAR_THREAT_REACTION (A4, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A4, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (A4))
//REMOVE_WEAPONs (A4)
SET_CHAR_OCCUPATION (A4, MUGGER)
SET_CHAR_OBJECTIVE (A4, NO_OBJ)
ADD_GROUP_TO_CHARACTER (A4, 2)
SET_GROUP_TYPE (A4, CHAIN)
//MAKE_CHAR_DO_NOTHING (A4)
SET_CHAR_THREAT_SEARCH (A4, NO_THREATS)
SET_CHAR_THREAT_REACTION (A4, REACT_AS_NORMAL)
SET_CHAR_INVINCIBLE (A4, ON)
//GIVE_WEAPON (A4, Pistol)
ENDIF
IF (HAS_CHARACTER_DIED(A5))
A5 = CREATE_CHAR (182.0,162.5,255.0) 30 180 MUGGER END
GIVE_WEAPON (A5, DUAL_PISTOL)
SET_CHAR_THREAT_SEARCH (A5, NO_THREATS)
SET_CHAR_THREAT_REACTION (A5, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A5, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (A5))
//REMOVE_WEAPONs (A5)
SET_CHAR_OCCUPATION (A5, MUGGER)
SET_CHAR_OBJECTIVE (A5, NO_OBJ)
ADD_GROUP_TO_CHARACTER (A5, 2)
SET_GROUP_TYPE (A5, CHAIN)
GIVE_WEAPON (A5, MACHINE_GUN)
SET_CHAR_THREAT_SEARCH (A5, NO_THREATS)
SET_CHAR_THREAT_REACTION (A5, REACT_AS_NORMAL)
SET_CHAR_INVINCIBLE (A5, ON)
ENDIF
IF (HAS_CHARACTER_DIED(A6))
A6 = CREATE_CHAR (128.5,189.5) 46 90 MUGGER END
GIVE_WEAPON (A6, SHOTGUN)
SET_CHAR_THREAT_SEARCH (A6, NO_THREATS)
SET_CHAR_THREAT_REACTION (A6, REACT_AS_NORMAL)
SET_CHAR_OBJECTIVE (A6, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (A6))
//REMOVE_WEAPONs (A6)
SET_CHAR_OCCUPATION (A6, MUGGER)
SET_CHAR_OBJECTIVE (A6, NO_OBJ)
ADD_GROUP_TO_CHARACTER (A6, 2)
SET_GROUP_TYPE (A6, CHAIN)
SET_CHAR_THREAT_SEARCH (A6, NO_THREATS)
SET_CHAR_THREAT_REACTION (A6, REACT_AS_NORMAL)
SET_CHAR_INVINCIBLE (A6, ON)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (Kazi1))
SET_CHAR_OBJECTIVE (Kazi1, NO_OBJ)
EXPLODE (Kazi1)
DESTROY_GROUP (Kazi1)
ENDIF
IF (HAS_CHARACTER_DIED(p1))
SET_CHAR_OBJECTIVE (Kazi1, NO_OBJ)
ENDIF
IF (IS_CHAR_OBJECTIVE_PASSED (KaziSupport))
SET_CHAR_OBJECTIVE (KaziSupport, NO_OBJ)
EXPLODE_LARGE (KaziSupport)
DESTROY_GROUP (KaziSupport)
ENDIF
IF(HAS_CHARACTER_DIED(p1))
SET_CHAR_OBJECTIVE (Kazisupport, NO_OBJ)
ENDIF
IF (CHECK_OBJ_MODEL (Psychogen, POWERGEN))
DO_NOWT
//CREATE_SOUND(055.5,066.5) GENERATOR_RUMBLE PLAY_INSTANT END
//MAKE_ALL_CHARS_MUGGERS (OFF)
ELSE MAKE_ALL_CHARS_MUGGERS (ON)
ENDIF
IF (HAS_CHARACTER_DIED(Term))
DO_NOWT
SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
SWITCH_GENERATOR (pupgen_gang_1, ON)
ENDIF
IF (HAS_CHARACTER_DIED(Term2))
DO_NOWT
CHANGE_GANG_CHAR_RESPECT (Shockers, p1, -5)
SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
SWITCH_GENERATOR (pupgen_gang_2, ON)
ENDIF
//IF (HAS_CHARACTER_DIED(Term3))
//DO_NOWT
//SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
//CREATE_OBJ (pupgen_gang_3, ON)
//ENDIF
IF (HAS_CHARACTER_DIED(Term4))
DO_NOWT
SET_CHAR_GRAPHIC_TYPE (p1, EMERG_GRAPHIC, 9)
SWITCH_GENERATOR (pupgen_gang_4, ON)
ENDIF
ENDWHILE[/mis]
Any suggestions on why exactly my Instant gangs may not be turning on once the respective Terminator is killed?
I also discovered some interesting things with gang zones, in that you can have multiple small boxes of different shape next to each other all under one gang name but once you've created so many gang zones the game will crash. Reworking the gang zones to all only be perfect squares/rectangles has prevented this.However, looking back at my code, I wonder if it's because I declared the fireman gang twice, when I only would have needed to declare them once despite their respective zones being across the map from each other. I'll test this out.
Currently I'm trying to make crates that produce weapons upon being broke, like in GTA1. However upon being destroyed it continues to produce the weapon indefinitely, which is not what I'm hoping for. I want it to be a one time thing. Do you know how I could go about doing this? This is my code currently,
[mis]IF (CHECK_OBJ_MODEL (Pistcrate, Crate))
DO_NOWT
ELSE Pistcrateproduct = CREATE_OBJ (099.18,087.24,003.09) 0 COLLECT_00 20 END
DELETE_ITEM (pistcrate)
ENDIF[/mis]
I look forward to your input.
(Also with Cerbera's permission I could upload the version of Multislayer I'm using here as well as the .mis script. I haven't tried this particular script yet in the latest version of MS & I know the maps a bit different in size so it may not work with it as intended)
EDIT:
So I'm pretty sure my biggest issue is I'm running all events off of one loop. This makes it impossible to say create for example a new assassin if the old one has died, because the loop keeps seeing the old guy died & then spawns a million Assassin B2s for example, crashing the game. I don't know how to make sequential events happen yet.
Also, I discovered a cool map design exploit you guys may be able to use.
I was redesigning the Mutlislayer map to make the Pherson ghetto a giant scripted survival / tower defense arena.
So, being new to GTA2 map editing, I added a few blocks to wall off the ghetto area.
The stairs to the south east I didn't delete, I just added blocks to bar it off. So, above the slope is a floating block. I was using my same .mis script for the old map, so my assassins were still spawning in the multiplayer locations & making their way towards me.
Naturally you would assume they couldn't get in, because I nor anyone else can get out.
However, due to the block hovering just above the ramp, they can come up the stairs & through the block, but not back out.
If you are ever to design arena based maps that you don't want to spawn scripted characters inside of the main area, you can use this to bring them into the arena from off screen.
Here's a screenshot demonstrating the exact layout needed,