Jump to content

addGroup - (https://wiki.hoggitworld.com/view/DCS_func_addGroup) What the heck is the psi? Documentation missing - is it really '-heading' and is it mandatory?


Recommended Posts

Posted

I'm trying to learn how to spawn my own aircraft from scratch via the DCS Scripting API.

The documentation is quite threadbare and there are no real tutorials on it that I could find, but going from the linked page, there are some params that are REQUIRED and most are OPTIONAL. However, there is a section that is not marked as either - which only adds to confusion. And in this new section there is a new, undocumented field: the 'psi' number. In fact, other than stating it's a number, it doesn't mention what it needs to be set to or anything.

I've seen other posts talk about how if this is missing the groups won't spawn, but there was nothing concrete about it.

My wonderful mentor @cfrag posted about it here:
 


But even that wasn't a definitive or clear answer.

So, can we, the scripting community, please have some final and complete feedback and clarification on this? @SUNTSAG and then perhaps have the documentation updated (even though it's unofficial) 

Thanks

Posted
36 minutes ago, Grimes said:

The answer is literally in the reply to the thread you posted. And by answer it is still an unknown mystery. 

Is it mandatory though, because @cfrag seemed to think it was? And if it is, how do I apply it to a starting on RAMP aircraft when I don't know the orientation (or even position) of the parking slot on the apron the the backend will assign? Or is this ONLY used for AIRBORNE aircraft spawns?

 

Posted
5 minutes ago, Elphaba said:

Is it mandatory though, because @cfrag seemed to think it was?

I think that this may be a misinterpretation of what I indented to say, apologies if I was imprecise. My use case involves reading unit tables from the mission itself as templates to clone. That is how DML functions so users of DML don't have to code and can use ME-placed groups and trigger zones instead of code. Now, the problem I ran across was that, reading a unit's table from a mission, these units had that psi value. I at first did not pay much attention to it, except that it completely screwed up the heading that the unit was taking when I changed the heading and left the psi value untouched. Not knowing that the (to me unknown and scarcely documented) psi value had an effect on the heading that the unit was taking (from the name I thought it had to do with outside pressure), I took me quite a while (and did bad things to my receding hairline) to figure out that psi was even involved.

The upshot, as far as I can see is that if you provide a psi value, it must be "-1 * heading". I don't know if psi is mandatory; I found that if it is present, it must be -heading. In my code I manage the psi code because I simply assume that if it is present, and I know how to handle it, I'll do so to provide better compatibility with the underlying game engine. If there is no psi value in the input table, I do not add it to the output table. Since we know the rules for psi (psi = -heading), and I don't know the consequences of what would happen if I stripped the attribute from an existing unit table, I went the way of least resistance.

So, I don't know if unit.psi is mandatory, and if a unit table that I process has it, I then (and only then) set it to -heading. That is all.

I hope that this clears it up 🙂 

 

  • Thanks 1
  • Recently Browsing   0 members

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