3aq Posted June 4, 2019 Share Posted June 4, 2019 so on https://www.creationkit.com/index.php?title=OnHit_-_ObjectReference it mentions akprojectile.. how would I go about properly assigning a projectile type? such as arrow or missile or beam from https://www.creationkit.com/index.php?title=Projectile and by assigning I mean by assigning for onhit event.I wish for an action to take place when actor x gets hit by a projectile thank you in advance :happy: Link to comment Share on other sites More sharing options...
Alaebasta Posted June 4, 2019 Share Posted June 4, 2019 You have to state the projectile property, then after calling the onhit event use a IF statement wich will conditionalize it with the projectile you want to trigger the event with. Example: Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \bool abBashAttack, bool abHitBlocked)If AkProjectile == MyProjectile;Do StuffEndifEndevent Projectile Property MyProjectile Hope i get myself clear. Link to comment Share on other sites More sharing options...
3aq Posted June 5, 2019 Author Share Posted June 5, 2019 yes I understand that, what i don't understand is how my listed property is understood as a missile or beam or other type but not something else by my script. Link to comment Share on other sites More sharing options...
Alaebasta Posted June 5, 2019 Share Posted June 5, 2019 You have to state the projectile property, then after calling the onhit event use a IF statement wich will conditionalize it with the projectile you want to trigger the event with. Example: Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \bool abBashAttack, bool abHitBlocked)If AkProjectile == MyProjectile;Do StuffEndifEndevent Projectile Property MyProjectile Hope i get myself clear.You have to use SKSE and use this function https://www.creationkit.com/index.php?title=GetType_-_Form recongnize akProjectile as a Form You will find all the types of projectiles there Link to comment Share on other sites More sharing options...
3aq Posted June 5, 2019 Author Share Posted June 5, 2019 so do I include int MyProjectile = MyArrow.GetType() into the onhit script or make a derivative script and extend it to form and have the onhit script reference the external derivative script? apologies for the question I'm simply lost on this. if there are working examples of it floating around which I could reference I think that would probably help figure this out for me. Link to comment Share on other sites More sharing options...
Evangela Posted June 5, 2019 Share Posted June 5, 2019 (edited) You don't need to extend to form and then spin your brain in circles by making another script to extend ObjectReference. Stick with the current script. Nice and easy and less confusing(and it can be because papyrus is a messy version of C++ imo) If you want the Event to check for the kind of projectile it is, then GetType is the way(but slow way) to do this. So I think the approach here is: ; since you might need to call it many times int projectileType = akProjectile.GetType() if projectileType == 63 ; missle type, Fireball for example ; do stuff to akProjectile endif The link provided by Alaebasta has the type codes on it. Edited June 5, 2019 by Rasikko Link to comment Share on other sites More sharing options...
3aq Posted June 5, 2019 Author Share Posted June 5, 2019 (edited) by slow, you mean performance wise right? if so, what would be the "fast way"? Edited June 5, 2019 by 3aq Link to comment Share on other sites More sharing options...
Evangela Posted June 5, 2019 Share Posted June 5, 2019 (edited) There's no faster way to get object types like that. Just letting you know the operation will be a tad bit slow. Edited June 5, 2019 by Rasikko Link to comment Share on other sites More sharing options...
Alaebasta Posted June 5, 2019 Share Posted June 5, 2019 by slow, you mean performance wise right? if so, what would be the "fast way"?Because it calculates every type of forms untill it gets to yours. If you are going to check a particular type of projectile you can still use a Formlist to narrow triggers. Link to comment Share on other sites More sharing options...
3aq Posted June 5, 2019 Author Share Posted June 5, 2019 Formlist as in [actor, spell, armor, weapon, etc] property <blank> auto? or the one found in esp? I have no concrete idea what it is you are referring to. Link to comment Share on other sites More sharing options...
Recommended Posts