Jump to content

How to check if player lowered the CH-47 loading ramp?


Go to solution Solved by sirrah,

Recommended Posts

Posted

Does anyone know if it's possible to add a trigger condition that checks if the CH-47 ramp has been lowered?

Can this perhaps be done with a "cockpit parameter equal to" condition? And if so, could anyone please share the values that should be used for that parameter?

 

 

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted (edited)
18 hours ago, sirrah said:

Does anyone know if it's possible to add a trigger condition that checks if the CH-47 ramp has been lowered?

Can this perhaps be done with a "cockpit parameter equal to" condition?

IIRC it can be done, and requires an IMHO excessively tedious process involving the model viewer, finding the model (which is not always named as you'd think), going through all possible accessible elements, noting the stage, and then trying this in ME. With some luck, it is supported. I'd rather choke and would prefer that ED give us that info in some kind of spreadsheet after we shelled out some 50 bucks or more fore the model.

 

Edited by cfrag
  • Like 1
Posted

Hm ok, that doesn't at all sound appealing to dive into, for my "simple" mission 🙄

Was kinda hoping for some simple parameter, like we use to check if a player has tuned to the correct radio freq.

Too bad..

 

Thanks for answering mate

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted

You can use the Lua Script function "getDrawArgumentValue" to check a model argument.

local varUnit = Unit.getByName("theCH-47s unitname here")

   if varUnit:getDrawArgumentValue(86) > 0.5 then

trigger.action.setUserFlag("DOOR", 1)

end

Now you can use the Flag "DOOR" to trigger things as usual e.g. send messages etc.

Reset the Flag by setting it to 0.

Not tested, but should work.

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Posted
9 hours ago, shagrat said:

You can use the Lua Script function "getDrawArgumentValue" to check a model argument.

local varUnit = Unit.getByName("theCH-47s unitname here")

   if varUnit:getDrawArgumentValue(86) > 0.5 then

trigger.action.setUserFlag("DOOR", 1)

end

Now you can use the Flag "DOOR" to trigger things as usual e.g. send messages etc.

Reset the Flag by setting it to 0.

Not tested, but should work.

Thank you Shagrat

I am however a simple man with no knowledge about scripting or how to use it. And to be honest, I don't feel like spending a whole bunch of time diving into that rabbit hole. I was hoping to do this with the simple ME tools.

But it's ok, I'll find some workaround 🙂

 

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted
Am 29.8.2024 um 07:04 schrieb sirrah:

Thank you Shagrat

I am however a simple man with no knowledge about scripting or how to use it. And to be honest, I don't feel like spending a whole bunch of time diving into that rabbit hole. I was hoping to do this with the simple ME tools.

But it's ok, I'll find some workaround 🙂

 

You can simply put the code into a switched condition "do script" trigger and use the Flag is true "DOOR" to do stuff like Message to coalition/group etc.

Just reset the flag with a "set flag false" in the trigger, if you need to track multiple uses of the ramp.

You only need to add the UNITNAME to the script in the get.unitByName("unitname") part.

The moment the ramp is lowered more than half it should trigger the "DOOR" Flag as true.

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Posted
8 hours ago, shagrat said:

You can simply put the code into a switched condition "do script" trigger and use the Flag is true "DOOR" to do stuff like Message to coalition/group etc.

Just reset the flag with a "set flag false" in the trigger, if you need to track multiple uses of the ramp.

You only need to add the UNITNAME to the script in the get.unitByName("unitname") part.

The moment the ramp is lowered more than half it should trigger the "DOOR" Flag as true.

Thanks @shagrat, that sounds simple indeed. I'll give it a go 👍

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted

Hi @shagrat,

 

For sure I must be doing something wrong, I just don't know what.

 

I created the switched condition for the script and a triggered "Door open" message when flag DOOR is true. But it doesn't seem to work.

(couldn't find the "set flag false" action, so I used "flag off" instead)

image.png

image.png

 

Any ideas?

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted
vor 20 Stunden schrieb sirrah:

Hi @shagrat,

 

For sure I must be doing something wrong, I just don't know what.

 

I created the switched condition for the script and a triggered "Door open" message when flag DOOR is true. But it doesn't seem to work.

(couldn't find the "set flag false" action, so I used "flag off" instead)

image.png

image.png

 

Any ideas?

For whatever reason DCS does not like "Switched Condition" with "Do Script".
I changed the Script trigger to "Contineous" and added an else condition to the script.

local varUnit = Unit.getByName("CH47player")
if varUnit:getDrawArgumentValue(86) >0.5  then
      trigger.action.setUserFlag("DOOR",1)
else
       trigger.action.setUserFlag("DOOR",0)
 end 

Then two separate "switched condition" for the appropriate Flag "DOOR" is 1 (ramp lowered) and  Flag "DOOR" is 0 (ramp raised)...

But easier to see for yourself. I attach the MIZ file so you can see what exactly I did there.

TEST_CH47_RAMP_TRIGGER.miz

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

  • Solution
Posted
12 minutes ago, shagrat said:

For whatever reason DCS does not like "Switched Condition" with "Do Script".
I changed the Script trigger to "Contineous" and added an else condition to the script.

local varUnit = Unit.getByName("CH47player")
if varUnit:getDrawArgumentValue(86) >0.5  then
      trigger.action.setUserFlag("DOOR",1)
else
       trigger.action.setUserFlag("DOOR",0)
 end 

Then two separate "switched condition" for the appropriate Flag "DOOR" is 1 (ramp lowered) and  Flag "DOOR" is 0 (ramp raised)...

But easier to see for yourself. I attach the MIZ file so you can see what exactly I did there.

TEST_CH47_RAMP_TRIGGER.miz 10.79 kB · 0 downloads

Thanks mate!

I'll give it a go as soon as life allows me to :thumbup:

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted

Yes, this works!

Now that I successfully used a script in one of my missions, I can now rightfully say:

scientist-science.gif

😌

  • Like 2

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted

I cheered a bit too soon I think @shagrat, because when testing I came across the following issue

 

When the player crashes, it results in this prompt:

image.png

 

Do you have any idea on how to solve this?

I attached my mission. The script triggers are at the top of my trigger list.

Chinook training mission - in progress.miz

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

Posted

Yeah, needed to do a sanity check on the varUnit, as a continous trigger will check the condition every second and if the unit crashes it won't find said unit...

local varUnit = Unit.getByName("00_Player")
if varUnit ~= nil then
if varUnit:getDrawArgumentValue(86) >0.5  then
      trigger.action.setUserFlag("DOOR_00",1)
else
       trigger.action.setUserFlag("DOOR_00",0)
end
end

I also did adjust for the fact, you have more than one player. So The script can be executed for individual units Flag ("DOOR_00" and "DOOR_01").
Additonally I eliminated the need to use a second Flag so I added a FLAG "DOOR_00" EQUAL 1 to the conditions using the same flag that is set in the script, and I added a message from a virtual "crew chief" to let the pilot know if the ramp is lowered or raised.

Have a look at all the orange triggers in the Script Editor to see what has changed:


image.png

Here is the MIZ file with the changes:

Chinook training mission - RAMP fixed.miz

Shagrat

 

- Flying Sims since 1984 -:pilotfly:

Win 10 | i5 10600K@4.1GHz | 64GB | GeForce RTX 3090 - Asus VG34VQL1B  | TrackIR5 | Simshaker & Jetseat | VPForce Rhino Base & VIRPIL T50 CM2 Stick on 200mm curved extension | VIRPIL T50 CM2 Throttle | VPC Rotor TCS Plus/Apache64 Grip | MFG Crosswind Rudder Pedals | WW Top Gun MIP | a hand made AHCP | 2x Elgato StreamDeck (Buttons galore)

Posted
1 hour ago, shagrat said:

Yeah, needed to do a sanity check on the varUnit, as a continous trigger will check the condition every second and if the unit crashes it won't find said unit...

local varUnit = Unit.getByName("00_Player")
if varUnit ~= nil then
if varUnit:getDrawArgumentValue(86) >0.5  then
      trigger.action.setUserFlag("DOOR_00",1)
else
       trigger.action.setUserFlag("DOOR_00",0)
end
end

I also did adjust for the fact, you have more than one player. So The script can be executed for individual units Flag ("DOOR_00" and "DOOR_01").
Additonally I eliminated the need to use a second Flag so I added a FLAG "DOOR_00" EQUAL 1 to the conditions using the same flag that is set in the script, and I added a message from a virtual "crew chief" to let the pilot know if the ramp is lowered or raised.

Have a look at all the orange triggers in the Script Editor to see what has changed:


image.png

Here is the MIZ file with the changes:

Chinook training mission - RAMP fixed.miz 54.98 kB · 1 download

Wizardry to me, but it works!

Thanks a bunch mate :notworthy:

  • Like 1

System specs:

 

i7-8700K @stock speed - GTX 1080TI @ stock speed - AsRock Extreme4 Z370 - 32GB DDR4 @3GHz- 500GB SSD - 2TB nvme - 650W PSU

HP Reverb G1 v2 - Saitek Pro pedals - TM Warthog HOTAS - TM F/A-18 Grip - TM Cougar HOTAS (NN-Dan mod) & (throttle standalone mod) - VIRPIL VPC Rotor TCS Plus with ALPHA-L grip - Pointctrl & aux banks <-- must have for VR users!! - Andre's SimShaker Jetpad - Fully adjustable DIY playseat - VA+VAICOM - Realsimulator FSSB-R3

 

~ That nuke might not have been the best of ideas, Sir... the enemy is furious ~ GUMMBAH

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...