Can I attach more than one object script to an NPC?

Post » Tue Mar 02, 2010 3:12 pm

Can I attach more than one object script to an NPC? I've run out of room in the one script attached to the NPC and need to continue it to another script.

Possible?
User avatar
kiss my weasel
 
Posts: 3221
Joined: Tue Feb 20, 2007 9:08 am

Post » Tue Mar 02, 2010 5:28 pm

Can I attach more than one object script to an NPC? I've run out of room in the one script attached to the NPC and need to continue it to another script.

Possible?

The only way I can think of to do this would be to put the scripts on tokens in the NPC's inventory.
User avatar
Robert Jr
 
Posts: 3447
Joined: Fri Nov 23, 2007 7:49 pm

Post » Tue Mar 02, 2010 11:22 am

I'll try it.
User avatar
Nicole M
 
Posts: 3501
Joined: Thu Jun 15, 2006 6:31 am

Post » Tue Mar 02, 2010 9:25 pm

Can I attach more than one object script to an NPC? I've run out of room in the one script attached to the NPC and need to continue it to another script.

Possible?

Add an item to their inventory that uses GetContainer to get their reference. You can only run gamemode blocks but that's all you'll need.

Odds are if you've hit the cap you could probably rework the code substantially though. Try farming out anything that doesn't absolutely need to be core or is repeated into scripted tokens. For example, rather than having a big set of if conditions you use several times to choose a package, remove that script and replace it with "Additem PackageSelectToken", then put the script in the OnAdd block of PackageSelectToken's script.
You can probably break down most of your script into tokens.
User avatar
Allison C
 
Posts: 3369
Joined: Mon Dec 18, 2006 11:02 am

Post » Tue Mar 02, 2010 1:42 pm

Three other ways of doing it, using the same concept TheTalkieToaster suggested (moving parts of your script somewhere else)

1 - Wiki article: http://cs.elderscrolls.com/constwiki/index.php/Activation_Functions
2 - Wiki article: http://cs.elderscrolls.com/constwiki/index.php/Category:Stage_Functions
3 - Wiki article: http://cs.elderscrolls.com/constwiki/index.php/User_Functions
User avatar
Sophie Louise Edge
 
Posts: 3461
Joined: Sat Oct 21, 2006 7:09 pm

Post » Tue Mar 02, 2010 12:43 pm

Most of the code triggers dialog. I can probably move that to the stage tab result scripts.

EDIT

That doesn't work. The package method is a bit to complex for me. I'm going to stick with the token. It works well enough. K.I.S.S. :hubbahubba:
User avatar
Alisha Clarke
 
Posts: 3461
Joined: Tue Jan 16, 2007 2:53 am

Post » Tue Mar 02, 2010 5:59 pm

eeeerrrrr.... is menu mode a form of game block?

Because I use "begin menumode" in tokens and they have worked as far as I know.

:confused:

Maybe they are not working as I thought, ok now I am worried...



Add an item to their inventory that uses GetContainer to get their reference. You can only run gamemode blocks but that's all you'll need.

Odds are if you've hit the cap you could probably rework the code substantially though. Try farming out anything that doesn't absolutely need to be core or is repeated into scripted tokens. For example, rather than having a big set of if conditions you use several times to choose a package, remove that script and replace it with "Additem PackageSelectToken", then put the script in the OnAdd block of PackageSelectToken's script.
You can probably break down most of your script into tokens.

User avatar
Dawn Porter
 
Posts: 3449
Joined: Sun Jun 18, 2006 11:17 am

Post » Tue Mar 02, 2010 8:35 pm

eeeerrrrr.... is menu mode a form of game block?

Because I use "begin menumode" in tokens and they have worked as far as I know.

:confused:

Maybe they are not working as I thought, ok now I am worried...
My curiosity is piqued too. I've used menuMode blocks in token scripts many times without hitches.
User avatar
Charles Weber
 
Posts: 3447
Joined: Wed Aug 08, 2007 5:14 pm

Post » Tue Mar 02, 2010 8:03 pm

eeeerrrrr.... is menu mode a form of game block?

Because I use "begin menumode" in tokens and they have worked as far as I know.

:confused:

Maybe they are not working as I thought, ok now I am worried...
I meant no 'OnPackageDone'/'OnHit'/'OnStartCombat' style blocks. Menumode slipped my mind for a moment.
User avatar
Skivs
 
Posts: 3550
Joined: Sat Dec 01, 2007 10:06 pm


Return to IV - Oblivion