Looking for event

Post » Tue Jun 19, 2012 7:09 am

Hi.

I need an event that runs when the player uses a certain bow (to which I will attach the script.)
I figured OnHit would work, but I can't figure it out.
User avatar
k a t e
 
Posts: 3378
Joined: Fri Jan 19, 2007 9:00 am

Post » Tue Jun 19, 2012 2:11 am

OnHit's not good. It works when an object IS hit. I'd try OnActivate maybe.
User avatar
Chloe Yarnall
 
Posts: 3461
Joined: Sun Oct 08, 2006 3:26 am

Post » Tue Jun 19, 2012 6:06 am

I thought OnActivate = when you click "E" on an object, such as "open door".

Would it be possible to OnEquip add a script to all the actors in the cell that has the OnHit event, and with that script check if akAggressor == Player and Weapon == (My Weapon), and remove the scripts when the player unequips the weapon?
User avatar
Kim Bradley
 
Posts: 3427
Joined: Sat Aug 18, 2007 6:00 am

Post » Tue Jun 19, 2012 12:42 am

http://www.gamesas.com/topic/1349649-dynamically-attaching-scripts-to-actors-near-the-player/
Maybe this?
User avatar
Fanny Rouyé
 
Posts: 3316
Joined: Sun Mar 25, 2007 9:47 am

Post » Tue Jun 19, 2012 9:39 am

I don't believe there is any event that will detect when the player fires an arrow, although you could try http://www.creationkit.com/OnAnimationEvent_-_Form.

Cipscis
User avatar
naomi
 
Posts: 3400
Joined: Tue Jul 11, 2006 2:58 pm

Post » Tue Jun 19, 2012 12:28 am

Yup. There are no events, however just as Cipscis suggests you can use OnAnimationEvent. Check out the thread http://www.gamesas.com/topic/1350174-how-to-trigger-onfire-bow/.
User avatar
sam
 
Posts: 3386
Joined: Sat Jan 27, 2007 2:44 pm

Post » Tue Jun 19, 2012 10:33 am

If your using a projectile you can attach an explosion that only has an enchantment on it. I am currently working this into my gun mod as we speak. Basically I just have the enchantment set to "fire and forget" and "target location". When it hits the MagicEffect on the enchantment runs a script only to this effect. This works if I hit something or not, which I want because I want to switch to another weapon after firing. All of this while I still get to apply damage and effects normally with my staff enchantments :D

Scriptname gunAutoSwitch extends activeMagicEffectEvent OnSpellCast(Form akSpell)  Debug.Notification("Bang!)endEvent

~Mikloud~
User avatar
Amanda Leis
 
Posts: 3518
Joined: Sun Dec 24, 2006 1:57 am

Post » Tue Jun 19, 2012 2:09 am

Nice mikloud!
User avatar
Tina Tupou
 
Posts: 3487
Joined: Fri Mar 09, 2007 4:37 pm


Return to V - Skyrim