Home   Help Search Login Register  

Author Topic: Forcing Units to get out and stay out  (Read 3418 times)

0 Members and 1 Guest are viewing this topic.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Forcing Units to get out and stay out
« on: 05 Jul 2005, 23:56:00 »
ok... ive searched, and got nothing (i swear) and its just a simple question... I want to be able to force the driver, gunner and any cargo to get out of a vehicle and unassign themselves from that vehicle (so AI wont get back in)...

now, making the driver and gunner get out is easy:

Code: [Select]
unassignvehicle (gunner _vehicle)
(gunner _vehicle) action ["EJECT"]
unassignvehicle (driver _vehicle)
(driver _vehicle) action ["EJECT"]

but how would i go about removing the cargo when it could in theory be anyone on the map, not just a named group (where i could then use a simple eject script)
Proud Member of the Volunteer Commando Battalion

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #1 on: 06 Jul 2005, 00:08:46 »
hmmm... tested my code to get the gunner and driver to get out... they get out, but the AI just get back in again... even with the unassign bit...

i guess just one big script to encorporate anything in the vehicle would be better... but how do we stop thegit getting back in, even when i've unassigned them  >:(
Proud Member of the Volunteer Commando Battalion

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Forcing Units to get out and stay out
« Reply #2 on: 06 Jul 2005, 00:12:42 »
See the unassignvehicle under Command References and read Thobson memo underneath.
That should point ya in the right direction. ;)
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #3 on: 06 Jul 2005, 00:25:54 »
ok, got that much, but how about the troops in cargo... since they have no names i'd need to be able to find out who's in cargo and kick them out...
Proud Member of the Volunteer Commando Battalion

Offline sharkyjoe

  • Members
  • *
  • Have you taken a BMP out at 500 meters??
Re:Forcing Units to get out and stay out
« Reply #4 on: 06 Jul 2005, 00:58:36 »
Well, from my mission making which is limited, you may want to name each group and/or man. Sounds like a bunch of trouble to this but in the long run it will help. It has helped me, once i started to name men,goups, triggers, waypoints.

A thought just occured, maybe dowlaod snYpir's sp/mp pack and open it up. He has a lot of stuff that can be customized to your mission. Looks like he names things with variables too. That(pack) is found in the Editors Depot under Mod Editing-sp/mp.
« Last Edit: 06 Jul 2005, 01:05:55 by sharkyjoe »
Remember the 7 Ps??--- Proper Previous Planning Prevents Pathetically Poor Performance

Offline ezol

  • Members
  • *
  • blah
Re:Forcing Units to get out and stay out
« Reply #5 on: 06 Jul 2005, 01:23:01 »
A silly of doing it would be to get a pointer to every unit on the map and UnAssign them from the vehicle.  
I don't think it would cause any crashes but it's just nasty scripting and would take alot longer.  

Naming groups when there's alot is dull but it seems to be the only plausible way.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Forcing Units to get out and stay out
« Reply #6 on: 06 Jul 2005, 03:48:56 »
a simple loop grabs them other guys

Code: [Select]
_vehicle = _this select 0
_cargo = (crew _vehicle) - [(driver _vehicle), (gunner _vehicle)]
_i = 0
?(count +_cargo) = 0:exit

#loop
_man = _cargo select _i
unassignvehicle _man
_man action ["EJECT"]
_i = _i + 1
?_i >= (count _cargo):exit
goto "loop"

fairly simple anyway...


EDIT: to keep them out, i think i remember something about giving them a new group or something. like they're staying in the vehicles group, so they go back to it. not sure though
« Last Edit: 06 Jul 2005, 03:51:15 by Triggerhappy »

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re:Forcing Units to get out and stay out
« Reply #7 on: 06 Jul 2005, 07:20:09 »
as a standby, you could also get the position and direction of the vehicle in question, and once the loons are all out, delete it, and then instantly create a new one of the same type in the same position facing the same direction.

saves you having to assign them to a new group perhaps.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Forcing Units to get out and stay out
« Reply #8 on: 06 Jul 2005, 07:59:12 »
Quote
but how about the troops in cargo
The command crew will give you everyone in the vehicle even those that are in cargo. So:

