Jump to content

Light emitting shields


MercerMeka

Recommended Posts

The last script doesn't work oddly enough. The "IsControlPressed 6" just works like "player.IsBlocking" meaning I have to be actually blocking for the shield effect to go off. Not a big deal I'll just use the first script.

 

While this topic is still hot I better ask this question that I cannot solve: How do I add the unique shields at a certain player level so they don't respawn?

I know how to add them in a leveled list but that means setting the container to respawn which means the shield is no longer unique (since it permanently respawns).

I was thinking about putting each shield in a shop and creating a reference marker with a script to it but I don't know how to make the script.

It just need to enable the shield at a certain player level. Can you help me out with another script that does that?

 

Link to comment
Share on other sites

With third example you must still actively press block button, but now it isn't tied to block animation - so you can emit light while swinging the weapon or with weapon sheathed.

 

To add a shield which will be only one in the world ? With some flag (as global variable), OnActivate event and GetLevel I think it can be done. At least with normal containers.

 

1. Define global variable first (for example shield_given)

 

2. And then

scn TreasureChestScript

int level

begin OnActivate player
   set int to player.GetLevel
   if shield_given == 0
      if level == 10 
         TreasureChest.AddItem SmallShieldOfLight 1
      endif
      if level == 15
         TreasureChest.AddItem BetterShieldOfLight 1
      endif
      ....
      set shield_given to 1
   endif
end
Link to comment
Share on other sites

Thanks for the help again.

 

From what I can understand of the script the player has to activate a chest? I don't see how that could work. Some (10) shields has to be sold by a different merchants and some are sold by all the merchants, so they cannot all appear from that one chest.

 

I also realized that my own idea of enabling the shields (which starts out disabled) won't work since they will be continuously enabled and therefore not be unique.

Maybe this could work:

 

Have a script run once every time the game load and check if the players level is sufficient. If it is then 1 or more shields has their ownership changed to the shop owner of the shop they are already placed in somewhere hidden, now ready for purchase.

I don't know if that script then had to be placed in a quest or not. I've seen some mods which starts out by initializing some things by a quest that runs once on game load. I think that could work.

Edited by MercerMeka
Link to comment
Share on other sites

Yes

set int to player.GetLevel

was really a misstype on my part, I'm sorry. This example was only made to show, how to use GetLevel function. In case of various vendors, you could propably use right "MenuMode" section to trigger this check. If I'm not mistaken, every NPC with inventory is also a "container".

Link to comment
Share on other sites

Well, here is another example script which works with vendors:

scn VendorShieldScript

ref vendor
short shieldgiven

begin MenuMode 1009
   if shieldgiven == 0
      set vendor to GetMerchantContainer
      if vendor != 0 && player.GetLevel >= 15
         vendor.AddItem DaedricShield 1
         set shieldgiven to 1
      endif
   endif
end

As you enter the dialog with vendor, the Daedric Shield will be added, so you can buy it. Script needs to be attached to vendor, but this is the simplest way.

Edited by RomanR
Link to comment
Share on other sites

Awesome, RomanR. Thank you so much.

 

Ever since you posted that script I've been testing it out and everything is working. My mod is essentially done now. I really appreciate the help since my mod wouldn't get off the ground without a full script provided by a generous modder.

The effects I've created for the shields are more than just Light effect and some of them are pretty darn cool IMO :yes: There are more than 30 new shields.

I'll post the mod link here when it's finalized as well in case you guys want to take a look.

 

I have 2 questions:

 

Does the "shieldgiven" part of script make it so the shield only gets added once?

 

In the 2nd script you provided for me (3 seconds delay) it seems that it can be used for any shield. The shield ID isn't defined in the script, only the effect changes. Is this correct?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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