The Elder Scrolls

ReferenceAlias Script Trouble

Content of the article: "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)

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

Read:  CTD after 1/2 mins of playing.

© Post "ReferenceAlias Script Trouble" for game The Elder Scrolls.




Top 7 NEW Games of June 2020

Quite a few exciting games are releasing for PC, PS4, Xbox One, and Nintendo in June. Here's what to keep an eye on.


Top 10 NEW Open World Games of 2020

Video games with open worlds continue to roll out in 2020 on PC, PS4, Xbox One, Nintendo Switch, and beyond. Here are some to look forward to!


Top 10 Best New Upcoming Games 2020-2021

The best selection of games which will be released in 2020 and 2021 for PS4, PS5, Xbox One, Xbox Series X, Google Stadia and PC - and you can watch in amazing UHD 4K and 60FPS with latest updates about all of the games in this list!


You Might Also Like

Leave a Reply

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