Code: [Select]
_occupants = crew vehiclename
{unassignVehicle _x} forEach _occupants
(_occupants) allowGetIn false

Will get everyone out of the vehicle and they should stay out.
« Last Edit: 06 Jul 2005, 08:04:43 by THobson »

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #9 on: 06 Jul 2005, 10:55:12 »
cheers gents... shall go try those suggestions out. I need to keep away from the looping commands, because they all need to be booted out at once due to the nature of the script... plus its being put into an addon, so any kind of looping script is bad for lag  :-\
Proud Member of the Volunteer Commando Battalion

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #10 on: 06 Jul 2005, 10:59:58 »
ok, that works excellently for AI grouped vehicles... but i also need it to kick the AI squad of a  player out too. With the current script they dont get out when the leader is a player...

basically this is a deploy camnet script. When deployed, no1 should be in the vehicle (to prevent a cam netted vehicle driving around, and the weapon being used) hence i'd need all humans kicked out and player lead AI... this is why i was initialy using the eject command as well...

Proud Member of the Volunteer Commando Battalion

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Forcing Units to get out and stay out
« Reply #11 on: 06 Jul 2005, 11:17:31 »
When the leader is the player they are all probably waiting to be ordered out.  Usually an unassignVehicle command would be sufficient for them.  Try also the EJECT action.
« Last Edit: 06 Jul 2005, 14:13:30 by THobson »

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #12 on: 06 Jul 2005, 11:35:38 »
something like this?

{action ["EJECT"]  _x} forEach _occupants
Proud Member of the Volunteer Commando Battalion

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Forcing Units to get out and stay out
« Reply #13 on: 06 Jul 2005, 13:02:29 »
From comref:

Quote
unit action action

Operand types:
unit: Object
action: Array
Type of returned value:
Nothing
Description:
Make unit to peform action. Format of action may be [type, target, param1, param2, param3]. Only type is required, target defaults to unit, param1, param2, param3 are type specific.

Example:
soldierOne action ["eject", vehicle soldierOne]



So it would be:
{_x action ["eject", vehicle _x]} forEach _occupants

Not tested.
« Last Edit: 06 Jul 2005, 13:03:00 by THobson »

bdfy1

  • Guest
Re:Forcing Units to get out and stay out
« Reply #14 on: 06 Jul 2005, 13:33:06 »
What are you discussing ? unassign command works nice ( no additional action needed ) , but it's slow - units disambarking one by one. If you want eject them faster just use EJECT function ( can be found in ED )

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #15 on: 06 Jul 2005, 14:59:02 »
works a charm... thanks everyone
Proud Member of the Volunteer Commando Battalion

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #16 on: 06 Jul 2005, 16:00:05 »
lol... nearly worked...

the method works brilliantly on my vehicles EXCEPT the MCar MILAN i'm using. Basically, once my deploy camo net script gets executed, all the occupants of the vehicle get booted out... unfortunatly for MCar vehichles, this means it also boots out the two gamelogics in 'hidden' cargo proxies which are used for guidance.... this then screws up the whole MCar scripting...

Code: [Select]
_occupants = crew _vehicle
{unassignVehicle _x} forEach _occupants
(_occupants) allowGetIn false
{_x action ["eject", _vehicle]} forEach _occupants

this is the ejection part of the script... what i need to code in is someway of removing the last two 'occupants' of the vehicle from the array of ejectee's
Proud Member of the Volunteer Commando Battalion

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Forcing Units to get out and stay out
« Reply #17 on: 06 Jul 2005, 16:26:55 »
If sa8gecko has done things right you have the crew_mcar function (it may be called something else too) at your disposal, designed just for these kinds of situations :)
and this actually reminds me of one thing we have forgot to fix alltogether to be more multiple end-user friendly... ::)


Anyway:
Code: [Select]
_occupants = [_vehicle] call crew_mcar
{unassignVehicle _x} forEach _occupants
(_occupants) allowGetIn false
{_x action ["eject", _vehicle]} forEach _occupants

I hope that helps :)
« Last Edit: 06 Jul 2005, 16:29:32 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:Forcing Units to get out and stay out
« Reply #18 on: 06 Jul 2005, 16:37:18 »
hater i don't see how that would keep the gl's in....

