The Elder Scrolls

ReferenceAlias Script Trouble

I'm having some trouble with a reference alias script. I'm working on a mod which makes telekinesis deal damage based on the weight of the object which is thrown. I have a quest which attaches a script to the throwable items nearest to the player. The script uses the OnGrab event to detect being grabbed by telekinesis (I have confirmed that this works). The problem I am running into is that I can't find a way to get an ObjectReference for the item which is being thrown. I need this so that I can get the weight of the item. I've tried using "self" but this appears to only point at the script and not the object. I've also tried GetReference, but this also doesn't seem to help. I'll post the current version of the script below.

*Edit: I've also now tried using the Game.GetPlayerGrabbedRef() function. I still have the same issue, however. I'm using a notification to tell me what I'm holding, and the notification tells me I'm holding

Scriptname TT_WeightToDamage extends ReferenceAlias

Scriptname TT_WeightToDamage extends ReferenceAlias

Event OnGrab()

ObjectReference Throwable = Game.GetPlayerGrabbedRef()

Float Weight = Throwable.GetWeight()

Debug.Notification("This is" +Throwable)

Debug.Notification("Weight is" +Weight) 

Float TotalDamage = (2*Weight)

Debug.Notification("Total Damage is" +TotalDamage) 

Game.SetGameSettingFloat("fMagicTelekinesisDamageBase", TotalDamage)

Read more:  CTD When Pushing New or Load, Or Going Into The Game At All

if Game.GetPlayer().GetEquippedWeapon().GetWeight() > 10.0

Debug.Notification("Your weapon is heavy!")

endIf

ENDEVENT

Thank you for any help you can provide.

Source: reddit.com

Similar Guides


More about The Elder Scrolls

Post: "ReferenceAlias Script Trouble" specifically for the game The Elder Scrolls. Other useful information about this game:





Top 20 NEW Medieval Games of 2021

Swords, dragons, knights, castles - if you love any of this stuff, you might like these games throughout 2021.



10 NEW Shooter Games of 2021 With Over The Top Action

We've been keeping our eye on these crazy action oriented first and third person shooter games releasing this year. What's on your personal list? Let us know!



Top 10 NEW Survival Games of 2021

Survival video games are still going strong in 2021. Here's everything to look forward to on PC, PS5, Xbox Series X, Nintendo Switch, and beyond.



You Might Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *