Awesome mod - this mod Spellcraft Functions SKSE64 has been abandoned by the author, and is open source (source on github), there are several functions that would be awesome to be able to use again in AE (it has by far the BEST get all actor spells functions, was super fast and unlike PO3's function it actually returns race spells). Would be awesome if you were able to roll up some or all of these functions into your mod. If I knew C I would redo it myself
If I may make a very selfish request... could you add a "GetAndrealphusExtenderVersion()" function? I want to make sure that my mod only works if the extender is working, and this is the least hacky way I could think of.
I'd love to, but I'm not sure how to do that. I assume it doesn't need to be a native function, but rather something like this?
Int Function GetAndrealphusExtenderVersion() global Return 141 Would that work? 141 refers to v1.4.1, but the number increases each time I update, so you can make checks to determine whether the user is using at least version X or higher.
Thank you for the modding resources. I am just starting modding using papyrus and they helped me. I wanted to ask for an opinion. I want to offset something that is cast from both hands (dual cast). How do you think I should go about this? Only CastSpellFromHand seems to have the offset parts below it but that is for a specific hand... Can I offset CastSpellFromRef somehow?
I think there's a misunderstanding here. All the Cast related papyrus functions don't take into consideration the slots that are used by the game. If you use the vanilla Cast function, the spell projectile will ALWAYS be auto-cast from the head (without any animations btw), regardless of it using the ingame BothHands equipment slot. With my functions, you can have the spell originate from the specified point, so it no longer gets cast from the head.
From which point would you like your spell projectile to originate?
I wanted to make it so dual cast gets casted from two places with the head in the middle and maybe a bit behind it (I had some ideas of adding levels to the perk (dual cast) that will increase the places the spell comes out of along with the cost of course but at a later date). I don't care for animations since I will use the mod on VR.
It can only be cast from one spot, unless you make multiple Cast calls. This is a scripted cast function, not an actual ingame spell cast. To do what you're describing, you'd need to make a dummy spell that fires on self, and within that spell's effect, you use the Cast functions to fire the actual spell. As for the position, I'd recommend using the CastSpellFromHand with Right hand parameter and then play with the X and Y offsets for Right and Right sneaking.
In that case, I'd recommend using the CastSpellFromPointToPoint() and then use certain values/calculations from CastSpellFromHand() for the origin point and get the X, Y, Z coordinates of the target. Something like this:
Spoiler:
Show
Function CastSpellFromHandToTarget(Actor akSource, Spell akSpell, Bool IsLeftHand, Actor akTarget, Float Offset_NoSneak_Left_X = 30.0, Float Offset_NoSneak_Left_Y = 30.0, Float Offset_NoSneak_Left_Z = 110.0, Float Offset_NoSneak_Right_X = 30.0, Float Offset_NoSneak_Right_Y = -30.0, Float Offset_NoSneak_Right_Z = 110.0, Float Offset_Sneak_Left_X = 30.0, Float Offset_Sneak_Left_Y = 30.0, Float Offset_Sneak_Left_Z = 70.0, Float Offset_Sneak_Right_X = 30.0, Float Offset_Sneak_Right_Y = -30.0, Float Offset_Sneak_Right_Z = 70.0)global { - akSource: The caster. - akSpell: The spell to cast. - IsLeftHand: True if cast from the left hand, false if cast from the right hand. - akTarget: The target. - Offset_NoSneak_Left_X: Optional, X Offset for left hand when the actor is not sneaking. Default value is 30.0. - Offset_NoSneak_Left_Y: Optional, Y Offset for left hand when the actor is not sneaking. Default value is 30.0. - Offset_NoSneak_Left_Z: Optional, Z Offset for left hand when the actor is not sneaking. Default value is 110.0. - Offset_NoSneak_Right_X: Optional, X Offset for right hand when the actor is not sneaking. Default value is 30.0. - Offset_NoSneak_Right_Y: Optional, Y Offset for right hand when the actor is not sneaking. Default value is -30.0. - Offset_NoSneak_Right_Z: Optional, Z Offset for right hand when the actor is not sneaking. Default value is 110.0. - Offset_Sneak_Left_X: Optional, X Offset for left hand when the actor is sneaking. Default value is 30.0. - Offset_Sneak_Left_Y: Optional, Y Offset for left hand when the actor is sneaking. Default value is 30.0. - Offset_Sneak_Left_Z: Optional, Z Offset for left hand when the actor is sneaking. Default value is 70.0. - Offset_Sneak_Right_X: Optional, X Offset for right hand when the actor is sneaking. Default value is 30.0. - Offset_Sneak_Right_Y: Optional, Y Offset for right hand when the actor is sneaking. Default value is -30.0. - Offset_Sneak_Right_Z: Optional, Z Offset for right hand when the actor is sneaking. Default value is 70.0. }
Is CastSpellFromHand() operating correctly after its update? I was using it fine in 1.3, but the script using it doesn't function correctly and cast in 1.4.1. I can pop back and forth between versions and the older update will work while the new one will not.
Edit: Just had to alter the casts/passes on the function call, working fine on 1.4.1 afterwards, oddly enough
How difficult do you think it would be to implement a function that checks if you collide with something? I'm thinking about the player getting ragdolled when he sprints into a wall or an NPC getting launched away when you bump into it, those kinds of things.
There is a somehwat ragdoll function that already exists with npcs, where you bump them and they kinda take like 2 steps and almost fall over. Idk if that is vanilla or not
Yes, vanilla has a feature that causes NPCs to stumble and take a few steps back when you sprint into them. I'm not entirely sure how that works, but I think it's handled by an animation event, not a native function.
There's no "Bugs" section, so I'll post this here:
One of the FAQs says:
"Q: Does this work with AE? A: AFAIK, it should. Although I haven't tested it. Same goes for VR."
However, when I launch the game with this installed:
"A DLL plugin has failed to load correctly. If a new version of SKyrim was just released, the plugin needs to be updated. Please check the mod's webpage for updates.
I don't know. I have been told that CommonlibSSE NG works on SE, AE and VR. But myself I'm still on SE, so I said, it's untested. I'll ask if anything can be done.
Edit: I have found the issue and I'm looking into ways to fix it. For now, it only works with SE 1.5.97. I've updated the FAQ in the description to reflect this. Hopefully this can be resolved soon.
Unfortunately, the same error message is still present after installing the latest version and launching the game.
Anyways, a while ago, Actor Value Generator game me the same issue, in which the mod author fixed it by re-uploading the file without its debug version.
43 comments
- IA710
Maybe after I do this next update of Handy Crafting I'll try to learn enough to get through it
-IA710
Int Function GetAndrealphusExtenderVersion() global
Return 141
Would that work?
141 refers to v1.4.1, but the number increases each time I update, so you can make checks to determine whether the user is using at least version X or higher.
Int[] Function Foo() Global Native
And this in a header or something
inline std::vector<std::int32_t> Foo(RE::StaticFunctionTag*){
return { 1, 4, 1 };
}
game.
If you use the vanilla Cast function, the spell projectile will ALWAYS be auto-cast from the head (without any animations btw),
regardless of it using the ingame BothHands equipment slot.
With my functions, you can have the spell originate from the specified point, so it no longer gets cast from the head.
From which point would you like your spell projectile to originate?
To do what you're describing, you'd need to make a dummy spell that fires on self, and within that spell's effect, you use the Cast functions to fire the actual spell.
As for the position, I'd recommend using the CastSpellFromHand with Right hand parameter and then play with the X and Y offsets for Right and Right sneaking.
I hope this helps.
Player gets hit by an arrow--> casts a spell from the left or right hand aimed at the aggressor.
CastSpellFromHand doesnt have a designated Target right? and the other functions dont cast from hand?
Function CastSpellFromHandToTarget(Actor akSource, Spell akSpell, Bool IsLeftHand, Actor akTarget, Float Offset_NoSneak_Left_X = 30.0, Float Offset_NoSneak_Left_Y = 30.0, Float Offset_NoSneak_Left_Z = 110.0, Float Offset_NoSneak_Right_X = 30.0, Float Offset_NoSneak_Right_Y = -30.0, Float Offset_NoSneak_Right_Z = 110.0, Float Offset_Sneak_Left_X = 30.0, Float Offset_Sneak_Left_Y = 30.0, Float Offset_Sneak_Left_Z = 70.0, Float Offset_Sneak_Right_X = 30.0, Float Offset_Sneak_Right_Y = -30.0, Float Offset_Sneak_Right_Z = 70.0)global
{
- akSource: The caster.
- akSpell: The spell to cast.
- IsLeftHand: True if cast from the left hand, false if cast from the right hand.
- akTarget: The target.
- Offset_NoSneak_Left_X: Optional, X Offset for left hand when the actor is not sneaking. Default value is 30.0.
- Offset_NoSneak_Left_Y: Optional, Y Offset for left hand when the actor is not sneaking. Default value is 30.0.
- Offset_NoSneak_Left_Z: Optional, Z Offset for left hand when the actor is not sneaking. Default value is 110.0.
- Offset_NoSneak_Right_X: Optional, X Offset for right hand when the actor is not sneaking. Default value is 30.0.
- Offset_NoSneak_Right_Y: Optional, Y Offset for right hand when the actor is not sneaking. Default value is -30.0.
- Offset_NoSneak_Right_Z: Optional, Z Offset for right hand when the actor is not sneaking. Default value is 110.0.
- Offset_Sneak_Left_X: Optional, X Offset for left hand when the actor is sneaking. Default value is 30.0.
- Offset_Sneak_Left_Y: Optional, Y Offset for left hand when the actor is sneaking. Default value is 30.0.
- Offset_Sneak_Left_Z: Optional, Z Offset for left hand when the actor is sneaking. Default value is 70.0.
- Offset_Sneak_Right_X: Optional, X Offset for right hand when the actor is sneaking. Default value is 30.0.
- Offset_Sneak_Right_Y: Optional, Y Offset for right hand when the actor is sneaking. Default value is -30.0.
- Offset_Sneak_Right_Z: Optional, Z Offset for right hand when the actor is sneaking. Default value is 70.0.
}
Float GameX = akSource.GetAngleX()
Float GameZ = akSource.GetAngleZ()
Float AngleX = 90 + GameX
Float AngleZ
Float SourceMarkerXOffset_Standard
Float SourceMarkerYOffset_Standard
Float SourceMarkerZOffset_Standard
If GameZ < 90
AngleZ = 90 - GameZ
Else
AngleZ = 450 - GameZ
EndIf
If !akSource.IsSneaking()
If IsLeftHand
SourceMarkerXOffset_Standard = Offset_NoSneak_Left_X
SourceMarkerYOffset_Standard = Offset_NoSneak_Left_Y
SourceMarkerZOffset_Standard = Offset_NoSneak_Left_Z
Else
SourceMarkerXOffset_Standard = Offset_NoSneak_Right_X
SourceMarkerYOffset_Standard = Offset_NoSneak_Right_Y
SourceMarkerZOffset_Standard = Offset_NoSneak_Right_Z
EndIf
Else
If IsLeftHand
SourceMarkerXOffset_Standard = Offset_Sneak_Left_X
SourceMarkerYOffset_Standard = Offset_Sneak_Left_Y
SourceMarkerZOffset_Standard = Offset_Sneak_Left_Z
Else
SourceMarkerXOffset_Standard = Offset_Sneak_Right_X
SourceMarkerYOffset_Standard = Offset_Sneak_Right_Y
SourceMarkerZOffset_Standard = Offset_Sneak_Right_Z
EndIf
EndIf
Float SourcePosX = akSource.GetPositionX()
Float SourcePosY = akSource.GetPositionY()
Float SourcePosZ = akSource.GetPositionZ()
Float TargetPosX = akTarget.GetPositionX()
Float TargetPosY = akTarget.GetPositionY()
Float TargetPosZ = akTarget.GetPositionZ()
CastSpellFromPointToPoint(akSource, akSpell, (SourcePosX + (cos(AngleZ)*SourceMarkerXOffset_Standard - sin(AngleZ)*SourceMarkerYOffset_Standard)), (SourcePosY + (cos(AngleZ)*SourceMarkerYOffset_Standard + sin(AngleZ)*SourceMarkerXOffset_Standard)), (SourcePosZ + SourceMarkerZOffset_Standard), TargetPosX, TargetPosY, TargetPosZ)
EndFunction
Let me know if it works. If it does, I'll add it to this mod.
Edit:
Just had to alter the casts/passes on the function call, working fine on 1.4.1 afterwards, oddly enough
How difficult do you think it would be to implement a function that checks if you collide with something? I'm thinking about the player getting ragdolled when he sprints into a wall or an NPC getting launched away when you bump into it, those kinds of things.
One of the FAQs says:
"Q: Does this work with AE?
A: AFAIK, it should. Although I haven't tested it. Same goes for VR."
However, when I launch the game with this installed:
"A DLL plugin has failed to load correctly.
If a new version of SKyrim was just released, the plugin needs to be updated.
Please check the mod's webpage for updates.
ANDR_PapyrusFunctions.dll: couldn't load plugin (0000007E).
Continuing to load may result in lost save data or other undesired behavior."
I'm on 1.6.640.08 (Steam).
Edit: I have found the issue and I'm looking into ways to fix it. For now, it only works with SE 1.5.97. I've updated the FAQ in the description to reflect this. Hopefully this can be resolved soon.
Looking forward to it.
Anyways, a while ago, Actor Value Generator game me the same issue, in which the mod author fixed it by re-uploading the file without its debug version.
Thank you very much.
Nice work!
Cheers, mate.