(thank you thobson for reminding me of foreach, sure made me feel dumb ;D :P)

the gls are the last 2 occupants correct?

Code: [Select]
_occupants = (crew _vehicle)
_n = (count _occupants) - 1
_occupants = _occupants - [(_occupants select _n),(_occupants select (_n - 1))]

that will get the last 2 out of the array of people to eject

then just use thobson's ejection code, or yours, they look the same to me (at a glance)

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #19 on: 06 Jul 2005, 16:42:10 »
no no no... lol... i need the last two cargo slots to remain in the vehicle, as these are the MCar proxies... i'll test Hater's coding... i reckon Sa8gecko has done it correctly... seeing as he's done such a sterling job of the MILAN so far  ;D
Proud Member of the Volunteer Commando Battalion

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Forcing Units to get out and stay out
« Reply #20 on: 06 Jul 2005, 16:43:52 »
Can't you do a typeOf or some such to find the GLs in _occupants and remove them?
« Last Edit: 06 Jul 2005, 16:46:24 by THobson »

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #21 on: 06 Jul 2005, 16:46:32 »
that was my first thought... but seeing as MCar had predicted this eventuality, i'll see if their method works  :)
Proud Member of the Volunteer Commando Battalion

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #22 on: 06 Jul 2005, 16:50:55 »
Code: [Select]
_vehicle = _this select 0

_occupants = [_vehicle] call crew_mcar
{unassignVehicle _x} forEach _occupants
(_occupants) allowGetIn false
{_x action ["eject", _vehicle]} forEach _occupants

_vehicle lock true
_vehicle setobjecttexture [23, ""]
_vehicle setobjecttexture [24, ""]
_vehicle setobjecttexture [25, ""]
_vehicle setobjecttexture [26, "\ukf_wmik\lcamnet.pac"]

exit

whereas i didn't get any error messages (which is generally a good sign) none of the crew got out with this coding... is it removing everyone from the array then?

strange...

p.s. I'm still amazed by how helpful you MCar guys are... in 4 years of flashpoint, i've never known another mod/group to helpout someone so much for no real gain to themselves  :D
« Last Edit: 06 Jul 2005, 16:54:25 by Messiah »
Proud Member of the Volunteer Commando Battalion

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Forcing Units to get out and stay out
« Reply #23 on: 06 Jul 2005, 17:02:04 »
Try putting in the line:

hint format["_occupants= %1\nReal Crew = %2",_occupants, crew _vehicle]

and see what you get.
« Last Edit: 06 Jul 2005, 17:02:32 by THobson »

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #24 on: 06 Jul 2005, 17:04:00 »
shall do  :)
Proud Member of the Volunteer Commando Battalion

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #25 on: 06 Jul 2005, 17:08:09 »
the hint is, when placed before the line Hater_Kint added:

Code: [Select]
_occupants = scalar bool array string oxfcffffef Real Crew = [WEST Bravo Black:1, WEST Bravo Black:2, no group, no group
those two no groups are the two empty usable cargo slots... i.e. no mention of the hidden proxies...

placed after the line from Hater_Kint and i get the same Hint.
« Last Edit: 06 Jul 2005, 17:12:34 by Messiah »
Proud Member of the Volunteer Commando Battalion

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Forcing Units to get out and stay out
« Reply #26 on: 06 Jul 2005, 17:11:32 »
You could put something like
hint format ["%1",_occupants]
after the
_occupants = [_vehicle] call crew_mcar


[edit]THobson beat me to it :) [/edit]

It's very possible that sa8 forgot to update/rename the function, or forgot to put it there alltogether...
If so, that hint should give you some odd print out or nothing at all...

Look at the init.sqs of the MCAR stuff and it should be mentioned there, and if it is it still might have the wrong game logic class name there...

For safety the function crew_mcar should be re-named because otherwise it will conflict with some other MCAR vehicles put in the same mission...

If this gets too complicated just say so :)

Quote
I'm still amazed by how helpful you MCar guys are... in 4 years of flashpoint, i've never known another mod/group to helpout someone so much for no real gain to themselves
Thanks..

It was our intention from the get-go to just make this thing available and accessible for everyone who wants it, and with full support :)
« Last Edit: 06 Jul 2005, 17:13:39 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #27 on: 06 Jul 2005, 17:15:35 »

