SimHQ
Previous Thread
Next Thread
Print Thread
Rating: 3
Hop To
Page 222 of 240 1 2 … 220 221 222 223 224 … 239 240
Joined: Nov 2004
Posts: 17,632
S
Skate Zilla Graphics
Veteran
Skate Zilla Graphics
Veteran
S Offline
Joined: Nov 2004
Posts: 17,632
open the in cockpit engine audio and pre-amp the crap out of it then save it?


HAF922, Corsair RM850, ASRock Fata1ity 990FX Pro,
Modified Corsair H100, AMD FX8350 @ 5.31GHz, 16GB G.SKILL@DDR2133,
2x R7970 Lightnings, +1 HD7950 @ 1.1/6.0GHz, Creative XFi Fata1ity Platinum Champ.,
3x ASUS VS248HP + Hanns�G HZ201HPB + Acer AL2002 (5760x1080+1600x900+1680x1050), Oculus Rift CV
CH Fighterstick, Pro Throt., Pro Pedals, TM Warthog & MFDs, Fanatec CSR Wheel/Shifter, Elite Pedals
Intensity Pro 10-Bit, TrackIR 4 Pro, WD Black 1.5TB, WD Black 640GB, Samsung 850 500GB, My Book 4TB
Inline advert (2nd and 3rd post)

Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
So, Mol, anyone --

How do I make a mission where a Huey can pick up and deliver a Stinger squad to any location? I mean, there's no event or advanced waypoint action for the Huey that I can set. There is an Embark waypoint action but it looks like it is not enabled.

I cannot set the Stinger group of three to be Cargo. There is a section in the Huey manual for transporting troops but that is not finished (Page 147, Helicopter Assault). I'm thinking I cannot just land the Huey next to an infantry group and cause them to go into the Huey and then later let them off -- unless I make events to do this.

The only way I know to do it is to put down zones for the drop off locations, and use events to trigger activating Stinger squads to make it look like the Huey dropped them off -- which means that the Huey pilots must drop the Stinger squads at set places instead of anywhere they want to.


Ya?

WC

Joined: Sep 2012
Posts: 401
M
Member
Member
M Offline
Joined: Sep 2012
Posts: 401
I am not sure Crew... I know that the ED forums has a lot of material about it.

http://forums.eagle.ru/showthread.php?t=118935&highlight=Troop+pickup

The missions I have flown allow you to land at a farp... Hit F10 then select if you want to load out infantry, Mortar Teams, Igla or Sam Teams, Para Troops, or Evacuees.

Normally they have a drop off zone that encompasses the battle area... I know this because in some missions I tried to drop near the enemy air base and I could not because it wasn't in a drop zone.

Hope this helps...

There is quite a few missions that have troop drop in them too.

http://forums.eagle.ru/showthread.php?t=105999

Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
I think I know how, now. The way I have it figured, the Huey pilot will be able to drop off the Stinger team *anywhere* on land.

I may set it up such that the Huey pilot takes off with the Stinger guys on board -- no going to pick them up, just take off from the FARP base and fly to your destination, land and select a radio message that says "Get Out!"

Is there any indication in the Huey cockpit that cargo is on board? In some missions I've reviewed there is a Cargo Weight -- thinking of setting it to 500 lbs for a three man Stinger team, and then clearing that when they are dropped off.

WC

Joined: Sep 2012
Posts: 401
M
Member
Member
M Offline
Joined: Sep 2012
Posts: 401
sounds about right...I really hadn't noticed... but I always take 50% fuel so weight is never a factor.

Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
Messing around with the mist stuff to make this work. I'm a noob at that.

Thinking that a Huey with a Stinger team would be able to disembark the team whenever, then also be able to embark them again and take the team further. Woof woof. That way if an enemy a/c came around the Huey would be able to deploy air defense weps biggrin Surprise!!

WC

Joined: Jan 2008
Posts: 1,292
U
Member
Member
U Offline
Joined: Jan 2008
Posts: 1,292
What about dropping off a team and then flying somewhere to pick up another team?

Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
I think I'll start it where the Huey has three 3-man teams to drop off. That would be the easiest to code, and would give the Hueys complete freedom to go where they want to.

WC

Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
I need Lua programming help.

There are a couple of Lua scripts that need development for this effort,


Here's what is needed in this Stinger Drop Test mission :

1. get the leading position of a specified helicopter group 'UH-1H 01 Stinger Team'; ground coords only are needed
2. apply those coords to the coords of a new infantry (Stinger) group that is cloned from an existing Stinger group "BLF VGrp90 Stinger Team'


So far...
The existing Stinger group can be transported at 20 seconds into the mission, and it can be cloned at 25 seconds.

What is needed is that the new Stinger group is cloned at the position of the helicopter.


WC

Joined: Mar 2005
Posts: 875
F
Member
Member
F Offline
Joined: Mar 2005
Posts: 875
I can take a look tomorrow evening ... I'm busy at work at the moment and tonight there is a local hockey game. I would be interested in this code as well - if someone gets it done for you before I can take a look.

How are you adding/removing weight from the helicopter?


