Jump to content

Help understanding CastAs function


vizex1

Recommended Posts

Looking at the scripts for the mod, they use variables and not properties. So you're going to have to rewrite the script, after getting permission first.

Hmmm... Maybe this is the long and complicated route. I think I might abandon ship with this idea and try something different.

 

Maybe you can help me with a different approach?

So I'm thinking I create an omod with an enchantment that is attached to the holster object.

The enchantment has a magic effect which has a script.

This script will be what determines if the weapon being used is linked to the holster.

 

Basically what I want the script to do is:

On SomeEvent

if a weapon is currently drawn and the current holster which the omod is attached to is unequipped.

then I activate the

 Game.GetPlayer().AttachModToInventoryItem(holsterreference, Mod1)

Is this possible?

I think this might work.

 

I will try to write it myself, but if you can help I'd really appreciate it.

Edited by vizex1
Link to comment
Share on other sites

I really don't have enough of a grasp on how the Visible Weapon scripts work to be able to help you. Sorry.

That's okay. But the new script i'm looking how to write no longer involves visible weapons.

 

Here's some script i've cobbled together:

On SomeEvent
	if (Game.GetPlayer().IsWeaponDrawn == True)
	and
	if (Game.GetPlayer().IsEquipped(ObjectProperty) == False)
		Game.GetPlayer().AttachModToInventoryItem(ObjectProperty, Mod1)
endIf
EndEvent

I'm still looking online on how to write this properly, but if you or anyone can help me turn this into actual code that would be a big help.

Edited by vizex1
Link to comment
Share on other sites

  • Recently Browsing   0 members

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