If this gets too complicated just say so :)


lol... MCar has confused me since day one... no offence of course, but my scripting skills are limited to cutscenes and simple things... lol

Code: [Select]
? UKF_Init: goto "go_on"
UKF_Init = true; UKF_sensor = "EmptyDetector" camCreate [0,0,0]; UKF_gamel = "logic" camCreate [0,0,0]

#go_on  

      [_this] exec "\UKF_WMIK\scripts\UKF_repair.sqs"
;      [_this] exec "\UKF_WMIK\scripts\UKF_mags.sqs"

   ? UKF_landR_Init: exit
   UKF_landR_Init = true

      UKF_getLaunch = loadfile "\UKF_WMIK\scripts\UKF_getLaunch.sqf"
      UKF_smokerAT = loadFile "\UKF_WMIK\scripts\UKF_smokerAT.sqf"
      UKF_calcH = loadFile "\UKF_WMIK\scripts\UKF_calcH.sqf"
      UKF_vNorm = loadFile "\UKF_WMIK\scripts\UKF_vNorm.sqf"
      UKF_search2 = loadFile "\UKF_WMIK\scripts\UKF_search2.sqf"
      UKF_subs = loadFile "\UKF_WMIK\scripts\UKF_subs.sqf"
      UKF_dir = loadFile "\UKF_WMIK\scripts\UKF_dir.sqf"
      UKF_flame= loadFile "\UKF_WMIK\scripts\UKF_flame.sqf"
      UKF_noCrewInHumvee = loadFile "\UKF_WMIK\scripts\UKF_noCrewInHumvee.sqf"
      UKF_hShooter = loadFile "\UKF_WMIK\scripts\UKF_hShooter.sqf"
      UKF_xchange = loadfile "\UKF_WMIK\scripts\UKF_xchange.sqf"
      UKF_towSpeed2 = loadfile "\UKF_WMIK\scripts\UKF_towspeed2.sqf"
      UKF_deflection = loadfile "\UKF_WMIK\scripts\UKF_deflection.sqf"
      UKF_distXY = loadfile "\UKF_WMIK\scripts\UKF_distXY.sqf"
      UKF_launchAT = loadfile "\UKF_WMIK\scripts\UKF_launchMissile.sqf"
      UKF_setVtow2 = loadfile "\UKF_WMIK\scripts\UKF_setVtow2.sqf"
      UKF_meters = loadfile "\UKF_WMIK\scripts\UKF_meters.sqf"
      UKF_discriminate = loadfile "\UKF_WMIK\scripts\UKF_discriminate.sqf"
      UKF_realbullet = loadfile "\UKF_WMIK\scripts\UKF_realbullet.sqf"
      UKF_jet = loadfile "\UKF_WMIK\scripts\UKF_jet.sqf"
      UKF_targetPos = loadfile "\UKF_WMIK\scripts\UKF_targetpos.sqf"
      UKF_getmissile = loadfile "\UKF_WMIK\scripts\UKF_getmissile.sqf"
      UKF_setFakePosAT = loadfile "\UKF_WMIK\scripts\UKF_setFakePosAT.sqf"
      exit

