Bolt or arrow? Is there a way to tell the difference in a sc

Post » Fri Jan 04, 2013 12:06 am

Bolt or arrow? Is there a way to tell the difference in a script?

They are all classified as AMMO but I need a function like IsBolt().

Would a "get model path" function work?

I do not want to make my mod dependent on Dawngaurd. AS it is now I have many Crossbow functions in my mod in case a player DOES have Dawngaurd.
None of which make my mod dependent.

But if I make a formlist of the bolts that will then require Dawngaurd to be loaded.

(I do have DG by the way, as I love the crossbows and extra Vampires.)


Edit: I think this may work, but I am worried a bolt is not a weapon per SKSE. I guess I will just try it:

String FilePath = WeaponProperty.GetModelPath()if StringUtil.Find(FilePath, "bolt") > 0debug.messagebox("I am a bolt")elseif StringUtil.Find(FilePath, "Bolt") > 0debug.messagebox("I am a Bolt")endif


Edit: NO...that will not work.... :confused:
User avatar
Marine x
 
Posts: 3327
Joined: Thu Mar 29, 2007 4:54 am

Post » Thu Jan 03, 2013 2:13 pm

What about finding out who/what fired the projectile?
User avatar
Ella Loapaga
 
Posts: 3376
Joined: Fri Mar 09, 2007 2:45 pm

Post » Fri Jan 04, 2013 12:57 am

What about finding out who/what fired the projectile?



Sorry I should have been more clear, this is in an on item add inventory block.

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)

so the mystery form is "akBaseItem" and I check it with GetType() == 42 ;ammo

But I need to know if akBaseItem is a bolt or an arrow.
User avatar
Tai Scott
 
Posts: 3446
Joined: Sat Jan 20, 2007 6:58 pm

Post » Thu Jan 03, 2013 7:17 pm

If you're using Dawnguard as a master, you could add all the bolts to a formlist, and use that as the condition. So instead of

akBaseItem.IsBolt(); not a true function

You could use

akBaseItem.IsInList(myFLST)
User avatar
^~LIL B0NE5~^
 
Posts: 3449
Joined: Wed Oct 31, 2007 12:38 pm


Return to V - Skyrim