Jump to content

How to make script for NPC to automatically equip GauntletShield when gauntlet is equipped?


lovender

Recommended Posts

The tittle says it all.

 

The script that works for player character is like this:

 

----------------------------------------------------------------------------

 

scn aaaSCIVIvyGauntletShieldScript
 
begin OnEquip
if (player.GetEquipped SCIVIvyGauntlet == 1)
                  player. additem SCIVIvyGauntletShield 1
player.equipitem SCIVIvyGauntletShield
endif
end
 
begin OnUnequip player
if (player.GetEquipped SCIVIvyGauntlet == 0)
                  player. removeitem SCIVIvyGauntletShield 1
endif
end
 
----------------------------------------------------------------------------
 
 
I got the script from this mod: http://www.nexusmods.com/oblivion/mods/46150/? and then modified a bit to work with my forthcoming mod.
Only NPC that still can't equip GauntletShield automatically. 
 
Thanks in advance.
 
-lovender-
 
Link to comment

Use the script and delete "player"

 

 

scn aaaSCIVIvyGauntletShieldScript

begin OnEquip
    if GetEquipped SCIVIvyGauntlet == 1
                  additem SCIVIvyGauntletShield 1
    equipitem SCIVIvyGauntletShield
    endif
end

begin OnUnequip
    if GetEquipped SCIVIvyGauntlet == 0
                  removeitem SCIVIvyGauntletShield 1
    endif
end


begin OnEquip
    if GetEquipped SCIVIvyArmor == 1
                  additem SCIVIvyGauntletShield 1
    equipitem SCIVIvyGauntletShield
    endif
end

begin OnUnequip
    if GetEquipped SCIVIvyArmor == 0
                  removeitem SCIVIvyGauntletShield 1
    endif
end

 

 

 

Or give her a ID

post-3205-0-02798100-1475088675_thumb.jpg

e.g.  HornyIsabellaValentineRef

 

 

 

scn aaaSCIVIvyGauntletShieldScript

begin OnEquip
    if HornyIsabellaValentineRef.GetEquipped SCIVIvyGauntlet == 1
                  HornyIsabellaValentineRef.additem SCIVIvyGauntletShield 1
    HornyIsabellaValentineRef.equipitem SCIVIvyGauntletShield
    endif
end

begin OnUnequip HornyIsabellaValentineRef
    if HornyIsabellaValentineRef.GetEquipped SCIVIvyGauntlet == 0
                  HornyIsabellaValentineRef.removeitem SCIVIvyGauntletShield 1
    endif
end


begin OnEquip
    if HornyIsabellaValentineRef.GetEquipped SCIVIvyArmor == 1
                  HornyIsabellaValentineRef.additem SCIVIvyGauntletShield 1
    HornyIsabellaValentineRef.equipitem SCIVIvyGauntletShield
    endif
end

begin OnUnequip HornyIsabellaValentineRef
    if HornyIsabellaValentineRef.GetEquipped SCIVIvyArmor == 0
                  HornyIsabellaValentineRef.removeitem SCIVIvyGauntletShield 1
    endif
end

 

 

Link to comment

Use the script and delete "player"

 

 

scn aaaSCIVIvyGauntletShieldScript

 

begin OnEquip

    if GetEquipped SCIVIvyGauntlet == 1

                  additem SCIVIvyGauntletShield 1

    equipitem SCIVIvyGauntletShield

    endif

end

 

begin OnUnequip

    if GetEquipped SCIVIvyGauntlet == 0

                  removeitem SCIVIvyGauntletShield 1

    endif

end

 

 

begin OnEquip

    if GetEquipped SCIVIvyArmor == 1

                  additem SCIVIvyGauntletShield 1

    equipitem SCIVIvyGauntletShield

    endif

end

 

begin OnUnequip

    if GetEquipped SCIVIvyArmor == 0

                  removeitem SCIVIvyGauntletShield 1

    endif

end

 

 

 

Or give her a ID

attachicon.gifID.jpg

e.g.  HornyIsabellaValentineRef

 

 

 

scn aaaSCIVIvyGauntletShieldScript

 

