Jump to content

Script help, simple do X on projectile hit script.


ZippyDSMlee

Recommended Posts

Got a test script I am trying to run in skyrim, bascily I want a projectile to run this script when it hits. As you can tell the script is incomplete trying to find info on whats wrong with it but thats always slow going. If its target or location based should it be something.zippytesteffect?

ScriptName zippytetratest1EffectScript



Float Random

Begin ScriptEffectStart


Set GRP to GetRandomPercent

		If GRP <= 50
 		        zippylightingtest1effect

                    If GRP <= 50
			zippyfrosttest1effect

                             If GRP <= 50
			          zippylightingtest1effect
      
          EndIf
	       EndIf
                   EndIf

End


Link to comment
Share on other sites

I'm not the greatest expert when it comes to scripts, but it would seem to me that you aren't calling for an Event or Function. Have you looked into projectile magic effects?

 

Perhaps take a look at the "OnHit" event.

 

http://www.creationkit.com/OnHit_-_ObjectReference

Link to comment
Share on other sites

I'm not the greatest expert when it comes to scripts, but it would seem to me that you aren't calling for an Event or Function. Have you looked into projectile magic effects?

 

Perhaps take a look at the "OnHit" event.

 

http://www.creationkit.com/OnHit_-_ObjectReference

last time i tried something like this I used some sort of place at me script to place an explosion, I could place a couple fake explosives and a explosive in one go.

 

 

But I lost that file and notes so I am going blind again using what little I know which is not much, I think you nailed it tho thats the connection I am missing but it begs the question will that get me my enchantments....mmmmmm

 

 

What I want to do is call upon 3 separate enchantments give them a random percent number then lock each to separate level ranges, I've tried this all using conditionals in a single enchantment but that did not work right.

 

 

Oh gawd the script looks worse now LOL

I've never been good at scripting ><

ScriptName zippytetratest1EffectScript

Float Random

Begin ScriptEffectStart

Event OnEffectStart(Actor akTarget, Actor akCaster)
Target = akTarget
endEvent

Set GRP to GetRandomPercent

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
endEvent
	If GRP <= 50
 		=  akTarget.zippylightingtest1effect
                     If GRP <= 50
	            =  akTarget.zippyfrosttest1effect
                             If GRP <= 50
	                 =  akTarget.zippylightingtest1effect
          EndIf
	  EndIf
                         EndIf
End

Link to comment
Share on other sites

You're not telling it to do anything in the event. Not that it'll work but I'm fairly sure that you need to place all your if statements inside the event.

 

Something like

 

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)

If GRP <= 50 = akTarget.zippylightingtest1effect

 

esleif GRP <= 50 = akTarget.zippyfrosttest1effect If GRP <= 50 = akTarget.zippylightingtest1effect

EndIf

EndIf

EndIf

 

endEvent

 

 

 

It won't work, it's just an example. I suggest that you look at the scripts attached to magic effects and also at how you are using random percentage (surely that needs definition )

Link to comment
Share on other sites

You're not telling it to do anything in the event. Not that it'll work but I'm fairly sure that you need to place all your if statements inside the event.

 

Something like

 

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)

If GRP <= 50 = akTarget.zippylightingtest1effect

 

esleif GRP <= 50 = akTarget.zippyfrosttest1effect If GRP <= 50 = akTarget.zippylightingtest1effect

EndIf

EndIf

EndIf

 

endEvent

 

 

 

It won't work, it's just an example. I suggest that you look at the scripts attached to magic effects and also at how you are using random percentage (surely that needs definition )

How do i get to the scripts? I can't find them under all....

Link to comment
Share on other sites

Ah ok.

 

Find a spell that does something similar (fireball?)and open it up. On the right hand side will be a list of magic effects. Make a note of them. Now find them in magic effects and open them up. If you're lucky there should be a script attached that you can take a peek at to gain an idea of how they function.

 

Happy hunting

 

Edit: Google is your friend and so is the nexus.

 

Greater minds than I may have your answers here: http://forums.nexusmods.com/index.php?/topic/2176224-help-with-onhit-script-for-spell/

Edited by skinnytecboy
Link to comment
Share on other sites

Ah ok.

 

Find a spell that does something similar (fireball?)and open it up. On the right hand side will be a list of magic effects. Make a note of them. Now find them in magic effects and open them up. If you're lucky there should be a script attached that you can take a peek at to gain an idea of how they function.

 

Happy hunting

 

Edit: Google is your friend and so is the nexus.

 

Greater minds than I may have your answers here: http://forums.nexusmods.com/index.php?/topic/2176224-help-with-onhit-script-for-spell/

Its almost like Uscript, oy I want the old foolproof scripting back :P LOL

Extending might work need to look over the hierarchy.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...