OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Resources Beta Testing & Submission => Topic started by: Zayfod on 04 Mar 2003, 15:12:21

Title: Newly Revised Rapple script
Post by: Zayfod on 04 Mar 2003, 15:12:21
Hi all,
check out the map. Tell me what you think ;D


EDIT: New rapple script and map is version 6 last thread--testmap available there

This is based on the earlier script made by Xcess and Gastovski. I have not included the rope addon so dont worry about any addons. If u include the addon as per the older script itll look very nice indeed ;D

What I have fixed:

1: only one script now not two

2:doesnt rely on setpos of chopper (this caused issues when the older onerapple.sqs was executed over a sloping hill--many AIs died as a result of this :'(  and the chopper would jerk around at funny angles)

3: the men dont bounce and shoot off at funny angle when they reach 5 metres above ground

4: the men come down the rope in a more rapple looking fassion. This done with switchmove "onchair"--looks quite good.

5.Men actually almost touch the ground before breaking from this pose with out any casualties so far.

6: Doesnt use any global variables , markers, or triggers, or waypoint conditions

7:The guys come down at random speed now, (some guys are better at rappeling than others)

8: They slightly spin left or right at random speeds when descending (as one would)

9:They will absolutely not start descening untill chopper has stopped or slowed enough (using velocity--setvelocity)

10: The chopper will not take off till all men are clear--oh and they will only descend one at a time now and wait till rope is clear--correct me if Im wrong but I think thats procedure?

11:can be used in as many choppers with as many troops as u like ;D


Previous versions of rapple scripts have been suggested to be only useful in cutscenes but I think this may offer considerable tactical advantage now that many of the older limitations are gone.



Code: [Select]
;New Rappel beta v1--By Zayfod. Strongly influenced and built on top of oneRapple.sqs By Xcess and Gastovski
;cheers guys =)

   _grp = _this select 0
   _helo = _this select 1
   _man = leader _grp
   _aunits = units _grp
   _I = 0
   _J = count _aunits

#stop
   _helo flyinheight 30
   commandstop _helo
#chopheight

   _height = getpos _helo select 2
   ? _height < 31: goto "speed_check"
   ~0.1
   goto "chopheight"

#speed_check
   _xvel = velocity _helo select 0
   _yvel = velocity _helo select 1
   _zvel = velocity _helo select 2

   ?_xvel > 2: _helo setvelocity [_xvel - 0.1,_yvel,_zvel]
   ?_yvel > 2: _helo setvelocity [_xvel,_yvel - 0.1,_zvel]
   ?_xvel < -2: _helo setvelocity [_xvel + 0.1,_yvel,_zvel]
   ?_yvel < -2: _helo setvelocity [_xvel,_yvel + 0.1,_zvel]
   ? _xvel > -2 and _xvel < 2 and _yvel > -2 and _yvel < 2 :goto "start"
   ~0.01
goto "speed_check"

#Start
   _man = (_aunits select _I)
   _man action ["getout",_helo]
   unAssignVehicle _man
   goto "rappel"

#check_j
   ?_J>_I : goto"Start"
   ~1
   ?_I==_J : goto"next"
#next
   _helo commandmove (getpos _helo)
   _helo flyinheight 100


hint "end"
exit

#rappel

   _chopdir = getdir _helo
   _mendir = _chopdir + 90
   _posrandomdir = (random 3) + 2
   _negrandomdir = 0 - ((random 3) + 2)
   _neg_and_pos_array = [_posrandomdir, _negrandomdir]
   _random = random (count _neg_and_pos_array)
   _random = _random - _random % 1
   _randomdir = _neg_and_pos_array select _random
   _man setdir _mendir
   _behave = behaviour _man
   _man setbehaviour"AWARE"
   _man switchmove "onchair"
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = getpos _helo select 2
   _drop = (random 0.2) + 0.3
   _posz = _posz - 1
   _man setpos[_posx, _posy, _posz]
   _changedir = _mendir
#loop
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - _drop
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ~ 0.001
   ? _posz > 2 : goto"loop"
#clear
   _mendir = getdir _man
   _pos = getpos _helo
   _man moveincargo _helo
   unassignvehicle _man
   _man action["getout",_helo]
   _man setdir _mendir
   _man setpos [_posx,_posy,0]
   _man Setbehaviour _behave
   _I = _I + 1; goto "check_j"


Tell me what ya think, any suggestions to make it better?

Zay out


Title: Re:Newly Revised Rapple script
Post by: Ace on 04 Mar 2003, 15:22:41
Looking good.

A few probs though, the Helo1 choppers rappelers somestimes die.
The others seem OK

Might look better if the rappelers were slightly tilted when going down, fi thats possible?

Overall not bad.
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 04 Mar 2003, 15:35:47
no kidding? :o

lol Ive just tested it like30 times in a row with out a single death. O well that diff parameters in computers fer ya.

Ace can u gimme more info?

Title: Re:Newly Revised Rapple script
Post by: Zayfod on 04 Mar 2003, 15:54:53
Quote
Might look better if the rappelers were slightly tilted when going down, fi thats possible?

Hmmm yup when abseil u do tilt back a bit dont ya ::)

Yer I thinks its possible


BTW just played it 5 more time without a casualty, only time they die for me is when I speed up time in the editor lol. Lemme know what the story was with u

Was it due to helo1s AI pilot deciding to drop em over one of the buildings at the airport?

Hes done that a few times for me too but the AIs just landed inside the building and ran out thru the walls fine

Zay out
Title: Re:Newly Revised Rapple script
Post by: Ace on 04 Mar 2003, 16:52:56
I noticed it is often the law soldier or offcier that die.

No the building drops are fine. When I play as one of the rappelers everything is OK, i never die.

It seems to be the AI. Do you think it could have something with the speed of the drop (since it varies)

The "on-chair" command looks great from a distance but not so good closer. Although theres nothing you can do about that, its just another ofp limitation


EDIT :

I just ttsted it again and every single soldier died! And all of them were deadbefore they even hit the ground!
I could tell because they were covered in blood while rappeling.
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 05 Mar 2003, 02:29:22
Nah Idon its got anything to do with the random descent speed cause the pause in the loop remains the same its only the setpos position thats changes-----not ruling it out completely but I think there may be other avenues to investigate.

AT any rate its going to be hard for me cause I simply CANT kill the buggers on my puter..........

Ive done at least another 30 test not a single death, but ill keep trying till I do.

Ill investigate:

1:Could be the fact that Ive bypassed the old way of having to setpos the chopper just before the action eject. But I would really like u to try these other changes first cause the setposing of the chopper is a major pooo bum

2:Could be I need to raise the height from 2m to 3m before they break from the descent loop.



#loop
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - _drop
   _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ~ 0.001
   ? _posz > 2 : goto"loop" <-----change to 3




3: Could be the fact that I made them commence the descent closer to the chopper than before.

#rappel

   _chopdir = getdir _helo
   _mendir = _chopdir + 90
   _posrandomdir = (random 3) + 2
   _negrandomdir = 0 - ((random 3) + 2)
   _neg_and_pos_array = [_posrandomdir, _negrandomdir]
   _random = random (count _neg_and_pos_array)
   _random = _random - _random % 1
   _randomdir = _neg_and_pos_array select _random
   _man setdir _mendir
   _behave = behaviour _man
   _man setbehaviour"AWARE"
   _man switchmove "onchair"
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = getpos _helo select 2
   _drop = (random 0.2) + 0.3
   _posz = _posz - 1 <--------Change this to 2
   _man setpos[_posx, _posy, _posz]
   _changedir = _mendir
#loop


4: could be that he needs to be setposed back to the spot he was at (before he broke the descent loop and was placed back in the chopper) rather than it being ground level ie "0". This will make him appear to hit the ground while in the air but if its gotta be done then its gotta be done :'(


#clear
   _mendir = getdir _man
   _pos = getpos _helo
   _man moveincargo _helo
   unassignvehicle _man
   _man action["getout",_helo]
   _man setdir _mendir
   _man setpos [_posx,_posy,0]<------change 0 to _posz
   _man Setbehaviour _behave
   _I = _I + 1; goto "check_j"


ACE recommend you try each one on its own then diff combinations then all together--see what u get ;D


LOL meanwhile I will to continue to try an kill one of these guys, if they were dyin for me like they are for u then I would not have posted this ;)

Zay out





Title: Re:Newly Revised Rapple script
Post by: Zayfod on 05 Mar 2003, 02:53:29
The more I think about it the more I reckon its this:



2:Could be I need to raise the height from 2m to 3m before they break from the descent loop.



#loop
  _posx = getpos _helo select 0
  _posy = getpos _helo select 1
  _posz = _posz - _drop
  _man setdir _changedir
  _changedir = _changedir - _randomdir
  _man setpos [_posx, _posy, _posz]
  ~ 0.001
  ? _posz > 2 : goto"loop" <-----change to 3