Fridge
----------
Things which do you no good in aviation:
1) Altitude above you;
2) Runway behind you;
3) Fuel in the truck;
4) The airspeed you don't have.
Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
Thanks, Fridge,
In another Huey mission there are examples of adding and removing cargo weight using regular events. In fact, there are a few missions that pick up and drop off troops in this thread --
http://forums.eagle.ru/showthread.php?t=105999&page=2

I looked at a couple missions that use zones with infantry group deactivation and activation -- that I can do, no problem. What I need is the Lua script that can be run to determine the Huey map position (and bearing would be good) and then to dynamically add the Stinger team at those coordinates with a little offset.

This script would be triggered when the Huey is at altitude zero and speed zero and the pilot executes a radio command to disembark the Stinger team (the radio could be first then the pilot has to land it). I'm pretty sure I can control all of this with regular events, although there is a bit of a concern for detecting if the Huey Client dies and is spawned again; in that case the counter needs to be reset so the new Huey can drop three more teams.


I started a thread here --
http://forums.eagle.ru/showthread.php?p=2209557#post2209557
Grimes showed how to add/clone the Stinger team. The Mist manual has mist.getAvgPos which should return the position data. I don't know how to combine these two functions.

WC

Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
There is an event Action of Set Internal Cargo that is used to set a weight in the a/c.


A Client is Alive and is Dead condition can be detected with regular events -- I tested that. Interestingly, the Condition for Alive can use Group Is Alive or Unit Is Alive, but the Dead condition required a Unit Is Dead. This worked in a single player test -- I need to try it on the server to see if a Client can spawn and die and repeat.

WC

Last edited by Wrecking Crew; 10/23/14 01:13 AM. Reason: Grp vs Unit
Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
OK, the Huey Clients can be detected as to when they spawn and die -- and spawn and die. Any Client can take the Huey slot and all Alive and Dead conditions are detected using the event logic in the mission link below.

Latest Stinger Drop mission v1e link

In this screenie the Huey (me) is flying over the Cloned Stinger team, while one unit of the transported Stinger team is on the road --


WC

Last edited by Wrecking Crew; 10/23/14 02:05 AM.
Joined: Mar 2005
Posts: 875
F
Member
Member
F Offline
Joined: Mar 2005
Posts: 875
Ahh cool. So it's working for you?

The only way I can ever figure these things out is through LUA scripting. Events confuse me :-)


Fridge
----------
Things which do you no good in aviation:
1) Altitude above you;
2) Runway behind you;
3) Fuel in the truck;
4) The airspeed you don't have.
Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
I still need your help... with the Lua :-)

The ground position (x, y) of the Client Huey 'UH-1H 01 Stinger Team' needs to be given to the infantry group that is cloned from 'BLF VGrp90 Stinger Team'.

I think the Huey coords can come from mist.getAvgPos (there is only one Client helicopter in the group). The xy pair then has to be passed to the script in the 'BLF DynAdd Stinger Team' event that has this code:
Code:
local newGroup = mist.getGroupData('BLF VGrp90 Stinger Team')
      local newCoords = {
            [1] = 
            {
                x = -271900,
                y = 620000,
            },
            [2] =
            {
                x = -271902,
                y = 620002,
            },
            [3] =
            {
                x = -271904,
                y = 620004,
            }
        }
for i = 1, #newGroup.units do
    newGroup.units[i].x = newCoords[i].x
    newGroup.units[i].y = newCoords[i].y
end
newGroup.clone = true
mist.dynAdd(newGroup)


I've spent the past couple of days reading up on the Mist stuff, but don't understand how to pass variables from one function to another.

WC

Joined: Mar 2005
Posts: 875
F
Member
Member
F Offline
Joined: Mar 2005
Posts: 875
So the problem I see with mist.getAvgPos () is that you have to pass it a table of values instead of a group (where it would be helpful if it built the table of values for you from a passed group). I can't remember off hand but if you have a list of names you could get away with something like this:

position_tmp = mist.getAvgPos ({"Stinger Unit Name #001", "Stinger Unit Name #002"})

which should return you a Vector3 value.

Now I also can't remember off hand how to convert a Vec3 value to a Position3 value which is used for setting a unit location. I think it is as simple as this:

pos3_tmp = {}
pos3_tmp.x = vec3_value.x
pos3_tmp.y = vec3_value.z

I am not sure why the Mist team decided to return a vec3 value ... which makes no sense in the context of returning a position.

If you want to get a units position, I would use something different. So lets say you have a UH-1H unit (no group) named "UH-1H Client #001"

I would do this:

[code:lua]
unit_ref = Unit.getByName("UH-1H Client #001")

-- Check to make sure getByName didn't screw up
if (unit_ref ~= nil) then
-- and get the Position3 location of the unit
local pos_tmp = unit_ref:getPosition().p
end
[/code]

