Home   Help Search Login Register  

Author Topic: Basic artillery script in multiplayer?  (Read 1493 times)

0 Members and 1 Guest are viewing this topic.

Offline u551

  • Members
  • *
Basic artillery script in multiplayer?
« on: 06 Mar 2008, 22:26:57 »
Im making a multiplayer map that needs artillery thrown over an area at one point.

So my script is run on all computers because camCreate (that creates bombs) doesnt work if executed just on server. The problem is with random -function that (i think) returns different number on every client thus making bombs fall different places on each computer.

Ive tried making a server-only script that randoms a coordinate for bomb, and then executes camcreate script on all computers to that location but this didnt - for some reason - work and bombs dont get created at all, only effects are seen on all machines.

Any ideas or something i might be missing here?

Offline dr. seltsam

  • Members
  • *
Re: Basic artillery script in multiplayer?
« Reply #1 on: 06 Mar 2008, 23:14:13 »
hi,

i would use the createVehicle - command for creating the artillery shells. The shell-create-script should only run on the server then. The clients will see the shells exploding with all their effects (sound, smoke and damage). This way you only have to do the randomize calculations in the server-script, with only 1 result for the network.

 :D  :cool2:

Offline u551

  • Members
  • *
Re: Basic artillery script in multiplayer?
« Reply #2 on: 06 Mar 2008, 23:52:47 »
Ahh, didnt know it was possible to create shells with createVehicle.
Edited the script and it works fine on my computer, shall test tomorrow on dedicated.

Thank you  :cool2: