Jump to content

Upperbody/Lowerbody Companion


liyalai

Recommended Posts

I can't see anything wrong with the script I gave you... The only thing I can think of is that either you forgot to assign the script to the token, or else you're equipping/unequipping in the inventory menu without getting out of menu mode at all when you check if it works.

 

As for your modification of the script, I don't know for sure what went wrong since you did not post it. But I suspect it's because you added a "1" after the EquipItem commands (eg "player.EquipItem ANRealF 1").

 

These are the scripts I've used,

 

A quest script.

 

scn AANRealBodyBeginQuestScript

Begin GameMode

       Player.AddItem AANRealF 1
       Player.AddItem AANRealH 1
       Player.AddItem AANRealL 1
       Player.AddItem AANRealU 1
   Player.AddItem AANRealToken 1
       Player.EquipItem AANRealF 1
       Player.EquipItem AANRealH 1
       Player.EquipItem AANRealL 1
       Player.EquipItem AANRealU 1
       
       
;       All the above should be checked as non-playable items

       StopQuest AANRealBodyBegin

End

 

A token script for the token object. {Object script}

 

scn AANRealTokenScript

ref actor

Begin GameMode

       let actor := GetContainer
       
       if (actor == 0) || (actor.IsActor == 0)
               Return
       endif
       
       if (actor.GetEquipmentSlotMask 4 == 0)
               actor.EquipItemSilent AANRealU
       endif
       
       if (actor.GetEquipmentSlotMask 8 == 0)
               actor.EquipItemSilent AANRealL
       endif
       
       if (actor.GetEquipmentSlotMask 16 == 0)
               actor.EquipItemSilent AANRealH
       endif
       
       if (actor.GetEquipmentSlotMask 32 == 0)
               actor.EquipItemSilent AANRealF
       endif

End

 

I'm certain the scripts you've provided aren't wrong, though I must admit I don't know how to assign the token script to the token object.

Like I mentioned when I click use info on the token object I see only the AANRealBodyBegin script in the box.

Edited by NikhilR
Link to comment
Share on other sites

There's the "1" at the end of "EquipItem" fg was talking of. That's telling the game to disable the wearer from unequipping this item!

 

As for how to get a script attached to an object, if you edit your token's properties, the 3rd line on the left side of the dialog says "Script". You can either use the pulldown or the "..."-button to select your token script. If this field shows the name of your script, then it is running on your tokens.

Link to comment
Share on other sites

There's the "1" at the end of "EquipItem" fg was talking of. That's telling the game to disable the wearer from unequipping this item!

 

As for how to get a script attached to an object, if you edit your token's properties, the 3rd line on the left side of the dialog says "Script". You can either use the pulldown or the "..."-button to select your token script. If this field shows the name of your script, then it is running on your tokens.

 

Thanks Drake, the script is now working as it should.

One more thing, though the items are added and equipped automatically for every race (which is what I want), I'd like to add the ability to disable the mod entirely via a menu item or a console command, just to allow for more functionality.

(If a mod user changes his mind to return back to using the default body, he doesn't need to exit out and disable the mod to stop it working)

Link to comment
Share on other sites

Well, given your AANRealBodyBegin quest exists, you could add another variable to it like:

   short disable

Then into the token script add following lines:

   if AANRealBodyBegin.disable == 1
       RemoveMe
   endif

This will make the tokens all remove themselves once "set AANRealBodyBegin.disable to 1" was issued in console, or the variable was set to "1" by other means.

You will need a mechanism to re-add the tokens though, if the user reconsiders and wants to reactivate the mod's function again later.

 

edit: I don't know if the quest has to actually be running for this to work, as it was stopped already at the beginning. But I think it doesn't.

Edited by DrakeTheDragon
Link to comment
Share on other sites

Well, given your AANRealBodyBegin quest exists, you could add another variable to it like:

   short disable

Then into the token script add following lines:

   if AANRealBodyBegin.disable == 1
       RemoveMe
   endif

This will make the tokens all remove themselves once "set AANRealBodyBegin.disable to 1" was issued in console, or the variable was set to "1" by other means.

You will need a mechanism to re-add the tokens though, if the user reconsiders and wants to reactivate the mod's function again later.

 

edit: I don't know if the quest has to actually be running for this to work, as it was stopped already at the beginning. But I think it doesn't.

 

Hmm, actually using the console command "set AANRealBodyBegin.disable to 0" reenables mod functionality :)

 

Could these console commands be attached to a playable object as a script?

so that when the playable object is assigned to a hotkey it can be used as a toggle?

 

Also should I assign the token object to an biped slot? (it is currently assigned to the head slot.)

Edited by NikhilR
Link to comment
Share on other sites

Could these console commands be attached to a playable object as a script?

Or what about a Lesser Power spell? One to disable, one to re-enable after the mod is installed (in enabled state of course).

Link to comment
Share on other sites

Could these console commands be attached to a playable object as a script?

Or what about a Lesser Power spell? One to disable, one to re-enable after the mod is installed (in enabled state of course).

 

Well anything that can be hotkeyed, so the console commands need not be typed. An item is preferred, or a spell with no visual effect/no animation (no hand movement)

Link to comment
Share on other sites

Well, ok, let's say you create another item, "AANRealBodyToggleItem" or whatever. Preferably you should not give it "any" slot assignment, just as for your tokens. They need not to be worn, just be inside your inventory to work. The CS might complain about items without slot assignments, but you can safely ignore this. I think I'm using some kind of Misc Item for my tokens, so there's no complaining by the CS, but I can't remember anymore.

 

On this item now you put following script:

scn AANRealBodyToggleItemScript

Begin OnEquip player ;player, because nobody else should be able to toggle this setting (hope this works)
   set AANRealBodyBegin.disable to (1 - AANRealBodyBegin.disable) ;this should work for the toggle. If it does not, make it an IF-ELSE-structure.
   player.UnequipItemNS AANRealBodyToggleItem
End

I've never done this before, but this should work, toggling the "disable" value of the quest when equipped and unequipping itself immediately afterwards.

 

An item doesn't require to occupy a slot to be equipped. The Unlimited Rings mod for example removes slot assignments so you can wear all rings at once. They just aren't rendered anymore without a slot assignment, so you can't see them. Their effects still apply.

As for your last question, the head slot is a biped slot, and no, you shouldn't give them any slot at all, they don't need to be worn nor rendered, just remain inside the inventory. :wink:

 

edit: I was thinking about replacing the "RemoveMe" with a simple "return", so it will not actually remove the tokens but when placed at the beginning of the script prevent them from executing the rest, if disabled. This way you could spare any means to re-distribute removed tokens later on and such. Though I'm a little clueless as to why the mod seems to become functional again only by setting "disable" back to "0". Quite honestly, it shouldn't, as the tokens should be gone and never come back once removed. :ermm:

Edited by DrakeTheDragon
Link to comment
Share on other sites

Well it seems that entering the console command

"set AANRealBodyBegin.disable to 0" was a bug when it worked that time round.

 

Actually it did what I wanted (restarted the script) so don't know what to make of it, though I haven't been able to reproduce it since!

 

I tried the script you've provided for the toggle, and though it disables the script successfully on equip. Unequipping it does not renable the script.

I've added it as a playable item though it isn't assigned to any slot.

 

Also I don't know how to write an appropriate if/else type structure (as you suggested), and I would require some help there...

Edited by NikhilR
Link to comment
Share on other sites

  • Recently Browsing   0 members

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