then you could move the Stinger squad to somewhere nearby. I can do this with units, but not with groups yet (I didn't get far enough in my PilotDown script to do a recovery group ... soon).

In the code below, I would give the Stinger group a path to the Helo but it should be relatively simple to change that to 'warp' the Stinger team to the helo's position.

[code:lua]local helo_pos = Unit.getByName("UH-1H Client #001"):getPosition().p

-- Pick Spawn point near SAR Helo: saru_pos at a random spot min:max meters (?) from the saru
local helo_lat, helo_long, dis_tmp = coord.LOtoLL(helo_pos)

-- Now, basically get a random direction from the helo
local sign_lat_range = -1
if (math.random (0,1) == 1) then
sign_lat_range = 1
end
local sign_long_range = -1
if (math.random (0,1) == 1) then
sign_long_range = 1
end

-- So we are looking for [-max..-min]..[min..max] (ex: [-10..-5]..[5..10])
-- Grab a random number beween (min,max), scale it, multiply it by the sign.
-- in this case between 4 and 8: so the units and not 'on' the helo and die but not too far away

helo_lat = helo_lat + (math.random (4, 8) * 0.00001 * sign_lat_range)
helo_long = helo_long + (math.random (4, 8) * 0.00001 * sign_long_range)

local near_helo_pos = coord.LLtoLO (helo_lat + 0.00007, helo_long + 0.00007)

-- Then give the path to the group
Path = {}
Path[#self.Path + 1] = mist.ground.buildWP (near_helo_pos, path_type, speed)
Path[#self.Path + 1] = mist.ground.buildWP (some_destination_pos, path_type, speed)

group_ref = Group.getByName("Stinger Team #001")
if (group_ref ~= nil) then
mist.goRoute (group_ref, Path)
end
[/code]

Does that make any sense?


Fridge
----------
Things which do you no good in aviation:
1) Altitude above you;
2) Runway behind you;
3) Fuel in the truck;
4) The airspeed you don't have.
Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
I'm looking at the latest Mist that is build 37 .

I had the idea that mist.getAvgPos would return the average position of units in a group name -- that you wouldn't need to pass the unit names. Regardless, the Client groups have only one unit which is named the same as the group, so unit functions will work. There is also a mist.getLeadPos.

I think this from you is basically what I'm needing:
position_tmp = mist.getAvgPos ({"Stinger Unit Name #001", "Stinger Unit Name #002"})

which should return you a Vector3 value.

Now I also can't remember off hand how to convert a Vec3 value to a Position3 value which is used for setting a unit location. I think it is as simple as this:

pos3_tmp = {}
pos3_tmp.x = vec3_value.x
pos3_tmp.y = vec3_value.z


---

It does seem simple, but where are x & y listed as return values... for the mist.getAvgPos function? That's the part I'm not getting. hmmm, maybe because I need the full 'vec3_value.x' -- that's what I don't get yet.


WC

Joined: Mar 2005
Posts: 875
F
Member
Member
F Offline
Joined: Mar 2005
Posts: 875
Right. That is not documented well.

On the Mist wiki page (http://wiki.hoggit.us/view/GetAvgPos) the description tells me it is a vec3. That has to be correlated with the DCS LUA interface (Search for Vectors here: http://en.wiki.eagle.ru/wiki/Part_1).

That tells me about the Vector3 structure:
Code:
Vec3 = { 
   x = Distance, 
   y = Distance, 
   z = Distance 
 } 


A good example of why it is almost impossible to do things with an API without good documentation; I would consider the DCS LUA API pages and the MIST pages not examples of how it should be done but they both try and give something to work with - which is better that a lot of other sources. The MIST team falls down often on this when they assume that you are already pretty familiar with the DCS LUA API.


Fridge
----------
Things which do you no good in aviation:
1) Altitude above you;
2) Runway behind you;
3) Fuel in the truck;
4) The airspeed you don't have.
Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
Have to open the old geometry book... who wants some pi?

WC

Joined: Mar 2007
Posts: 5,111
W
Smooth Operator
Hotshot
Smooth Operator
Hotshot
W Offline
Joined: Mar 2007
Posts: 5,111
The latest on the Stinger drop Lua code is here --
http://forums.eagle.ru/showthread.php?t=132583

Geez it's always the little stuff that holds up the development the longest.

WC

Page 222 of 240 1 2 … 220 221 222 223 224 … 239 240

Moderated by  Force10, RacerGT 

Link Copied to Clipboard
Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
God Forbid they want to have a bit of fun at work
by NoFlyBoy - 09/22/26 08:50 PM
How a 5" 38 Caliber US Naval Gun Works
by F4UDash4 - 09/19/26 01:20 AM
100% commission based sales
by PanzerMeyer - 09/18/26 04:47 PM
Relativity
by Terl9999 - 09/18/26 04:34 AM
HOA's
by Terl9999 - 09/18/26 04:12 AM
Football
by Terl9999 - 09/18/26 02:42 AM
Flags
by Terl9999 - 09/15/26 10:03 PM
September 15th Battle of Britain Day.
by RedToo - 09/15/26 08:06 PM
Population Patterns
by PanzerMeyer - 09/15/26 03:43 PM
"Problem occurred in connection"
by F4UDash4 - 09/14/26 01:41 PM
Popular Topics(Views)
7,068,680 SAM Simulator
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 8.0.1