Asterra Posted September 2, 2019 Share Posted September 2, 2019 (edited) As the title says, I can't get these to return anything other than null/0, either scripted or from the console. Obviously including when they absolutely should, by design, be returning something, such as when a Molerat is doing its paw-the-ground or sniffing animation, both "special idles". Try it for yourself. What I need here is really two things. 1: A way to figure out which special idle is currently playing on an actor (a-la GetPlayedIdle, if it worked as intended), and then a way to detect whether said idle is currently playing on an actor (IsIdlePlayingEx, likewise). If there are other, less-nonfunctional ways of achieving this, great, I'm all ears. GetAnimAction will, at least, correctly give me the data it's designed to provide, although what it returns is too nonspecific for my needs. Edited September 2, 2019 by Asterra Link to comment Share on other sites More sharing options...
dubiousintent Posted September 2, 2019 Share Posted September 2, 2019 Just to clarify: Those functions are dealing with "references". When trying to see what they return, you are converting them to "strings" with the NVSE "ToString" function first before display output (as in a debug message), correct? Otherwise a "reference" (which is actually a record number) gets displayed as "null/0" because it is not normally displayable to the console or a print statement. See also "TIP Referencing Objects" under the "Scripting" section of the wiki "Getting started creating mods using GECK" article. -Dubious- Link to comment Share on other sites More sharing options...
Asterra Posted September 2, 2019 Author Share Posted September 2, 2019 (edited) Just to clarify: Those functions are dealing with "references". One gives a reference, the other gives an int. In the former case, yes, I have tried converting to string (hence "<null>"). In the latter, it is really quite straightforward. Taking the earlier example I noted, the Molerat has a handful of special idles whose IDs can be ascertained, so it is a simple matter indeed to whip something up that studies the crosshair target to see if what they're currently doing happens to be a match for any of those special idle IDs, which, as I've underscored, IsIdlePlayingEx fails at, consistently returning "0" under all circumstances. Edited September 2, 2019 by Asterra Link to comment Share on other sites More sharing options...
Mktavish Posted September 4, 2019 Share Posted September 4, 2019 Are you starting with "Set MyActionVar To " ? Both the JIP functions require you to make a variable to store what is returned by the function.Then you compare your variable to something. Unlike the GetAnimAction does not need a storage spot. So there is no way to use those with the console , just a script as far as I know.So with the cross hair returning a reference that you store in a variable. SCN MyScript Int iActivate Ref rCrossHairRef rAnimAct Begin OnActivate ; set up some kind of activation ;If button pressed for example Set iActivate to 1 endifEnd Begin GameMode If iActivate == 1 Set rCrossHair to GetCrosshairRefEx Set iActivate to 2 If iActivate == 2 Set rAnimAct to rCrossHair.GetPlayedIdle ; and then what ever you're going to do with that That is assuming you can return an idle of a reference variable.The reason for the iActivate stages in the game mode block is to give it another frame for returning on a previous return. What exactly are you trying to achieve ? Are just looking for specific idles , or is it going to be rather dynamic ... ergo a lot of possibilities and lengthy code writing if you have to make libraries so to speak to check against. Link to comment Share on other sites More sharing options...
Asterra Posted September 5, 2019 Author Share Posted September 5, 2019 (edited) Are you starting with "Set MyActionVar To " ? Both the JIP functions require you to make a variable to store what is returned by the function.Then you compare your variable to something. As it happens, that is how I went about it. So there is no way to use those with the console , just a script as far as I know. I obviously can't say for certain, since none of the "idle" functions have worked for me thus far (and the JIP folks are being characteristically mum), but my solution to these headaches has always been to set a mod variable (using the console) to accept the output of a given function and then print the variable's value out to the console. This hasn't failed me yet. Begin GameMode If iActivate == 1 Set rCrossHair to GetCrosshairRefEx Set iActivate to 2 If iActivate == 2 Set rAnimAct to rCrossHair.GetPlayedIdle ; and then what ever you're going to do with that That is assuming you can return an idle of a reference variable. According to the Geckwiki entries, yes, you can (and I rather imagine they'd be worthless otherwise, even in a hypothetically functional capacity). As for permitting the game extra frames, simple enough: My investigation script simply watched for a valid target every 6 frames; if it found one, it stored the ref and spent every cycle thereafter reporting whether or not any of several predefined special idles were being played by said ref; it also printed the string name of the target ("Molerat"). Over the span of a solid minute of a Molerat cycling through its set of four special idles, none were detected. What exactly are you trying to achieve ? Are just looking for specific idles , or is it going to be rather dynamic ... ergo a lot of possibilities and lengthy code writing if you have to make libraries so to speak to check against. Nothing more or less complicated than the following: 1. Determine the name of a given special idle. What I am looking for may not, in fact, be a so-called "SPECIAL idle", but according to GetAnimAction, it is ("13"), so I'm in luck. (There are no functions for detecting specific idles that fall into any other category.) That said, I do not know the name of the idle, and I can't locate it in the somewhat convoluted idle animation tree (hence my refusal to outright trust what GetAnimAction is reporting), so I need that information before I can proceed. 2. Find a way to detect when a specific, pre-known special idle is playing. Obviously there's a function whose description suggests it's meant to do just that. But it, too, does not work. The final scripting will be modestly dynamic in the sense that I already know, for example, that there are certain flexibilities of timing involved that I will need to account for. I've dealt with such problems before. Edited September 5, 2019 by Asterra Link to comment Share on other sites More sharing options...
Mktavish Posted September 5, 2019 Share Posted September 5, 2019 Well there may be something up with that creature , or creatures in general , for these functions based on how their tree's are structured.Have you tried on npc's , or other creatures ? And are you just looking through the idle tree in geck ? In which I would suggest to unpack the BSA and look within it , just to see if you can find some explanation for the mystery.Or ... possibly by pulling the specific Idle(s) out of the BSA and dropping in loose folders will fix it ??? Also I'm thinking you could run an effect script to hit an actor with , then put "IsIdlePlayingEx" as the condition to run the effect , thereby round about telling you the idle is playing , so you can then do something else based on it. Hope that helps ... but that is pretty much the extent of my knowledge on it. Link to comment Share on other sites More sharing options...
Asterra Posted September 5, 2019 Author Share Posted September 5, 2019 Well there may be something up with that creature , or creatures in general , for these functions based on how their tree's are structured.Have you tried on npc's , or other creatures ?This is a fair point -- the function may only work on humans, despite no reason for nor indication of this limitation. I'll investigate this later. And are you just looking through the idle tree in geck ?Between GECK and FNVEdit, I did eventually locate the idle I was looking for (and confirm it was the right one with Nifskope). It did not matter; the function did not work with that idle any more than it did with the Mole Rat idles. Also I'm thinking you could run an effect script to hit an actor with , then put "IsIdlePlayingEx" as the condition to run the effect , thereby round about telling you the idle is playing , so you can then do something else based on it.Heh, that was actually going to be the next thing I tried today, simply because it was a suggestion made on the function's description page. (The idea being that perhaps the folks who implemented the function got that much working, but then forgot to make the function work in a scripted capacity.) You have some good ideas. Thanks. Link to comment Share on other sites More sharing options...
Asterra Posted September 5, 2019 Author Share Posted September 5, 2019 Also I'm thinking you could run an effect script to hit an actor with , then put "IsIdlePlayingEx" as the condition to run the effect , thereby round about telling you the idle is playing , so you can then do something else based on it. If ever I needed confirmation that these functions simply do not currently work, I now have it. IsIdlePlayingEx cannot be fully utilized as a GECK condition -- the "Function Parameters" cannot be filled, rendering the function unusable. Hard not to suspect that this also has some bearing on the function's non-usability in a script. Link to comment Share on other sites More sharing options...
c6dev Posted September 8, 2019 Share Posted September 8, 2019 It's pretty weird, the function is registered as a condition function but the arguments just don't work for some reason. Need to look into that. Link to comment Share on other sites More sharing options...
Recommended Posts