; the following code is not executed
   #Hum2AR_HP
      [_this] exec "\psy_mcar_scripts\MCAR_repair.sqs"
      [_this] exec "\psy_mcar_scripts\at\MCAR_mags.sqs"

   ? MCAR_humwee2ar_hpInit: exit
   MCAR_humwee2ar_hpInit = true

      MCAR_getLaunch = loadfile "\psy_mcar_scripts\MCAR_getLaunch.sqf"
      MCAR_smokerAT = loadFile "\psy_mcar_scripts\at\MCAR_smokerAT.sqf"
      MCAR_calcH = loadFile "\psy_mcar_scripts\MCAR_calcH.sqf"
      MCAR_vNorm = loadFile "\psy_mcar_scripts\MCAR_vNorm.sqf"
      MCAR_dir = loadFile "\psy_mcar_scripts\at\MCAR_dir.sqf"
      MCAR_noCrewInHumvee = loadFile "\psy_mcar_scripts\at\MCAR_noCrewInHumvee.sqf"
      MCAR_hShooter = loadFile "\psy_mcar_scripts\MCAR_hShooter.sqf"
      MCAR_targetPos = loadfile "\psy_mcar_scripts\at\MCAR_targetpos.sqf"
      MCAR_setVtow2 = loadfile "\psy_mcar_scripts\at\MCAR_setVtow2.sqf"
      MCAR_towSpeed2 = loadfile "\psy_mcar_scripts\at\MCAR_towspeed2.sqf"
      MCAR_deflection2 = loadfile "\psy_mcar_scripts\at\MCAR_deflection2.sqf"
      MCAR_launchAT2 = loadfile "\psy_mcar_scripts\at\MCAR_launchMissile2.sqf"
      MCAR_meters = loadfile "\psy_mcar_scripts\at\MCAR_meters.sqf"
      MCAR_realbullet = loadfile "\psy_mcar_scripts\at\MCAR_realbullet.sqf"
      MCAR_jet2 = loadfile "\psy_mcar_scripts\at\MCAR_jet2.sqf"
      MCAR_setFakePosAT = loadfile "\psy_mcar_scripts\at\MCAR_setFakePosAT.sqf"
      MCAR_getmissile = loadfile "\psy_mcar_scripts\at\MCAR_getmissile.sqf"
      exit

   #Hum2BR
      [_this] exec "\psy_mcar_scripts\at\MCAR_mags.sqs"
      [_this] exec "\psy_mcar_scripts\MCAR_repair.sqs"

   ? MCAR_humwee2brInit: exit
   MCAR_humwee2brInit = true

      MCAR_getLaunch = loadfile "\psy_mcar_scripts\MCAR_getLaunch.sqf"
      MCAR_smokerAT = loadFile "\psy_mcar_scripts\at\MCAR_smokerAT.sqf"
      MCAR_calcH = loadFile "\psy_mcar_scripts\MCAR_calcH.sqf"
      MCAR_vNorm = loadFile "\psy_mcar_scripts\MCAR_vNorm.sqf"
      MCAR_search2 = loadFile "\psy_mcar_scripts\at\MCAR_search2.sqf"
      MCAR_subs = loadFile "\psy_mcar_scripts\at\MCAR_subs.sqf"
      MCAR_dir = loadFile "\psy_mcar_scripts\at\MCAR_dir.sqf"
      MCAR_stayAfloat= loadFile "\psy_mcar_scripts\at\MCAR_stayAfloat.sqf"
      MCAR_noCrewInHumvee = loadFile "\psy_mcar_scripts\at\MCAR_noCrewInHumvee.sqf"
      MCAR_hShooter = loadFile "\psy_mcar_scripts\MCAR_hShooter.sqf"
      MCAR_xchange = loadfile "\psy_mcar_scripts\at\MCAR_xchange.sqf"
      MCAR_towSpeed2 = loadfile "\psy_mcar_scripts\at\MCAR_towspeed2.sqf"
      MCAR_deflection = loadfile "\psy_mcar_scripts\at\MCAR_deflection.sqf"
      MCAR_distXY = loadfile "\psy_mcar_scripts\at\MCAR_distXY.sqf"
      MCAR_slug = loadfile "\psy_mcar_scripts\at\MCAR_slug.sqf"
      MCAR_realbullet = loadfile "\psy_mcar_scripts\at\MCAR_realbullet.sqf"
      MCAR_launchAT = loadfile "\psy_mcar_scripts\at\MCAR_launchMissile.sqf"
      MCAR_setVtow2 = loadfile "\psy_mcar_scripts\at\MCAR_setVtow2.sqf"
      MCAR_meters = loadfile "\psy_mcar_scripts\at\MCAR_meters.sqf"
      MCAR_discriminate = loadfile "\psy_mcar_scripts\at\MCAR_discriminate.sqf"
            exit

thats the init.sqs - i'm not overly sure what im meant to be looking for... so yeah, this is getting a tad confusing...  :-\

I'm assuming i just need to add a few lines of code into the init.sqs... the mcar game logics for the ukf Milan are called (*scans through the longest config i've ever seen*):

UKF_Logic

