Guest Posted January 31, 2015 Posted January 31, 2015 Ok, if you do a getfromfromfile and the mod does not exist you have a line in the trace file, no big deal, and then you simply have a None as result of your call. You can check the mod, but you still have a trace line if the mod is not here. As far as I know you cannot "equip" a potion. I was not able to do this with my mods. So I simply send an anmiation event "drinkpotion" and then apply the effect of the potion if any. Workrs fine for the player, does not for NPCs. But this may be only my little knowledge. The definition of EquipItem is: Actor.EquipItem(Form Item, bool PreventRemoval = false, bool Silent = false) So you need always to specify the item, then you may specify the second parameter to True or False depending if you want the item to be equipped by default and NOT removed. True will prevent the automatic unequipping (but not an explicit one); False will let the game to decide if the item has to be unequipped. The third parameter will specify if the sound that may be associated with the item will be played or not. There is no integer parameter for this function. Please use the CreationKit site to get all the definitions of the standard Functions (also SKSE ones): http://www.creationkit.com/ It is an amazing resource for all the modders.
chajapa Posted January 31, 2015 Author Posted January 31, 2015 CPU74, Thank you. I'll have to look at whether Lactacid is a potion or food or both.... just found IsFood() hehehehe . I know when I'm in game if I go to console, I can target an NPC and type: equipitem <ID of Lactacid> 1 and that will cause them to USE the Lactacid... so I'll look and see what category it is being listed under.
Guest Posted January 31, 2015 Posted January 31, 2015 If you know the id of lactaid, then in the console type: help <id> And then you will see 4 uppercase letters just before the item. These letter will tell you what the object is. ARMO = Armor NPC_ = NPC (also a specific creature) WEAP = Weapon ALCH = Alchemy MISC = Misc Object RACE = Race CELL = Cell etc. But it will be way more easy if you get the object in the CK, just click on "All Object" at the very bootom of the tree and type in the Form field the name or the id of the item
Guest Posted January 31, 2015 Posted January 31, 2015 Side note: if you do a console command like: equipitem <id> 1 the last "1" is not the number of items, it is equivalent to the "True" value for the "PreventUnequip" parameter.
chajapa Posted January 31, 2015 Author Posted January 31, 2015 Lactacid is ALCH When I view it in CK, the Window title is Potion and the "Food Item" box is checked. The ID of it is MME_Lactacid the NAME is Lactacid It plays the ITMDrinkPotion sound...
chajapa Posted January 31, 2015 Author Posted January 31, 2015 Side note: if you do a console command like: equipitem <id> 1 the last "1" is not the number of items, it is equivalent to the "True" value for the "PreventUnequip" parameter. Hmmm... maybe this depends on item type? Because if I type: player.additem <ID_of_Daedric_Arrow> 300 I get 300 Daedric arrows
WraithSlayer Posted January 31, 2015 Posted January 31, 2015 if you do a getfromfromfile and the mod does not exist you have a line in the trace file, no big deal, and then you simply have a None as result of your call. You can check the mod, but you still have a trace line if the mod is not here. If you're using Game.GetModByName("modname.esp") and the mod doesn't exist, there won't be any trace lines, the function simply returns 255 as that's what it's designed to do if it doesn't find the mod. Source: Calling this function on a non-existent plugin will not result in any log output, and so it may be used strategically before calling something like GetFormFromFile() to avoid creating log errors. (Or in place of GetFormFromFile entirely, if you only want to check if the plugin is present). Using Game.GetFormFromFile() without first checking for the mod's presence, will result in trace errors. These errors won't actually do any harm as long as you're checking if the function output is None and acting accordingly, but they might confuse some users of your mod if they look at their trace log, thinking something's broken when it's not.
WraithSlayer Posted January 31, 2015 Posted January 31, 2015 Side note: if you do a console command like: equipitem <id> 1 the last "1" is not the number of items, it is equivalent to the "True" value for the "PreventUnequip" parameter. Hmmm... maybe this depends on item type? Because if I type: player.additem <ID_of_Daedric_Arrow> 300 I get 300 Daedric arrows CPU74 is talking about EquipItem, you used Additem in your console command.
chajapa Posted January 31, 2015 Author Posted January 31, 2015 ahhhh.... gotcha. Yeah, that was dumb on my part. Apples and oranges.... I'm still working on planning where and how to insert the stripping stuff into JUGs. Using the avaiable idles and animations included in the dialogue topics adds some life to the conversation. I wish I knew what more of them did. THis is kinda fun I might create another test mod that just tests those little animation bits. Conversation would basically be each actor saying what animation they're using That will be lots of topics though... Although.... it MIGHT be nice to have just to have a way of seeing what all those animations do. Like... for reference. Some are persistent (HandsBehindBack) and some seem to stop just fine without looping. I haven't found a way to list them and run them in-game.
Guest Posted January 31, 2015 Posted January 31, 2015 To check anymations you can do a small trick (that I always use): For standard animations just go in CK, Menu GamePlay then Animations... Then expand "Actors\Characters\Behaviors\0_Master,hkx" and then by sub-folder write somewhere the IDs of the animations, usually you find most of them that are safe in the LOOSE group. If you wish to check animations from a mod, go in the folder on your drive: <Skyrim>\Data\meshes\actors\character\animations\<name of the mod>\ and check for a .txt file, it usually contains the FNIS definition for the animations. Track the names (usually it is the first word of a row that NOT begin with -, +, or ' ) Example from FNIS_Cum Shot Brothel_List.txt o -a,h,o csbPoleDance csbPoleDance.hkx csbAnimObjectPole b csbModelAnim csbModelAnim.hkx b -h csbStanding csbStanding.hkx b -h,a csbA1 csbA1.hkx b -h,a csbA2 csbA2.hkx The items highlighted in green are the names and IDs of the animations. Then add to your mod a debug package: two procedures inside Travel to your favorite Marker, and then Wait. Set BOTH to not "Success completes package". Then add this debug package to the NPC you like. start the game, go to the marker you selected, your NPC will be here. At this point open the console and type: sae <id of the animation> sae is the short form of SendAnimationEvent Your NPC will play forcely the animation, also if it is a paired animation. (I suppose your FNIS is at least version 4 ...) Track the anims you like. Then in your code, for the non-paired ones (but the anim objects one are ok) you can play them with: Debug.SendAnimationEvent(actor, "animation id") Where actor is the NPC you want (can be also the player but in this case better to control player AI for a short while, disable some commands the player can use, and usually force the third view)
WraithSlayer Posted January 31, 2015 Posted January 31, 2015 Although.... it MIGHT be nice to have just to have a way of seeing what all those animations do. Like... for reference. Some are persistent (HandsBehindBack) and some seem to stop just fine without looping. I haven't found a way to list them and run them in-game. There isn't a way of previewing FNIS animations, I'm afraid. But you could try: Nevermind, CPU74 has a better alternative. Debug.MessageBox("Playing animation_name1") Debug.SendAnimationEvent(PlayerRef, "animation_name1") Utility.Wait(5.0) ;give some time for the animation to play Debug.SendAnimationEvent(Target, "IdleForceDefaultState") ;reset the player to default idle Debug.MessageBox("Playing animation_name2") Debug.SendAnimationEvent(PlayerRef, "animation_name2") Utility.Wait(5.0) Debug.SendAnimationEvent(Target, "IdleForceDefaultState") ...etc...
Guest Posted January 31, 2015 Posted January 31, 2015 There isn't a way of previewing FNIS animations, I'm afraid. But you could try: Actually there is. You just need to find the names/ids (for animations names and IDs are the same) and then open the console and try, after clicking on a NPC, better if it is stable in one position: sae <animid> My recommendation is to have a debug NPC still at one position, and to write somewhere the list of animations names to try. It is hard to get them from the "help" of the console. EDIT: ok, me and WraithSlayer are competing on who will post first
WraithSlayer Posted January 31, 2015 Posted January 31, 2015 Actually there is. You just need to find the names/ids (for animations names and IDs are the same) and then open the console and try, after clicking on a NPC, better if it is stable in one position: sae <animid> Yeah, didn't know sae existed! Should prove very useful, thanks.
Guest Posted January 31, 2015 Posted January 31, 2015 You welcome. sae is the short form of SendAnimationEvent (Almost) All functions that are like Debug.xyz have an equivalent xyz command in the console. Very useful for modding. But it is sad that to do advanced modding we need to use a "debug" function. Let's wait for TESVI (or mybe TES6) Side note: some animation are looping. They will NOT stop themselves when the animation end. To stop them is mandatory to do to the same actor a Debug.SendAnimationEvent(actor, "IdleForceDefaultState")
chajapa Posted January 31, 2015 Author Posted January 31, 2015 yeah, actually, the FNIS animations aren't a problem for me. When you're in the topc's info editing screen, there are places to select an animation to play for Speaker (the NPC you're talking to) and for Listener (your player). There's a rather long list of animations. 5 different "applaud", one called IdleHandsBehindBack, another called ComeThisWay, etc. Some are obvious as to what they do. I mean if it's called DrinkPotion I can kinda figure out what that one entails. Oh there's one IdleWipeBrow, Or IdlePointFar, IdlePointNear, and the ones for WarmHands, etc. But there are a bunch that I have no idea what tehy're referring to, some seem intended for a specific character or event... NocturnalThisAnimation or NocturnalThatAnimation... can another character do that animation? Or WeddingWelcome... is that arms spread in welcome and can any character do that? And you can select any of these and it doesn't add scripts so it must be built in to the Dialogue engine. I'm only using a couple and they really add a lot to a dialogue exchange between characters. And I *THINK* I'll only find their names by stomping around in CK.
Guest Posted January 31, 2015 Posted January 31, 2015 Ok, I think you are referring of the Idle animations that you can select in the definition of the Response Text of a Topic. In this case you can play only "unpaired" animations (anim object animations are ok.) The NPC or the Player will play them while he/she is speaking, but keep in mind that you have zero control in this case. Animations are bounded only to a skeleton, nothing else. So all the animation that apply to a "biped model" will be playable. Your player can be Nocturnal or Astrid if you wish. What an animation does? It is written nowhere. Just play all of them using the console until you will find something that you like. Some of them are not in the drop-down list? Maybe they are linked to a specific AnimEvent. No way to bypass this in an easy way. (But it is posisble to do it by creating a copy of the animation and re-entering it using a custom behavior generated by FNIS for your mod.) Keep in mind also that the list of animations that appear in the drop down are only the LOOSE animations.
chajapa Posted January 31, 2015 Author Posted January 31, 2015 yes... exactly. In the Response Text of a topic. The drop-down there. Not sure how to find the specific animations. I was in CK and I found what appears to be an "IdleMarker" for "ComeThisWay"... I selected "All" in the Object Window in CK and tried to filter on HandsBehindBack (which I am USING so I know it's real) and nothing showed up. Maybe I need to enable the DLCs when looking for these. I'll get there... I'll figure something out. I still have to open my mod and figure out where to place the dialogue and use the stripping (thank you both very much) and in my test mod I need to work out if I can give that potion from MilkModNEW to an NPC and have it work the same as if it WAS from MilkModNEW. So... for me... lots of dialogue-writing to do and depending on how my wife is out shopping... maybe some testing in the test mod.
chajapa Posted January 31, 2015 Author Posted January 31, 2015 Wow.... just stoppin' in real quick to thank you both again. I wrote dialogue to make use of the stripping and it's working out beautifully. I have my female player kinda... showing off (with a lot of dialogue), and my male PC having a discussion with one of his followers when she's concerned about her breasts not being big enough. The animation plays into the conversation perfectly. I can't wait to find more gems like this as I'm trying to build a very dialogue-based interaction between PC and NPC, in a consensual theme. There's already enough rape-based stuff. And they're very well done, but I wanted to go in a different direction. YOUR help... both of you... is appreciated very much as I try to learn my way into having something fun...
Guest Posted February 1, 2015 Posted February 1, 2015 Thanks chajapa, happy to help. An idea, if you don't mind: "breast not big enough"? Use one potion to enlarge them. I have something similar in both my mods (one uses a spell, the other a potion). I can give you the code for the magic effect to make it happen, it is really easy to use.
WraithSlayer Posted February 1, 2015 Posted February 1, 2015 You're welcome, always nice to help people get into mod development.
fore Posted February 1, 2015 Posted February 1, 2015 Unfortunately, sae is only possible for a subset of animations, like someone said. Because sae sends anim events, and in most cases animevent and animation file (which is what you want) do not have the same name. Even more, in many cases there isn't a proper animation event at all which makes the wanted animation file play. The easiest way to play most of the available animation files is FNIS Spells, or FNIS Zoo for the creatures. Simply replace FNIS' animation files with what you want to look at.
chajapa Posted February 1, 2015 Author Posted February 1, 2015 OK, another question... I want to make sure my PLAYER is put into the JugsFaction I am assuming that the main quest script is loaded when the quest starts. If that is an incorrect assumption, please let me know If I put something like this in the main quest script: if PlayerRef.IsInFaction(JugsFaction) != 1 PlayerRef.AddToFaction(JugsFaction) endif Would that take care of it? AND.. If I'm talking to an NPC named... Eryniel and if I want a debug.notifications to tell me that she has been added to the JugsFaction How do I get her NAME to be part of the notification? I'm finding something like this: PlayerRef.GetActorBase().GetName() and having a bit of a brain fart trying to figure out how to actually use that
Guest Posted February 1, 2015 Posted February 1, 2015 Hi chajapa, on you main quest script you should have a Event function called OnInit() Just place your checking in this event, and it will be done. Event OnInit() if !PlayerRef.IsInFaction(JugsFaction) PlayerRef.AddToFaction(JugsFaction) endif ... EndEvent To have a notification (or a trace) with a name of the NPC first of all you need the Actor. If you are in a dialog fragment you can use akSpeaker, if you are in a package you can use akActor, if the case is different you need to get somehow a reference to the Actor. Then just write (dialogue example): Debug.Notification(akSpeaker.getLeveledActorBase().getName() + " is in JUG!") Try to use getLeveledActorBase() and not getActorbase() or for some NPCs you may have weird results.
chajapa Posted February 1, 2015 Author Posted February 1, 2015 would all followers be in LeveledActorBase? I mean followers in vanilla game followers, add-on followers who are in the vanilla follower system, special followers who are NOT in the vanilla follower system? AND... in that OnInit() event, would that also be where I would put a message like, "JUGs is started" ?
Guest Posted February 1, 2015 Posted February 1, 2015 the GetLeveledActorbase() is used to get the correct actor when an actor is not specific (like guards or bandits). If the actor is specific, then this function simply revert to getActorbase(). So use it, always, and just forget. (Works on the player too if you ask.) About "JUGs is started" yes. The OnInit is a good place. But people will get frustrated if they get this message every time the start a game with your mod. Better this approach: * in your main script add a variable to check if JUG was already activated or not. bool isJUGActive = false Event OnInit() if (!isJUGActive) isJUGActive = true ; do your first initialization stuff if !PlayerRef.IsInFaction(JugsFaction) PlayerRef.AddToFaction(JugsFaction) endif Debug.Notification("JUG is active!") endIf EndEvent
Recommended Posts
Archived
This topic is now archived and is closed to further replies.