Jump to content

Unit Lower than...


ENO

Recommended Posts

I think it is MSL. But tbh Im not sure what the numbers are measuring..

 

I dont think it is feet. I have a trigger that start on the number 33 in the triggers menu. What happends when the aircraft is "33" above it starts some music. However, the music does start the second I take off from the airstrip. If I use the number "32" the music started when I entered the aircraft, so that was to low..

Link to comment
Share on other sites

Guess I'll have to test it :)

 

I'll confirm in a few minutes...

Of course while I'm doing this I see that the aircraft altitude is in feet but if memory serves the "unit lower than" is measured in meters.

 

 

WHY?! :doh:


Edited by ENO

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Okay, so basically what I did was I set up an aircraft to start at 1100 feet over the ocean and set a waypoint at 100 feet so it would gradually descend. I set up a few triggers for "unit height less than" 300(m) / 200(m) / 100(m) 10 (m) and had it broadcast a message once it reached each height.

 

Over the ocean it broadcast each message (I don't think the AI likes flying less than 100 feet unless landing so it didn't give me the 10m notice.

 

Over the terrain and heights around 6-800 feet (*or more) I only got the 1 trigger for less than 300 meters.

 

So what this tells me is that the unit lower than is in fact MSL in meters.

 

While the height of the ME is in feet above either or.

 

This is a real PITA now especially if you're interested in setting up "group activates" around your Huey- you need to know where someone is going to land so that you can go "lower than" and speed lower than... 1 M/S is about 3kph (btw).

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Once> Unit inside Zone and Expression>Do your action for the aircraft being landed

Copy and paste this into expression:

if Unit.getByName('unitName'):inAir() == false then

return true

end

 

That expression is basically the same as a trigger that would be "Unit is on the ground"

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Once> Unit inside Zone and Expression>Do your action for the aircraft being landed

Copy and paste this into expression:

if Unit.getByName('unitName'):inAir() == false then

return true

end

 

That expression is basically the same as a trigger that would be "Unit is on the ground"

 

Hmm...added that .. and get a nil value error when entering the zone from it..

 

did a once, then unit present and expression above, then action to just send a message..

remove expression and the message passes fine on zone entrance..

 

what did I do wrong?

 

 

 

.


Edited by Fuby
Link to comment
Share on other sites

to figure out the msl all you need to do is place you cursor anywhere on the ME map and it tells you what the msl is along with the lat and long of that point. It displays on the bottom information bar at the base of the screen. I used three conditions:

1)altitude less than,if alt is stated for that area as 200 i made it 205

2)speed less than 2,if you have wind at ground lvl of 5m/s obviously add the minimum speed to that

3)unit pitch limit, a possitive of 5 and a negative of 5 for if the ground you land on is sloped.

 

that way you have to meet all three conditions before the action becomes "true"

Link to comment
Share on other sites

to figure out the msl all you need to do is place you cursor anywhere on the ME map and it tells you what the msl is along with the lat and long of that point. It displays on the bottom information bar at the base of the screen.

 

Yes and generally this is good enough to get you close- however as I'm quickly learning is few people (now) are good at landing the huey with pinpoint accuracy and heights can vary around terrain. Granted, if terrain is undulating so much that I couldn't get height within a couple of meters- they're not going to land there anyway.

 

Further, if you have multiple landing points this script does (if we can get it working) prevent you from having to go scroll around various areas looking for high points in terrain to go "unit lower than."

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Hmm...added that .. and get a nil value error when entering the zone from it..

 

 

Basically did the same- left it exactly as is... also tried entering the actual unit name (didn't know I had to add the zone- that the other empty ()?

 

(I'm code simple)

"ENO"

Type in anger and you will make the greatest post you will ever regret.

 

"Sweetest's" Military Aviation Art

Link to comment
Share on other sites

Yes the () is required as that is a function call. Otherwise it is basically checking for the variable "inAir" (which probably doesn't exist) and if it equals false. Thus an error will occur, "can't compare a nil value" probably.

 

There is more than one way to use the inAir() function.

Unit.getByName('unitsName'):inAir()

 

Unit.inAir(Unit.getByName('unitsName')

 

local newUnit = Unit.getByName('unitsName')

newUnit:inAir()

 

Attached is a working example of what I described how to do it in my first post in the thread.

land_test.miz

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

well silly me.. the 'unitsname' was the actual name.. I thought it was part of expression when mentioned copy paste..

 

Now..with the right name of the UNIT in there it worked..

But.. if the pilot (my great flying skills) crashes within the trigger area instead of landing..it gives the nil error once again..

Link to comment
Share on other sites

  • Recently Browsing   0 members

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