Jump to content

Upperbody/Lowerbody Companion


liyalai

Recommended Posts

You can, however, abuse the fact that your body comes with your clothes. There's a body mesh included in every clothing or armor item you wear, and the default one will only be rendered when you're not wearing anything.

You can easily give this companion only fitting items including the right upper- and lowerbody and additionally use the NIFs of your prefered upper- and lowerbodies to create "new" clothing items, only including these bodies, "wearable" bodies, if you like.

Limiting it to NPC-only it won't even require complex scripting, as NPCs have some AI to determine which type of items they wear at which time, and they will only wear 1 set of each (I think the highest valued one, but don't know it for sure).

On the other hand, scripts to auto-equip the respective wearable bodyparts when nothing else is worn in their equipment slot are rather simple few-liners (is that a word?) and quickly written.

Link to comment
Share on other sites

On the other hand, scripts to auto-equip the respective wearable bodyparts when nothing else is worn in their equipment slot are rather simple few-liners (is that a word?) and quickly written.

 

 

Could you provide an example for such a script?

Link to comment
Share on other sites

On the other hand, scripts to auto-equip the respective wearable bodyparts when nothing else is worn in their equipment slot are rather simple few-liners (is that a word?) and quickly written.

 

 

Could you provide an example for such a script?

 

Check 'Set Body and Set Body Self'.

Link to comment
Share on other sites

Well, let's assume this is a token, a meaningless item only there to have a script running with access to its container (you).

Let's furthermore assume "MyUpperbody" is the EditorID of your wearable upperbody item.

ref actor

Begin GameMode
   set actor to GetContainer ;in whos inventory am I, if any?
   if(actor) ;it would crash the game when just lying around in the open without this check!
       if(actor.GetEquipmentSlotMask 4 == 0) ;check if there is any item covering the upperbody slot and only continue if not
           actor.EquipItemNS MyUpperbody ;silent equip without message spam (maybe it will still make a sound though)
       endif
   endif
End

It requires OBSE, perhaps could be done without it, but far more complicated and complex.

 

Note: I'm always using GetEquipmentSlotMask, because it's the only function able to return any item covering the slot that was asked for without checking for the exact slot-combination!

GetEquippedObject, for example, only returns some data garbage, if you're asking for the content of the upperbody slot and wearing, say, the Arena Raiments. It doesn't return the Raiments' id nor does it return "0". I couldn't yet figure out what it is it returns in this case. So I'm just not using it at all and query with GetEquipmentSlotMask instead.

 

An additional benefit would be GetEquipmentSlotMask is not restricted to the pre-defined set of slot-combinations such as GetEquippedObject.

Have an item which is only covering hands and feet? Well, too bad it can't be checked for with GetEquippedObject.

Don't know of any such item in existance, yet? Alright, but does it mean there won't be any ever? Surely not.

Edited by DrakeTheDragon
Link to comment
Share on other sites

Is this a quest script or an object script.

If I make it an object script it doesn't work

If I make it a quest script I get this error when I try to save,

 

"Reference function 'GetContainer' requires explicit reference in quest script."

 

What am I doing wrong here?

Edited by NikhilR
Link to comment
Share on other sites

It is an Object script, of course, running on the "token" item I was talking of at the beginning of the post. This token has to be inside the inventory of the actor, which is why my mods all have some means to check for said tokens' presence and add them where missing. I'm using a scripted spell effect for doing this and a quest script constantly casting an area spell with this effect on the player to scan his surrounding (the range setting is very huge). But it can of course also be done differently.

 

You can of course also use a different approach than a token. But you would have to have some means to get the reference of the actor you want to control... or limit it to player-only.

Edited by DrakeTheDragon
Link to comment
Share on other sites

It is an Object script, of course, running on the "token" item I was talking of at the beginning of the post. This token has to be inside the inventory of the actor, which is why my mods all have some means to check for said tokens' presence and add them where missing. I'm using a scripted spell effect for doing this and a quest script constantly casting an area spell with this effect on the player to scan his surrounding (the range setting is very huge). But it can of course also be done differently.

 

You can of course also use a different approach than a token. But you would have to have some means to get the reference of the actor you want to control... or limit it to player-only.

 

The script doesn't seem to work. I have another script running which adds the items to the players inventory and equips them.

This is the script,

 

scn AANRealBodyBegin

short doonce

begin gamemode
if(doonce)
  return
endif
player.additem ANRealF 1
player.additem ANRealH 1
player.additem ANRealL 1
player.additem ANRealU 1
player.equipitem ANRealF 0
player.equipitem ANRealH 0
player.equipitem ANRealL 0
player.equipitem ANRealU 0
set doonce to 1
end

 

 

Would it be conflicting with the script you provided?

How do I integrate both scripts, do any of your race mods use such a script? With your permission could I use them for my mod?

Edited by NikhilR
Link to comment
Share on other sites

  • Recently Browsing   0 members

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