Jump to content

What's the latest on AI behavior re: trains?


Recommended Posts

I see we can create them and they do run back 'n forth quite well in MP.  

They also seem to throw hit/dead events at some level, but these aren't accessible as far as I can tell. 

--- onChatMessage---    RED AI in T-90 killed BLUE unknown in Locomotive with   nil

I cannot make them respond to waypoint actions of any kind.

They also don't draw enemy AI fire, or make triggers fire.

Is there anything I am missing at this point?

[sIGPIC][/sIGPIC]

Are you ready to take your chopper flying skills to the next level?

Then check out http://www.blacksharkden.com/ Or visit us on Discord https://discord.gg/kaayJ5z and talk to some of our awesome pilots today.

Link to comment
Share on other sites

  • 1 month later...
On 10/22/2021 at 3:50 AM, fargo007 said:

I see we can create them and they do run back 'n forth quite well in MP.  

They also seem to throw hit/dead events at some level, but these aren't accessible as far as I can tell. 

 

There doesn't appear to be much - however I have been able to identify if particular carriages are hit by their IniTypeName (using Moose):

ie:

evh1 = EVENTHANDLER:New()
evh1:HandleEvent(EVENTS.Dead)
function evh1:OnEventDead(EventData)
 if EventData.IniTypeName == "Coach a tank yellow" then
   MESSAGE:New("You have hit a yellow tank carriage!" ,30):ToAll()
 end
      
 if EventData.IniTypeName == "Coach a passenger" then
   MESSAGE:New("You have killed civilians!" ,30):ToAll()
 end
end --OnEventDead  / evh1

Hope this helps.

Link to comment
Share on other sites

14 minutes ago, Dangerzone said:

 

There doesn't appear to be much - however I have been able to identify if particular carriages are hit by their IniTypeName (using Moose):

ie:

evh1 = EVENTHANDLER:New()
evh1:HandleEvent(EVENTS.Dead)
function evh1:OnEventDead(EventData)
 if EventData.IniTypeName == "Coach a tank yellow" then
   MESSAGE:New("You have hit a yellow tank carriage!" ,30):ToAll()
 end
      
 if EventData.IniTypeName == "Coach a passenger" then
   MESSAGE:New("You have killed civilians!" ,30):ToAll()
 end
end --OnEventDead  / evh1

Hope this helps.

Thank you very much for the reply.  This does help a lot actually.  

I imagine with it I can track events by unit (rail car) as well, and have scenarios where single cars in a large train might be specifically targeted, or when attacked (hit), have enemies spill out from them with SpawnFromUnit() and start fighting back. 


Edited by fargo007

[sIGPIC][/sIGPIC]

Are you ready to take your chopper flying skills to the next level?

Then check out http://www.blacksharkden.com/ Or visit us on Discord https://discord.gg/kaayJ5z and talk to some of our awesome pilots today.

Link to comment
Share on other sites

20 minutes ago, fargo007 said:

Thank you very much for the reply.  This does help a lot actually.  

I imagine with it I can track events by unit (rail car) as well, and have scenarios where single cars in a large train might be specifically targeted, or when attacked (hit), have enemies spill out from them with SpawnFromUnit() and start fighting back. 

 

Quite possibly. Not sure if this is of any help. I know that I can mount and dismount troops from vehicles - it may be possible to implement with trains as well. (Although I imagine with trains, once they're hit - they stop permanently - so such a script may not be required). 

 

 

Re the script above, the way I found out the iniUnitName was by basically having something similar to the following:

evh1 = EVENTHANDLER:New()
evh1:HandleEvent(EVENTS.Dead)
function evh1:OnEventDead(EventData)
 if EventData.IniTypeName == "Coach a tank yellow" then
   MESSAGE:New("You have hit "..EventData.IniTypeName ,30):ToAll()
 end
end --OnEventDead  / evh1

... and then I started blowing up each one to get the unit names.  😂   (There may be other references to this but I didn't know where to find it, so I did it this 'hack' way).

I'd love to see the ability to name individual carriages and refer to each one - but I'm not holding my breath on that one. 

Good luck with your designing. Glad this was of help!

Link to comment
Share on other sites

Thank you, same.

I will check it out soon and see what can be expanded from where we are here.

If an indexed, spawned unitname is exposed, I'm pretty sure we can get it and use it, at least with an event handler.

It's cool stuff we're doin' bro.  We toil for the glory of DCS.

  • Like 1

[sIGPIC][/sIGPIC]

Are you ready to take your chopper flying skills to the next level?

Then check out http://www.blacksharkden.com/ Or visit us on Discord https://discord.gg/kaayJ5z and talk to some of our awesome pilots today.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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