i must say, when i implemented the ejection coding, i nearly cried when the MILAN's stopped working... after all of Sa8's hard work, i thought i had gone and broken it  ;D
« Last Edit: 06 Jul 2005, 17:21:08 by Messiah »
Proud Member of the Volunteer Commando Battalion

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Forcing Units to get out and stay out
« Reply #28 on: 06 Jul 2005, 17:25:33 »
Ok, there is no such function defined :)

Anyway, change the init.sqs to this:
Code: [Select]
? UKF_Init: goto "go_on"
UKF_Init = true; UKF_sensor = "EmptyDetector" camCreate [0,0,0]; UKF_gamel = "logic" camCreate [0,0,0]

#go_on  

      [_this] exec "\UKF_WMIK\scripts\UKF_repair.sqs"
;      [_this] exec "\UKF_WMIK\scripts\UKF_mags.sqs"

   ? UKF_landR_Init: exit
   UKF_landR_Init = true

      UKF_getLaunch = loadfile "\UKF_WMIK\scripts\UKF_getLaunch.sqf"
      UKF_smokerAT = loadFile "\UKF_WMIK\scripts\UKF_smokerAT.sqf"
      UKF_calcH = loadFile "\UKF_WMIK\scripts\UKF_calcH.sqf"
      UKF_vNorm = loadFile "\UKF_WMIK\scripts\UKF_vNorm.sqf"
      UKF_search2 = loadFile "\UKF_WMIK\scripts\UKF_search2.sqf"
      UKF_subs = loadFile "\UKF_WMIK\scripts\UKF_subs.sqf"
      UKF_dir = loadFile "\UKF_WMIK\scripts\UKF_dir.sqf"
      UKF_flame= loadFile "\UKF_WMIK\scripts\UKF_flame.sqf"
      UKF_noCrewInHumvee = loadFile "\UKF_WMIK\scripts\UKF_noCrewInHumvee.sqf"
      UKF_hShooter = loadFile "\UKF_WMIK\scripts\UKF_hShooter.sqf"
      UKF_xchange = loadfile "\UKF_WMIK\scripts\UKF_xchange.sqf"
      UKF_towSpeed2 = loadfile "\UKF_WMIK\scripts\UKF_towspeed2.sqf"
      UKF_deflection = loadfile "\UKF_WMIK\scripts\UKF_deflection.sqf"
      UKF_distXY = loadfile "\UKF_WMIK\scripts\UKF_distXY.sqf"
      UKF_launchAT = loadfile "\UKF_WMIK\scripts\UKF_launchMissile.sqf"
      UKF_setVtow2 = loadfile "\UKF_WMIK\scripts\UKF_setVtow2.sqf"
      UKF_meters = loadfile "\UKF_WMIK\scripts\UKF_meters.sqf"
      UKF_discriminate = loadfile "\UKF_WMIK\scripts\UKF_discriminate.sqf"
      UKF_realbullet = loadfile "\UKF_WMIK\scripts\UKF_realbullet.sqf"
      UKF_jet = loadfile "\UKF_WMIK\scripts\UKF_jet.sqf"
      UKF_targetPos = loadfile "\UKF_WMIK\scripts\UKF_targetpos.sqf"
      UKF_getmissile = loadfile "\UKF_WMIK\scripts\UKF_getmissile.sqf"
      UKF_setFakePosAT = loadfile "\UKF_WMIK\scripts\UKF_setFakePosAT.sqf"
      UKF_crew_mcar = loadFile "\UKF_WMIK\scripts\UKF_crew_mcar.sqf"
      exit

