Jump to content

Mine Ore Scripting


iansaltman

Recommended Posts

I attached the script MineOreVein (or whatever it is) to an absorb health spell, obviously so you could magically extract the ore rather than using the pickaxe. I set it as a concentrated cast as well as an aimed targeting. Any ideas on why it wouldn't work when I cast it on a vein in-game?
Link to comment
Share on other sites

Maybe it has something to do with the animations shown when mining, or perhaps the vein object isn't registering that it's being hit, thus won't do anything?

 

I'm going to try a different type of casting I suppose, a projectile seems like it would register better. It's too late where I live though, it'll have to wait.1

Link to comment
Share on other sites

Could you post up the script? It will probably need a minor modification. It would also probably be a good idea to make it a completely new script and then you can edit it without modifying the original.

 

As well, if someone has a mod that changes the mining script, it'll potentially prevent your mod from working properly.

 

Edit: I don't have the CK handy but I'm guessing it's an onhit event.

 

You're going to want to make sure the akProjectile is not set to false. This is for melee.

 

 

This is what I'm thinking:

 

 

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
  If ( akAggressor == Game().GetPlayer() ) && ( akSource == MySpellProperty)
      script block to collect mine ore 
  endif
  Debug.Trace("We were hit by " + akAggressor)
EndEvent

 

 

 

This is obviously untested but may be a good start

Edited by PaladinRider
Link to comment
Share on other sites

Could you post up the script? It will probably need a minor modification. It would also probably be a good idea to make it a completely new script and then you can edit it without modifying the original.

 

As well, if someone has a mod that changes the mining script, it'll potentially prevent your mod from working properly.

 

Edit: I don't have the CK handy but I'm guessing it's an onhit event.

 

You're going to want to make sure the akProjectile is not set to false. This is for melee.

 

 

This is what I'm thinking:

 

 

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)
  If ( akAggressor == Game().GetPlayer() ) && ( akSource == MySpellProperty)
  	script block to collect mine ore 
  endif
  Debug.Trace("We were hit by " + akAggressor)
EndEvent

 

 

 

This is obviously untested but may be a good start

 

This, it's making sense! Help much appreciated, it is a good start!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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