A solution seems to come closer.
For now I end up with yet another while loop so my script now counts 3 of them.
I have created CHAR_DATA 6 slots for the dummies so far and want to use a few more.
[syntax=mis]
// originally decompiled from "MP1-6P.scr" Using Epic GTA2 Script Decompiler by T.M. //
// using script parts from SEKTOR´s god.mis //
////////////////////////////////////////////////////////////////////////////////////////////////////
// DECLARATION //
////////////////////////////////////////////////////////////////////////////////////////////////////
PLAYER_PED p1 = (62.50, 193.50, 2.00) 10 0
PLAYER_PED p2 = (83.50, 179.50, 2.00) 9 90
PLAYER_PED p3 = (115.50, 169.50, 2.00) 8 270
PLAYER_PED p4 = (53.50, 164.50, 2.00) 6 0
PLAYER_PED p5 = (77.50, 170.50, 2.00) 7 90
PLAYER_PED p6 = (84.50, 192.50, 2.00) 11 270
CHAR_DATA p
CHAR_DATA currentped
CHAR_DATA ped
CHAR_DATA ped_01
CHAR_DATA ped_02
CHAR_DATA ped_03
CHAR_DATA ped_04
CHAR_DATA ped_05
CHAR_DATA ped_06
CHAR_DATA ped_07
CHAR_DATA ped_08
CHAR_DATA ped_09
CHAR_DATA ped_10
CHAR_DATA ped_11
CHAR_DATA ped_12
CHAR_DATA ped_13
CHAR_DATA ped_14
CHAR_DATA ped_15
CHAR_DATA ped_16
CHAR_DATA ped_17
CHAR_DATA ped_18
CHAR_DATA ped_19
CHAR_DATA ped_20
CHAR_DATA b1 = (60.0, 193.4, 2.0) 1 180 CRIMINAL_TYPE2
RADIO_STATION radio1 = STATION_KRISHNA (242.50, 214.50)
RADIO_STATION radio2 = STATION_RUSSIAN (201.50, 21.50)
RADIO_STATION radio3 = STATION_ZAIBATSU (20.50, 230.50)
RADIO_STATION radio4 = STATION_INDUSTRIAL (110.50, 108.50)
PARKED_CAR_DATA auto1 = (81.90, 183.50, 255.00) 0 90 SPRITE
PARKED_CAR_DATA auto2 = (81.90, 182.50, 255.00) 1 90 VTYPE
PARKED_CAR_DATA auto3 = (81.90, 181.50, 255.00) 2 90 GT24640
PARKED_CAR_DATA auto4 = (88.40, 182.60, 255.00) 0 180 BUS
PARKED_CAR_DATA auto5 = (103.50, 193.60, 255.00) 0 0 MORGAN
PARKED_CAR_DATA auto6 = (105.50, 193.60, 255.00) 1 0 BMW
PARKED_CAR_DATA auto7 = (104.50, 196.40, 255.00) 2 180 FIAT
PARKED_CAR_DATA auto8 = (106.50, 196.40, 255.00) 0 180 SPIDER
MAP_ZONE pedzone1
GENERATOR gen1 = (59.90, 186.50, 4.00) 0 COLLECT_08 6000 6000 10
GENERATOR gen2 = (73.50, 179.50, 5.00) 0 COLLECT_17 6000 6000 4
GENERATOR gen3 = (71.50, 170.50, 3.00) 0 COLLECT_01 6000 6000 10
GENERATOR gen4 = (118.50, 177.50, 2.00) 0 COLLECT_18 8000 8000 10
GENERATOR gen5 = (113.90, 195.00, 2.00) 0 COLLECT_02 6000 6000 5
GENERATOR gen6 = (89.50, 185.50, 2.00) 0 COLLECT_34 6000 6000 4
GENERATOR gen7 = (60.90, 195.00, 2.00) 0 COLLECT_00 6000 6000 40
GENERATOR gen8 = (100.50, 172.50, 2.00) 0 COLLECT_31 6000 6000 3
GENERATOR gen9 = (97.90, 158.90, 2.00) 0 COLLECT_03 8000 8000 6
GENERATOR gen10 = (49.90, 176.90, 2.00) 0 COLLECT_10 6000 6000 30
GENERATOR gen11 = (111.50, 170.50, 2.00) 0 COLLECT_01 6000 6000 10
GENERATOR gen12 = (50.50, 172.50, 4.00) 0 COLLECT_04 6000 6000 8
GENERATOR gen13 = (62.90, 184.00, 2.00) 0 COLLECT_40 6000 6000 2
GENERATOR gen14 = (78.50, 192.50, 2.00) 0 COLLECT_06 6000 6000 12
GENERATOR gen15 = (92.50, 176.50, 2.00) 0 COLLECT_00 6000 6000 40
GENERATOR gen16 = (98.50, 188.50, 2.00) 0 COLLECT_05 6000 6000 12
GENERATOR gen17 = (61.50, 175.50, 2.00) 0 COLLECT_16 6000 6000 6
GENERATOR gen18 = (68.00, 194.50, 4.00) 0 COLLECT_04 6000 6000 8
GENERATOR gen19 = (62.50, 171.50, 4.00) 0 COLLECT_30 6000 6000 3
ARROW_DATA pfeil
COUNTER mainloop = 1
COUNTER currentped_busy
COUNTER current_ped
COUNTER current_player
COUNTER ped_01_busy
COUNTER ped_02_busy
COUNTER ped_03_busy
COUNTER ped_04_busy
COUNTER ped_05_busy
COUNTER ped_06_busy
COUNTER ped_07_busy
COUNTER ped_08_busy
COUNTER charpointer = 1320
COUNTER b1_objective
COUNTER b1_timer = 97
COUNTER b1_guarding = 1
COUNTER b1_area
COUNTER pweapon = 1 //counter for the current player - // gta2 loads values from one the following
// counters, use it for checks, changes them
// if necessary and write them back into
// the right counter slot //Thanks to Jones - this saves a lot of work!
COUNTER p1weapon = 0 //game stores values here for player ped1 when not processed
COUNTER p2weapon = 0 //game stores values here for player ped2 when not processed
COUNTER p3weapon = 0 //game stores values here for player ped3 when not processed
COUNTER p4weapon = 0 //game stores values here for player ped4 when not processed
COUNTER p5weapon = 0 //game stores values here for player ped5 when not processed
COUNTER p6weapon = 0 //game stores values here for player ped6 when not processed
////////////////////////////////////////////////////////////////////////////////////////////////////
// LEVELSTART //
////////////////////////////////////////////////////////////////////////////////////////////////////
LEVELSTART
SET_AMBIENT_LEVEL (0.40, 0)
SWITCH_GENERATOR (gen1, ON)
SWITCH_GENERATOR (gen2, ON)
SWITCH_GENERATOR (gen3, ON)
SWITCH_GENERATOR (gen4, ON)
SWITCH_GENERATOR (gen5, ON)
SWITCH_GENERATOR (gen6, ON)
SWITCH_GENERATOR (gen7, ON)
SWITCH_GENERATOR (gen8, ON)
SWITCH_GENERATOR (gen9, ON)
SWITCH_GENERATOR (gen10, ON)
SWITCH_GENERATOR (gen11, ON)
SWITCH_GENERATOR (gen12, ON)
SWITCH_GENERATOR (gen13, ON)
SWITCH_GENERATOR (gen14, ON)
SWITCH_GENERATOR (gen15, ON)
SWITCH_GENERATOR (gen16, ON)
SWITCH_GENERATOR (gen17, ON)
SWITCH_GENERATOR (gen18, ON)
SWITCH_GENERATOR (gen19, ON)
SET_PEDDENSITY (pedzone1, 1000)
ADD_GROUP_TO_CHARACTER (b1, 0)
SET_GROUP_TYPE (b1, CHAIN)
SET b1_objective = 0
SET_CHAR_BRAVERY_LEVEL ( b1 , LOONY )
SET_CHAR_THREAT_REACTION ( b1 , NO_REACTION )
WHILE_EXEC ( mainloop = 1 )
SET current_player=1 //to start Innerwhile with player 1 again
WHILE_EXEC(current_player<7) //perform "Innerwhile" if Counter "current_player" is not bigger than 6 (players)
SET current_ped=1
IF(current_player=1) //who is current player ped?
SET p=(p1+0) //set CHAR_DATA slot "p" = p1
SET pweapon=(p1weapon+0) //load his weapon counter values
ENDIF //End check (who is current player ped?)
IF(current_player=2)
SET p=(p2+0)
SET pweapon=(p2weapon+0)
ENDIF
IF(current_player=3)
SET p=(p3+0)
SET pweapon=(p3weapon+0)
ENDIF
IF(current_player=4)
SET p=(p4+0)
SET pweapon=(p4weapon+0)
ENDIF
IF(current_player=5)
SET p=(p5+0)
SET pweapon=(p5weapon+0)
ENDIF
IF(current_player=6)
SET p=(p6+0)
SET pweapon=(p6weapon+0)
ENDIF
WHILE_EXEC(current_ped<7) //14bots //perform "Innerwhile" if Counter "current_ped" is not bigger than 6 (bots)
IF(current_ped=1) //who is current bot ped?
SET currentped=(ped_01+0) //set CHAR_DATA slot "p" = p1 //load his weapon counter values
SET currentped_busy=(ped_01_busy+0)
ENDIF //End check (who is current bot ped?)
IF(current_ped=2)
SET currentped=(ped_02+0)
SET currentped_busy=(ped_02_busy+0)
ENDIF
IF(current_ped=3)
SET currentped=(ped_03+0)
SET currentped_busy=(ped_03_busy+0)
ENDIF
IF(current_ped=4)
SET currentped=(ped_04+0)
SET currentped_busy=(ped_04_busy+0)
ENDIF
IF(current_ped=5)
SET currentped=(ped_05+0)
SET currentped_busy=(ped_05_busy+0)
ENDIF
IF(current_ped=6)
SET currentped=(ped_06+0)
SET currentped_busy=(ped_06_busy+0)
ENDIF
SET charpointer = ( charpointer + 660 )
SET currentped = ( p + charpointer )
IF (b1_objective = 0)
//SET_CHAR_OBJECTIVE (b1, WAIT_ON_FOOT)
ADD_PATROL_POINT (b1, 52.5, 185.5, 2.0)
ADD_PATROL_POINT (b1, 58.5, 193.5, 2.0)
SET b1_objective = 1
ENDIF
IF (currentped_busy = 0)
ADD_EXISTING_CHAR_TO_GROUP (b1, currentped)
//CHANGE_CHAR_REMAP (currentped, 17)
//SET_CHAR_OBJECTIVE (currentped , GOTO_AREA_ON_FOOT, 61.5, 39.2, 2.0)
//POINT_ARROW_AT (pfeil, currentped)
//GIVE_WEAPON (ped_01, ROCKET_LAUNCHER)
//MAKE_ALL_CHARS_MUGGERS (on)
POINT_ARROW_AT (pfeil, currentped)
SET currentped_busy = 1
ENDIF //ped_01_busy = 0
IF (HAS_CHARACTER_DIED (ped_01))
//IF(NOT(IS_ITEM_ONSCREEN(ped_01)))
//DELETE_ITEM (ped_01)
SET currentped_busy = 0
//ENDIF
ENDIF //HAS_CHARACTER_DIED (ped_01)
IF ( charpointer > 32340 ) // 49 x 660 (each character has a struct of 660 bytes)
SET charpointer = 3960 // If you don't want to kill player 2-6, set to 3960 ( 6 x 660 )
ENDIF //charpointer > 32340
IF(current_ped=1) //who is current bot ped? //set CHAR_DATA slot "p" = p1 //load his weapon counter values
SET ped_01_busy =(currentped_busy+0)
ENDIF //End check (who is current bot ped?)
IF(current_ped=2)
SET ped_02_busy =(currentped_busy+0)
ENDIF
IF(current_ped=3)
SET ped_03_busy =(currentped_busy+0)
ENDIF
IF(current_ped=4)
SET ped_04_busy =(currentped_busy+0)
ENDIF
IF(current_ped=5)
SET ped_05_busy =(currentped_busy+0)
ENDIF
IF(current_ped=6)
SET ped_06_busy =(currentped_busy+0)
ENDIF
++current_ped //perform all the "WHILE 3 commands" on the next bot, please
ENDWHILE //End WHILE 3
++current_player //perform all the "WHILE 2 commands" on the next player, please
ENDWHILE //End WHILE 2
ENDWHILE//End WHILE 1
LEVELEND[/syntax]
Remaining problems:
When I stop the group leader the queue is not proper (now i use patrol points to let him walk)
I have to think about how to delete the dummies who died and get the slots free again for new ones.
This also seems to be necessary to avoid crashes due to many peds if I am right?
My scenario should actually be a queue in front of a techno club and from time to time one guy should join the club.
I want to delete him, move the queue one step forward and make a new one join the group / queue.