cause this lessens the chace of him touching the ground during the fall :-\ I tryed setting it to 0 and got heaps of casualties--set it to 1 handful of deaths- set it to 2 no deaths as it s in the script BUT maybe if you set it to 3 itll help solve your issue of deaths.

Anyway try the others above also.

still cant kill one yet lol
Title: Re:Newly Revised Rapple script
Post by: alimag on 05 Mar 2003, 22:01:55
Hi Zayfod,

I use your example mission and modified a few things. Hope you dont mind.

Modifications
-------------

GASUH80Rope.pbo : Only the texture so it looks more like a rope to me. I think the rope could be a little thinner for fast-ropping but I dont know how to deal with p3d files.

rappel.sqs : Accepts multiple groups (see Zayfod sample but with chinook). Informs the rope script when to start and to end. Adds a line insuring fast-ropper health (setDammage 0) because once in a while someone dies on me.

rope.sqs : Creates and delete the rope object. Keep it where it should be (as it was)

Note
----
The 2 scripts use 1 global variable called rappelRope[]. It serves has a flag for each chopper to know when the rope is not needed any more.

Everything is fine now. Here's your modified sample mission

Thumbs up for the way you handle the fast-ropper!

AliMag
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 06 Mar 2003, 09:41:21
Hi AliMag,  ;D

ofcourse I dont mind, thats the reason for my post ;)

Great work on the "multiple groups in one chopper solution"...lol I hadnt even thought about that one.

Quote
Adds a line insuring fast-ropper health (setDammage 0) because once in a while someone dies on me.


Unfortunately that only works for AI in a MP situation--if u happen to be a human player and the script decides to(every once in a while) kill u then sure your body will be set back to full health but youll be watching it wave at you as it slides down the rope from the "YOUR DEAD" window. lol

Reason being no trigger or script is fast enuff to set u back to health b4 the game recognises your dead.

But dont worry I have a solution and its in these two lines:


_man addeventhandler ["hit", {_this select 0 setdammage 0}]
_man addeventhandler ["dammaged", {_this select 0 setdammage 0}]

I guess these are processed b4 the game checks on your health because while they are active u (player or AI) are invincible. Cool huh?

Note: Any naughty map makers decide to use these to make invicible players then I certainly wont be interested in playing your map. BUT for script issues just like this its perfect ;D

So there ya go. Anyways once I knew I didnt have to worry about the health of the AI or player I made a few more asthetic changes to the rapple and boy it looks good now.

Changes:

1:Rappeler starts the rapple slow then speeds up then slows down again before he hits the ground. (as u would)

2: Changed the switchmove pos from "onchair" to "FXfromtable" looks real nice, he leans back and if u keep the chopper height  at 30m he puts out his legs for landing at the right time (almost depending on the random speed of descent);D Legs are also more slighlty apart than the "onchair" look.

Well Ill stick my neck out here--If I dont no one else will --and say im 99.99% sure u cant die during this rapple now.

If u do then----then ----poooo

Check the map,  they look cool now

Thanks again AliMag

Zay out



Code: [Select]
;*******************************************************************************************
; rappel.sqs                                                                               *
; Original:                                                                                *
; By Zayfod. Strongly influenced and built on top of oneRapple.sqs By Xcess and Gastovski  *
; modified by AliMag and then again by Zayfod =) thanks AliMag!!. - 03/2003                *                                                             ;                                                                                          *                                                                        
;*******************************************************************************************

   _groups = _this select 0
   _helo = _this select 1
   _aunits = []
   "_aunits = _aunits + (units _x)" forEach _groups
   _i = 0
   _j = count _aunits

   ? (count rappelRope) == 2 : goto "stop"
   rappelRope = [["rappel.sqs", "rope.sqs"], []]

#stop
   _helo flyinheight 30
   commandstop _helo

#chopheight
   _height = getpos _helo select 2
   ? _height < 31 : goto "rope"
   ~0.1
   goto "chopheight"

#rope
   rappelRope set [1, (rappelRope select 1) + [_helo]]
   _helo exec "rope.sqs"

#speed_check
   _xvel = velocity _helo select 0
   _yvel = velocity _helo select 1
   _zvel = velocity _helo select 2
   ?_xvel > 2 : _helo setvelocity [_xvel - 0.1,_yvel,_zvel]
   ?_yvel > 2 : _helo setvelocity [_xvel,_yvel - 0.1,_zvel]
   ?_xvel < -2 : _helo setvelocity [_xvel + 0.1,_yvel,_zvel]
   ?_yvel < -2 : _helo setvelocity [_xvel,_yvel + 0.1,_zvel]
   ? _xvel > -2 and _xvel < 2 and _yvel > -2 and _yvel < 2 : goto "start"
   ~0.01
   goto "speed_check"

#Start
   _man = (_aunits select _i)
   _man action ["getout",_helo]
   unAssignVehicle _man
   _man addeventhandler ["hit", {_this select 0 setdammage 0}]
   _man addeventhandler ["dammaged", {_this select 0 setdammage 0}]
   goto "rappel"

#check_j
   ? _j > _i : goto"Start"
   ~1
   ? _i == _j : goto"next"

#next
   _helo commandmove (getpos _helo)
   _helo flyinheight 100
   ~3
   rappelRope set [1, (rappelRope select 1) - [_helo]]
   exit

#rappel
   _chopdir = getdir _helo
   _mendir = _chopdir + 90
   _posrandomdir = (random 3) + 2
   _negrandomdir = 0 - ((random 3) + 2)
   _neg_and_pos_array = [_posrandomdir, _negrandomdir]
   _random = random (count _neg_and_pos_array)
   _random = _random - _random % 1
   _randomdir = _neg_and_pos_array select _random
   _man setdir _mendir
   _behave = behaviour _man
   _man setbehaviour"AWARE"
   _man switchmove "fxfromtable"
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = getpos _helo select 2
   _drop = (random 0.2) + 0.3
   _posz = _posz - 1
   _man setpos[_posx, _posy, _posz]
   _changedir = _mendir
   _dropcheck = 0.01
#loop
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - (0 + _dropcheck)
   _dropcheck = _dropcheck + 0.01
   ?_dropcheck >= _drop: _dropcheck = _drop
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ~ 0.001
   ? _posz > 8 : goto "loop"



#loop2

   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - _drop
   _drop = _drop - 0.01
   ?_drop <= 0.07: _drop = 0.08
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ~ 0.001
   ? _posz > 1 : goto "loop2"

#clear
   _mendir = getdir _man
   _pos = getpos _helo
   _man moveincargo _helo
   _man action["getout",_helo]
   _man switchmove ""
   unassignvehicle _man
   _man setdir _mendir
   _man setpos [_posx,_posy,0.2]
   _man Setbehaviour _behave

   _man removealleventhandlers "hit"
   _man removealleventhandlers "dammaged"
   _I = _I + 1; goto "check_j"




Title: Re:Newly Revised Rapple script
Post by: Zayfod on 06 Mar 2003, 19:32:44
*********UPDATE************

Fixes:

#1: If helo encounters enemy during rapple itll no longer fly away.

#2: If rappelers encountered enemy during rapple you would see a split second of them in prone position at end of rapple--this has been fixed.

#3: If any of the rappelers are killed in the chopper before they start to descend then they dont rapple down as a dead body now--they stay dead in chopper.

#4: If any of the rappelers gain any dammage during flight before they rapple then they maintain that dammage after rapple and are no longer magically revived from the script.

#5: Sometimes the switchmove "FXfromtable" would finish before he hits the ground and u would see him stand up in the air--this has been fixed.


*******UPDATE AGAIN************
Ive noticed that quite a few of the guys yell "ARRRRGH" when they hit the ground(even tho they suffer no damage) this has now been fixed and added to this attached map-- New rapple v4.

#loop
   _man switchmove "fxfromtable"
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - (0 + _dropcheck)
   _dropcheck = _dropcheck + 0.01
   ?_dropcheck >= _drop: _dropcheck = _drop
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ~ 0.001
   ? _posz > 8 : goto "loop"
   _man moveincargo _helo      <-----added
   _man action["getout",_helo] <-----added
   unassignvehicle _man            <-----added
   _man switchmove "fxfromtable" <-----added



#loop2

   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - _drop
   _drop = _drop - 0.01
   ?_drop <= 0.07: _drop = 0.08
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ~ 0.001
   ? _posz > 1 : goto "loop2"

 ;D

Zay out

New version 4 attached



