Jump to content

Recommended Posts

Posted

Hey guys,

 

I'm trying to figure out a way to track where a player or AI that ejected finds themselves on the ground.

 

The idea is to send rescue/OpFor to that location, within the same mission.

 

Any idea how to fetch that information?

http://www.youtube.com/konotani

 

Computer Specs:

 

Z97X-gaming Mobo

4670k i5

24G DDR3

GTX 1080

Asus PG278Q Rog Swift 27-INCH G-SYNC

Valve Index

Thrustmaster Warthog

Fanatec Clubsport Pedals (used as Rudders)

Thrustmaster T300 Arcantera Wheel

Obutto R3volution rig

 

Posted

You might be able to capture something close using events maybe. If you got the position of the event initiator it would be roughly in the same neighbourhood at least.

world.event = {

S_EVENT_INVALID = 0,

S_EVENT_SHOT = 1,

S_EVENT_HIT = 2,

S_EVENT_TAKEOFF = 3,

S_EVENT_LAND = 4,

S_EVENT_CRASH = 5,

S_EVENT_EJECTION = 6,

S_EVENT_REFUELING = 7,

S_EVENT_DEAD = 8,

S_EVENT_PILOT_DEAD = 9,

S_EVENT_BASE_CAPTURED = 10,

S_EVENT_MISSION_START = 11,

S_EVENT_MISSION_END = 12,

S_EVENT_TOOK_CONTROL = 13,

S_EVENT_REFUELING_STOP = 14,

S_EVENT_BIRTH = 15,

S_EVENT_HUMAN_FAILURE = 16,

S_EVENT_ENGINE_STARTUP = 17,

S_EVENT_ENGINE_SHUTDOWN = 18,

S_EVENT_PLAYER_ENTER_UNIT = 19,

S_EVENT_PLAYER_LEAVE_UNIT = 20,

S_EVENT_PLAYER_COMMENT = 21,

S_EVENT_SHOOTING_START = 22,

S_EVENT_SHOOTING_END = 23,

S_EVENT_MAX = 24

}

Posted
If you got the position of the event initiator it would be roughly in the same neighborhood at least.

world.event = {

 

S_EVENT_EJECTION = 6,

 

}

 

That,s pretty much exactly what i'm trying to pinpoint.

Thanks for the Event marker.

 

I'm trying to figure out a way to note or mark a gps (or other) coordinate at the ejection moment.

That information is super easy to get in a replay or with Tacview, but i'd like for the Engine to know immediately.

 

Do you know of a way to get the "event initiator location"? with a triggergroup (if even_eject in triggerzone[...], "do this")?

http://www.youtube.com/konotani

 

Computer Specs:

 

Z97X-gaming Mobo

4670k i5

24G DDR3

GTX 1080

Asus PG278Q Rog Swift 27-INCH G-SYNC

Valve Index

Thrustmaster Warthog

Fanatec Clubsport Pedals (used as Rudders)

Thrustmaster T300 Arcantera Wheel

Obutto R3volution rig

 

Posted (edited)

just to clarify the event.initiator value is the unit id. So as an example a code snippet from the old GCI CAP script where for a unit spawning the script is getting the name of the unit and then it went on to do other stuff for supply tracking:

function arrivaltableINT:onEvent(event)

 

--CAP or GCI units spawning reduce supply

if (world.event.S_EVENT_BIRTH == event.id)

then

if event.initiator ~= nil then

local airspawnname = Unit.getName(event.initiator)

.

blah

blah

.

.

end --function

 

Then you need to tell DCS about the event handler with something like the line below:

 

world.addEventHandler(arrivaltableINT)

 

So the above tells DCS that when an event happens to call the handler function arrivaltableINT

 

You can do something similar for the ejection event but then as Matador suggested get the Vec 3 position of the unit at the time of the event and then do what you want to translate it to MGRS or lat/long. There are various mist functions to do this and I am sure moose does the same thing. Possibly there are even DCS native functions to translate vec3 co-ords.

Edited by Stonehouse
Posted

Doesn't Ciribob his alternative CSAR script do the same? It's on this part of the forum. When a unit ejects, his script spawns a soldier on the ground at the moment of ejection. Might be worthwhile to check his script.

[sIGPIC][/sIGPIC]

 

Commodore 64 | MOS6510 | VIC-II | SID6581 | DD 1541 | KCS Power Cartridge | 64Kb | 32Kb external | Arcade Turbo

  • 3 years later...
Posted

On an Ejection event how to identify the coalition

 

Hello, Here is my code:

 

 

local PlayerEject=SET_UNIT:New():FilterCategories("plane"):FilterStart()
PlayerEject : HandleEvent( EVENTS.Ejection )

function  PlayerEject:OnEventEjection( EventData )
 local JoueurCoalition = EventData.IniCoalition

 MESSAGE:New(tostring(JoueurCoalition),20,"Info Ejection"):ToAll()

end

 

Whatever the coalition of the plane I receive the same answer: "2" ???

Where is my error please

  • Recently Browsing   0 members

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