Where to attach script

Post » Sun Jan 30, 2011 7:01 am

I have made a script that effects some npc's but i dont know where to attach the script so it effects all places eg tamriel worldscape, the shivering isles ect can someone please help
User avatar
Taylor Thompson
 
Posts: 3350
Joined: Fri Nov 16, 2007 5:19 am

Post » Sun Jan 30, 2011 6:43 am

Just create a quest, set it to "start game enabled" and attach a script to it (script needs to be set as quest script).
User avatar
maddison
 
Posts: 3498
Joined: Sat Mar 10, 2007 9:22 pm

Post » Sat Jan 29, 2011 6:51 pm

Thank you for your help trollf but now there is another problem . Heres my script:

scn ChangeCupAAshort actorrefref upperbodyBegin GameModeset upperbody to UpperBodyAAset actorref to GetSelfif {actorref.GetItemCount ChangeTokenAA == 1}actorref.equipitemNS upperbodyendifend


I try to save it as a quest script but it just gets errors, how do i fix this. Its for OBSE
User avatar
carly mcdonough
 
Posts: 3402
Joined: Fri Jul 28, 2006 3:23 am

Post » Sat Jan 29, 2011 5:44 pm

Your main problem is the "GetSelf" which refers to the object a script is attached to, and therefore you can only use it in an object script. Most times you don't need it anyway, as functions are assumed to operate on the object unless you use an explicit operand.

The quest script should be the one that adds the token to all the appropriate actors, and the script that uses the token to change the equipment needs to be an object script on the token probably using GetContainer instead of GetSelf, so it finds the actor holding the token, not the token itself.

But if you're attempting to have a proportion of female NPCs differ in size from the others, it would be much easier just to give them a selection of armor and clothes of that other size. NPC's don't pick up armor and clothing and wear it, they only use what's in their own inventory. If their inventory is all size zero, they're petite. If it's all size 20, they're fat.

The only time you'd need a script is if you want a change of clothing that's not covered by armored/unarmored. E.g. you want a smith to put on an apron to work, sleep without it, and wear a cuirass and greaves to fight. Three situations, and only two AI package settings.
User avatar
Siidney
 
Posts: 3378
Joined: Fri Mar 23, 2007 11:54 pm

Post » Sun Jan 30, 2011 12:47 am

Your main problem is the "GetSelf" which refers to the object a script is attached to, and therefore you can only use it in an object script. Most times you don't need it anyway, as functions are assumed to operate on the object unless you use an explicit operand.

The quest script should be the one that adds the token to all the appropriate actors, and the script that uses the token to change the equipment needs to be an object script on the token probably using GetContainer instead of GetSelf, so it finds the actor holding the token, not the token itself.

But if you're attempting to have a proportion of female NPCs differ in size from the others, it would be much easier just to give them a selection of armor and clothes of that other size. NPC's don't pick up armor and clothing and wear it, they only use what's in their own inventory. If their inventory is all size zero, they're petite. If it's all size 20, they're fat.

The only time you'd need a script is if you want a change of clothing that's not covered by armored/unarmored. E.g. you want a smith to put on an apron to work, sleep without it, and wear a cuirass and greaves to fight. Three situations, and only two AI package settings.


Thank you for your help but what function will i use for the reference. Heres the quest script :

scn ChangeCupSizeAAScriptref actorrefshort doonceBegin GameModeif {doonce ==0}if {actorref.GetIssix female}&&{actorref.GetFactionRank ChangeSizeAA >= 0}actorref.additem ChangeTokenAA 1set doonce to 1endifendifend


I dont seem to get the token. I dont see any changes in the certain npc's with the faction in the script. What do i have to change
User avatar
SaVino GοΜ
 
Posts: 3360
Joined: Mon Sep 17, 2007 8:00 pm


Return to IV - Oblivion