Code: [Select]
;*******************************************************************************************
; rappel v4.sqs                                                                               *
; Original:                                                                                *
; By Zayfod. Strongly influenced and built on top of oneRapple.sqs By Xcess and Gastovski  *
; modified by AliMag and then again by Zayfod =) thanks AliMag!!. - 03/2003                *                                                             ;                                                                                          *                                                                        
;*******************************************************************************************

   _groups = _this select 0
   _helo = _this select 1
   _aunits = []
   "_aunits = _aunits + (units _x)" forEach _groups
   _i = 0
   _j = count _aunits

   ? (count rappelRope) == 2 : goto "stop"
   rappelRope = [["rappel.sqs", "rope.sqs"], []]

#stop
   _helobehaviour = behaviour _helo
   _helo setbehaviour "careless"
   _helo flyinheight 30
   commandstop _helo

#chopheight
   _height = getpos _helo select 2
   ? _height < 31 : goto "rope"
   ~0.1
   goto "chopheight"

#rope
   rappelRope set [1, (rappelRope select 1) + [_helo]]
   _helo exec "rope.sqs"

#speed_check
   _xvel = velocity _helo select 0
   _yvel = velocity _helo select 1
   _zvel = velocity _helo select 2
   ?_xvel > 2 : _helo setvelocity [_xvel - 0.1,_yvel,_zvel]
   ?_yvel > 2 : _helo setvelocity [_xvel,_yvel - 0.1,_zvel]
   ?_xvel < -2 : _helo setvelocity [_xvel + 0.1,_yvel,_zvel]
   ?_yvel < -2 : _helo setvelocity [_xvel,_yvel + 0.1,_zvel]
   ? _xvel > -2 and _xvel < 2 and _yvel > -2 and _yvel < 2 : goto "start"
   ~0.01
   goto "speed_check"

#Start
   _man = (_aunits select _i)
   ? not (alive _man): goto "dead_check"
   _man action ["getout",_helo]
   unAssignVehicle _man
   _dammageman = getdammage _man
   _man addeventhandler ["hit", {_this select 0 setdammage 0}]
   _man addeventhandler ["dammaged", {_this select 0 setdammage 0}]
   goto "rappel"

#check_j
   ? _j > _i : goto"Start"
   ~1
   ? _i == _j : goto"next"

#next
   _helo commandmove (getpos _helo)
   _helo flyinheight 100
   ~3
   rappelRope set [1, (rappelRope select 1) - [_helo]]
   _helo setbehaviour _helobehaviour
   exit

#rappel
   _chopdir = getdir _helo
   _mendir = _chopdir + 90
   _posrandomdir = (random 3) + 2
   _negrandomdir = 0 - ((random 3) + 2)
   _neg_and_pos_array = [_posrandomdir, _negrandomdir]
   _random = random (count _neg_and_pos_array)
   _random = _random - _random % 1
   _randomdir = _neg_and_pos_array select _random
   _man setdir _mendir
   _behave = behaviour _man
   _man setbehaviour"AWARE"
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = getpos _helo select 2
   _drop = (random 0.2) + 0.3
   _posz = _posz - 1
   _man setpos[_posx, _posy, _posz]
   _changedir = _mendir
   _dropcheck = 0.01
#loop
   _man switchmove "fxfromtable"
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - (0 + _dropcheck)
   _dropcheck = _dropcheck + 0.01
   ?_dropcheck >= _drop: _dropcheck = _drop
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ~ 0.001
   ? _posz > 8 : goto "loop"
   _man moveincargo _helo
   _man action["getout",_helo]
   unassignvehicle _man
   _man switchmove "fxfromtable"
#loop2

   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - _drop
   _drop = _drop - 0.01
   ?_drop <= 0.07: _drop = 0.08
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ~ 0.001
   ? _posz > 1 : goto "loop2"

#clear
   _mendir = getdir _man
   _pos = getpos _helo
   _man moveincargo _helo
   _man action["getout",_helo]
   unassignvehicle _man
   _man switchmove "combattocrouch"
   _man setdir _mendir
   _man setpos [_posx,_posy,0.2]
   _man Setbehaviour _behave
   _man removealleventhandlers "hit"
   _man removealleventhandlers "dammaged"
   _man setdammage _dammageman
#dead_check
   _I = _I + 1; goto "check_j"


Title: Re:Newly Revised Rapple script
Post by: Iwesshome on 06 Mar 2003, 22:03:15
Awsome looking script.... I am new to scripts so I want to try it out but I am not sure what info to change to apply it to my characters.

?
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 07 Mar 2003, 00:55:02
 :joystick: hmmm well some of em still do cry like babies when they land but its a lot better.

Anyone know how I can shut these guys up? :hmm:

Zay out
Title: Re:Newly Revised Rapple script
Post by: alimag on 07 Mar 2003, 11:14:06
Hi Zayfod,

Each of them is screaming like hell and to be honest, I prefer the version where they dont slow down at the end (at least not so much).
The thing I like in this version is the crouch position that they take on touch down.
I would suggest that you just add the crouch position to the earlier version. The more time they spend in the air the more they scream.

AliMag
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 07 Mar 2003, 11:38:45
Yer cheers dude,
make sure ya got the latest edition. That should have helped a bit. If still got em screaming then consider it a work in progress.

RE: touchdown speed--Ill look at those parameters again and reconsider em-- perhaps make em touch down a lil quicker ;)

Thanks heaps for your help

Zay out
Title: Re:Newly Revised Rapple script
Post by: LCD on 07 Mar 2003, 13:43:05
da script looks kool ;D

and dey didnt scream 4 me ;D

but u need 2 change it lil cuz en i shot em dey dont die  :o - mebe remove dat _man addeventhandler ["hit", {_this select 0 setdammage 0}] cuz it works only wen he is shoted @ and make it so dat if he is shoted he dies or somin like dat ;D

LCD OUT
Title: Re:Newly Revised Rapple script
Post by: Iwesshome on 07 Mar 2003, 13:55:08
Took a look at the your demo mission and totally like the design.... I was wondering as some other have stated how would you go about speeding up the descent or possibly have them coming down right after each other maybe with a 2 to 3 sec pause in between?

I have only seen one other rappel script and it looked so choppy so great work on what you did. Have you tried this script on any other choppers?

IW
Title: Re:Newly Revised Rapple script
Post by: Delta Hawk on 07 Mar 2003, 23:50:07
Hi,
i have no idea about scripting and all that crap...but GASH's rope looks a little too clean :-\

I know, that sounds stupid! :o But soldiers go down those rope, causing friction and between the dust, sweat, skin, dirt and such, shoulded the rope be alot more dark brown? Little on BHD?  ???  It's just an idea, i mean if you think about it...it's not like soldiers would spend hours trying to clean them, i wouldn't. Correct me if i'm wrong  :-\ maybe some soldier would TRY to clean them.
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 11 Mar 2003, 08:14:06
*****************UPDATE**************

Hi all  ;D

well this script has taken on a life of its own lately and boy its has it grown.

I see a few comments which has been great so--- "wipes sweat from brow"---here goes.

Quote
Each of them is screaming like hell and to be honest, I prefer the version where they dont slow down at the end (at least not so much).


I agree--solved



Quote
I was wondering as some other have stated how would you go about speeding up the descent or possibly have them coming down right after each other maybe with a 2 to 3 sec pause in between?

I agree--solved

Quote
...but GASH's rope looks a little too clean

I agree and its too fat--Nothing I can do Im not a model maker. In saying this I mean no disrespect to Gash at all. Its thanks to him\her that we have a rope at all.


Quote
...and dey didnt scream 4 me

ROFL @ LCD


Quote
but u need 2 change it lil cuz en i shot em dey dont die  

I agree--solved


OK so whats new? HEAPS!  ;D

They say u gotta go backwards in order to go forwards sometimes and the removal of the eventhandlers was one of these backwards steps Ive made.


#1: you can kill them as they rappel. They die, gain speed from the point where they were killed, and topple when they hit the ground.

#2: There have been reports of them letting out a yell "argh " every now and then--this has been solved cause I no longer use eventhandlers to ensure their health.

#3:Have been reports of them every now and then slowing down too much just b4 they hit the ground --this has been solved.

#4:I have spoken to New Zealand Army at length about the protocol of rappeling. Long and short of it is that when only one rope is involved they will INFACT allow 2 up to maximum 3 "they said" guys on the rope at any one time.----this has now been implemented into the script.

#5. NZ army also said the first one down stays at the rope and holds it for the others and dosn't move till all are down-------Ive done this also. Once chopper moves out he rejoins the group.  ;D

If the rope holder gets killed then the next down the rope takes his position.

#6. Chopper now turns slowly while troops rappel. If the gunner engages a tango the chopper stops turning for a while (approx 3 secs)--chopper wont turn while gunner is firing.

#7:Gunner is seperated form chopper in script so while pilot is "careless" (so he dont fly away) on a hot LZ the gunner is "combat"

#8: chopper remains at LZ for a while after troops have landed to continue aircover as they do their sweep. Then continues on its waypoints.

