Home   Help Search Login Register  

Author Topic: Drop command acting up in MP?  (Read 1576 times)

0 Members and 1 Guest are viewing this topic.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Drop command acting up in MP?
« on: 24 Jun 2003, 18:18:55 »
Hello folks,

I've made this little script to enhance an mp mission which is all about flying in the air..

Code: [Select]
#start

AAfire = 1
_c = 1
_color = [[0,0,0,0.85],[0,0,0,0.9],[0,0,0,0.4], [0, 0, 0,0]]
_size = [10,30]
_lifetime = 60
_timer = 60
_vel = [1,1,1]
_plane = _this select 0
_AApos = _this select 1

#loop

?!(alive _plane): exit
?_plane distance _AApos > 650: AAfire = 0; exit

~random(1)+0.2

_bearing = random(360)
_distance = random(40)+50
_ypos = (getpos _plane select 2) + (random(25)-random(25))

?(local server): _shell1 = "mortarshell" createvehicle [(getpos _plane select 0) + sin (getdir
_plane + _bearing) * _distance, (getpos _plane select 1) + cos (getdir _plane + _bearing) * _distance, _ypos]

_pos = getpos _shell1
_x = _pos select 0
_y = _pos select 1
_z = _pos select 2

drop ["cl_basic", "", "Billboard", _lifetime, _timer, [_x, _y, _z], _vel, 0, 0.2, 0.157, 1, _size, _color, [0], 0, 0, "", "", ""]

?(local server): _shell11 = "mortarshell" createvehicle [getpos _shell1 select 0,getpos _shell1 select 1,(getpos _shell1 select 2)]

_bearing = 0
_distance = 0
goto "loop"

Works like a charm for me but now for the others connected to a game hosted by me!
They say it gives a "genric error" from the drop command, but I don't see it.

Thus I can see the drop created little smoke cloud, but the others can't which isn't funny  :P


Why?  :o
Not all is lost.

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Drop command acting up in MP?
« Reply #1 on: 24 Jun 2003, 19:05:43 »
hmpf g'daem I went and solved the bugger on my own  :P ;D

The problem was that I was creating the two mortar shells locally, but the drop command was naturally set to go off globally.
Now because the drop command took it's coordinates from the locally created shell, it couldn't take them on anywhere else than on the server machine thus giving the genric error message.
Not all is lost.

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Drop command acting up in MP?
« Reply #2 on: 25 Jun 2003, 11:59:44 »
Quote
_bearing = random(360)
_distance = random(40)+50
_ypos = (getpos _plane select 2) + (random(25)-random(25))


You might also get different results on each machine with
the random's above.

You should create the random value local on server and then
publicVariable 'em as global variable.

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Tactician

  • Guest
Re:Drop command acting up in MP?
« Reply #3 on: 25 Jun 2003, 12:33:56 »
Those three random variables are only used ?(local Server) so there's no place for discrepance.  Still they could be skipped by clients to reduce overhead :)

Looking again, I see that a random number after a ~ could be trouble.  But the peanut gallery is debugging Artak's scripts for him!
« Last Edit: 25 Jun 2003, 12:36:23 by Tactician »

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Drop command acting up in MP?
« Reply #4 on: 25 Jun 2003, 13:17:14 »
uh - yeah i can see now they're only used serverside,
but created global.

OK, then they don't cause more than just the clients to be
busy without the need to be  ;D

~S~ CD
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Drop command acting up in MP?
« Reply #5 on: 26 Jun 2003, 10:17:05 »
Uh.. You're right guys. Thanks for the hint  ;)
Not all is lost.