Home   Help Search Login Register  

Author Topic: Newly Revised Rapple script  (Read 13989 times)

0 Members and 1 Guest are viewing this topic.

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:Newly Revised Rapple script
« Reply #30 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
« Last Edit: 14 Mar 2003, 09:31:27 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Newly Revised Rapple script
« Reply #31 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?

 ::)
Bohemia Interactive Simulations

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Newly Revised Rapple script
« Reply #32 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 :-[
« Last Edit: 14 Mar 2003, 10:03:20 by snYpir »
Bohemia Interactive Simulations

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:Newly Revised Rapple script
« Reply #33 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

« Last Edit: 14 Mar 2003, 11:39:38 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Newly Revised Rapple script
« Reply #34 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?
Bohemia Interactive Simulations

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:Newly Revised Rapple script
« Reply #35 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?
« Last Edit: 14 Mar 2003, 12:52:33 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline Zayfod

  • ECP Team
  • *
  • Llama, softest natural fibre in the world.
Re:Newly Revised Rapple script
« Reply #36 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.
« Last Edit: 14 Mar 2003, 14:30:45 by Zayfod »
"I have come here to kick ass and chew bubble gum......an I'm all outta bubble gum!"

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Newly Revised Rapple script
« Reply #37 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...
Bohemia Interactive Simulations

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Newly Revised Rapple script
« Reply #38 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.
Bohemia Interactive Simulations

Offline Blanco

  • Former Staff
  • ****
Re:Newly Revised Rapple script
« Reply #39 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/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/
« Last Edit: 15 Mar 2003, 20:52:08 by Blanco »
Search or search or search before you ask.

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Newly Revised Rapple script
« Reply #40 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).
Bohemia Interactive Simulations

Josef

  • Guest
Re:Newly Revised Rapple script
« Reply #41 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...

Offline Terame

  • Members
  • *
  • Nice one OFPEC
    • http://fantasyscifi.com/main/ fantasy scifi sci-fi
Re:Newly Revised Rapple script
« Reply #42 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
You can travel to infinity though the endless passages of the cosmos. Even
better this belongs to you. This is your mind

Josef

  • Guest
Re:Newly Revised Rapple script
« Reply #43 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....

Offline snYpir

  • BIS Team
  • ****
  • OFPEC Jedi Master
    • OFPEC
Re:Newly Revised Rapple script
« Reply #44 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 ;)
Bohemia Interactive Simulations