#9: I have added the option of smoke. If map maker wants it theyll drop smoke before they rappel.  ;D

#10: I noticed in a HOT LZ the AI would hit the dirt and all would pile up in prone position at bottom of rope--this is now solved



#NOTE IMPORTANT
I have scripted an alternative method of keeping player and AI alive (its not using setdammage cause this is no good in MP)___ It is untested so I will be asking any and all to run the script AT LEAST 15 times and report any casualties ASAP. Make sure when u do these tests u dont have any tangos around lol --this may make it hard to see if they  died in fall or were shot. ;)

Also I have lowered the height of the chopper to the lowest before itll hit a tree 21M. Ant lower that 21 M and itll risk hitting trees. Why? NZ Army says most of the time they rappel from a height no more that 5-7M cause the longer your in the air more chance of being shot.


Now if we could figure a way for script to understand if its over trees, buildings, or flat land then it would be GREAT!!

The script is now executed like this for one group in a chopper with smoke:

["initialise", [groupname], choppername, 1] exec "rappel.sqs"

The script is now executed like this for one group in a chopper with out smoke:

["initialise", [groupname], choppername, 0] exec "rappel.sqs"

The script is now executed like this for multiple groups in a chopper with smoke:

["initialise", [groupname, group2name,group3name], choppername, 1] exec "rappel.sqs"

The script is now executed like this for multiple groups in a chopper with out smoke:

["initialise", [groupname, group2name,group3name], choppername, 0] exec "rappel.sqs"


PLZ download and test the new test map New Rappel V6

Code: [Select]
;*******************************************************************************************
; rappel v6.sqs                                                                            *
; Original:                                                                                *
; By Zayfod. Strongly influenced and built on top of oneRapple.sqs By Xcess and Gastovski  *
; modified by AliMag and then again by Zayfod =) thanks AliMag!!. - 03/2003                *                                                             ;                                                                                          *                                                                        
;*******************************************************************************************


;goto appropriate part of script
   goto (_this select 0)

#initialise
   _groups = _this select 1
   _helo = _this select 2
   _smokeon_off = _this select 3

#check_smoke
   ? (_smokeon_off == 1):   _smoker = true
   ? (_smokeon_off == 0):   _smoker = false

#isolate_helo_gunner
   _helocrew = crew _helo
   _pilot = _helocrew select 0
   _gunner = _helocrew select 1
   [_gunner] join grpnull
   _gunners = []
   _gunners = _gunners + [_gunner]
   _helogunner = _gunners select 0

#local_variables
   _k = 0.5
   _helo_ammo = _helo ammo "Browning"

#groups_to_rappel
   _aunits = []
   "_aunits = _aunits + (units _x)" forEach _groups
   _i = 0
   _j = count _aunits

#rope_setup
   ? (count rappelRope) == 2 : goto "stop"
   rappelRope = [["rappel.sqs", "rope.sqs"], []]

#stop
   _helobehaviour = behaviour _helo
   _helo setbehaviour "careless"
   _helogunner setbehaviour "combat"
   _helogunner setcombatmode "red"
   _helogunner disableai "autotarget"
   _helo flyinheight 21
   dostop _helo

#chopheight
   _height = getpos _helo select 2
   ? _height < 22 : goto "rope"
   ~0.1
   goto "chopheight"

#rope
   rappelRope set [1, (rappelRope select 1) + [_helo]]
   _helo exec "rope.sqs"

#speed_check
   _xvel = velocity _helo select 0
   _yvel = velocity _helo select 1
   _zvel = velocity _helo select 2
   ?_xvel > 0.2 : _helo setvelocity [_xvel - 0.1,_yvel,_zvel]
   ?_yvel > 0.2 : _helo setvelocity [_xvel,_yvel - 0.1,_zvel]
   ?_xvel < -0.2 : _helo setvelocity [_xvel + 0.1,_yvel,_zvel]
   ?_yvel < -0.2 : _helo setvelocity [_xvel,_yvel + 0.1,_zvel]
   ? _xvel > -0.2 and _xvel < 0.2 and _yvel > -0.2 and _yvel < 0.2 : goto "start"
   ~0.01
   goto "speed_check"

#Start
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = getpos _helo select 2
   ? (_smoker):_smokedrop = "smokeshellred" createvehicle [_posx, _posy, _posz]
   _count = 0

#dropping
   _rappeler = (_aunits select _i)
   ? not (alive _rappeler): _I = _I + 1; goto "check_j"
   _rappeler action ["getout",_helo]
   unAssignVehicle _rappeler
   ["rappel",[],_helo,_rappeler] exec "rappel.sqs"
   _chopdir = getdir _helo


#drop_wait
   ?not (alive _helo): goto "next"
   _count = _count +1
   ?_count > 300: _helo_ammo = _helo ammo "Browning"; _k = 0.5; _count = 0
   _helo setdir _chopdir
   _chopdir = _chopdir + _k
   ? (_helo ammo "Browning") < _helo_ammo: _k = 0
   _rappeler_height = getpos _rappeler select 2
   ? _rappeler_height < 10 or not (alive _rappeler): goto "next_rappeler"
   ? not (alive _rope_holder): _rope_holder = _rappeler
   ~0.01
   goto "drop_wait"

#next_rappeler
   ?_I == 0: _rope_holder = _rappeler
   dostop _rope_holder
   _rope_holder setunitpos "down"
   _I = _I + 1

#check_j
   ? _j > _i : goto"dropping"
   ~1
   ? _i == _j : goto"helo_wait"

#helo_wait
   _rappeler_height = getpos _rappeler select 2
   ? _rappeler_height <= 0.5 or not (alive _rappeler): goto "helo_cover"
   ~0.1
   goto "helo_wait"

#helo_cover
   _chopdir = getdir _helo
   _count = 0
   _count2 = 0

#helo_cover_check
   ?not (alive _helo) or not (alive _pilot): goto "next"
   _count = _count +1
   _count2 = _count2 +1
   ?_count > 300: _helo_ammo = _helo ammo "Browning"; _k = 0.5; _count = 0
   ?_count2 > 1000: goto "next"
   _helo setdir _chopdir
 Â Â Â _chopdir = _chopdir + _k
   ? (_helo ammo "Browning") < _helo_ammo: _k = 0
   ~0.01
   goto "helo_cover_check"

#next
   _helo domove (getpos _helo)
   _helo flyinheight 100
   ~3
   rappelRope set [1, (rappelRope select 1) - [_helo]]
   _helo setbehaviour _helobehaviour
   _rope_holder domove (getpos _rope_holder)
   _rope_holder setunitpos "auto"
   exit

#rappel
   _helo = _this select 2
   _man = _this select 3
   _weapon = primaryweapon _man
   _chopdir = getdir _helo
   _mendir = _chopdir + 90
   _posrandomdir = (random 3) + 2
   _negrandomdir = 0 - ((random 3) + 2)
   _neg_and_pos_array = [_posrandomdir, _negrandomdir]
   _random = random (count _neg_and_pos_array)
   _random = _random - _random % 1
   _randomdir = _neg_and_pos_array select _random
   _man setdir _mendir
   _behave = behaviour _man
   _man setbehaviour"AWARE"
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = getpos _helo select 2
   _drop = (random 0.2) + 0.3
   _posz = _posz - 1
   _man setpos[_posx, _posy, _posz]
   _changedir = _mendir
   _dropcheck = 0.01

#loop
   _man moveincargo _helo
   _man action["getout",_helo]
   unassignvehicle _man
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - (0 + _dropcheck)
   _dropcheck = _dropcheck + 0.02
   ?_dropcheck >= _drop: _dropcheck = _drop
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   _man switchmove "fxfromtable"
   ?not (alive _man):goto "dead_loop"
   ~ 0.001
   ? _posz > 5 : goto "loop"

#loop2
   _man moveincargo _helo
   _man action["getout",_helo]
   unassignvehicle _man
   _man switchmove "fxfromtable"
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - _drop
   _drop = _drop - 0.01
   ?_drop <= 0.2: _drop = 0.21
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ?not (alive _man):goto "dead_loop2"
   ~ 0.001
   ? _posz > 0.2 : goto "loop2"

#clear
   _mendir = getdir _man
   _man moveincargo _helo
   _man action["getout",_helo]
   unassignvehicle _man
   _man switchmove "combattocrouch"
   _man setdir _mendir
   _man setpos [_posx,_posy,0]
   _man Setbehaviour "aware"
   _man playmove "combatrunf"
   exit

#dead_loop
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - (0 + _dropcheck)
   _dropcheck = _dropcheck + 0.02
   _man switchmove "fxfromtable"
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ~ 0.001
   ? _posz > 0.5 : goto "dead_loop"
   _man removeweapon _weapon
   _man switchmove "crouch"
   ~1
   _man addweapon _weapon
   exit

