Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

translatetoref function issues


Erotic_Hippo
 Share

Recommended Posts

I am trying to write a script that locates the nearest weapon to the caster and translates it to the target the spell was cast on. I find the nearest weapon using the FindClosestReferenceOfAnyTypeInListFromRef command and created a form list of weapons. The problem comes when I try to translate the weapon to the target. It wont move at all. I can translate the target to the weapon, but I cant translate the found weapon to the target. The only thing I can do to the weapon is applyhavocimpulse or moveto. All other motion functions dont work on the weapons found from the form list. Can someone tell me how I can get the translatetoref to work for the weapon found from the form list?

 

scriptName WeaponThrow extends ActiveMagicEffect
import game
import debug
formlist property WeaponList auto 
objectreference WeaponFound 
float RadiusToFindWeapon = 2000.0

Event Oneffectstart(Actor akTarget, Actor akCaster)
	WeaponFound = game.FindClosestReferenceOfAnyTypeInListFromRef(WeaponList, akCaster, RadiusToFindWeapon) 
	WeaponFound.translatetoref(akTargetObject,500.0)
Endevent
	

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...