icecreamassassin Posted May 23, 2017 Share Posted May 23, 2017 So I am trying to avoid altering the mining deposit Activator forms in any way whatsoever, so I have an animation event set up which listens for the pickaxe sound generated by players mining a deposit. This works perfectly, but I am having an issue because there is also the "attack with a pick axe" method of mining and I do not want to make a cloak magic effect to target them, because the cloak system is far to complex and I simply hate working with it, plus it's overly cumbersome on the system. I have tried setting up a self resetting quest handler which cycles every 3 seconds and applies an alias script to an alias which fills from a list of ore deposits but for some reason it won't work. I have used this system on another application which finds the nearest item on a list and it works just fine. Basically the stage 5 start stage registers an update for 3 seconds later, the update sets stage 6 which resets the quest and sets stage 5 again which then should trigger setting the alias again which is using the nearest reference in the loaded area which IsInList containing all of the base forms for the ore nodes I am trying to find. I've compared the system to my working one and they seem to match just fine, with the only variance being the list contents itself. Anyone see something I may be missing or have another suggestion on how I could detect an attack against a mine node? I also want to avoid using a perk entry point that uses the Apply Hit Spell entry point since only one entry point of that variety can be used at a time. Thanks in advance. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 23, 2017 Share Posted May 23, 2017 Perhaps post some screenshots of your editor settings and/or relevant script code. Without that, there is no way for anyone to 'see something that may be missing'. Link to comment Share on other sites More sharing options...
icecreamassassin Posted May 23, 2017 Author Share Posted May 23, 2017 oh I was thinking more generally, but sure, I'll do that. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 24, 2017 Share Posted May 24, 2017 Was thinking about this... Instead of having the quest keep resetting itself and trying to fill an alias, start off with the alias filled with a dummy object. Then apply a script directly to that alias which contains an OnInit event to call for an update. The update event uses GetCurrentCrosshairRef and checks the result to ensure that it is an ore vein activator and/or its base is in your formlist. If the result is valid force the target into the alias where a second script contains whatever you need for the OnHit event. A drawback would be that you'd need the update polling to be fairly quick so that you can catch the first attack strike. But it does avoid the story manager grabbing a different ore vein than the one the player is interacting with (i.e. it picks a floor vein while player picked a wall vein) Link to comment Share on other sites More sharing options...
icecreamassassin Posted May 24, 2017 Author Share Posted May 24, 2017 Yeah that could work. I'll try that out, thanks. Link to comment Share on other sites More sharing options...
icecreamassassin Posted May 24, 2017 Author Share Posted May 24, 2017 so a couple questions. Wouldn't having the update on the referencealias itself be problematic? Wouldn't it just work to have the update handled by the quest script? This way it would also be easy to apply an alias script to the player that watches for equip events for pick axe forms to actually turn on and off the update, so it's only running when you have a pickaxe in hand. Link to comment Share on other sites More sharing options...
icecreamassassin Posted May 24, 2017 Author Share Posted May 24, 2017 hmmm scratch that, not really an easy way to monitor the player for equip events, and I think it may be more burdensome than simply conditioning the update event to instead stop if a pick item is not equipped. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted May 24, 2017 Share Posted May 24, 2017 hmmm scratch that, not really an easy way to monitor the player for equip events, and I think it may be more burdensome than simply conditioning the update event to instead stop if a pick item is not equipped.A player alias script could use OnObjectEquipped and check if the item is 1. a weapon and 2. in the MineOreTools list. Then it can call a function on whatever other script to start up whatever you need. Not sure what is burdensome about that. so a couple questions. Wouldn't having the update on the referencealias itself be problematic? Wouldn't it just work to have the update handled by the quest script? This way it would also be easy to apply an alias script to the player that watches for equip events for pick axe forms to actually turn on and off the update, so it's only running when you have a pickaxe in hand.I had thought about it on another script, but ForceRefTo which is the function to assign an ObjectReference to an alias can only be ran on the reference alias that you want to fill. I suppose tho the update and all that could be on the quest script and you just a call a function on the reference alias script, but you'll still need a dummy object initially. Link to comment Share on other sites More sharing options...
icecreamassassin Posted May 24, 2017 Author Share Posted May 24, 2017 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. Link to comment Share on other sites More sharing options...
icecreamassassin Posted May 24, 2017 Author Share Posted May 24, 2017 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. Link to comment Share on other sites More sharing options...
Recommended Posts