Jump to content

Is it possible to create a weapon that shoots "spells"?


Recommended Posts

38 minutes ago, GamerRick said:

OnRelease, eh.  Sounds good.  OnAttack looks like it would be good for what the OP is asking for.

I wonder if OnRecoil and OnStagger would be better than what the mod I am using does.

I think it would be a matter to try it out. OnAttack might be better. This would need to be tested in conjunction with the spell.

Yes, OnRecoil and OnStagger would be better than a quest that runs every frame. But may be the mod you're using was made before OBSE had this event functionality. Or may be the mod author didn't know how to use it.

Link to comment
Share on other sites

After some research and tests I'm positive it can be done. For ranged spells you can use invisible activators positioned in front of you - first one will shoot spell of your choice, second will serve as a target in which direction the first one will shoot. For positioning you will need OBSE, as vanilla doesn't have needed functions. Also positioning them at right direction is quite tricky in first person, but for races scaled near 1 doable. However using activator will bring some small disadvantages:

1. By default this won't raise any skill, but it can be arranged using OBSE function.

2. Doesn't trigger a crime when hitting friendly NPC (if you care of course).

3. Friendly fire (you can be hit by your "own" spell if not carefull).

4. On my computer projectile from activator doesn't light surrounding enviroment for some reason (but as I named my test power Mind Projectile, it's propably fitting).

I can upload my test mod, if there's still interest, but bear in mind it's largely experimental - reasonably tested though.

Link to comment
Share on other sites

  • 4 weeks later...
On 4/13/2024 at 2:19 AM, RomanR said:

After some research and tests I'm positive it can be done. For ranged spells you can use invisible activators positioned in front of you - first one will shoot spell of your choice, second will serve as a target in which direction the first one will shoot. For positioning you will need OBSE, as vanilla doesn't have needed functions. Also positioning them at right direction is quite tricky in first person, but for races scaled near 1 doable. However using activator will bring some small disadvantages:

1. By default this won't raise any skill, but it can be arranged using OBSE function.

2. Doesn't trigger a crime when hitting friendly NPC (if you care of course).

3. Friendly fire (you can be hit by your "own" spell if not carefull).

4. On my computer projectile from activator doesn't light surrounding enviroment for some reason (but as I named my test power Mind Projectile, it's propably fitting).

I can upload my test mod, if there's still interest, but bear in mind it's largely experimental - reasonably tested though.

i think i know what type of invisible activator you were talking about, from Supreme Magicka perhaps? i researched its Mystic Hands spell but as soon as i know how it's done i didn't want to "copy" the effects anymore.

it's too complicated for me to do a version of my own and i'd like to keep Finger of the Mountain in the spell slot while i'm waving fancy sword waves.

but anyway thanks for advising.

Link to comment
Share on other sites

thanks people, i'd appreciate you all for posting in my first post.

there is only one but rather weird problem that i posted before, i DID install OBSE and any mods that require it and my game didn't crash, but the game won't run my script for that special weapon, specificly, OnAttack function and such doesn't work.

anyway, you'll always welcome to give any advices here.

🙂

Edited by JoachimLaw
Link to comment
Share on other sites

OnAttack and OnRelease aren't functions, they're events defined by SetEventHandler command. By using it you specify type of event you want and a script which will handle it. However script functions made as event handlers aren't made to return values, so if you need such thing (and you propably will), use shared quest or global variable. You must also define SetEventHandler events again at every restart of Oblivion. Handler function can be like this:

scn FnMyOnReleaseHandler
ref actor
ref weapon

begin function {actor}
	if actor == PlayerRef ;It was player...
		let weapon := actor.GetEquippedObject 16
		if weapon == MyMagicWeapon ;...who done swing with wanted weapon?
			if MyQuest.canCast == 0
				set MyQuest.canCast to 1 ;inform another part via this quest flag
			endif
		endif
	endif
end

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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