Home   Help Search Login Register  

Author Topic: So many BMPs  (Read 1332 times)

0 Members and 1 Guest are viewing this topic.

LAPD

  • Guest
So many BMPs
« on: 07 Aug 2003, 19:06:02 »
Hello. I made a mission that reinforcements need to come. To create the reinforcements I use CreateUnit and CreateVehicle. Everything is fine, they are all created, but I don't know why so many BMPs are created. I only want 1 BMP with a crew in it, and then a squad enters ass ride in back. The BMP with the crew in it is created, but also something like 4-5 empty BMPs. I don't want the empty one. To create the reinforcements I use this script (or code, nevermind) in the on activation of a trigger which is activated only once (so only one bmp and 1 reinforments) and there isn't any loop as you can see:

Code: [Select]
_units2 = units east2
"_x setunitpos up" foreach _units2
"_x allowfleeing 0" foreach _units2

BMP = "BMP" CreateVehicle getpos G2
"OfficerE" CreateUnit [getpos G2, East2, "E10 = this", 1, "SERGEANT"]
"SoldierEG" CreateUnit [getpos G2, East2, "E11 = this", 1, "CORPORAL"]
"SoldierEB" CreateUnit [getpos G2, East2, "E12 = this", 1, "CORPORAL"]
"SoldierELaw" CreateUnit [getpos G2, East2, "E13 = this", 1, "CORPORAL"]
"SoldierEMG" CreateUnit [getpos G2, East2, "E14 = this", 1, "PRIVATE"]
"SoldierEB" CreateUnit [getpos G2, East2, "E15 = this", 1, "PRIVATE"]
"SoldierEB" CreateUnit [getpos G2, East2, "E16 = this", 1, "PRIVATE"]
"SoldierECrew" CreateUnit [getpos G2, East2, "E17 = this", 1, "PRIVATE"]
"SoldierECrew" CreateUnit [getpos G2, East2, "E18 = this", 1, "PRIVATE"]
"SoldierECrew" CreateUnit [getpos G2, East2, "E19 = this", 1, "PRIVATE"]
~2
E10 AssignAsCargo BMP; E11 AssignAsCargo BMP; E12 AssignAsCargo BMP; E13 AssignAsCargo BMP; E14 AssignAsCargo BMP; E15 AssignAsCargo BMP; E16 AssignAsCargo BMP; E17 AssignAsGunner BMP; E18 AssignAsCommander BMP; E19 AssignAsDriver BMP
[E10,E11,E12,E13,E14,E15,E16,E17,E18,E19] ordergetin true

~3
OBJ5 = True

If someone can tell me what is wrong and why there are so many BMPs i'll be glag :D. At first I tought I could skip it, but one time the BMP couldn't move because the empty BMPs blocked it, so I decided to deal with it.

Thanks :)

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:So many BMPs
« Reply #1 on: 07 Aug 2003, 19:41:34 »
I think its because your script is run on every client and the server, so they are all creating one each.

Simple way to stop it

1) Create a gamelogic, name it "Server"

and then place the following line at the start of the script

?!(Local server):exit
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

LAPD

  • Guest
Re:So many BMPs
« Reply #2 on: 08 Aug 2003, 13:58:36 »
I already have a game logic named G2, which I need so the reinforcements will be created on it.
Do I need to replace that game Logic with the "server" one, or I create a NEW gamelogic named "Server"?

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:So many BMPs
« Reply #3 on: 08 Aug 2003, 20:34:07 »
no, keep the G2 gamelogic and simply use the following line

?!(local G2):exit

Ant  gamelogic is only local to the server, so using the above line at the start of the script will ensure the script will only run on the server

As a kinda unnoficial standard, folks normally call one of the gamelogics "server", but any named gamelogic will do
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

LAPD

  • Guest
Re:So many BMPs
« Reply #4 on: 10 Aug 2003, 12:46:22 »
Thanks Terox, I didn't have time to check it so i'll leave this topic for now. If it works i'll solve the topic, if it won't, i'll reply again. Thanks!  :) :thumbsup:

Edit: It works! YAY! Thanks Terox!  8) My mission is FINAL.
« Last Edit: 11 Aug 2003, 00:05:19 by LAPD »