Home   Help Search Login Register  

Author Topic: Why do I get 2 of each object in co-op? (help)  (Read 1537 times)

0 Members and 1 Guest are viewing this topic.

Miek

  • Guest
Why do I get 2 of each object in co-op? (help)
« on: 08 Jun 2003, 01:57:27 »
I'm pretty new to editing, and I've looked all over and can't find a straight answer to this question.

I'm trying to add a few more buildings to a little village to make it into a much bigger city, I've been doing this by putting:

house = "object_name" createVehicle getPos this; house setdir getdir this

in the 'init:' field of game logic units. (I got it from the "Resistance object names" tutorial by Girts).

Anyway, it worked perfect when I previewed the mission in the editor, but when I tried it out in co-op there were two of each building I had added, right next to each other.

I mean, it doubled the size of my city, but kind of annoying...

I'm gonna go out on a limb here ;) and guess it has something to do with the fact both machines are running the mission, either the host machine makes an object for each player, or each machine creates an object. Why is it doing this?

Am I just making some classic noob error? It feels like it. I'd appreciate some help anyway.

k thx.

- Miek

Offline Zombie

  • Members
  • *
  • Beware the night, the zombie walks among you
    • USI
Re:Why do I get 2 of each object in co-op? (help)
« Reply #1 on: 08 Jun 2003, 12:46:46 »
Never tried to add buildings that way, but do you have a game logic named server?  Putting that in saves many problems, might do the trick for you

Offline Terox

  • Former Staff
  • ****
  • Follow the Sappers!
    • zeus-community.net
Re:Why do I get 2 of each object in co-op? (help)
« Reply #2 on: 08 Jun 2003, 14:47:40 »
On the surface of it, it sounds like both the server and the client are adding buildings, hence 2 of each, So you simply need to

?!(local server):exit

I would create a script to add these buildings and then place the line above at the start of the script
or ?(local server):[]exec "addbuildings.sqs"

Activate the script from the init.sqs

Gamelogics are only present on a server

make sure you have a gamelogic called "server" somewhere on the map, doesnt matter where
« Last Edit: 08 Jun 2003, 14:51:20 by Terox »
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123

Miek

  • Guest
Re:Why do I get 2 of each object in co-op? (help)
« Reply #3 on: 08 Jun 2003, 17:45:15 »
On the surface of it, it sounds like both the server and the client are adding buildings, hence 2 of each, So you simply need to

?!(local server):exit

I would create a script to add these buildings and then place the line above at the start of the script
or ?(local server):[]exec "addbuildings.sqs"

Activate the script from the init.sqs

Gamelogics are only present on a server

make sure you have a gamelogic called "server" somewhere on the map, doesnt matter where

Is it possible to do this without making a script, and if so where do I have to put
"?!(local server):exit"?