Jump to content

Something in line with "UNIT HIT"?


Holton181

Recommended Posts

HI

I'm not particularly experienced when it comes to mission building, so forgive my ignorance. Creating a rocket practicing mission and would like to know if there is some way to detect and print a message every time a bullet/rocket/missile causes damage to a target?

I know about the "UNIT DAMAGED", but it will only trigger at first hit.

I would prefer not to do scripting, I'm to much of a noob, but I can manage some simple and limited scripting if it's the only way.

And yes, I have searched before posting (possible I used wrong search words though)

Thanks in advance!

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

HI

I'm not particularly experienced when it comes to mission building, so forgive my ignorance. Creating a rocket practicing mission and would like to know if there is some way to detect and print a message every time a bullet/rocket/missile causes damage to a target?

I know about the "UNIT DAMAGED", but it will only trigger at first hit.

I would prefer not to do scripting, I'm to much of a noob, but I can manage some simple and limited scripting if it's the only way.

And yes, I have searched before posting (possible I used wrong search words though)

Thanks in advance!

You need to make the trigger to be checked more than once. Then it gets checked again after first trigger.

 

--

I usually post from my phone so please excuse any typos, inappropriate punctuation and capitalization, missing words and general lack of cohesion and sense in my posts.....

i7-8700k, 32GB 2666Mhz DDR4, 2x 2080S SLI 8GB, Oculus Rift S.

i7-8700k, 16GB 2666Mhz DDR4, 1080Ti 11GB, 27" 4K, 65" HDR 4K.

Link to comment
Share on other sites

You need to make the trigger to be checked more than once. Then it gets checked again after first trigger.

So by using the continuous action trigger with UNIT DAMAGE might actually work? I was certain UNIT DAMAGE turned true at first hit and stayed that way, making continuous action to give me false hit indication every second. Of course I was stupid enough to not try it out before...

But I will as soon as I can (earliest tomorrow evening). Thanks!

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

So by using the continuous action trigger with UNIT DAMAGE might actually work? I was certain UNIT DAMAGE turned true at first hit and stayed that way, making continuous action to give me false hit indication every second. Of course I was stupid enough to not try it out before...

But I will as soon as I can (earliest tomorrow evening). Thanks!

It is little difficult to get those words as "single" or "once" means something different easily.

 

You can as well try something like increase "a flag" everytime a hit is registered and then call a notification when "a flag" status changes.

 

That if you need some more complex designs.

 

--

I usually post from my phone so please excuse any typos, inappropriate punctuation and capitalization, missing words and general lack of cohesion and sense in my posts.....

i7-8700k, 32GB 2666Mhz DDR4, 2x 2080S SLI 8GB, Oculus Rift S.

i7-8700k, 16GB 2666Mhz DDR4, 1080Ti 11GB, 27" 4K, 65" HDR 4K.

Link to comment
Share on other sites

I believe your assessment of UNIT DAMAGED is correct, Holton...once it flips on it stays on as far as I can remember. May be worth trying a SWITCHED CONDITION type though, in case my memory fail me, or you can brute force it with a series of UNIT'S LIFE LESS THAN triggers.

 

You can also access the desired info through the scripting engine with the hit event if you're a .lua jockey.

Link to comment
Share on other sites

May be worth trying a SWITCHED CONDITION

Need to read up on that, haven't figured out how to use them yet.

 

You can also access the desired info through the scripting engine with the hit event if you're a .lua jockey.

Not very much so I'm afraid. I can read and understand some basics, so if I find a script that utilizes hit events I might get an idea how to do it. Might be over my head though.

 

Thanks for the suggestions feefifofum.

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

Continuous action will execute the trigger once per second whenever the conditions are met. Useful for something like a counter when a player is in an entire. Let's say you wanted something to happen after the player had been in a location for 30 seconds =

 

unit inside zone (player, counter zone)

flag increase 1, 1

 

then another trigger

 

flag equals (1, 30)

message to all "30 seconds have elapsed"

 

Switched condition will execute the trigger one time each time the conditions are met; useful for area capture type exercises among other things. As a quick example =

 

Red in zone = flag on 1

Red out of zone = flag off 1

 

Blue in zone = flag on 2

Blue out of zone = flag off 2

 

flag 1 true

flag 2 false = red controls zone

 

flag 1 false

flag 2 true = blue controls zone

 

flag 1 true

flag 2 true = zone is contested

 

There is a target range script floating around here somewhere that graded performance and counted hits inside of a strafe pit that would be a great place to look for some context.

Link to comment
Share on other sites

Thanks for your explanations, really helpful.

There is a target range script floating around here somewhere that graded performance and counted hits inside of a strafe pit that would be a great place to look for some context.

Yep, Simple Range Script, I have it incorporated in my mission already. An excellent tool for practice. Unfortunately only measures distance from the center of a trigger zone, not real hits on targets. I'm trying to expand the reporting by adding actual hits.

I will see what I can do with switched conditions when I get back home.

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

I got some feedback on this now.

I tested to see if I could use switched conditions and/or flags somehow, but could not find a way with native ME functionality.

But as I mentioned, I use the Simple Range Script by Ciribob and had a look in it to see if I could learn something from it. And indeed it gave results immediately!

In the code Ciribob had already implemented almost exactly what I wanted to have, but comment it out. De-commenting the single line and I got the hit indications :thumbup:

 

He utilize

_event.id == world.event.S_EVENT_HIT

in an IF statement and within it had

trigger.action.outText("HIT! ".._event.target:getName().." with ".._event.weapon:getTypeName(),10,false)

commented out.

 

The only problem with this is that all hits from any initiator are indicated, so whenever I'm fired upon and hit by my target i get an indication as well. Have asked Ciribob for help on this.

 

Thank you all for your help!

Helicopters and Viggen

DCS 1.5.7 and OpenBeta

Win7 Pro 64bit

i7-3820 3.60GHz

P9X79 Pro

32GB

GTX 670 2GB

VG278H + a Dell

PFT Lynx

TrackIR 5

Link to comment
Share on other sites

  • Recently Browsing   0 members

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