Auklin Posted May 22, 2013 Share Posted May 22, 2013 Hello everyone, I'm totally new to these forums, but I'm not new to forums. My searches turned up blank, and I understand the wiki page is a godsend, but I still have a hard time finding things. I'm new to the modding scene, I really want to create scripted 'Time-Saver' mods for Skyrim, but I have abysmal scripting/ programming skills. I got notepad ++ all set up, I have the creation kit installed and I've been digging hard for answers but I'm clearly not looking hard enough, I hope you all can help me. It's funny because I know the information is out there given the shear number of mods, but it almost seems like anyone who does pure scripting mods (i.e. MoreHotKeysPlease), all seem to just know their trade and keep to themselves. I found maybe 3 tutorial videos on youtube, all three consist of the relative "helloworld" tutorials/ questing tutorials, which I've practiced with before. Ok, onto my point. I want to create a mod that auto-applies poisons to weapons given the information regarding enemy being fought against / aimed at (I'm assuming this function exists because of 'activating' objects and the ability to click items in the cmd console menu), and auto apply potions (i.e. ResistFrostPotion) given the type of damage being taken by enemies. I've gotten to the point now where when I THINK about what I want the mod to be, I see a general structure in my head. I understand what a script IS at its core. Correct me if I'm wrong, its a logical sequence of events demonstrated by seperate lines and 'indicators' that 'direct' the event to a conclusion, whether that be, in this case, applying a potion, or aborting the script (say, for example, if the script detects your in beast form). However, after dissecting 'Swift Potion' (Chesko), and aside from the fact that half the text appears as large black boxes (I could use some advice with that too), I can't seem to understand why the script IS where it IS. I've managed to get my 'SwiftPoison' mod in the NMM, but the pitiful script I put in it (not to my suprise at all) doesn't work. I'm not sure how to 'outfit' a script to insert it into the game. Do I even do this in the creation kit? or is it all done externally by simply creating folders and winrars and PEX files in notepad++? Seriously, if anyone can direct me somewhere, or tell me 'how stupid can you be?" and "everything you need to know is found at xyz" , I'd greatly appreciate it. Link to comment Share on other sites More sharing options...
GrimyBunyip Posted May 22, 2013 Share Posted May 22, 2013 (edited) I could just make this mod for you, I was going to anyways. The only issue is that the SKSE team is going to release this new function that would make autopoison marginally more efficient. But the new release isn't out yet. So for now I'd have to rely on animation events. Which are slightly less efficient. PS you want to open psc files, not pex files in notepad++ Edited May 22, 2013 by GrimyBunyip Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 22, 2013 Share Posted May 22, 2013 To have a script work in game it needs to be attached to an object of some sort. That means using the Creation Kit to tie the script to a record in your ESP. In your case you are wanting to auto-apply poison to the player's weapon depending upon the player's target. This would be best done by setting up a start game enabled quest with a reference alias for the player. It is on the alias that you would assign your script. You would then need to have the properties that you've been working with in the script filled out. In your case, the equipped weapon, the various poisons or perhaps formlists of poisons depending upon what they do and how you've designed your script to work. All that said, with current functions/events it is difficult to get the player's target. If I were to consider doing something like what you want, I would dynamically attach scripts to the surrounding enemies and work with their OnHit events. If they are hit by the player and the player has X poison then add that poison's damage to the actor while removing one instance of X poison from the player. True, the poison wouldn't be applied before the hit, but you would get a close enough result in my opinion at any rate. http://www.creationkit.com/Dynamically_Attaching_Scripts Link to comment Share on other sites More sharing options...
Auklin Posted May 22, 2013 Author Share Posted May 22, 2013 (edited) Thanks man, I really appreciate the response_________________________And Grimybunyip,If you do, let me know, cause I'd like to either help you out, or at least observe your scripting when you do it. Edited May 22, 2013 by Auklin Link to comment Share on other sites More sharing options...
GrimyBunyip Posted May 23, 2013 Share Posted May 23, 2013 (edited) Well here's what I made so far, I haven't uploaded this into my Grimy Utilities mod yet but like I said, here it is:Keep in mind that using the "weaponSwing" animation event probably isn't the best way to do this.It doesn't consider power attacks for example. But I think it will give you the general idea of how to do it.I'm fine with this since I'm just biding my time for the next SKSE release. You'll notice the function:MainMenu.equipPoison() MainMenu is a separate script, and I'm calling the equipPoison() function from that script.It's basically really similar to what you'd find in swift potions or whatever.I just have a different method of populating the list of poisons. EVENT OnEffectStart(Actor akTarget, Actor akCaster) RegisterForAnimationEvent(PlayerRef, "weaponSwing") ENDEVENT EVENT OnAnimationEvent(ObjectReference akSource, string asEventName) IF ( ( akSource == PlayerRef ) && ( asEventName == "weaponSwing") ) MainMenu.equipPoison() GoToState("Cooldown") ENDIF ENDEVENT EVENT OnPlayerBowShot(Weapon akWeapon, Ammo akAmmo, float afPower, bool abSunGazing) MainMenu.equipPoison() GoToState("Cooldown") ENDEVENT STATE Cooldown EVENT OnBeginState() tempInt = 1 ENDEVENT EVENT OnAnimationEvent(ObjectReference akSource, string asEventName) IF ( ( akSource == PlayerRef ) && ( asEventName == "weaponSwing") ) tempInt += 1 IF ( tempInt >= GUI_Interval_AutoPoison.GetValueInt() ) GoToState("") ENDIF ENDIF ENDEVENT EVENT OnPlayerBowShot(Weapon akWeapon, Ammo akAmmo, float afPower, bool abSunGazing) tempInt += 1 IF ( tempInt >= GUI_Interval_AutoPoison.GetValueInt() ) GoToState("") ENDIF ENDEVENT ENDSTATE int tempInt = 0 GLOBALVARIABLE PROPERTY GUI_Interval_AutoPoison AUTO ACTOR PROPERTY PlayerRef AUTO GUI_MenuMain PROPERTY MainMenu AUTO Edited May 23, 2013 by GrimyBunyip Link to comment Share on other sites More sharing options...
Recommended Posts