fg109 Posted April 15, 2012 Author Share Posted April 15, 2012 A script to make an NPC appear just like a psijic does....? I think you're talking about when the psiijic first appears in that vision/telepathy thing in Saarthal right? I haven't looked at the scripts controlling that, but I think it's something like this: Spell property AbGhost auto {An ability that applies the ghost effect shader} Spell property AoEAbility01 auto {Cloak ability to apply effects to everyone in the current area and disable their AI} Spell property AoEAbility02 auto {Cloak ability to apply effects to everyone in the current area and enable their AI} Actor property MyNPC auto {The NPC taking the place of the psiijic monk} ImageSpaceModifier property CGDragonBlurImod auto {An imod to apply the blurring effect on the screen} Function StartVision() CGDragonBlurImod.Apply() Game.GetPlayer().AddSpell(AoEAbility01, false) MyNPC.MoveTo(Game.GetPlayer()) MyNPC.Enable() MyNPC.AddSpell(AbGhost) Utility.Wait(1) Game.GetPlayer().RemoveSpell(AoEAbility01) EndFunction Function StopVision() MyNPC.RemoveSpell(AbGhost) MyNPC.Disable() Game.GetPlayer().AddSpell(AoEAbility02, false) CGDragonBlurImod.Remove() Utility.Wait(1) Game.GetPlayer().RemoveSpell(AoEAbility) EndFunction So when the "vision" starts, you call the StartVision() function, and when it ends, you call the StopVision() function. I wrote an article on the wiki that will show you how to make the AoE abilities. (You wouldn't need this if you could control exactly who is near the player when the vision starts.) @yagya What you want to do is way beyond the scope of scripting. I'm not a programmer... :( Not that I'm any expert, but I think it would require re-writing the game/graphics engine. @ghosu Someone answered your topic on the BethSoft forums. And I really can't think of anything other than what they already suggested (having two objects, one for each nif, and then switching them out for each other). Link to comment Share on other sites More sharing options...
Jadak Posted April 15, 2012 Share Posted April 15, 2012 Outstanding, you sir are a scholar and a gentleman. Link to comment Share on other sites More sharing options...
ghosu Posted April 15, 2012 Share Posted April 15, 2012 I know that i need 2 nifs, that's why i mention that all the time...but i have no clue how to create a script that changes them when you draw the weapon. Link to comment Share on other sites More sharing options...
fg109 Posted April 15, 2012 Author Share Posted April 15, 2012 (edited) I know that i need 2 nifs, that's why i mention that all the time...but i have no clue how to create a script that changes them when you draw the weapon. Scriptname SheathedWeaponScript extends ObjectReference Weapon property DrawnWeapon auto Event OnInit() RegisterForAnimationEvent(Game.GetPlayer(), "BeginWeaponDraw") EndEvent Event OnAnimationEvent(ObjectReference akSource, String asEventName) if (Game.GetPlayer().IsEquipped(Self.GetBaseObject()) Game.GetPlayer().AddItem(DrawnWeapon, 1, true) Game.GetPlayer().EquipItem(DrawnWeapon, false, true) ;unfortunately, no script command to equip weapon on left hand Utility.Wait(0.1) Game.GetPlayer().RemoveItem(Self.GetBaseObject(), 1, true) endif EndEvent Scriptname DrawnWeaponScript extends ObjectReference Weapon property SheathedWeapon auto Event OnInit() RegisterForAnimationEvent(Game.GetPlayer(), "BeginWeaponSheathe") EndEvent Auto State Inactive Event OnAnimationEvent(ObjectReference akSource, String asEventName) if (Game.GetPlayer().IsEquipped(Self.GetBaseObject()) GoToState("Active") Replace() GoToState("Inactive") endif EndEvent Event OnUnequipped(Actor akActor) if (akActor == Game.GetPlayer()) GoToState("Active") Replace() GoToState("Inactive") endif EndEvent EndState State Active EndState Function Replace() Utility.Wait(1) Game.GetPlayer().AddItem(SheathedWeapon, 1, true) Game.GetPlayer().EquipItem(SheathedWeapon, false, true) ;unfortunately, no script command to equip weapon on left hand Game.GetPlayer().RemoveItem(Self.GetBaseObject(), 1, true) EndFunction EDIT: added unequip event to second script Edited April 15, 2012 by fg109 Link to comment Share on other sites More sharing options...
ghosu Posted April 15, 2012 Share Posted April 15, 2012 Thy a lot, hope i get it working ;) greetings Link to comment Share on other sites More sharing options...
leedavis Posted April 15, 2012 Share Posted April 15, 2012 Well your gonna have your hands full FG if this post goes Viral. I'm actually having a problem with Primitives and scripts. I was refered to this post by Gasti89. He has been a great help with my scripting. Here is a quote from my last email QUOTEI have two, but we'll start with the most annoying one. World Objects->Activator->"defaultActivateLinkedChest This item exists in game. Near the tower were you first kill a dragon is a destroyed house with a buried chest. The chest has a L_noncollidable Primitive linked to it using the above Activator and similar Script that activates the chest using the Primitive. In game this works as expected. Copy and Pasting both the Primitve and the chest (TOGETHER ONLY) continues to work. However, seperate C&P breaks the link and it can not be repaired. Nor can a new link to ANY other activatable object work. Draging the above Activator in the game through the OBJECTS Window fails to create the Activator. It will show up in the Item list in the CELL Window, But can not be attached or linked to any activatable object. This concept is CRUCIAL to the mod I am working on. I need to learn how to activate objects using Primitives.ENDQOUTE Hope you can help me solve this issue. Thanks Link to comment Share on other sites More sharing options...
fg109 Posted April 15, 2012 Author Share Posted April 15, 2012 (edited) OK... what you asked had nothing to do with scripting but I tried anyway. I did what you described and had exactly the same results. But after lots of experimentation, I thought of weapon racks and mannequins. Supposedly, they don't always work correctly if they are at one of those nice Z angles (0, 90, 180, 270) so I tried changing the Z angle of the trigger to -15. It worked! Don't know why it is, but that's how you have to do it. Also, read this on how to create primitives. Since you're making a trigger, click the cube with a 'T' on it, not a 'C'. EDIT: Also, if you don't mind, please update the wiki article so that others don't have the same problem. Edited April 15, 2012 by fg109 Link to comment Share on other sites More sharing options...
Leeira Posted April 15, 2012 Share Posted April 15, 2012 Well, I would like to get a very complex script, so if it's impossible or just too much for you alone just tell me:A script that changes the carry-weight system. The weight is made obsolete, instead you can just carry: 2 one-handed weapon OR 1 two-handed; two daggers; only the one set of armor you wear plus 1 light armor set in your bag. Limited ammount of potions, food, clothing and so on. It should just be as realistic as possible.So each time you pick something up, the script must check if you already have the maximum ammount of item type x and decline the pickup if you have already reached the maximum number of item type x. This should work with vanilla Keywords (which would make it even compatible with every mod that adds items and use the vanilla keywords). Link to comment Share on other sites More sharing options...
fg109 Posted April 15, 2012 Author Share Posted April 15, 2012 Well, I would like to get a very complex script, so if it's impossible or just too much for you alone just tell me:A script that changes the carry-weight system. The weight is made obsolete, instead you can just carry: 2 one-handed weapon OR 1 two-handed; two daggers; only the one set of armor you wear plus 1 light armor set in your bag. Limited ammount of potions, food, clothing and so on. It should just be as realistic as possible.So each time you pick something up, the script must check if you already have the maximum ammount of item type x and decline the pickup if you have already reached the maximum number of item type x. This should work with vanilla Keywords (which would make it even compatible with every mod that adds items and use the vanilla keywords). It's possible, but I'd rather not do it. It would require doing two things: Filtering the player's inventory when the mod is first loaded.Watching for item added and item removed events.For the first one, it would be basically the same as what JustinOther does when his Bag of Holding mod is first loaded. Rather than figuring it out on my own, I would just re-use his code (after asking for permission). Then I would put a script on the player (through a reference alias I suppose) to listen for OnItemAdded and OnItemRemoved events, and have to check the added/removed item against the form lists used for #1 in order to figure out the type of item. Then it should check the item count for that type of item (saved as variables in the script) and decide whether to let the player keep it or drop it on the ground. #2 is very easy once you finish the grunt work for #1. Link to comment Share on other sites More sharing options...
FalloutBeast Posted April 15, 2012 Share Posted April 15, 2012 How bout a script so that when an enemy dies for the first time, it gets revived and continues to fight. Link to comment Share on other sites More sharing options...
Recommended Posts