Jojash Posted April 11, 2013 Share Posted April 11, 2013 Is there a way to add items from DLCs or other mods to a form list in a separate mod without making them a master of whatever mod contains the form list they would be added to? And, because asking something that has nothing to with the original question is always fantastic, is there a way of getting an NPC to play a specific animation. I know that I can use "PlayGroup" to get an NPC to play an animation, but if I use something like, "ExampleNPC.PlayGroup LeftAttack" and "ExampleNPC" has multiple animations labelled "LeftAttack", is there a way to choose a specific one? Thanks in advance! Link to comment Share on other sites More sharing options...
Gribbleshnibit8 Posted April 11, 2013 Share Posted April 11, 2013 The first one is very possible using NVSEs wonder IsModLoaded, GetModIndex, and BuildRef. IsModLoaded is a condition function that takes a string parameter in the form of the name of the mod you are looking for. if (isModLoaded "DeadMoney.esm") GetModIndex returns the load order index of a mod in decimal format. set iIndex to getModIndex "DeadMoney.esm" BuildRef takes the formID of an item converted into decimal format, and combines it with the mod's index to, well build a reference. set rObject to BuildRef iIndex 48393This sets rObject equal the the base form of NVDLC01WeapPolicePistol. Obviously you can do an awful lot with these three functions. A few notes to keep in mind that I have learned from using them a lot.BuildRef will build any object. Placed, base, etc. You simply need to convert the formID of the object into decimal format.The engine will NOT keep track of your data value for you. It would be perfectly possible to set the ref variable to a quest form and then try to equip that quest or add it to inventory. It's up to you to make sure you have the correct data and do the correct thing with it.Once you use GetModIndex, you do not need to call it again until you change mods. Setting up for BuildRef is tedious work. I have done hundreds of forms by hand, plugging each into a converter and getting the results. However, thanks to JaxFirehart there exists a FNVEdit script for doing this much more easily and quickly. You can download it here. Simply extract the archive to your new vegas directory, ensuring that you have FNVEdit 3.0.29 or higher. Open it and load the mods you want to use. Expand the mods out until you find the items you want and select the items (use Ctrl+click to select more than 1). Once you have them all selected. right click on one of them and choose Apply Scripts. Then select the script I provided and run it. It will export all the selected refs out to the included csv file, with the formIDs converted to decimal already, and the EditorID of the item alongside the FormID, along with the plugin that the item came from. As for your second question, no clue. Link to comment Share on other sites More sharing options...
jazzisparis Posted April 11, 2013 Share Posted April 11, 2013 Is there a way to add items from DLCs or other mods to a form list in a separate mod without making them a master of whatever mod contains the form list they would be added to?NVSE includes some very useful functions, intended for this purpose.For instance, suppose you want to add the Holorifle (from Dead Money) to some form list, you can use this code: set iIndex to GetModIndex "DeadMoney.esm" ; If Dead Money was loaded, returns its index (or 255 otherwise). if iIndex < 255 set rObject to BuildRef iIndex 37615 ; 37615 is the decimal of 92EF - the FormID of the Holorifle. AddFormToFormList YourTargetList rObject ; rObject, now pointing to the Holorifle, is added to your list. endif I know that I can use "PlayGroup" to get an NPC to play an animation, but if I use something like, "ExampleNPC.PlayGroup LeftAttack" and "ExampleNPC" has multiple animations labelled "LeftAttack", is there a way to choose a specific one?As far as I know, the attack animation played depends on the type of weapon ExampleNPC has equipped. If it's a pistol, then the AttackLeft animation associated with OneHandPistol weapon type will be played. EDIT: It appears I was ninja'd by Gribb. Just you wait, Gribb! Link to comment Share on other sites More sharing options...
Jojash Posted April 12, 2013 Author Share Posted April 12, 2013 (edited) Thank you both very much, this is very helpful! I'm sad that I'm capable of giving only one kudos point. Ah well. One other thing though, if I use something like "ExampleNPC.PlayGroup FastForward 1", will this cause the NPC to move, or will they play the animation but stay rooted to the spot? I assumed the former, but after some testing I find myself unsure. :\ Edited April 12, 2013 by Jojash Link to comment Share on other sites More sharing options...
jazzisparis Posted April 12, 2013 Share Posted April 12, 2013 As a rule, using either PlayGroup or LoopGroup should always be followed by PlayGroup Idle 0. Not doing so will invite some pretty nasty glitches. Link to comment Share on other sites More sharing options...
Jojash Posted April 12, 2013 Author Share Posted April 12, 2013 (edited) Immediately after? Right now I've got it set up in such a way that the NPC will play whatever animation when a key is pressed and then when the key is released I've used "PlayGroup Idle 1". For example: If IsControlPressed 0 && Counter != 1 ExampleNPC.PlayGroup FastForward 1 Set Counter to 1 Elseif IsControlPressed 0 != 1 && Counter == 1 ExampleNPC.PlayGroup Idle 1 Endif Also, what about creatures that have multiple weapons, such as a securitron or a radscorpion? How would I make it equip a specific weapon? Would I just use "ExampleNPC.Equip Item Weapon6" and then, "ExampleNPC.Play Group Equip 1", or something? Edited April 12, 2013 by Jojash Link to comment Share on other sites More sharing options...
jazzisparis Posted April 12, 2013 Share Posted April 12, 2013 PlayGroup Idle 0 should be called when you want the actor to stop playing the animation. It would be easier if you could elaborate on what, exactly, you're trying to do. Link to comment Share on other sites More sharing options...
Jojash Posted April 12, 2013 Author Share Posted April 12, 2013 Heh, I always seem to give too little information, my apologies. Basically, I'm trying to get an NPC to move if the player tells them to. So, if the player presses whatever key is bound to moving them forward, the NPC moves forward too. I can post the segment of the script that deals with it, if that would help? Link to comment Share on other sites More sharing options...
jazzisparis Posted April 12, 2013 Share Posted April 12, 2013 I can post the segment of the script that deals with it, if that would help?Sure, go ahead. Link to comment Share on other sites More sharing options...
Jojash Posted April 12, 2013 Author Share Posted April 12, 2013 (edited) Here, I think I've managed to pretty badly screw up how the animations are handled, as the ones handling movement seem to work in-game, when I'm fairly certain that they really, really shouldn't. I've not been successful in my attempts to get the weapon animations working at all. If RobotPosition != 0 && PossessCounter < 1 Set RobotScale to RobotPosition.GetScale Set PlayerScale to Player.GetScale Player.SetScale RobotScale ApplyImageSpaceModifier CyberianDawnBifrostPossessionISFX RobotPosition.SetActorAlpha 0 Player.AddSpell CyberianDawnRobotPossessedEffect ShowMessage CyberianDawnBifrostPossessedMessage Set PossessCounter to 1 Set UserHealth to Player.GetAV Health Set UserDT to Player.GetAV DamageThreshold If Player.GetPCIsSex Male Set User to StartingPosition.PlaceAtMe CyberianDawnUserMale User.SetAV Health UserHealth User.SetAV DamageThreshold UserDT Else Set User to StartingPosition.PlaceAtMe CyberianDawnUserFemale User.SetAV Health UserHealth User.SetAV DamageThreshold UserDT Endif User.SetActorsAI 0 Endif If PossessCounter == 2 If IsKeyPressed CDMarkHotkey != 1 RobotPosition.SetRestrained 1 Set PossessCounter to 3 EnablePlayerControls 0 0 0 0 1 0 0 Endif Endif If PossessCounter == 4 If IsKeyPressed CDMarkHotkey != 1 RobotPosition.SetRestrained 0 Set PossessCounter to 1 DisablePlayerControls 1 1 1 1 1 1 1 Endif Endif If PossessCounter == 3 If IsControlPressed 0 && MoveCounter < 1 Set MoveCounter to 1 RobotPosition.PlayGroup FastForward 1 Elseif IsControlPressed 1 && MoveCounter < 1 Set MoveCounter to 1 RobotPosition.PlayGroup FastBackward 1 Elseif MoveCounter == 1 If IsControlPressed 0 != 1 If IsControlPressed 1 != 1 RobotPosition.PlayGroup Idle 0 Set MoveCounter to 0 Endif Endif Endif If RobotPosition.IsInList CyberianDawnProtectronList || RobotPosition.IsInList CyberianDawnMrGutsyList If IsControlPressed 2 && MoveCounter != 2 RobotPosition.PlayGroup Left 0 Set MoveCounter to 2 Elseif IsControlPressed 3 && MoveCounter != 2 RobotPosition.PlayGroup Right 0 Set ControlCounter to 2 Elseif MoveCounter == 2 RobotPosition.PlayGroup Idle 0 Set MoveCounter to 0 Endif Else If IsControlPressed 2 && MoveCounter != 2 RobotPosition.PlayGroup TurnLeft 0 Set MoveCounter to 2 Elseif IsControlPressed 3 && MoveCounter != 2 RobotPosition.PlayGroup TurnRight 0 Set MoveCounter to 2 Elseif MoveCounter == 2 RobotPosition.PlayGroup Idle 0 Set MoveCounter to 0 Endif Endif If RobotPosition.IsInList CyberianDawnSecuritronList If IsControlPressed 4 && DrawCounter == 1 Set RobotWeapon to Robotposition.GetEquippedObject 5 RobotPosition.FireWeapon RobotWeapon Set MoveCounter to 3 Elseif IsControlPressed 4 && DrawCounter != 1 RobotPosition.PlayGroup Equip 1 Set MoveCounter to 3 Set DrawCounter to 1 Elseif MoveCounter == 3 RobotPosition.PlayGroup Idle 0 Set MoveCounter to 0 Set DrawCounter to 0 Endif Else Set PossessCounter to 4 Endif Endif If PossessCounter == 1 && ISMCounter != 1 If RobotPosition.GetDead != 1 If IsKeyPressed CDHackHotkey != 1 && IsKeyPressed CDMarkHotkey != 1 DisablePlayerControls 1 1 1 1 1 1 1 Player.StopCombatAlarmOnActor Set MovePosition to RobotPosition.GetPos X Player.SetPos X Moveposition Set MovePosition to RobotPosition.GetPos Y Player.SetPos Y Moveposition Set MovePosition to RobotPosition.GetPos Z Player.SetPos Z Moveposition Set RobotAngleX to RobotPosition.GetAngle X Set RobotAngleY to RobotPosition.GetAngle Y Set RobotAngleZ to RobotPosition.GetAngle Z Player.SetAngle X RobotAngleX Player.SetAngle Y RobotAngleY Player.SetAngle Z RobotAngleZ Elseif IsKeyPressed CDHackHotkey RobotPosition.SetActorAlpha 1 User.Disable User.MarkForDelete Player.Dispel CyberianDawnRobotPossessedEffect RemoveImageSpaceModifier CyberianDawnBifrostPossessionISFX Player.MoveTo StartingPosition StartingPosition.Disable StartingPosition.MarkForDelete Player.SetScale PlayerScale Player.SetGhost 0 EnablePlayerControls Set RobotPosition to 0 Set PossessCounter to 0 Set CDRobotPossessed to 0 Set HotKeyCounter to 0 Set ISMCounter to 0 Elseif IsKeyPressed CDMarkHotkey Set PossessCounter to 2 Endif Else RobotPosition.SetRestrained 0 RobotPosition.SetActorAlpha 1 Set Timer to 1 Set ISMCounter to 1 RemoveImageSpaceModifier CyberianDawnBifrostPossessionISFX ApplyImageSpaceModifier CyberianDawnBifrostSignalLostISFX Endif Endif If PossessCounter == 3 && ISMCounter != 1 If RobotPosition.GetDead != 1 If IsKeyPressed CDHackHotkey != 1 && IsKeyPressed CDMarkHotkey != 1 Player.StopCombatAlarmOnActor Set MovePosition to RobotPosition.GetPos X Player.SetPos X Moveposition Set MovePosition to RobotPosition.GetPos Y Player.SetPos Y Moveposition Set MovePosition to RobotPosition.GetPos Z Player.SetPos Z Moveposition Set RobotAngleX to RobotPosition.GetAngle X Set RobotAngleY to RobotPosition.GetAngle Y Set RobotAngleZ to RobotPosition.GetAngle Z Set PlayerAngleZ to Player.GetAngle Z RobotPosition.SetAngle Z PlayerAngleZ Elseif IsKeyPressed CDHackHotkey RobotPosition.SetRestrained 0 RobotPosition.SetActorAlpha 1 User.Disable User.MarkForDelete Player.Dispel CyberianDawnRobotPossessedEffect RemoveImageSpaceModifier CyberianDawnBifrostPossessionISFX Player.MoveTo StartingPosition StartingPosition.Disable StartingPosition.MarkForDelete Player.SetScale PlayerScale Player.SetGhost 0 EnablePlayerControls Set RobotPosition to 0 Set PossessCounter to 0 Set CDRobotPossessed to 0 Set HotKeyCounter to 0 Set ISMCounter to 0 Elseif IsKeyPressed CDMarkHotkey Set PossessCounter to 4 Endif Else RobotPosition.SetRestrained 0 RobotPosition.SetActorAlpha 1 Set Timer to 1 Set ISMCounter to 1 RemoveImageSpaceModifier CyberianDawnBifrostPossessionISFX ApplyImageSpaceModifier CyberianDawnBifrostSignalLostISFX Endif Endif If ISMCounter == 1 Set Timer to Timer - GetSecondsPassed If Timer <= 0 User.Disable User.MarkForDelete RemoveImageSpaceModifier CyberianDawnBifrostSignalLostISFX ShowMessage CyberianDawnBifrostSignalLostMessage Player.Dispel CyberianDawnRobotPossessedEffect Player.MoveTo StartingPosition StartingPosition.Disable StartingPosition.MarkForDelete Player.SetScale PlayerScale Player.SetGhost 0 EnablePlayerControls Set RobotPosition to 0 Set CDRobotPossessed to 0 Set HotKeyCounter to 0 Set ISMCounter to 0 Set PossessCounter to 0 Endif Endif Edited April 12, 2013 by Jojash Link to comment Share on other sites More sharing options...
Recommended Posts