Jump to content

[LE] Help identifying ore attacking?


Recommended Posts

Is there any way I can check the value of a property on another script without filling it via the Init block? I need to be able to check the If CurNode.ResourceCountCurrent != -1 as a condition for the whole hit process, but I can't fill it on Init because the reference changes all the time.

Try

If (CurNode as MineOreScript).ResourceCountCurrent != -1

Got it working. The script works fine being on the quest and calling the Alias_Name.ForceRefTo(Object), it doesn't have to be on the alias itself. So I just have the actual hit script on the alias and it's all good... Now all I need to do is figure out how to negate the hit effect if the deposit is depleted sigh.... it still registers even when depleted.

Sorry, I saw the function was an extension of ReferenceAlias and thought it would need to be on a ReferenceAlias script. I'd never used it before, thus didn't know how it actually worked.

Link to comment
Share on other sites

So I got it all working. The (CurNode as MineOreScript).ResourceCountCurrent != 0 worked (had to review the mineorescript again) but it's all working fine now. It drops a few hits now and then if they happen too fast, but I think it will work fine. I have the update going ever 1 second but if a pick is not equipped it immediately stops the script, so it shouldn't be too much of a drain on the scripting system. Thanks for your suggestion.

Link to comment
Share on other sites

Just some quick questions, whatever you are doing, should it work alongside mods like my Random Mining? I would think it would but better to be safe than sorry. And what about say Mining For Mages where a spell is used to attack the ore vein? I'm guessing that it will fail in that scenario.

Link to comment
Share on other sites

Well, if the spell actually hits the deposit itself it should be fine to register an OnHit event with a simple condition edit in the script which allows akSource to be the spell instead of a pickaxe item I could even code in a conditional getformFromFile fill for another property check for that spell if that's the case. or just offer an alternate script for compatibility.

 

There is also an entire separate system on this though which works with activating the deposit which listens for animation event sounds of mining from the player. This one works flawlessly alongside any other system as long as they don't alter the mining animation event sounds. No edits are made to any deposit activators at all. The main thing I was doing all this compatibility work for was so it would work along side CCOR with no issues. It also scales the hit counts to match CCOR's faster or slower mining settings.

Link to comment
Share on other sites

Mining For Mages (both the original and my rebuild) have a projectile spell which hits the ore vein. Both the spell and the projectile are added to the MineOreTools list so you could just do a check for projectile impact and if that projectile is on the formlist, then do whatever. In fact this is how I have Random Mining determine whether to provide magic skill exp or smithing skill exp depending upon what hit the ore vein, should work for you too.

If mineOreToolsList.hasForm(akProjectile as Form)
Link to comment
Share on other sites

  • Recently Browsing   0 members

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