Nexussux! Posted September 21, 2021 Posted September 21, 2021 I've got the following function defined: Its purpose is simple: play a certain idle after some delay in seconds. The code itself works when implemented outside of the function, i.e. PlayIdle(tempIdle) will make player read a book when tempIdle is an idle property set to IdleBook_Reading. However, one of its arguments is of type "Idle". So whenever the function is called, such as: idlePlayOnPlayer(IdleBook_Reading,1.0) the compiler returns "undefined variable IdleBook_Reading". How do I pass an idle as an argument to this function?
Seijin8 Posted September 21, 2021 Posted September 21, 2021 58 minutes ago, Nexussux! said: I've got the following function defined: Its purpose is simple: play a certain idle after some delay in seconds. The code itself works when implemented outside of the function, i.e. PlayIdle(tempIdle) will make player read a book when tempIdle is an idle property set to IdleBook_Reading. However, one of its arguments is of type "Idle". So whenever the function is called, such as: idlePlayOnPlayer(IdleBook_Reading,1.0) the compiler returns "undefined variable IdleBook_Reading". How do I pass an idle as an argument to this function? Would help to see the section of code trying to call this. Did you declare the Idle as a property? In my own experience with this, I found it simpler (and a lot more flexible) to use: With Target being the actor, nName being a string of the animationevent to play. Can be tested in console with things like "player.sae gs386" or something like that. No compiler issues and very flexible since you can pass a wide array of possible strings.
Nexussux! Posted September 21, 2021 Author Posted September 21, 2021 3 minutes ago, Seijin8 said: Would help to see the section of code trying to call this. Did you declare the Idle as a property? In my own experience with this, I found it simpler (and a lot more flexible) to use: With Target being the actor, nName being a string of the animationevent to play. Can be tested in console with things like "player.sae gs386" or something like that. No compiler issues and very flexible since you can pass a wide array of possible strings. Thank you for your reply/ However, what was I supposed to use again? It doesnt show up XD
Nexussux! Posted September 21, 2021 Author Posted September 21, 2021 4 minutes ago, Seijin8 said: Would help to see the section of code trying to call this. Did you declare the Idle as a property? Also, this function is to be used in the scene papyrus fragment like so: (GetOwningQuest() AS AnimationPlayerControl).idlePlayOnPlayer(IdleBook_Reading,0.5)
Seijin8 Posted September 21, 2021 Posted September 21, 2021 3 minutes ago, Nexussux! said: Thank you for your reply/ However, what was I supposed to use again? It doesnt show up XD Right. Not a fan of the new formatting on the site... "Debug.SendAnimationEvent(Target, nName)" Not sure why it didn't print that... Anyhow, I've never had much luck with idlePlay... functions. Debug.SendAnimationEvent() has always worked better for me.
Nexussux! Posted September 21, 2021 Author Posted September 21, 2021 8 minutes ago, Seijin8 said: Right. Not a fan of the new formatting on the site... "Debug.SendAnimationEvent(Target, nName)" Not sure why it didn't print that... Anyhow, I've never had much luck with idlePlay... functions. Debug.SendAnimationEvent() has always worked better for me. Funny how I tried Debug.SendAnimationEvent() about 10 min before and it failed. Everything compile, The Debug notification I've set up shows, but No animation is played. Tried doing SendAnimationEvent in onKeyDown event, doesnt work either. Is there something I might be missing? Like GoToState("AIdriven") that is required for PlayIdle (it doesnt work otherwise) My code: Debug.SendAnimationEvent(Game.GetPlayer(),"IdleBook_Reading")
Seijin8 Posted September 21, 2021 Posted September 21, 2021 7 minutes ago, Nexussux! said: Funny how I tried Debug.SendAnimationEvent() about 10 min before and it failed. The Debug notification I've set up shows, but No animation is played. Tried doing SendAnimationEvent in onKeyDown event, doesnt work either. Is there something I might be missing? Like GoToState("AIdriven") that is required for PlayIdle (it doesnt work otherwise) The only time I've had issues was when the requested animation had conditions to prevent it. It'll say something like "not processed by graph" (which might mean I misspelled it), or a series of faction/condition variables will show up, meaning that there is some condition check and if it doesn't play, it didn't pass the check. That's why I like testing in console first. If it works there in-game, then Debug.SendAnimationEvent() will work, too. EDIT: Note that the string to activate it through SendAnimationEvent isn't always the same as the name of the idle as would be found as a property. xEdit helps for finding the right value to enter. With most such stuff, if I am unsure, I will add a half dozen ways to do something and notate each one, so I know which one worked, then remove the rest.
Nexussux! Posted September 21, 2021 Author Posted September 21, 2021 15 minutes ago, Seijin8 said: The only time I've had issues was when the requested animation had conditions to prevent it. It'll say something like "not processed by graph" (which might mean I misspelled it), or a series of fraction/condition variables will show up, meaning that there is some condition check and if it doesn't play, it didn't pass the check. That's why I like testing in console first. If it works there in-game, then Debug.SendAnimationEvent() will work, too. Ok, I see, thank you. It works in-game through console when I use gs386 (GSposes mod). However, player.sae IdleBook_Reading returns "not processed by graph ". Is there anywhere in the CK I can check the default idles' names? Or any other mod's (Like GSposes) anim names? Or is xEdit a must to get that info?
Seijin8 Posted September 21, 2021 Posted September 21, 2021 36 minutes ago, Nexussux! said: Or is xEdit a must to get that info? I would think that's a must. I used xEdit to fill up part of a spreadsheet of animations that could be reliably sent. Looks like "IdleBook_Read" is the correct send for that one. Testing now to confirm. EDIT: Confirmed. "player.sae idlebook_read" works. EDIT2: In xEdit, it is the ENAM value that you want to use, so "GS405" in the example pic you used. I'm sure the string is present in CK, I just don't use that abomination of a program unless I absolutely have to. xEdit is my go-to and I do the majority of my modding through it.
Nexussux! Posted September 21, 2021 Author Posted September 21, 2021 12 minutes ago, Seijin8 said: abomination of a program Totally agree with you on that ;D I've run xEdit on a bunch of mods (and skyrim.esm) and can now find the animEvent strings. Thanks a ton for the hint, was stuck at that forever until now (CK wiki wasn't much of a help). 12 minutes ago, Seijin8 said: xEdit is my go-to and I do the majority of my modding through it. Interesting. I've heard people making mods with xEdit before CK was out for public use. Is there a reliable documentation or wiki on modding with xEdit? Might reduce the amount of dumb questions I have to ask on this forum XD
Seijin8 Posted September 21, 2021 Posted September 21, 2021 2 minutes ago, Nexussux! said: Is there a reliable documentation or wiki on modding with xEdit? Probably. I've been using it for over a decade now, so I have no idea the current status of their documentation. 2 minutes ago, Nexussux! said: Might reduce the amount of dumb questions I have to ask on this forum XD If your questions were dumb, my only involvement would be ridicule. You're forging searchable documentation for the other doers out there. Ask away.
Nexussux! Posted September 21, 2021 Author Posted September 21, 2021 48 minutes ago, Seijin8 said: Probably. I've been using it for over a decade now, so I have no idea the current status of their documentation. Thanks again! The problem is solved. For anyone looking for a solution: To play idle animation: Debug.SendAnimationEvent(Target, nName) Where targt is ActorRefrence and nName is an animationEvent string. These strings can be found with Tes5Edit by loading the mod containing the idles you want, then looking in the "Idle Animation" branch. Example: Debug.SendAnimationEvent(PlayerRef.GetActorReference(), "gs386") The only part left is finding the SLAL animation event names. Is this even possible with xEdit? SLAL packs aren't in its mod list...
Seijin8 Posted September 21, 2021 Posted September 21, 2021 21 minutes ago, Nexussux! said: Thanks again! The problem is solved. For anyone looking for a solution: To play idle animation: Debug.SendAnimationEvent(Target, nName) Where targt is ActorRefrence and nName is an animationEvent string. These strings can be found with Tes5Edit by loading the mod containing the idles you want, then looking in the "Idle Animation" branch. Example: Debug.SendAnimationEvent(PlayerRef.GetActorReference(), "gs386") The only part left is finding the SLAL animation event names. Is this even possible with xEdit? SLAL packs aren't in its mod list... Sometimes possible, and I don't know why it sometimes works and sometimes not. You would have to look into the SLAL jsons for each stage to get the right info to send. (For instance, "Anubs_Troll_hold_A2_S5" or something similar. I haven't worked out the kinks on that one yet (mainly haven't put the time in, not that it would necessarily be difficult to figure out). Also, regarding GS animations, this might help (file attached). LibraryForPoses.json
Nexussux! Posted September 22, 2021 Author Posted September 22, 2021 15 hours ago, Seijin8 said: Sometimes possible, and I don't know why it sometimes works and sometimes not. Thanks! Just tested with Leito's SLAL anims and Billyy's SLAL anims. You were right that sometimes Papyrus chokes on itself and doesn't play the idle. However, I've found that if you spam that SendAnimationEvent() function about 4 times, it always works (at least in my mod), while the spamming doesn't affect the animation playback itself. Example: This thread should really be renamed "How to make NPC play an animation"
Seijin8 Posted September 22, 2021 Posted September 22, 2021 4 hours ago, Nexussux! said: This thread should really be renamed "How to make NPC play an animation" Probably so. 4 hours ago, Nexussux! said: if you spam that SendAnimationEvent() function about 4 times, it always works It had never occurred to me to try that. Good job, can add that to the arsenal.
Nexussux! Posted September 23, 2021 Author Posted September 23, 2021 20 hours ago, Seijin8 said: can add that to the arsenal. As a follow-up to my previous advice. There is a VERY specific case where even the "spam" method won't work: It is when you are trying to SendAnimationEvent() a non-first SLAL animation stage. I.e you want to play a 3rd stage of SLAL Billyy's "Masturbation" animation ("B_B_FMast1_A1_S3"). Using SendAnimationEvent(Game.GetPlayer(),"B_B_FMast1_A1_S3") will not work even though player.sae "B_B_FMast1_A1_S3" will. To fix that, play the first stage of that SLAL animation before 2nd, 3rd, or whatever stage. I.e: SendAnimationEvent(Game.GetPlayer(),"B_B_FMast1_A1_S1") ;Play 1st stage. SendAnimationEvent(Game.GetPlayer(),"B_B_FMast1_A1_S4") ;Play 3rd stage. Since you called this straightaway, 1st stage won't show Will correctly play 3rd stage of Billyy's masturbaton slal anim. If even that does not work, check whether the animation is appropriate for the actor's gender and race, as the game seems to check for it! I.e. _A1_ and _A2_ parts of the SLAL name (stands for Actor 1 and Actor2) No idea why it behaves this way.
Nexussux! Posted September 23, 2021 Author Posted September 23, 2021 21 hours ago, Seijin8 said: can add that to the arsenal. Ok, I start to kida get what is going on. SendAnimationEvent() does not just "play" the animation as, say, 3DSmax would. It is not "just" and animation - the actions are actually being performed and calculated by the game. I.e. if you SendAnimationEvent(Hadvar,"PowerAttackStanding"), whatever is in front of Hadvar will get hurt (This info is from the CK wiki). This leads to the following example: You want a riekling to play bleedOutEnd (or "Get up from the ground") animation. You do SendAnimationEvent(actor, "bleedOutEnd"). Nothing happens. In fact even "sae" command will throw you an error. However, if you do SendAnimationEvent(actor, "bleedOutStart") first, and only then "bleedOutEnd", then both animations will correctly play. Therefore, in order to "stop bleedout", the actor first have to already be in the "bleedout" state (i.e bleedout animation). It seems SendAnimationEvent() CAN and WILL inevitably check for conditions before deciding whether make that "animation" (full action in fact) play out. FNIS animation stages cannot play if the actor wasn't in the state preceding it (i.e. Blowjob_S2 cannot play unless actor is already playing Blowjob_S1). This effectively means that the in-game actions are driven by the 3D animation, not the other way around as it should and is done in more reputable engines since forever. The 3D animation speed now controls attack speed, run speed, jump speed or speed of any action in game. Since 3D animation's speed depends on your framerate (more FPS = faster 3D animation plays), such dependency inevitably ties the overall game speed to your FPS, explaining why "don't play Beth games over 60FPS" is a thing, and why in Fallout76 you could make a character run faster the faster your FPS count was. It Just: Works (tm)
alex77r4 Posted September 24, 2021 Posted September 24, 2021 9 hours ago, Nexussux! said: This leads to the following example: You want a riekling to play bleedOutEnd (or "Get up from the ground") animation. You do SendAnimationEvent(actor, "bleedOutEnd"). Nothing happens. In fact even "sae" command will throw you an error. However, if you do SendAnimationEvent(actor, "bleedOutStart") first, and only then "bleedOutEnd", then both animations will correctly play. That is caused by the animation graph. Skyrim use the behavior files to decide if one animation can be played. That mean, bleedOutEnd can not be reached if the actor is not in the correct position inside the animation chart. In others words, in bledout. I think that is imposed by the animation engine, probably havok, to have the less posible animations loaded in memory and ready to be executed. 9 hours ago, Nexussux! said: I.e. if you SendAnimationEvent(Hadvar,"PowerAttackStanding"), whatever is in front of Hadvar will get hurt (This info is from the CK wiki). One extended example is make that the wiki say with different weapons and look what happend. The exact animation played by the game depend of the weapon type that the NPC have in their hands. More clear, call SendAnimationEvent(Hadvar,"PowerAttackStanding") when Hadvar have a two hand sword play the correct animation for two hand sword. But when Hadvar have a single hand sword the game play the correct animation for one hand sword. As i said, that is caused by the animation graph because the one hand animation can not be reached while the actor is in two hands idle.
Seijin8 Posted September 24, 2021 Posted September 24, 2021 13 hours ago, Nexussux! said: There is a VERY specific case where even the "spam" method won't work: It is when you are trying to SendAnimationEvent() a non-first SLAL animation stage Yeah, those animations hkx entries have explicit start points, so maybe the engine needs that to use them? Makes me curious if creating a "new" SLAL type animation with whatever start stage you want to access would allow it to be pulled more flexibly.
Nexussux! Posted September 24, 2021 Author Posted September 24, 2021 1 hour ago, Seijin8 said: Yeah, those animations hkx entries have explicit start points, so maybe the engine needs that to use them? Makes me curious if creating a "new" SLAL type animation with whatever start stage you want to access would allow it to be pulled more flexibly. This is a possible option. Gotta look into it.
alex77r4 Posted September 24, 2021 Posted September 24, 2021 4 hours ago, Seijin8 said: Yeah, those animations hkx entries have explicit start points, so maybe the engine needs that to use them? Makes me curious if creating a "new" SLAL type animation with whatever start stage you want to access would allow it to be pulled more flexibly. As i said: "Skyrim use the behavior files to decide if one animation can be played" The individual hkx files not have any limitation of any kind because are pure animations converted from Max or Blender. But for add that animations (hkx) to Skyrim you need a behavior file. Is absolutely impossible make the game play an animation that is not included inside a behavior file. And the behaviors, normally, are created with FnisForModers and go to have the expressed limitations. The only possibility is create the behavior file in a manual way, using hkxcmd.exe, to try remove that limitations. But the behaviors must be created following specific rules and the internal structure of the behaviors must be preserved. If you try break the rules, probably, you go to have all kind of problems.
Nexussux! Posted September 24, 2021 Author Posted September 24, 2021 10 hours ago, alex77r4 said: As i said: "Skyrim use the behavior files to decide if one animation can be played" The individual hkx files not have any limitation of any kind because are pure animations converted from Max or Blender. But for add that animations (hkx) to Skyrim you need a behavior file. Is absolutely impossible make the game play an animation that is not included inside a behavior file. And the behaviors, normally, are created with FnisForModers and go to have the expressed limitations. The only possibility is create the behavior file in a manual way, using hkxcmd.exe, to try remove that limitations. But the behaviors must be created following specific rules and the internal structure of the behaviors must be preserved. If you try break the rules, probably, you go to have all kind of problems. 15 hours ago, Seijin8 said: Yeah, those animations hkx entries have explicit start points, so maybe the engine needs that to use them? Makes me curious if creating a "new" SLAL type animation with whatever start stage you want to access would allow it to be pulled more flexibly. There is a PlayAnimation() function in SKSE (here), but it is undocumented and it isn't clear what parameter it expects. Did you ever use it?
Seijin8 Posted September 24, 2021 Posted September 24, 2021 10 minutes ago, Nexussux! said: There is a PlayAnimation() function in SKSE (here), but it is undocumented and it isn't clear what parameter it expects. Did you ever use it? https://www.creationkit.com/index.php?title=PlayAnimation_-_ObjectReference Seems it cannot be played on an actor.
alex77r4 Posted September 24, 2021 Posted September 24, 2021 15 minutes ago, Nexussux! said: There is a PlayAnimation() function in SKSE (here), but it is undocumented and it isn't clear what parameter it expects. Did you ever use it? Is documented: https://www.creationkit.com/index.php?title=PlayAnimation_(Papyrus) That is the call that you must make when, for example, you want a dwarven object start moving when press a button.
Nexussux! Posted September 25, 2021 Author Posted September 25, 2021 15 hours ago, alex77r4 said: Is documented: https://www.creationkit.com/index.php?title=PlayAnimation_(Papyrus) That is the call that you must make when, for example, you want a dwarven object start moving when press a button. Oops. Thank you for the link nevertheless
Recommended Posts
Archived
This topic is now archived and is closed to further replies.