begin OnEquip

    if HornyIsabellaValentineRef.GetEquipped SCIVIvyGauntlet == 1

                  HornyIsabellaValentineRef.additem SCIVIvyGauntletShield 1

    HornyIsabellaValentineRef.equipitem SCIVIvyGauntletShield

    endif

end

 

begin OnUnequip HornyIsabellaValentineRef

    if HornyIsabellaValentineRef.GetEquipped SCIVIvyGauntlet == 0

                  HornyIsabellaValentineRef.removeitem SCIVIvyGauntletShield 1

    endif

end

 

 

begin OnEquip

    if HornyIsabellaValentineRef.GetEquipped SCIVIvyArmor == 1

                  HornyIsabellaValentineRef.additem SCIVIvyGauntletShield 1

    HornyIsabellaValentineRef.equipitem SCIVIvyGauntletShield

    endif

end

 

begin OnUnequip HornyIsabellaValentineRef

    if HornyIsabellaValentineRef.GetEquipped SCIVIvyArmor == 0

                  HornyIsabellaValentineRef.removeitem SCIVIvyGauntletShield 1

    endif

end

 

 

 

Still didn't work, fejeena.

 

I delete "player" and can compile & save the script in TES CS.

But now both player & NPC can't automatically equip the gauntlet shield.

 

I tried the second way you recommend & give the NPC an ID.

But when trying to compile & save the script in TES CS, I got:

Syntax error. invalid reference '[EDITOR ID Name]' (only object references and reference variables are allowed in this context).

Link to comment

Were did you add the ID ?

Not to the NPC in the NPC window!

See my picture, you must add the ID to the NPC in the world ( your NPC is in the world space )

 

But if the NPC use the same script it will not work for the player.

 

--------------------

I don't understand why the script without "player" does not work.

The script is added to the "Ivy SCIV Gauntlet", so the script with out player should work for everyone how equip the "Ivy SCIV Gauntlet" ( or the "Ivy SCIV Armor" )

 

I will test it.

 

Edit: shit does not work.

Link to comment

Ok i read the "quest" and dialogs, the script was never for the NPC and the "begin OnEquip" does not work with a NPC (don't know why, I add the Gauntlet with MCS orders/ trade spell )

 

.....after some tests......

 

Here a script for Player and NPC , tested in game.

 

Your NPC need a ID ( the NPC in the world- or interior-cell ! not in the NPC section ! ) I used ID: IsabellaVRef

--------------------------------------------------------------------------------------------

scn aaaSCIVIvyGauntletShieldScript

begin OnEquip
    if Player.GetEquipped SCIVIvyGauntlet == 1
                  Player.additem SCIVIvyGauntletShield 1
                   Player.equipitem SCIVIvyGauntletShield
    endif
end

begin OnUnequip
    if Player.GetEquipped SCIVIvyGauntlet == 0
                  Player.removeitem SCIVIvyGauntletShield 1
    endif
end


begin OnEquip
    if Player.GetEquipped SCIVIvyArmor == 1
                  Player.additem SCIVIvyGauntletShield 1
                  Player.equipitem SCIVIvyGauntletShield
    endif
end

begin OnUnequip
    if Player.GetEquipped SCIVIvyArmor == 0
                  Player.removeitem SCIVIvyGauntletShield 1
    endif
end

 

Begin gamemode

    if ( IsabellaVRef.GetItemCount SCIVIvyGauntlet >= 1 || IsabellaVRef.GetItemCount  SCIVIvyArmor  >= 1 ) && IsabellaVRef.GetItemCount SCIVIvyGauntletShield == 0
                  IsabellaVRef.AddItem SCIVIvyGauntletShield 1
                  IsabellaVRef.EquipItem SCIVIvyGauntletShield
    endif

    if ( IsabellaVRef.GetItemCount SCIVIvyGauntlet == 0 && IsabellaVRef.GetItemCount  SCIVIvyArmor  == 0 ) && IsabellaVRef.GetItemCount SCIVIvyGauntletShield >= 1

        IsabellaVRef.RemoveItem SCIVIvyGauntletShield 1
    endif


end

---------------------------------------------------------

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use