#dead_loop2
   _man switchmove "fxfromtable"
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - _drop
   _drop = _drop + 0.02
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ~ 0.001
   ? _posz > 0.5 : goto "dead_loop2"
   _man removeweapon _weapon
   _man switchmove "crouch"
   ~1
   _man addweapon _weapon
   exit







Zay out.  :wave:
Title: Re:Newly Revised Rapple script
Post by: Ace on 11 Mar 2003, 09:06:16
u could shut them up by recording a blank .ogg file and have them say it as each 1 rappels.

Becasue I believe soldiers won't amke ay other sound when they are talking.
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 11 Mar 2003, 09:19:21
thats a good point Ace and its one I had considered but I didnt want the mapmaker to have to add any .ogg files.

I did try and make the AI say stuff just at the point they were dammaged (which BTW was hard to calculate since descent speed is  random) and they still went "argh" (in V4)  and said the comment also--any way I am hoping this is a null issue.


Anyways
 :thumbsup:
I  its solved in V6

Cheers ;D

Zay out
Title: Re:Newly Revised Rapple script
Post by: snYpir on 11 Mar 2003, 10:49:26
It looks cool, and i will test it tomorrow. The main issue I have is MP - basically, each client needs to do the switchmove command or else it just looks like the unit is standing all the way down.

Also, in the old version, if the player was a client, he would die every rappel. I almost got around this by running the rappel part of the script on the client machines instead of the server (the server simply stops the chopper and creates the rope).

This new version looks promising, and I will report back tomorrow. Thanks!
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 11 Mar 2003, 11:02:16
Most excellent--I have no way of testing MP without a major pain in the arse.  ;D

Zay out
Title: MP results
Post by: snYpir on 13 Mar 2003, 21:48:03
Ok, I tested your script on a dedicated server with two clients. Both clients were in the same group, in the chopper.

In SP, everything worked perfectly, with the correct seperation between rappellers.

However, in MP, there were problems. Although neither player died, there was no seperation between the units as they dropped and no switchmoves.

I think the chopper is 'local' to the dedicated server, and the actual units (and maybe groups) are 'local' to the clients.

This means that the server can't reliably do the setpos or switchmove to the clients, causing the complete screw up of the script in MP.

How to fix this? Serious coding. Here is how the script will have to work:



I don't know if this will work, I ran out of time to test it yesterday. I'll have another go at it this morning and get back to you. :P
Title: Re:Newly Revised Rapple script
Post by: Dinger on 13 Mar 2003, 22:40:33
zayfod -- mp testing is easy:
You can run several instances of OFP on the same machine and alt-tab between them. You'll get a "FADE" warning, but it'll work fine.

As for the problem here:
I'm pretty sure that vehicles are local to the client to whom the driver is local.  Groups are local to the client to whom the leader is the player.
I think that's how it works.

A few other things:
server can't just say "Go", it has to say which helo to go.  and the order to start rappelling should be accessible from all clients.
I'd do it with something like:
ZayRappGo = MyHelo
PublicVariable "ZayRappGo"
then have a monitor script that looks for a change in ZayRappGo.  When there is a change, it goes to that unit:
_helo = ZayRappGo
_crew = crew _helo
_pax = (_Crew - [driver _helo]) - [gunner _helo]
~2
;that allows for synching between clients

Then each script counts off the wait time for each passenger, and checks if the passenger is local to the machine. if it is, it sends it out.

separation will never be glorious, but you might get it looking "ok"
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 14 Mar 2003, 01:06:56

***snYpir***
Thanks for the report snYpir  :) look forward to your further results.  Does this mean we need 2 versions of the script? One for server and one for client?


***dinger***
Thanks for awesome feed back dinger :) tho its a lil over my head.

Well when it comes to this kinda stuff both u guys are light years ahead of me --MP syncing and clients talking to servers b4 then can exec a script is all "Greek" to me at this stage of the game. Im a learner.

I am just flattered and happy that both u guys have shown such an interest in the script. I REALLY want to solve the MP issue. It must be possible with out any of us having a stroke  ;D

Dinger i almost understand what u said.

I tried to run 2 instances Res on my puter but got the error:

Cannot memory-map file 'RES\addons\o.pbo'

I guess my puter aint got enuff grunt.



Like I said these MP issues are best left to the experts but.............. perhaps there would be a use for the global event handlers  "Getin" and "Getout" here? Just a thought.


One other thing  ;D

U may think Im nuts (and u may be right)
but Ive added YUP U GUESSED it "cough" more to the rappel script.

Ill post this as version 7 but not till I hear your MP outcome.

what Ive added:

#1. if pilot gets killed but chopper remains intact then I give the gunner 3 seconds to scramble for the controls and pull the chopper up from its death dive to save the rappelling guys--(note all the rappellers that are still in chopper halt their rappeling while this happens--probably busy sh*tting their pants  anyways )

once the gunner (now pilot) has regained control they continue to rappel. This espesh usefull in black hawks cause I noticed the pilot can get killed quite often but chopper still operational. It makes for quite a dramatic display. The gunner becomes a hero .

If this happens while a rappeller is half way down he contiues his descent and will survive.

#2 If pilot and gunner are dead  and chopper still operational it used to be that all would rappel out together and this would cause big frame rate drop. Ive solved this so all the guys assumme the position (head between legs to kiss your arse goodbye) then once chopper has crashed and if they still alive they leap out one at a time --into the fray. quite quickly. -- they dont all sit there expecting to rappel from zero feet. lol

Zay out




Zay out.

Title: Re:Newly Revised Rapple script
Post by: snYpir on 14 Mar 2003, 05:50:00
Not suprisingly Dinger is correct. Clients are local to their own computer, as well as other members of their group.

In this instance, you have a chopper (local to the server - AI driven), with occupants that are (in many instances) not local to the server - ie players on other computers.

In V6 you move the unit in and out of the chopper to keep him alive - this works in SP because it happens instantaneously. In MP, however, the chopper is on a different computer - the move back into the chopper goes all the way back to the server, and it therefore does not happen instantaneously.

The good new is, however, that in OFP there is a workaround for everything.

You are going to need more scripts, however. I recommend the following:



So, the server is running, right? When a rappel has to be done, this is what happens:

1. Rappel_monitor.sqs starts on all clients.

2. Rappel.sqs starts on server, and sets up the chopper (rappel.sqs should only ever start on the server)

3. Before sending each unit out, the server checks to see if the unit about to rappel is local. If it is local, the server takes over and runs the rappel as normal. If it is not local, it must be on a clients machine, so a public variable is sent equaling the unit that needs to rappel.

4. Rappel_monitor detects the public variable on the client, and starts rappel_client.sqs. Rappel_client rappels the client unit to the ground, and when it is near the ground, it informs the server via another public variable.

Now the rappel script relies on having a local chopper to move in and out of to prevent death, yeah? Because we can't use the chopper on the server (in rappel_client.sqs) we need to create a dummy chopper on the client to use instead.

I'll attach the MP compatible version after i run a few more tests, probaly in about an hour or so. ;D
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 14 Mar 2003, 06:16:50



 :o "Holy crappoler --Lord of the rings --time fer a toilet drink--whats that smell i hear?!!!"  :o



Thats complicated-- ???

SnYpir--our cyber bodies lay in your hands ;D

Zay out
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 14 Mar 2003, 06:30:52
Does it have to be a chopper?....maybe it could be a jeep?

Will this be a createvehicle job then instant delete?

if it is will map makers have to have a copy of the vehicle already in the map somewhere to save lag on the texture load? --

Actually if the map maker put the jeep or truck miles away hidden then you wouldnt even need to create it then delete would you? And it would be local--yes?

It would just sit there hidden


Zayfod "twiddles thumbs and waits"

 :o
Title: Re:Newly Revised Rapple script
Post by: snYpir on 14 Mar 2003, 07:03:24
Right, attached is the working, tested MP compatible version.

BUT - The switchmoves will only be seen on the computers where the rappelling units are local.

Timing for the rappel is pretty much perfect - in fact i am fairly happy with the results.

I think it would be relatively easy to write another script that simply changes the switchmoves for each unit on all machines, but i have run out of time right now - i will do it either tonight or tomorrow.

Zay - please hit me up with any questions as to how the MP version works - you'll see the core code has not been changed, it's just that I have executed certain parts of it on certain machines.

To summarise,

rappel.sqs is run as per normal on the server, whenever a rappel needs to happen.

rappel_monitor.sqs is run at the start of the mission on ALL machines.

no probs?
Title: Re:Newly Revised Rapple script
Post by: snYpir on 14 Mar 2003, 07:09:11
Oh yeah - you need a gamelogic named Server in the mission as well.

I tested one chopper with two groups inside, each group led by a different client. I did not test a rappel with no clients (ie only server-side units in the chopper), but i assume that would work because it would be the same as an SP rappel.

