Jump to content

Questions regarding ActorValues


Recommended Posts

So I'm looking to use a custom ActorValue on the playercharacter and have a script check its value when a certain event fires. So far I have:

 

  • Configured a new ActorValue in the CK with a default value of 0.0
  • Created a 'Value Modifier' Magic Effect (Constant Effect, Delivery: Self) and it's pointed at my new ActorValue
  • Created an Enchantment pointing at the above Magic Effect with the magnitude set to 1.0
  • Attached the Enchantment to an equippable item

 

I have a script which fires when the now echanted item is equipped, gets the ActorValue and for debugging reasons, shows the current value of my custom ActorValue. However, my custom ActorValue never seems to change from 0.0 to 1.0. Clearly I'm missing a step somewhere or not configuring something quite right.

 

Do I somehow need to attach my custom ActorValue to the player actor, if so how is this accomplished?

Edited by CylonSurfer
Link to comment
Share on other sites

You need to update the actorvalue in whatever way. In whatever script, eg your magic effect attached a script where ActorValue property xxx auto const and at the properties point to your custom actor value and u can modify and do whatever u want with ti ...

Link to comment
Share on other sites

You need to update the actorvalue in whatever way. In whatever script, eg your magic effect attached a script where ActorValue property xxx auto const and at the properties point to your custom actor value and u can modify and do whatever u want with ti ...

Thanks

 

Maybe I was being foolish, I thought that the magnetude setting on the Enchantment would set the ActorValue the 'Value Modifer' Magic Effect pointed to. So what exactly is the point of the 'Value Modifer' Magic effect pointing at an ActorValue if I'm going to have to set a script to run with the ActorValue property set so I can modify it?

Edited by CylonSurfer
Link to comment
Share on other sites

Just a quick update on this:

 

I tried Langnao's advice and got my ActorValue changing. However I found it too slow when paired with my main script which uses the 'OnItemEquipped' event. I often found, even with a delay added, that my script polled for the ActorValue before the magic effect has had chance to change it so it was a deadend really.

 

Anyway, as I'm having to add a script to a magic effect in order to get the actor value changing I just ditched the ActorValue and added the code I wanted to run in my main script directly to the magic effect. I now have everything working as I need and I'm happy with the results. The only thing I don't like is that I'm having to add my enchanment / magic effect directly to a few vanilla forms which I like to avoid where possible but I can't find a way around this - if anyone has any suggestions on how I can add an enchanment to an OMod without editing the vanilla record I'd be happy to hear from you.

 

Cheers all.

Edited by CylonSurfer
Link to comment
Share on other sites

Is enchanting the object the best solution ?

 

I hate working with the overly complicated magic nonsense unless absolutely forced to and there is generally a more manageable mechanism or script event for most needs.

 

Describe the scenario, user story As a < type of user >, I want < some goal > so that < some reason >.

Link to comment
Share on other sites

Is enchanting the object the best solution ?

 

I have been mulling this over in the past hour and I'm not sure it is... If I can just add an OMod as a quest alias I can attach a script to it which uses the 'OnEquipped' event and executes my code from there and I'd be rid of the magic stuff and any vanilla edits. That solution would depend on being able to add OMods as quest aliases though - which I admit I haven't looked at yet..

 

The aim is:

 

Player equips a weapon > game adjusts its position to line up with a right hand mesh. It's the VR version of the game, it doesn't have visible hands but I have added some but they cannot be referenced by script. So it's a question of "if I can't move the hand, I need to move the weapon".

 

Issue:

 

Some weapons with certain grip mods change how that weapon needs to be adjusted on screen so that they appear correctly positioned (or the best I can get them to be under the cirumstance) in the players hand. For example, the Laser Pistol has 3 grip types which drastically alter the position of where the weapon would be positioned in the hand but all report as the base 'Laser Pistol' weapon. I need to indentify any weapon with such mods installed when they are equipped in order to seperate them out and apply the unique positioning they require.

Edited by CylonSurfer
Link to comment
Share on other sites

Do the omods you need to act on come with unique or distinct keywords (ap_Gun_GripDisplay) , or are there specific omods your looking for by form id , or something else ?

Link to comment
Share on other sites

Do the omods you need to act on come with unique or distinct keywords (ap_Gun_GripDisplay) , or are there specific omods your looking for by form id , or something else ?

 

While looking at the grip Omods last night I couldn't see anything that distinguished one from another other than its name, model and form ID. I'll recheck the keywords when I'm home later but I'm pretty certain that there was nothing which stood out.

Edited by CylonSurfer
Link to comment
Share on other sites

Doing the "dummy" quest and attached script that way is definitely better. But sometime for some reason, this quest is not fired for some users, maybe due to mods conflict or whatever reason...

 

You probably can get all the mods attached to the weapon and act accordingly but its a F4SE function.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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