Barrel with a thousand parachutes script.......... - Marto - 05-24-2010
Here is the script:
Code:
;Variables
_vehicle = _this select 0
;Creating the parachute
_chute = "parachute" createvehicle [getPos pos1 select 0, getPos pos1 select 1, (getPos pos1 select 2) +200];
_drop=[getPos pos1 select 0, getPos pos1 select 1, (getPos pos1 select 2) +200]
_chute setpos _drop
#Drop
If ((getPos _chute) select 2 < 0.1 or not alive _chute) Then {Exit}
;Putting the vehicle in parachute
_location=getpos _chute
_vehicle setpos _location
~0.01
goto "Drop"
Seems to create a paracute for every player that is connected. Would using camcreate rather than createvehicle work?
Re: Barrel with a thousand parachutes script.......... - Zulu1 - 05-24-2010
Marto,
Here's a paradrop script I have laying around, see if it works for you.
Quote:;*********************
;Parachute Drop Script V1.0
;By MP (markpalmer@hotmail.com)
;
;usage: [cargo, marker, height, DropHeight, xoffset, yoffset, zoffset] exec "ParaDropObject.sqs"
;see ParaDropObject.txt for full info
;
;*********************
;Gets Variables from script call.
_Cargo = _this select 0
_Marker = _this select 1
_Height = _this select 2
_DropHeight = _this select 3
;These variables allow you to apply an offset to the parachute.
;Using these variables you can position the parachute so it looks right above the object.
;Experimentation is the key here.
_XOffset = _this select 4
_YOffset = _this select 5
_ZOffset = _this select 6
;Seems to kickstart a vehicle, without it they just sit there, or worse hover.
_Cargo domove [(getPos _Cargo select 0), (getPos _Cargo select 1)]
;Sets Initial Variables
_MarkerPos = GetMarkerPos _Marker
_cx = _MarkerPos select 0
_cy = _MarkerPos select 1
_cz = _MarkerPos select 2
_Dir = 0
;Creates and Sets Initial position of Cargo.
_Cargo setpos[_cx, _cy, (_cz + _Height)]
;Places Cargo and parachute at required position,height and offset
_Parachute = "parachute" camCreate[((getPos _Cargo select 0) + _XOffset), ((getPos _Cargo select 1) + _YOffset), ((getPos _Cargo select 2) + _ZOffset)]
;Places Cargo relative to Parachute
;Note the offset is reversed because we are making the cargo relative to the parachute and
;Not the other way around as in the previous camcreate call
#Loop1
~0.01
_dir = getdir _Parachute
_Cargo setdir _dir
_Cargo setpos[((getPos _Parachute select 0) - _XOffset), ((getPos _Parachute select 1) - _YOffset), ((getPos _Parachute select 2) - _ZOffset)]
;Loops Until Object reaches the ground, warning: if you set the drop height to zero the cargo
;has a tendancy to disappear
?((getpos _Cargo select 2) > _DropHeight): goto "Loop1"
#Loop1 Exit
exit
Re: Barrel with a thousand parachutes script.......... - Zwobot - 05-24-2010
The script definitely has a MP locality issue which is clearly indicated ingame by the appearance of multiple parachutes and the barrel being beamed under them every few seconds.
I think you have to make sure that the script is run only locally on the server. You can do this by placing a game logic and name it server and in the script add ?!(local server) : exit
Re: Barrel with a thousand parachutes script.......... - RKDmitriyev - 05-24-2010
(05-24-2010, 09:28 AM)Zwobot link Wrote: The script definitely has a MP locality issue which is clearly indicated ingame by the appearance of multiple parachutes and the barrel being beamed under them every few seconds.
I think you have to make sure that the script is run only locally on the server. You can do this by placing a game logic and name it server and in the script add ?!(local server) : exit
Yeah, that's what I would suspect too, because I don't see any way that that script is checking to make sure it's only running on one computer. CreateVehicle is going to create a new vehicle for every machine that reads the code.
|