Remember - you won't see switchmoves if you are on a client machine, and another machine is controlling the descent. (not until i write another script, anyway)
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 14 Mar 2003, 09:12:43
Great work snYper  ;)

But hmmm cant seem to get it to work in editor (ie single player)

OK I did following:


#1.I made a copy of my previous V6 map and called it New MP rappel

#2 placed all 4 new scripts in missions folder
new-rappel
new-rappel_monitor
new-rappel_client
new-rope

#3.placed a Game logic on map and named it server

#4. made an init.sqs file put it in mission folder. In the Init I put this:

[] exec "rappel_monitor.sqs"

#5. I left the activation lines in the waypoints as they were--no change

*******Issue: I get error that says*********

'rappel_thisunit_done == _rappeler |#|': Error Generic error in expression

or it says


'rappel_thisunit_done == _rappeler |||#| !(alive _rappeler)': Error Generic error in expression
 ???

Um I may be the first to ask this but may I have a test map for my own script? lol  :-[  "im embarrased"

Zay out
Title: Re:Newly Revised Rapple script
Post by: snYpir on 14 Mar 2003, 09:53:25
LOL! oops, my fault for not giving you all of the information - the second parameter is now a list of all units to rappel, not the groups to rappel. you'll see i modified that a bit in rappel.sqs. i meant to change it back, but i forgot.

attached is an example mission that would work in MP - check the init.sqs file for how i set up the array of units to rappel. it can either be your original way or the way it is in this mission, it doesn't make any difference to MP compatability.

any questions?

 ::)
Title: Re:Newly Revised Rapple script
Post by: snYpir on 14 Mar 2003, 09:55:40
mate, if you like, post v7 here and i'll do the MP conversion for you - either way i have to do it for use with the support pack. now that i know how, converting the script to work in MP takes about 5 mins. 8)