; the following code is not executed
   #Hum2AR_HP
      [_this] exec "\psy_mcar_scripts\MCAR_repair.sqs"
      [_this] exec "\psy_mcar_scripts\at\MCAR_mags.sqs"

   ? MCAR_humwee2ar_hpInit: exit
   MCAR_humwee2ar_hpInit = true

      MCAR_getLaunch = loadfile "\psy_mcar_scripts\MCAR_getLaunch.sqf"
      MCAR_smokerAT = loadFile "\psy_mcar_scripts\at\MCAR_smokerAT.sqf"
      MCAR_calcH = loadFile "\psy_mcar_scripts\MCAR_calcH.sqf"
      MCAR_vNorm = loadFile "\psy_mcar_scripts\MCAR_vNorm.sqf"
      MCAR_dir = loadFile "\psy_mcar_scripts\at\MCAR_dir.sqf"
      MCAR_noCrewInHumvee = loadFile "\psy_mcar_scripts\at\MCAR_noCrewInHumvee.sqf"
      MCAR_hShooter = loadFile "\psy_mcar_scripts\MCAR_hShooter.sqf"
      MCAR_targetPos = loadfile "\psy_mcar_scripts\at\MCAR_targetpos.sqf"
      MCAR_setVtow2 = loadfile "\psy_mcar_scripts\at\MCAR_setVtow2.sqf"
      MCAR_towSpeed2 = loadfile "\psy_mcar_scripts\at\MCAR_towspeed2.sqf"
      MCAR_deflection2 = loadfile "\psy_mcar_scripts\at\MCAR_deflection2.sqf"
      MCAR_launchAT2 = loadfile "\psy_mcar_scripts\at\MCAR_launchMissile2.sqf"
      MCAR_meters = loadfile "\psy_mcar_scripts\at\MCAR_meters.sqf"
      MCAR_realbullet = loadfile "\psy_mcar_scripts\at\MCAR_realbullet.sqf"
      MCAR_jet2 = loadfile "\psy_mcar_scripts\at\MCAR_jet2.sqf"
      MCAR_setFakePosAT = loadfile "\psy_mcar_scripts\at\MCAR_setFakePosAT.sqf"
      MCAR_getmissile = loadfile "\psy_mcar_scripts\at\MCAR_getmissile.sqf"
      exit

   #Hum2BR
      [_this] exec "\psy_mcar_scripts\at\MCAR_mags.sqs"
      [_this] exec "\psy_mcar_scripts\MCAR_repair.sqs"

   ? MCAR_humwee2brInit: exit
   MCAR_humwee2brInit = true

      MCAR_getLaunch = loadfile "\psy_mcar_scripts\MCAR_getLaunch.sqf"
      MCAR_smokerAT = loadFile "\psy_mcar_scripts\at\MCAR_smokerAT.sqf"
      MCAR_calcH = loadFile "\psy_mcar_scripts\MCAR_calcH.sqf"
      MCAR_vNorm = loadFile "\psy_mcar_scripts\MCAR_vNorm.sqf"
      MCAR_search2 = loadFile "\psy_mcar_scripts\at\MCAR_search2.sqf"
      MCAR_subs = loadFile "\psy_mcar_scripts\at\MCAR_subs.sqf"
      MCAR_dir = loadFile "\psy_mcar_scripts\at\MCAR_dir.sqf"
      MCAR_stayAfloat= loadFile "\psy_mcar_scripts\at\MCAR_stayAfloat.sqf"
      MCAR_noCrewInHumvee = loadFile "\psy_mcar_scripts\at\MCAR_noCrewInHumvee.sqf"
      MCAR_hShooter = loadFile "\psy_mcar_scripts\MCAR_hShooter.sqf"
      MCAR_xchange = loadfile "\psy_mcar_scripts\at\MCAR_xchange.sqf"
      MCAR_towSpeed2 = loadfile "\psy_mcar_scripts\at\MCAR_towspeed2.sqf"
      MCAR_deflection = loadfile "\psy_mcar_scripts\at\MCAR_deflection.sqf"
      MCAR_distXY = loadfile "\psy_mcar_scripts\at\MCAR_distXY.sqf"
      MCAR_slug = loadfile "\psy_mcar_scripts\at\MCAR_slug.sqf"
      MCAR_realbullet = loadfile "\psy_mcar_scripts\at\MCAR_realbullet.sqf"
      MCAR_launchAT = loadfile "\psy_mcar_scripts\at\MCAR_launchMissile.sqf"
      MCAR_setVtow2 = loadfile "\psy_mcar_scripts\at\MCAR_setVtow2.sqf"
      MCAR_meters = loadfile "\psy_mcar_scripts\at\MCAR_meters.sqf"
      MCAR_discriminate = loadfile "\psy_mcar_scripts\at\MCAR_discriminate.sqf"
            exit
