-
Posts
114 -
Joined
-
Last visited
Everything posted by elseagoat
-
I very, very much appreciate you posting this. Warms my heart when people share their scripts like this and I applaud you. I have glanced over it and haven't had much time to really work on this, but from what I am looking at it looks like there is a shortcoming with your method. Forgive me if I am wrong, and I am by no means trying to slight your excellent script or abilities, merely trying to consider all the possibilities for locational damage detection. First, it appears that your script cannot take into account actor animations. For example, if you hit an enemy in the arm while he was performing an overhead power attack with a two handed weapon, whilst his arm was above his head, it looks like your script may not be able to compensate for this as it uses predefined values to determine hit locations in space assuming a perfectly rigid figure facing the player in a specific idle pose. Am I incorrect in assuming this? I have successfully implemented very accurate hit detection on custom spells. The method I used was to pre-load a few custom empty activators with scripts, and have the magic effect of the spell move them to nodes on the target's body if they exist as fast as possible, as this is time-sensitive. The magic effect projectile uses an explosion which places another activator. This activator runs a script, which finds the nearest "node activator" and then reports which one it found to a quest script. The magic effect then retrieves this information from the quest script and does something (double damage, extra effects, ect.) The result is very accurate locational damage that can detect arm and headshots on the fly in the middle of chaotic fights with fast moving enemies. For melee locational damage, I imagined having a script which simply casts a spell with an invisible fast moving projectile, functioning as any custom spell would with the above method, whenever the player performs some melee animation or with onhit events on nearby actors. I havent actually tried this yet. Bows seemed the hardest to implement. The method in the op is the best I could come up with. Obviously, you could attach explosions to the arrow projectiles and get quick and dirty locational damage that way, but the problems with this method are major, ranging from compatibility issues to arrows being unrecoverable after being shot. Your script looks promising, and similar to my "theory" outlined above in many ways and different in others. Hopefully soon I will get a chance to sit down and grind through some testing.
-
Thanks for the input! I wish someone knew the exact value for acceleration in the game due to gravity though. I also hope that there aren't other weird factors that effect the trajectory, I have heard that bow speed effects the range and I hope those people that say that don't know what they are talking about.
-
Deleting objects created with placeatme.
elseagoat replied to mercuito's topic in Skyrim's Skyrim LE
The PlaceAtMe() function returns the last object reference that it creates. So, you call this function on another object reference like so: SpawnedObject = ObjectToSpawnSomethingElseOn.PlaceAtMe(ObjectToSpawn) Then to delete it: SpawnedObject.DisableNoWait() SpawnedObject.Delete() Calling a function on Self to remove a placed object with PlaceAtMe() would only work if the script calling Self.Delete() were actually attached directly to the object you spawned using PlaceAtMe() in a completely different script. -
So, I had this idea for a useful script that would determine the location where an arrow has impacted an actor. My idea is to utilize basic dymanics equations to create a formula which will utilize easily obtained information. The equation of motion in one dimension with constant acceleration (note that if acceleration due to gravity in skyrim has a "cap" in that it drops to zero at some point, or varies at all, I am in deep trouble seeing as integrating is not the easiest thing to do in papyrus.) is defined as: Rt = Ro + Vo * T + 0.5 * A * T^2 So I thought, okay, well we can easily obtain the angles that the player is facing the moment the bow is fired, along with his position and thus roughly the point of origin on the projectile. We can find the velocity in the projectile forms for all arrows and they all appear to be at 3600 by default. Additionally, we can easily find the time the arrow is fired, and as long as it actually hits something that a magic effect can be applied to, we can register an onhit event and record the time the arrow landed. With this information, we should be able to locate an X Y and Z coordinates in space exactly where the arrow struck the enemy, and then use this information to do any number of things including some form of accurate locational damage that actually looks at where the target's body parts are in relation to the arrow sticking out of them rather than relying on where the shooter is looking the moment the arrow strikes. Additionally, this could work without modifying any arrow or ammo forms and be compatible with all mods that introduce new arrows. But, there were a few problems that I am stuggling with. First off, I set up a quest. This quest throws the player into an alias so that I can give him an ability, upon which I attached a script with an OnPlayerBowShot event. Alternatively, you could probably register for an animation event OnInit() that corresponds with an arrow being fired if this event doesn't work with crossbows, but the nice thing about OnPlayerBowShot is that it returns the draw strength of the bow. This is important, because it effects the trajectory. So now that we have that script, we can find the angles, position, and time the arrow was fired at. Then we can report them to a script on the quest I created to store them. Now that those are stored, we need to register the time that the arrow hits the actor to actually calculate the final positions of the arrow, and hopefully get it right. Now looking at the equations, we can establish a motion equation for each direction, X, Y, and Z. The Z direction, being up and down, is the only direction that experiences acceleration to my knowledge, unless there is wind resistance or some crap in Skyrim, which I doubt. So the X and Y equations of motion become: Xpos = Xinit + Vxinit * Time Ypos = Yinit + Vyinit * Time where Xpos and Ypos are the final positions we are looking for, Xinit and Yinit are the initial X and Y positions, the ones we got right when the player fired the bow, and Time is the time elapsed from the moment the arrow was fired and the moment it hit the target. Vxinit and Vyinit are a little more difficult. Those are the components of the initial velocity in the X and Y directions. We can calculate those once we have the Z component, which is easier to calculate. The Z direction is the direction that gravity acts in. As such, the motion equation becomes Zpos = Zinit + Vzinit * Time + 0.5 * Grav * Time^2 This is obviously a little more complex. The new variable here, Grav, is the acceleration due to gravity. ;This one is a bit of a mystery. In the projectile forms, it is listed as 0.35. No units are given. So I assume this is a percentage of the maximum gravity experienced by any object in the game. But what is that value, and what units does it have so I can use it in this equation? So I set about creating an Accelerometer to determine this value. I made a spell which causes an arrow to drop in free fall, with zero initial velocity, and record the distance traveled and the start and end times when it hit the ground. The arrow had 0.35 gravity, whatever that means. I applied these distances and time elapsed along with the information that initial velocity was zero, to the equation: Grav = (2* (Zpos - Zinit)) / (T^2) which is just rearranged from the equation above and dropping the initial velocity term. Almost every time I ran the test, I got a value around 233. Sometimes I got anomalies. But it was fairly consistent. The problem is, experimental error will lend to a number which is inexact, and as such, will effect the accuracy of our determination of the arrow's position in our ultimate goal. Remember, we are trying to figure out where in space we achieved a hit with our arrow without actually looking at the arrow itself, because doing so would make our mod extremely incompatible with other mods. So, we have a rough estimate for the amount of gravity experienced by an arrow in flight. Now we need a little trig to get the velocity components and we should be good to go. Lumping the X and Y directions into one dimension in the direction of the velocity vector component in those two directions yields a two dimensional vector. The XY, Z plane. We can use simple sin and cos to break our vector apart to get the magnitude of the velocity in the Z direction. But first, we must remember that in skyrim, arrows are not shot directly though the crosshairs, without editing the INI, they are given a slight upward angle, as if the crosshair is not zeroed at point blank but rather at 10 meters or so. This means we must first fetch this angle from the INI file using the utility.GetINIFloat() function. Then, we must add this to the player's angle around the X axis at the time of firing the bow. But again, we must remember that this angle is inverted when retrieved with the GetAngleX() function, when the player looks up, it goes negative, and goes positive when the player looks down, contrary to intuition. So we multiply GetAngleX() by negative one and add Utility.GetINIFloat() to retrieve the additional firing angle. Now we take the Sin of this value, and multiply it by our arrow speed, which is 3600 according to the form (we just hope these units actually work out, which they dont). Now, we have a value for Vzo. We need to find Vxo and Vyo. Since we broke our 3600 into a Z component, we are left with an XY component we can use and break it apart further. So we take Cos of the value above, retrieved from the GetAngleX() function and GetINIFloat() function. That yields the magnitude of our velocity in the XY plane, or horizontal plane. We need the direction too, to get the components. I could be wrong, but this is what I think we should do. Take the angle around the Z axis which is the angle that the player is turned, and multiply the magnitude we just got times the SIN of that angle around the Z axis to yield the Y component, and COS to yield the X component. The end result looks like this. Xpos = Xinit + Vxinit * Time Ypos = Yinit + Vyinit * Time Zpos = Zinit + Vzinit * Time + 0.5 * Grav * Time^2 Where: Vxinit = (ArrowVelocity * Cos(Utility.GetINIFloat("f1PArrowTiltUpAngle") + (-1 * Game.GetPlayer().GetAngleX())) * Cos(Game.GetPlayer().GetAngleZ()) Vyinit = (ArrowVelocity * Cos(Utility.GetINIFloat("f1PArrowTiltUpAngle") + (-1 * Game.GetPlayer().GetAngleX())) * Sin(Game.GetPlayer().GetAngleZ()) Vzinit = (ArrowVelocity * Sin(Utility.GetINIFloat("f1PArrowTiltUpAngle") + (-1 * Game.GetPlayer().GetAngleX())) All taken at the time the arrow was fired with ArrowVelocity being the velocity of the arrow taken from the projectile form multiplied by afPower returned from the event OnPlayerBowShot(), additionally: Time = TimeHit - TimeShot Now onto the questions. 1) Is my math even remotely correct? 2) Is it possible to do this another way, using a script to fire a projectile right when an arrow is fired that mimicks the trajectory of the arrow? Possibly only with a full power bow draw to avoid that problem? I can't seem to get "Cast()" to work on the player to do this, and even then, we would encounter problems with the INI setting mentioned above which makes arrows, but not spells, fire at a slight upwards angle. Perhaps using an activator placed using trig to acquire this angle and firing the projectile from the player towards the activator would work, but would introduce timing problems. 3) Does anyone know the exact value in units/(s^2) of the acceleration due to gravity in this game?
-
Bump, I really need help here. I just need some trick to find the coordinates of an arrow when it hits an actor which is the only reason I am doing this, but I need to do it without modifying the arrow itself.
-
But also, I have no idea what you are talking about with that forcegreet thing. I have never actually placed anything in the actual game world, only made mods entirely with scripts and forms. I also fail massively when it comes to packages, I can never get them to do what I want.
-
Looking for modding partner/teacher!
elseagoat replied to saintgrimm92's topic in Skyrim's Skyrim LE
You are going to need a strong vision and well defined goals for a specific mod before you will get any takers. In addition, you will need to at least establish your own abilities in a specific aspect of modding. Anyone looking to mod needs to be well versed in the creation kit itself, but beyond that, you will need to be adept at at least one other aspect of modding, be it modeling, texturing, a combination of both, or scripting. Once you can handle one of those aspects, you may be more likely to find someone to join you in making a mod. But your mod idea must be a strong one and you must have something to show for it, it can't just be an idea. From your linked mod, it is clear you know how to at least do basic modeling and texturing and how to import these models and textures so that they work in-game. This is a good start. If you are looking to make simple armor or weapons mods and not work with complex quests involving hefty scripts then you will likely do just fine making the models yourself and asking questions on these forums or the bethsoft ones when you run into snags. Basically, I have found that finding someone to babysit you or even go 50/50 with your own vision of a mod is MUCH more difficult than just doing it yourself and asking about specific problems on the forums. Plus, you learn more that way. -
The acceleration is my biggest problem. I tried making a script which when cast, creates an activator at a random position in the sky. This activator records its x,y,z location in space, then casts a spell and records the time of cast before deleting itself. This spell fires a projectile which has zero velocity and 0.35 gravity, consequently it falls directly to the ground. When it hits, it creates another activator at that point which immediately records the time it was created, and then marks down its position. Once all this information is recorded, it is plugged into this formula in a script and the result is given to me: A=(2(Zt-Zo))/(T^2) where A is acceleration, Zt is the Z position at time T, and Zo is the initial Z position. The problem is that I get a result which varies between -215 and -240 for that value, which I believe to be in units of game units per second squared as the positions are measured in units of game units. This is likely due to papyrus sucking and not being able to precisely record the times the spell is fired and when it hits solid ground. Does anyone out there know the exact value of the negative z acceleration applied to all havok enabled objects in this game? If papyrus is just being slow, my best bet is to drop the projectile from very very high to get a more accurate reading, as the percentage that the time is off due to papyrus being slow will be small compared to the total time.
-
This may not be a scripting issue but rather a plugin issue. I have had trouble in the past getting mods to utilize information from each other. Is this script called by your own mod, while the two mods containing the weapons are separate ESPs? If so, the game may be having trouble finding the weapons unless you make the other two ESPs containing the weapons into masterfiles, and then make your mod into an ESP that requires those two masterfiles.
-
Decapitation: A Construction Kit Dilemma
elseagoat replied to Campaigner's topic in Skyrim's Skyrim LE
There is a keyword "magicnoreanimate" which prevents reanimate spells from being applied to certain actors. Naturally, this keyword is used on things like mechanical NPCs or Dragons which cannot be reanimated. It is used by several NPC's, Races, and Magic Effects which cause the reanimation. I figured it was most likely that the culprit would be on a magic effect or quest, where the actor that is decapitated either fills an alias with the keyword or a magic effect is applied with the keyword when it is decapitated, thus preventing reanimation. I could not find any magic effects that looked suspicious, but I did notice a quest in there. DA02 is the name of the quest. Try taking a look at that. Though it seems unlikely. The other place to look is in perks. There might be some conditionals or wonky stuff that is doing what you say. Sadly, I've already been fiddling with the "MagicNoReanimate", as the mod I'm making takes that off of certain NPCs like Kodlak and Vigilant Adalvald, and it's not applied to player races unfortunately. For the quest, that's Boethiah's quest, and it's only there because headless NPCs don't get revived by Boethiah. Can't see anything else in that. Looking through all the perks now. Chances are I might have to do a hack-job and just put conditions saying "GetisRace (blahblah) == 0" for every race that shouldn't be reanimated, but that'd be sloppy. Hopefully I don't have to do that. Well you could take off that condition for the keyword and see if it gives you the right results. If it does, you know the keyword is responsible for the issue, in which case you can keep digging to find what is applying that keyword to decapitated actors that would otherwise not have the keyword, or you could do your hack and slash method of manually adding the races you don't want to be reanimated, which could be accomplished by checking for the actortypeundead and actortypenpc keywords, and then going through and adding any other npcs or undeads you dont want reanimated which would be a giant pain in the ass. And if removing the keyword condition doesn't help, well, then you know not to bother with it and to start looking for other reasons. -
I am trying to write a script using some simple dynamics equations to predict the location where the player will strike with a bow before the projectile will actually hit. The problem is that I cant figure out what the numbers represent. In the projectile form, arrows are listed as having a velocity of 3600, and a "gravity" of 0.35. 0.35 what? 0.35% of maximum? What is the maximum acceleration due to gravity? What is 3600? 3600 units/second? inches/min? feet/month? light years/(billion years)? elephants? I have a tester script which measures the angles of the player. The angles I am assuming are in degrees and not radians. It also measures distance traveled by the arrow in all 3 directions, and the time it took for the arrow to land. The time is in seconds. But what is the distance? Units? Is that what "GetPositionX()" returns? A value in units along that axis? Can anyone help with this craziness?
-
Decapitation: A Construction Kit Dilemma
elseagoat replied to Campaigner's topic in Skyrim's Skyrim LE
There is a keyword "magicnoreanimate" which prevents reanimate spells from being applied to certain actors. Naturally, this keyword is used on things like mechanical NPCs or Dragons which cannot be reanimated. It is used by several NPC's, Races, and Magic Effects which cause the reanimation. I figured it was most likely that the culprit would be on a magic effect or quest, where the actor that is decapitated either fills an alias with the keyword or a magic effect is applied with the keyword when it is decapitated, thus preventing reanimation. I could not find any magic effects that looked suspicious, but I did notice a quest in there. DA02 is the name of the quest. Try taking a look at that. Though it seems unlikely. The other place to look is in perks. There might be some conditionals or wonky stuff that is doing what you say. -
Determining which part of an actor's body was hit
elseagoat replied to elseagoat's topic in Skyrim's Skyrim LE
I don't believe that author has released the sources for his scripts. Though he claims to use only trig, and through my experience with the mod, it is not quite as accurate as I would like. -
Determining which part of an actor's body was hit
elseagoat replied to elseagoat's topic in Skyrim's Skyrim LE
Thank you. Any ideas for an approach to determine where an actor has hit with a spell/weapon? -
I did a little modding several months ago and I am jumping back into it now. While I can maneuver about papyrus just fine, my working knowledge is rather limited so solutions to problems like this don't "pop" for me. Anyways, I was wondering if anyone knew how to detect where on an actor's body they have been hit by any attack. I have managed to detect headshots with spells, but bows are much more complicated because the only thing I can think of doing to detect where you are hitting with them is to attach explosions to all the arrow types, which introduces compatability problems and arrows no longer stick around once they are shot. Alternatively, I could try to make invisible spells that mimick the ballistics of each arrow, but then I run into problems with how to compensate for variable bow draw strengths effecting the trajectory. Melee attacks could be done by casting an invisible projectile spell on certain animations. But then again, with all of these ideas, you run into the problem of performance issues where the script is too slow as it has to spawn a ton of stuff for each body part separately. For starters, could anyone give me the names of the various nodes or tell me where they are listed in the CK? I only know about NPC Head [Head].
-
I tend to agree which is why I am making my own . Instead of 629 new fireballs and feather spells, I am trying to revamp the spells and perks for all shools so that they are actually interesting and have cool mechanics.
-
Sounds like it has to do with material types. Make sure you have the impactdata that you want assigned to various material types and not just flesh
-
Spell Creation... At least, that's what I wanted it to be...
elseagoat replied to jojo4u's topic in Skyrim's Skyrim LE
The summon creature archetype will only allow you to.select from all actors with the summon flag checked. No other form will appear in the dropdown. You are going to need a script to do what you want, so if you are unfamiliar with papyrus I recommend reading the tutorials on the creation kit wiki. -
Sorry for bump but I am trying to do the same to no avail. I want to make bound weapons look more "black" so I basically took the bound sword, took the gradshockrune texture and made it black and white, then changed the specular and emissive colors in the 1stpersondaedricsword nitrishape. The result is a slightly transparent, black and white daedric sword with no flames.
-
Did we ever figure out how to do this? Trying to do something similar, but not successfully. I see wierd purple-blue shiny blobs in nifscope, which I am assuming is some sort of normal map. How can I make the model show up like it looks in game? Also, when I look at the emissive colors in nifskope, i am seeing values that have equal red, green, blue. What exactly does that mean? Wouldn't that be a greyscale color?
-
I need to call a function in my quest script the moment a player picks a perk, just once, and never do it again. Can I do this with a perk fragment? The wiki seems to explain perk fragments as ways to run functions only when the actor with the perk uses activators (which will be nice if I make a perk that increases the chance of finding certain items on dead bodies I'd assume?) But it doesn't say anything about running scripts when the perk is taken. Can anyone enlighten me on this?
-
Wish I was as smart as you... works perfectly and is ten times simpler than my script, in terms of legibility. Plus it actually works.
-
Nice catch! Testing now. Will update. Edit: Works almost perfectly. Looks like I got my equations right, its pulling up the menus and perks from the proper indices and everything so they are all lining up with their choices. The only problem is that the "Previous Menu" buttons are taking me to the first menu, not to the previous menu. So say I pick Magical Skills -> Illusion ->Illusion Perk Group B and decide I don't want one of the illusion perks here, and I hit Previous Menu, it takes be back to the first menu asking if I want to add perks in Magical Skills or Physical Skills instead of taking me back to the menu asking me which illusion perk group I want. Its not a big deal, but I would rather not go through 100's of forms and change "Previous Menu" to "Main Menu" for clarity. Now I got to wondering why this is happening the way it is happening. Does Show() pause your script until the user selects an option to give it something to return, meaning the while loop is not running while a menu is active? Or does the while loop keep running?
-
Hmm. I think there is a condition in the game that checks if a target is on fire or not. Might be worth looking in to, as whatever it is that the condition is checking could be what causes them to scream when lit on fire. Props on your script, because that is a VERY convincing cyclone. I literally thought you had found some undiscovered cyclone nif in the vanilla files.
-
Scriptname ESG_RefundMessageScript extends ActiveMagicEffect GlobalVariable Property ESG_RefundPoints Auto Message Property ESG_MainMenuRefund Auto Message Property ESG_MagicalRefund Auto Message Property ESG_PhysicalRefund Auto FormList Property ESG_SkillMessageLists Auto FormList Property ESG_GroupMessageLists Auto Formlist Property ESG_PerkMessageLists Auto Spell Property ESG_RefundSpell Auto Actor Player Bool Show = true Int StyleChoice = -1 Int SkillChoice = -1 Int GroupChoice = -1 Int PerkChoice = -1 Int GroupIndex Int PerkIndex Int Points Function Messages(Int ListIndex) GroupChoice = ((ESG_SkillMessageLists.GetAt(ListIndex) as FormList).GetAt(SkillChoice) as Message).Show(Points) If (GroupChoice == 0 || GroupChoice == 1 || GroupChoice == 2 || GroupChoice == 3) GroupIndex = (GroupChoice + (SkillChoice * 4)) PerkChoice = ((ESG_GroupMessageLists.GetAt(ListIndex) as FormList).GetAt(GroupIndex) as Message).Show(Points) If (PerkChoice == 0 || PerkChoice == 1 || PerkChoice == 2 || PerkChoice == 3 || PerkChoice == 4 || PerkChoice == 5) PerkIndex = ((ListIndex * 5) + SkillChoice) Player.AddPerk((ESG_PerkMessageLists.GetAt(PerkIndex) as FormList).GetAt(PerkChoice) as Perk) ESG_RefundPoints.SetValueInt(Points - 1) Show = false Dispel() ElseIf (PerkChoice == 6) PerkChoice = -1 GroupChoice = -1 EndIf ElseIf (GroupChoice == 4) GroupChoice = -1 SkillChoice = -1 EndIf EndFunction Event OnEffectStart(Actor Target, Actor Caster) Player = Game.GetPlayer() Points = ESG_RefundPoints.GetValueInt() While Show ESG_MainMenuRefund.Show(Points) If (StyleChoice == 0) SkillChoice = ESG_MagicalRefund.Show(Points) If (SkillChoice == 0 || SkillChoice == 1 || SkillChoice == 2 || SkillChoice == 3 || SkillChoice == 4) Messages(0) ElseIf (SkillChoice == 5) SkillChoice = -1 StyleChoice = -1 EndIf ElseIf (StyleChoice == 1) SkillChoice = ESG_PhysicalRefund.Show(Points) If (SkillChoice == 0 || SkillChoice == 1 || SkillChoice == 2 || SkillChoice == 3 || SkillChoice == 4 || SkillChoice == 5) Messages(1) ElseIf (SkillChoice == 6) SkillChoice = -1 StyleChoice = -1 EndIf ElseIf (StyleChoice == 2) Show = false Dispel() EndIf EndWhile If (ESG_RefundPoints.GetValueInt() == 0) Player.RemoveSpell(ESG_RefundSpell) EndIf Dispel() EndEvent This script is supposed to show a series of messages. There are over 100 messages, and 4 "teirs" of messages. The first message, ESG_MainMenuRefund, has 3 buttons. A, B, and Exit. Exit is supposed to exit the while loop and do nothing, closing the message box. It doesn't, the box is stuck. A and B bring up two other menus. A is a menu with 6 options, 5 of them lead to even more menus while the 6th is supposed to go back to the main menu. B is similar, but has 7 options, again one goes back to the main menu. Each of the 5 menu options in A and 6 menu options in B to individual menus that are separate, but similar, as they all have 5 total options. The fifth option on all of these is supposed to take the player back to A or B, whichever they were on previously. The 4 other options in these menus go to even more menus, each with 7 options, 6 of which add a perk to the player, decrement the global variable by 1, and close the menu system. Again, the 7th goes back a menu. You will notice I tried to avoid linking all 100+ messages as properties and having massive if statements by using "two dimensional" formlists. Formlists inside of Formlists basically. Don't even know if that is working because I can't get that far. Problem is, I can't get past the first menu. None of the buttons respond when I click them, the first menu is stuck there and wont go away, preventing me from even leaving the game.