Is it possible to have multiple scripts on one script?

Post » Mon Jun 20, 2011 4:28 am

Hello peoples, I am a beginner when it comes to scripting, although I have messed around some with it (mostly unsuccessfully). My current set up mod-wise is Morrowind Complete and Balmora Expanded. The Balmora Expanded mod adds the furniture market, a place where one can purchase, among other things, anvils. These anvils have a script for allowing the player to pick up the anvil and place it somewhere else. Morrowind Complete allows the player to craft materials, items, etc. The smithing portion of the mod adds a script to the anvil that upon activation, you have different options related to repairing, etc.
Unfortunately I don't see how it's possible to set two different scripts onto the same object. I have found that if I change the script that object "Anvil" uses, I can choose which function (Moving anvil, Repairing) it does. I thought that I might be able to create a script that switches between the two scripts depending on if the player was in sneak mode or not. This is what I've come up with so far...

Begin Anvil_Select_Mode
if ( OnActivate == 1 )
if ( GetPCSneaking == 1 )
Begin dh_furn_PickupCheck


elseif ( GetPCSneaking == 0 )
Begin max_smithing_01
endif

Endif
End

I'm almost 100% sure that the "Begin" functions I added later aren't correct...how exactly would I get the two scripts to run through one, is it even possible? Any help on this would be great, thanks.
User avatar
Lori Joe
 
Posts: 3539
Joined: Tue Jun 20, 2006 6:10 am

Post » Mon Jun 20, 2011 12:03 am

Well, it's supposed to be "StartScript", but there's plenty of local etiquette in working with multiple scripts that you may be not ready for. Why not implement all anvil functions in a single script?
User avatar
Nikki Lawrence
 
Posts: 3317
Joined: Sat Jul 01, 2006 2:27 am


Return to III - Morrowind