Home   Help Search Login Register  

Author Topic: Everyone out! No!!! NOT YOU, driver!!!  (Read 709 times)

0 Members and 1 Guest are viewing this topic.

RP

  • Guest
Everyone out! No!!! NOT YOU, driver!!!
« on: 03 Mar 2003, 22:28:17 »
Hi guys,

i know this must be a simple script, but i can't find a way to do it right.
I have the player's group assignAsCargo in Boat1, then  the BoatDriver (not in player's group) with a GETIN WP to Boat1, and a TRANSPORTUNLOAD sinchronised with the GETOUT WP of player's group. I want ALL the player's group to get out of the boat, when they arrive to the GETOUT/TRANPORTUNLOAD WPs, without having to order them to, and then the BoatDriver carries on (driving the boat) to its next WP.
I've experimented with several comands like unassignVehicle and leaveVehicle with and without forEach units group player, and whenever i use the leaveVehicle comand, the BoatDriver also disembarks!
None of this is solving my problem, and i'm a litle lost here.
I've made a search and scrolled trough the forums, and couldn't find a solution.
Any help would be apreciated.

RP

Knut Erik

  • Guest
Re:Everyone out! No!!! NOT YOU, driver!!!
« Reply #1 on: 03 Mar 2003, 22:46:39 »
Try to just have a transport unload wp

RP

  • Guest
Re:Everyone out! No!!! NOT YOU, driver!!!
« Reply #2 on: 03 Mar 2003, 23:39:49 »
Uh? ???
Could you please explain further Knut Erik?

RP

  • Guest
Re:Everyone out! No!!! NOT YOU, driver!!!
« Reply #3 on: 04 Mar 2003, 00:09:57 »
What i'm trying to get here is an automated get-out-of-the-boat for the player's group, not just for the group leader (which is the player), if you see what i mean...
I've seen this kind of action included in much more complex scripts (like chopper insertions), and i don't know enough about scripting to take just the part that i want, and make a simple one out of it.
I thought this could (maybe) be achieved with a simple comand in the WP's activation field, and that's why i posted it here, and not in the advanced scripting forums. I just hope i'm in the right place...

Offline Wadmann

  • OFPEC Patron
  • ****
  • I'm the next evolutionary step after a llama!
Re:Everyone out! No!!! NOT YOU, driver!!!
« Reply #4 on: 04 Mar 2003, 01:44:14 »
Have you tried using a trigger (switch?) to "unassign" each/every unit in the boat ? Perhaps this could even be typed into the "On Activation" field of the waypoint but I have not tried. I am new to scripting/editing but I was able to get several groups to mount a truck and then every 100m drop off a group then proceed to the next WP and drop off another group before going to last WP where the driver and remaining troops got off the truck. I am at work right now but when I get home I will reply if you have not gotten this to work and be more specific as to how I was able to get this to work.
Check out my Camouflage Collection! New items added 31 July 2005.

deaddog

  • Guest
Re:Everyone out! No!!! NOT YOU, driver!!!
« Reply #5 on: 04 Mar 2003, 04:01:13 »
I used this script to do exactly what you want (except with a chopper, called h1).  The players group is called g1.  I executed this script in the waypoint before the transport unload waypoint.  In the activation field of that waypoint type "[] exec getouth1.sqs".  

It monitors the player and when he is no longer in the vehicle it ejects every member of his group.  The may not be the best way to do this but it does work.

getouth1.sqs:

;player globalchat "start getouth1.sqs script"
_unitslist = units g1
_j = count _unitslist

_i = 0


#loop1
~1
?(player in h1):goto "loop1"
h1 lockwp true
~2
#loop2
_unit = (_unitslist select _i)
_unit action["EJECT",h1]
unassignvehicle _unit
_unit doFollow player
_i=_i+1
~1.3
?_j>_i:goto "loop2"

h1 lockwp false
;player globalchat "end getouth1.sqs script"
exit


You can change h1 to the name of your boat and g1 to the name of your players group.  If you haven't named your players group then replace:

_unitslist = units g1

with

_unitslist = units (group player)

Hope this helps.  

RP

  • Guest
Re:Everyone out! No!!! NOT YOU, driver!!!
« Reply #6 on: 04 Mar 2003, 06:34:44 »
Thanks for the reply guys. I'm gonna trie using that script deaddog, looks like what i needed, with the lockwp command as a bonus. ;D
I will let you know if it solved my problem.
Well, back to the editor. See ya latter.

RP

  • Guest
Re:Everyone out! No!!! NOT YOU, driver!!!
« Reply #7 on: 04 Mar 2003, 07:19:16 »
It works!!! Very cool piece of script you got there deaddog! I just changed the names and removed the globalchat thingie, and they jump out of the boat real pretty! ;D ;D ;D
Thanks a lot guys, and thanks for sharing that piece of code deaddog.
Cheers,  :cheers:

RP

Offline Sui

  • Former Staff
  • ****
    • OFPEC
Re:Everyone out! No!!! NOT YOU, driver!!!
« Reply #8 on: 04 Mar 2003, 07:52:40 »
Try to just have a transport unload wp

He meant that all you need is a TRANSPORT UNLOAD waypoint for the boat.
Get rid of the GET OUT waypoint, and you shouldn't need a script ;)

Knut Erik

  • Guest
Re:Everyone out! No!!! NOT YOU, driver!!!
« Reply #9 on: 04 Mar 2003, 10:55:27 »
Yes! That was what i ment. Sorry for not posting further info, but I live in norway, so i whent to sleep before i saw the replays.
Btw I've just gotten out of my bed  ;D

RP

  • Guest
Re:Everyone out! No!!! NOT YOU, driver!!!
« Reply #10 on: 04 Mar 2003, 13:01:20 »
Well guys, i just deleted the GET OUT wp, and it worked just like you said, but everybody in my group died in the water, (including me) because the boat driver didn't wait.
I guess it will work fine on land, and that's one more thing that i've learned from you today. ;)
I just want to thank you all for your generous replies, before closing this case.
With the invaluable help we can get from this forums, maybe one of these days i can come up with a half decent mission worth posting. ;D

Cheers, RP.

RP

  • Guest
Re:Everyone out! No!!! NOT YOU, driver!!!
« Reply #11 on: 04 Mar 2003, 18:31:12 »
It's me again , just to clear up a few things...
I've seen this kind of action included in much more complex scripts (like chopper insertions), and i don't know enough about scripting to take just the part that i want, and make a simple one out of it.
It's not like i'm using other people's code, and saying that i did it. I guess copyright laws don't aply here, but i belive that people who take the time and effort to make this scripts (or any other intelectual creation for that matter), and share it with the community, should at least be respected and credited for it. Which brings me to...
Hey maddog, did you made this script? I would like to give credits to the author, if my mission is going to go public someday...