Jump to content

Is there a way to find out a Random skill unit's "true" skill at runtime?


Recommended Posts

Posted

I'm looking to have AI aggressor aircraft spawn with random skill levels, but then inform the player after the fight that they defeated or were defeated by an Average/Veteran/Ace AI opponent.

 

It looks like MOOSE's UNIT:GetSkill() function doesn't actually exist, so I'm wondering if there's another way to accomplish this?

 

 

i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S

Posted

If its like the mist function of getting skill it is just looking up a known value in a database for whatever was used in the mission file or spawned via a its own spawn functionality so it is aware of what the skill was set to. But yeah there isn't a Unit.getSkill function at present. 

 

Your best bet would be to spawn them with a randomized value that you know of. So it isn't the random skill but you choose between average, good, high, or excellent. Then your script knows the skill level assigned to that specific unit that you spawned which you can reference in your messaging. 

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

Posted
9 minutes ago, Grimes said:

Your best bet would be to spawn them with a randomized value that you know of. So it isn't the random skill but you choose between average, good, high, or excellent. Then your script knows the skill level assigned to that specific unit that you spawned which you can reference in your messaging. 

 

Yeah, I was thinking I'd probably end up having to go that route. Thanks for confirming, Grimes.

 

The only frustration is that it means filling mission file with multiple "different skill" instances of the exact same units. I know I could spawn dynamically via MOOSE, but I don't like the way that script-spawned aircraft have a weird numerical GUID in the debrief as opposed to a real name. Also, I think I'm right in saying that kills on dynamically script-spawned enemies don't actually count towards your score (i.e. you get zero points for those kills in the debrief).

i7-7700K @ 4.9Ghz | 16Gb DDR4 @ 3200Mhz | MSI Z270 Gaming M7 | MSI GeForce GTX 1080ti Gaming X | Win 10 Home | Thrustmaster Warthog | MFG Crosswind pedals | Oculus Rift S

  • Recently Browsing   0 members

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