oh yeah - i forgot to change the rope object in rope.sqs as well :-\ it should be "GASRope" or whatever it was before i changed it to the renamed rope in the support pack :-[
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 14 Mar 2003, 11:38:19
 ;D ;D ;D
got it to work,yup yup
I was missing that init line.

SnYpir your da best.

BUT couple ques"

#1: Y remove the smoke option? Just for your script setup? If I implement the smoke option will it stuff up your compilation script addon?

#2: I noticed this in the rappel_client.sqs

Code: [Select]
#loop
   _man moveincargo _dummyhelo
   _man action["getout",_dummyhelo]
   unassignvehicle _man
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - (0 + _dropcheck)
   _dropcheck = _dropcheck + 0.02
   ?_dropcheck >= _drop: _dropcheck = _drop
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   _man switchmove "fxfromtable"
   ?not (alive _man):goto "dead_loop"
   ~ 0.001
   ? _posz > 5 : goto "loop"


   ; signal to the server to start the next man's rappel
   rappel_thisunit_done = _man; publicvariable "rappel_thisunit_done"

now does this mean in a MP situation that the global variable "rappel_thisunit_done" is only declared after the rappeler is below 5 m?

I cant test this cause im using single player. in which case it relies on the rappel.sqs

Code: [Select]
#drop_wait
   ?not (alive _helo): goto "next"
   _count = _count +1
   ?_count > 300: _helo_ammo = _helo ammo "Browning"; _k = 0.5; _count = 0
   _helo setdir _chopdir
   _chopdir = _chopdir + _k
   ? (_helo ammo "Browning") < _helo_ammo: _k = 0
   _rappeler_height = getpos _rappeler select 2
   ? _rappeler_height < 10 or not (alive _rappeler): goto "next_rappeler"
   ? not (alive _rope_holder): _rope_holder = _rappeler
   ~0.01
   goto "drop_wait"



where as youll see the next rappeler is called after previous has reached 10m above ground.

Do I need to put a counter in rappel_client.sqs that check if the rappeler is at 10m above ground? or does it still work right your way. like i said im only using single player and I cant tell.

Zay out

Title: Re:Newly Revised Rapple script
Post by: snYpir on 14 Mar 2003, 12:32:27
#1: Y remove the smoke option? Just for your script setup? If I implement the smoke option will it stuff up your compilation script addon?

Um, its ok to leave the smoke in rappel.sqs (it will work fine because it is being created with createVehicle). There is no need for anything to do with it in rappel_client.sqs.

Quote
now does this mean in a MP situation that the global variable "rappel_thisunit_done" is only declared after the rappeler is below 5 m?

Yeah, it does. You should probaly write a better test so that it happens at 10m like in rappel.sqs (i ran out of time so i just threw it in there)

sweet?
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 14 Mar 2003, 12:50:47
cool  ;D

so
#1: we all know that having the smoke option wont stuff up your compilation script.OK will you give player option to apply smoke in your "single.clik" script? It would be way cool.

#2 RE drop height b4 next rappeller descends: Ill make it so the global variable is declared when rappeller one is at or below 10M (ill add a counter) itll then tell the next one to go and so on and so on--rather than 5 M.

As it was in original

#3. I suggest putting second activation parameter back to groups IE: ([grp1,grp2] in the activation of script) cause then map maker has option to make only one group rappel and leave 2nd group in chopper to perhaps rappel at another location or wotever. I hope this is compatible with your script?

Itll also save em putting this in the init.sqs

Code: [Select]
units_in_chopper = []
"if (_x != driver chopper && _x != gunner chopper) then {units_in_chopper = units_in_chopper + [_x]}"


for each chopper doing the rappel

Ill post new rappel version 7 ASAP.

IMPORTANT. Snyper I was going to offer map maker the opportunity to set the wait period of the choper after rappel is complete. from 0 to wotever. At the mo its set to about 10 secs. this woz to provide air cover while they did their sweep after rappelling.

if I add this as a further parameter do u think it could be included in your script?
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 14 Mar 2003, 14:27:44
AHHHHHH I see
But if we do change the 2nd parameter back to grps well have to alter the rappel_monitor so itll recognise the selected groups  or group that are in "rapple.sqs"

at the moment rappel_monitor is configured to select all units in the choppers regardless of groups and tells em to exec "rappel_client.sqs" hmmmmmm

Is there anyway we can make it so rappel_monitor recognises only the groups selected to perform rappel.sqs-as permy suggested original method? U know the one where u specify which groups in the chopper to perform the rappel?

Or is this simply getting too complicated?

It would be great tho. U could have a MP game where all players are in like 3 groups in the same chopper and are rappeled into like 3 diff spots.
Title: Re:Newly Revised Rapple script
Post by: snYpir on 14 Mar 2003, 17:06:18
Ok, I see where you are coming from. Yeah, this is do-able. Let me get back to the workbench, and i'll come up with something...
Title: Re:Newly Revised Rapple script
Post by: snYpir on 14 Mar 2003, 19:01:54
scrap the last version, this one is better. Now i only use rappel_monitor.sqs. With this version, all computers should see the switchmoves.

I haven't tested it on a proper LAN yet, though (i did the server-client thing Dinger suggested).

This caused some wierd results with regards to locality of units - i will do a proper test later today. Either way, i am fairly sure that this *updated* version is sound.
Title: Re:Newly Revised Rapple script
Post by: Blanco on 15 Mar 2003, 20:24:11
Zay, some guys from Project: Battle Over Hokkaido Mod. (never heard b4) made an animpack and...

http://ofp.gamezone.cz/shots2/JSDFofpinfo2.jpg (http://ofp.gamezone.cz/shots2/JSDFofpinfo2.jpg)

http://ofp.gamezone.cz/shots2/JSDFofpinfo1.jpg (http://ofp.gamezone.cz/shots2/JSDFofpinfo1.jpg)

do I have to tell more?

and euh... a new good rope is included...

The march anim is great too

source : http://ofp.gamezone.cz/ (http://ofp.gamezone.cz/)
Title: Re:Newly Revised Rapple script
Post by: snYpir on 15 Mar 2003, 21:27:29
Awsome! Zay, using that addon, we have a much better rope and rappelling anim. Check out the example mission (you'have to install the addon in the other zip first so you can access the new anim and the new rope).

Your actual rappelling script is much better than theirs, because i think they focussed on rapelling down walls etc whereas yours is from a chopper.

For the support pack, i copied their rope and anim action into my addon (so the anim is called SNYropedown and the rope is SNYRope (I asked the dudes who made it for permission of course).
Title: Re:Newly Revised Rapple script
Post by: Josef on 16 Mar 2003, 00:09:15
You should inclure Barrons Formation script, that way your chaps can cover the rest faster...

I used it, and the leader started running instantly, without forming up, and the others followed... It was great...

I use a custom flank guard formation, for cityfight...
Title: Re:Newly Revised Rapple script
Post by: Terame on 17 Mar 2003, 08:30:21
Hi all,
check out the map. Tell me what you think ;D


EDIT: New rapple script and map is version 6 last thread--testmap available there

This is based on the earlier script made by Xcess and Gastovski. I have not included the rope addon so dont worry about any addons. If u include the addon as per the older script itll look very nice indeed ;D

What I have fixed:

1: only one script now not two

2:doesnt rely on setpos of chopper (this caused issues when the older onerapple.sqs was executed over a sloping hill--many AIs died as a result of this :'(  and the chopper would jerk around at funny angles)

3: the men dont bounce and shoot off at funny angle when they reach 5 metres above ground

4: the men come down the rope in a more rapple looking fassion. This done with switchmove "onchair"--looks quite good.

5.Men actually almost touch the ground before breaking from this pose with out any casualties so far.

6: Doesnt use any global variables , markers, or triggers, or waypoint conditions

7:The guys come down at random speed now, (some guys are better at rappeling than others)

8: They slightly spin left or right at random speeds when descending (as one would)

9:They will absolutely not start descening untill chopper has stopped or slowed enough (using velocity--setvelocity)

10: The chopper will not take off till all men are clear--oh and they will only descend one at a time now and wait till rope is clear--correct me if Im wrong but I think thats procedure?

11:can be used in as many choppers with as many troops as u like ;D


Previous versions of rapple scripts have been suggested to be only useful in cutscenes but I think this may offer considerable tactical advantage now that many of the older limitations are gone.



Code: [Select]
;New Rappel beta v1--By Zayfod. Strongly influenced and built on top of oneRapple.sqs By Xcess and Gastovski
;cheers guys =)

   _grp = _this select 0
   _helo = _this select 1
   _man = leader _grp
   _aunits = units _grp
   _I = 0
   _J = count _aunits

#stop
   _helo flyinheight 30
   commandstop _helo
#chopheight

   _height = getpos _helo select 2
   ? _height < 31: goto "speed_check"
   ~0.1
   goto "chopheight"

#speed_check
   _xvel = velocity _helo select 0
   _yvel = velocity _helo select 1
   _zvel = velocity _helo select 2

   ?_xvel > 2: _helo setvelocity [_xvel - 0.1,_yvel,_zvel]
   ?_yvel > 2: _helo setvelocity [_xvel,_yvel - 0.1,_zvel]
   ?_xvel < -2: _helo setvelocity [_xvel + 0.1,_yvel,_zvel]
   ?_yvel < -2: _helo setvelocity [_xvel,_yvel + 0.1,_zvel]
   ? _xvel > -2 and _xvel < 2 and _yvel > -2 and _yvel < 2 :goto "start"
   ~0.01
goto "speed_check"

#Start
   _man = (_aunits select _I)
   _man action ["getout",_helo]
   unAssignVehicle _man
   goto "rappel"

#check_j
   ?_J>_I : goto"Start"
   ~1
   ?_I==_J : goto"next"
#next
   _helo commandmove (getpos _helo)
   _helo flyinheight 100


hint "end"
exit

#rappel

   _chopdir = getdir _helo
   _mendir = _chopdir + 90
   _posrandomdir = (random 3) + 2
   _negrandomdir = 0 - ((random 3) + 2)
   _neg_and_pos_array = [_posrandomdir, _negrandomdir]
   _random = random (count _neg_and_pos_array)
   _random = _random - _random % 1
   _randomdir = _neg_and_pos_array select _random
   _man setdir _mendir
   _behave = behaviour _man
   _man setbehaviour"AWARE"
   _man switchmove "onchair"
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = getpos _helo select 2
   _drop = (random 0.2) + 0.3
   _posz = _posz - 1
   _man setpos[_posx, _posy, _posz]
   _changedir = _mendir
#loop
   _posx = getpos _helo select 0
   _posy = getpos _helo select 1
   _posz = _posz - _drop
 Â Â Â _man setdir _changedir
   _changedir = _changedir - _randomdir
   _man setpos [_posx, _posy, _posz]
   ~ 0.001
   ? _posz > 2 : goto"loop"
#clear
   _mendir = getdir _man
   _pos = getpos _helo
   _man moveincargo _helo
   unassignvehicle _man
   _man action["getout",_helo]
   _man setdir _mendir
   _man setpos [_posx,_posy,0]
   _man Setbehaviour _behave
   _I = _I + 1; goto "check_j"


Tell me what ya think, any suggestions to make it better?

Zay out




OK how do I use this script (complete scripting newbie here) I'd love to test it for you but no idea where to place the text?

"init"?
"OnActivation"?

Thanks ;D
Title: Re:Newly Revised Rapple script
Post by: Josef on 18 Mar 2003, 11:45:11
You use the new MP one with custom anims...

["initialise",[group leadername],heloname,0] exec "rappel.sqs"

in on activ of waypoint....

or trigger....
Title: Re:Newly Revised Rapple script
Post by: snYpir on 18 Mar 2003, 12:08:24
the new mp one has a bug - clients don't see the switchmoves. i am working on a working MP version ;)
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 18 Mar 2003, 12:45:35
SnYpir,

heres the latest  rappel V7 single player script attached.

Added:

#1. If pilot killed during rappel gunner  has 3 secs to regain control of helo then rappel continues. If dudes are half way down rope the continue on their way.

#2. added 4th parameter to activation line so that map maker can dictate how long the chopper will wait after drop is complete. "0" means he'll take off straight away.
"1"  he should wait around fer a sec or so --"5" hell wait around 5 secs or so etc


Here is an example of a group that will deploy smoke and chopper will wait around after drop is complete for about 10 secs

["initialise",[group leadername],heloname, 1, 10] exec "rappel.sqs"
 ;)

I did try to save u the trouble of converting Version 7 to MP but I thought it best u did it cause I cant test it--espesh with the switchmove issue. ;D

Also--NoW this is really FUCKING me off. The new animation has issues. So Ive left the old animation in just for u to check. ;)

Im afraid their maybe further changes with reagard to the new animation.

Why? OK example :

With the old "fxstandfromtable" if the chopper gets blown up and crashes but doesnt land oin the dudes half way down the rope then they drop and break from the switchmove and continue on their way. but if this happens with the new JDFS switchmove I cant always get em to break from the switchmove.


ARRRRGH Ive tried everything. And I mean everthing I know of so Ill leave it with you to implement the new switchmove. This is an intermittant issue that i cant lock down.

Switchmove "", only works sometimes, also ive noticed I get better results if I dont try to switcmove em outta the animation untill they are bang on ZERO FEET. do it in the air and theyll switchmove "" then shoulder their rifle
 then go BACK to the rope switchmove and look at you floating in the air. DRIVING ME NUTS

I absolutley think this is also the random issue that Dirtman encountered in your spt pack thread also.

Its that fucking switchmove I tell ya.

Zayfod "breathes deep and slow" :o

ahh thats better.


Title: Re:Newly Revised Rapple script
Post by: Zayfod on 18 Mar 2003, 13:15:13
Actually heres the MP versions of rappel.sqs and rappel_monitor.sqs for version 7 that I made.

They may help you so I thought Id include em anyways  ;D

I think the random wait Ive included b4 I switch em outta the animation has helped it alot with regards to the destroyed helo scenario.

Ive altered the #endall  segment in both rappel and rappel_monitor so it now reads


#endall
   ? not ( alive _man): exit
   ~ (random 2) + 2
   @ unitready _man
   _man switchmove ""
   exit


this works better




Zay out
Title: Re:Newly Revised Rapple script
Post by: supergruntsb78 on 19 Mar 2003, 15:07:22
i tried the v7 rappel  and its nice  very very nice  only one prob though   spray.sqs???????  somewhere down the line it says  cant find spray.sqs   now the question is   what the ...... is spray.sqs?
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 20 Mar 2003, 01:48:26
somewhere down the line it says  cant find spray.sqs   now the question is   what the ...... is spray.sqs?


Oooops my fault.

Youve downloaded the single player script from above called (rappel v7) and not (MP_Rappel_v7)


I put up (rappel v7) for snypir to integrate into his SP\MP spt pack and I left a line in it by mistake.  :-[

just open up the rappel.sqs from the rappelv7 zip file and remove this line.

Code: [Select]
_helo addeventhandler ["fired", {[_helogunner select 0, _helo select 0]  exec "spray.sqs"}]


then all should be ok.

Ill or u can just re download the file cause Ill fix it now ;D

BTW the above (rappelv7) zip file doesnt use the cool new animation (did this on purpose just for testing) --the MP version does.

Thanks for you comments too. Glad u like it  ;D

Snypir has done an amazing job of fix all the MP bugs.

Zay out
Title: Re:Newly Revised Rapple script
Post by: Terame on 20 Mar 2003, 02:49:38
Oooops my fault.

Youve downloaded the single player script from above called (rappel v7) and not (MP_Rappel_v7)


I put up (rappel v7) for snypir to integrate into his SP\MP spt pack and I left a line in it by mistake.  :-[

just open up the rappel.sqs from the rappelv7 zip file and remove this line.

Code: [Select]
_helo addeventhandler ["fired", {[_helogunner select 0, _helo select 0]  exec "spray.sqs"}]


then all should be ok.

Ill or u can just re download the file cause Ill fix it now ;D

BTW the above (rappelv7) zip file doesnt use the cool new animation (did this on purpose just for testing) --the MP version does.

Thanks for you comments too. Glad u like it  ;D

Snypir has done an amazing job of fix all the MP bugs.

Zay out

DOH! I am sooo confused now - what is the correct URL for the file please?

thanks in advance
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 20 Mar 2003, 03:16:55
terame :)

this is the latest single player version of the script. It doesnt have a rope and it doesnt use the new animation. i posted this only for snypir to study and turn it into a MP version with rope and new animation.


http://www.ofpec.com/yabbse/attachments/Rappel_v7.zip



This is my attempt to make the new rappel version into MP version. It is ONLY scripts and doesnt include a test map. It requires the JSDFcustomanim.pbo addon (not included in the zip) I posted this to try and help snypir solve the MP switchmove issue because snypir has reported that the latest MP rappel version 6  has a bug related to the switchmove being seen on all clients.

http://www.ofpec.com/yabbse/attachments/MP_rappel_V7.zip

Pls stand by for update. You are welcome to test these if you like but they are not proven and were posted mainly for snypir to look at.

cheers

Zay out

Title: Re:Newly Revised Rapple script
Post by: supergruntsb78 on 20 Mar 2003, 14:59:05
i changed the file already with the new animations and it works like a charm  ;D

(i havn't got the support pack going like i want to this script works very for me  :-\ :-\ :-\ (until i figured the sup pack out ) )

as again  like love this rappel script (sup pack is a master piece but i explained why its not used yet) ;D

greetings supergrunt
Title: Re:Newly Revised Rapple script
Post by: supergruntsb78 on 20 Mar 2003, 17:13:49
it looked like it went well  but now the chopper waits forever to fly off (it does not fly off)  ( go you ugly chopper guy you are giving away my postion  >:( )

Title: Re:Newly Revised Rapple script
Post by: Zayfod on 20 Mar 2003, 21:48:52
supergruntsb78

try making the fourth parameter in the execution line smaller. In below example the fourth parameter is 10.




Code: [Select]
["initialise",[group leadername],heloname, 1, 10] exec "rappel.sqs"



try making it 2 or 1 or 0 like this


Code: [Select]
["initialise",[group leadername],heloname, 1, 2] exec "rappel.sqs"

this will decrease the time the chopper waits after drop is complete.



Im gonna be away for a few days but will try to check in from remote computer. I wont be able to test any thing but Ill try and keep u guys updated.


Zay out



Title: Re:Newly Revised Rapple script
Post by: supergruntsb78 on 21 Mar 2003, 00:28:43
have fun on your few days out  ;)

and thanks will try the setting right now
Title: Re:Newly Revised Rapple script
Post by: Joe_1911 on 22 Mar 2003, 04:24:29
Hmmm...

I am having slight trouble with this script too....

The rope goes down, 1 guy goes down the rope, then the chopper sits there until its time is up then it flys away with AI still in the chopper....

this is in MP btw

I'm rather new to scripting, I have no idea what is causing it....
Title: Re:Newly Revised Rapple script
Post by: bmgarcangel on 22 Mar 2003, 04:42:12
The Script is GREAT!!! :o
I've already used it now in one of my Resistance mission that is going to be in my new campaign and I love it.  Much better than the older ones.   Thanks alot!
Title: Re:Newly Revised Rapple script
Post by: Cpl. Vagabond on 28 Mar 2003, 14:30:36
hey i'm using the MP version but i've got the rappel going on radio commands (for pilots) and action(for all group members) but sometimes i found that i could kill every team member but eerytime i killed the groupleader he would respawn (with just m16 & 30 rounds) can you help me fix this problem and i'm trying to find a rappel that will work with one script command where the passengers/gunner can rappel with an action and make the remove an action once they leave the helicopter and what about the idea of having 2 ropes coming from each side of the chopper and 2 guys going down the ropes, mainly cause it's quicker and i don't want to have 2 guys on the same rope @ the same time.

but the biggest shock came to me when i saw that my friends couldn't repel onto the rooftops because it's would put them around the building instead of ontop of it.
Title: Re:Newly Revised Rapple script
Post by: Cpl. Vagabond on 29 Mar 2003, 08:50:35
OK i've fixed the re-spawn problem and then one where every1 tryed to go down the rope @ the same time.

But can anyone help me  solve the problem with the Rappel onto a roof bit, i'd really like it if i could reppel onto a roof/ship/any object instead of spawning on the floor
Title: Re:Newly Revised Rapple script
Post by: snYpir on 30 Mar 2003, 06:37:01
ok, i am back at it again with the rappel script. the MP methodology i used was wrong, zay :-[

i have worked out a way to do it, and it is in 1.19 of the support pack.

i will now try and make a MP version that uses the new anim and rope, and also is v7.

stopping the chopper at a certain location - you need to use very advanced chopper movement scripts to do this. luckily, i have one of those too.

i'll be back...
Title: Re:Newly Revised Rapple script
Post by: CODY2622 on 30 Mar 2003, 06:45:00
If ya'll make an exapmle mission on the desert island for this script let me know.
Title: Re:Newly Revised Rapple script
Post by: snYpir on 31 Mar 2003, 14:38:20
I have modified Zay's script as promised, and have created the worlds greatest rappeling system i think.

you can now rapple onto the top of buildings, and the chopper will stop within 1m of where it is supposed to.

but... you need the SNYSptPack addon :(

Sorry dudes, but I needed to create a new class to find the surface height of the location where the rappel is to occur.

The prototype example mission is here (http://www.ofpec.com/staff/snYpir/precision_rapple.zip) (SNYSptPack addon included).

Single player only, and still under development! This is an example mission only, and the addon included is not for distribution (it is a BETA, and contains bugs). I will be creating a new MP version tomorrow night, so stay tuned... ;D
Title: Re:Newly Revised Rapple script
Post by: Zayfod on 01 Apr 2003, 06:41:09
Hey all :)

sorry for no updates lately but Ive had so much work to do its taken up all my time and havent been able to work on the scripts.

Snypir--I just wanna thank you for your incredible input towards this script--also everyone else that has given feed back and Blanco for finding the new animation.

This has been one of the many great examples of the OFPEC community at its best.  ;D

Im still very busy with work but Ill check this test map of yours out snypir and get back to you. :thumbsup:

Lastly Snypir:  Im keen to know if you read my thread I posted in your SP\MP support thread about using setvelocity [0,0,0] on the rappeller instead of moveincargo.

It gives exactly the same effect with less code and without the need to cam create another chopper in multiplayer. I think its definately worth investigating. It  may be a better way of doing it.  :)

Lemme know what ya think of the setvelocity idea mate.

The accurate chopper positioning and being able to land on roofs sounds bloody great. Cant wait to try it.

Zay out
Title: Re:Newly Revised Rapple script
Post by: snYpir on 09 Apr 2003, 12:27:26
*bangs head on table*

Zay, I am just about at my wits end. Yeah, I agree with you about the setvelocity idea.

I have just about gone as far as i can go with your scripts. They are fantastic, don't get me wrong, but trying to get rappelling onto boats working is killing me.

I have worked out rappelling onto buildings - that was tough, but rappelling onto boats is kinda like pushing sh*t uphill.

With setvelocity, we wouldn't have to create a new chopper, hell, we might not have to do anything on the clients.

The problem is that now the rappelling scripts require the SNYSptPack.pbo addon. Are you ok with this? I had to make a new invisible grenade to find the surface height of buildings.

Anyway, if you want to make a rappelling system using setvelocity, i'd be happy to test and implement it. ;D

Thoughts?
Title: Re:Newly Revised Rapple script
Post by: Donnervogel on 21 Apr 2003, 19:47:33
Hmm can anybody tell me what method is used to move the untis in the rappel script after they hit the ground? I can't find the method in Zayfords script and I need something similar for a script I am making.
Title: Re:Newly Revised Rapple script
Post by: Donnervogel on 22 Apr 2003, 23:10:05
or maybe to make it clear... how can I make the  human player walk witout having him to do it via keyboard ;)
Title: Re:Newly Revised Rapple script
Post by: Josef on 19 Oct 2003, 14:39:11
I dont know...

I just want to ask, could someone make the rapple script work with variable height?

See, I want to rapell into the jungle...Oh, and how about two ropes like the BAS blackhawk?...