I left all that humwee stuf there although I'm pretty sure can pretty safely delete everything after the line ; the following code is not executed.. And the line itself of course...

Then, in UKF_WMIK\scripts\ you put the following function, and name it as UKF_crew_mcar.sqf:
Code: [Select]
private["_crw","_i"];

_crw = crew (_this select 0);
_i = (count _crw) - 1;

while "_i > 0"
  do
   {
    if (typeOf (_crw select _i) == "UKF_logic")
     then
    {
     _crw = _crw - [(_crw select _i)];
    };

    _i = _i - 1;
   };

_crw
Where you put the game logic name sa8 defined for you in the config to that appropriate place..

Then, in that script of yours instead of [_vehicle] call crew_mcar you use [_vehicle] call UKF_crew_mcar

And all should work fine... :)

EDITED: put the UKF_logic in the function :)

EDIT2:
Quote
i must say, when i implemented the ejection coding, i nearly cried when the MILAN's stopped working... after all of Sa8's hard work, i thought i had gone and broken it
;D
You didn't brake it, you just confused it ::) :P
« Last Edit: 06 Jul 2005, 17:29:16 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #29 on: 06 Jul 2005, 17:28:49 »
thankyou very much... shall try it now  :)
Proud Member of the Volunteer Commando Battalion

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Forcing Units to get out and stay out
« Reply #30 on: 06 Jul 2005, 17:30:16 »
Ok..

Don't worry if it doesn't work, I'm notorious of making very stupid mistakes in my scripts ;D ;D ;D
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #31 on: 06 Jul 2005, 17:32:25 »
perfect... you guys think of everything  ;D

works like a charm, and no silly mistakes (i do exactly the same, but with configs normally)

thankyou everyone... finally i can perhaps get a beta out to our testers  ;D
« Last Edit: 06 Jul 2005, 17:33:36 by Messiah »
Proud Member of the Volunteer Commando Battalion

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #32 on: 06 Jul 2005, 18:05:28 »
AAARGH...

lol... ok, so it actually doesnt work... it seems that only one of the game logics get removed from the array, because after the camo net is deployed and removed, the missile will only fire upwards...  :-\
Proud Member of the Volunteer Commando Battalion

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #33 on: 06 Jul 2005, 18:10:48 »
nevermind again... lol... Hater_kint you did make a silly mistake somewhere, but lukily Sa8Geckon had already PM'd me an sqf code on your forums... i tried that and it seems to work fine again  ;D

ok... i lie, i did some more testing and found out when it does and doesnt work...

basically if there are people in the vehicle when the deploy cam net script is hit, it works fine...

if the vehicle is empty (either if it started empty, or all the occupants get out) then the milan goes wrong, firing vertically ... perhaps we need to check if the thing has any crew at all when the script is called? bearing in mind it could have anything from 1 to 4 men on board...

i'm not sure what its doing  :-\
« Last Edit: 06 Jul 2005, 18:17:00 by Messiah »
Proud Member of the Volunteer Commando Battalion

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Forcing Units to get out and stay out
« Reply #34 on: 06 Jul 2005, 19:06:52 »
:(

Well, the easiest way to avoid this is to add a getout eventHandler for the vehicle:
Code: [Select]
getout="[_this select 0] call UKF_createProxyAT";
Or, add a line in the script after the occupants have ejected:
Code: [Select]
[_vehicle] call UKF_createProxyAT
Should work with either one... :P

I would prefer that script line solution because otherwise that createProxy function is called everytime someone exits the vehicle...

EDIT:
And before doing that above, you can fix the UKF_crew_mcar.sqf..
This line
Code: [Select]
while "_i > 0"
Should be this instead:
Code: [Select]
while "_i >= 0"
And by doing this you don't have to do the createProxyAT stuff at all ;)
One bug we never even noticed... ::)
« Last Edit: 06 Jul 2005, 19:29:22 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #35 on: 06 Jul 2005, 20:44:12 »
so just the last part should solve it?
Proud Member of the Volunteer Commando Battalion

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Forcing Units to get out and stay out
« Reply #36 on: 06 Jul 2005, 20:49:23 »
excellent - works a beaut now... lol - better not speak too soon, as i'm sure i'll destroy it  ;D
Proud Member of the Volunteer Commando Battalion