Jump to content

I made 3 Grey Cowls, each having it's own stats.


dra6o0n

Recommended Posts

But the problem is that, once you unequip the 1st cowl and put on the 2nd, it will end up switching the crimegold, fame, and infamy around. With 3 cowls, it will lead to a disasterous fame/infamy change.

 

First off, I have a Grey Cowl of Nobody, with its +5 all attribute, it lets players store away their crimegold, fame, and infamy into variable "00playergold", etc.

 

Then, I ran into a huge conflict once I go and checked the Begin OnEquip section...

 

Here's the code of the 3 cowls

 

ScriptName 00GreyCowlscript

 

Short 00playerinfamy

Short 00playerfame

Short 00playergold

Short 00tempcrimegold

Short 00tempfame

Short 00tempinfamy

 

Begin OnAdd ;resets the item's crime,fame,infamy upon pickup.

Set 00playergold to 0

Set 00playerfame to 0

Set 00playerinfamy to 0

End

 

Begin OnEquip Player

Set 00tempcrimegold to player.getcrimegold ;saves the player's crime,fame,infamy to temp.

Set 00tempfame to player.getpcfame

Set 00tempinfamy to player.getpcinfamy

player.setcrimegold 00playergold ;takes variable from item and applies it to player.

player.setpcfame 00playerfame

player.setpcinfamy 00playerinfamy

End

 

Begin OnUnequip Player

set 00playergold to player.getcrimegold ;upon unequip, current player gold,fame,infamy is stored.

set 00playerfame to player.getpcfame

set 00playerinfamy to player.getpcinfamy

player.setcrimegold 00tempcrimegold ;sets player's current stats to saved temp.

player.setpcfame 00tempfame

player.setpcinfamy 00tempinfamy

End

ScriptName 00GreyCowlscript2

 

Short 00playerinfamy2

Short 00playerfame2

Short 00playergold2

Short 00tempcrimegold2

Short 00tempfame2

Short 00tempinfamy2

 

Begin OnAdd ;resets the item's crime,fame,infamy upon pickup.

Set 00playergold2 to 0

Set 00playerfame2 to 25

Set 00playerinfamy2 to 0

End

 

Begin OnEquip Player

Set 00tempcrimegold2 to player.getcrimegold ;saves the player's crime,fame,infamy to temp.

Set 00tempfame2 to player.getpcfame

Set 00tempinfamy2 to player.getpcinfamy

player.setcrimegold 00playergold2 ;takes variable from item and applies it to player.

player.setpcfame 00playerfame2

player.setpcinfamy 00playerinfamy2

End

 

Begin OnUnequip Player

set 00playergold2 to player.getcrimegold ;upon unequip, current player gold,fame,infamy is stored.

set 00playerfame2 to player.getpcfame

set 00playerinfamy2 to player.getpcinfamy

player.setcrimegold 00tempcrimegold2 ;sets player's current stats to saved temp.

player.setpcfame 00tempfame2

player.setpcinfamy 00tempinfamy2

End

ScriptName 00GreyCowlscript3

 

Short 00playerinfamy3

Short 00playerfame3

Short 00playergold3

Short 00tempcrimegold3

Short 00tempfame3

Short 00tempinfamy3

 

Begin OnAdd ;resets the item's crime,fame,infamy upon pickup.

Set 00playergold3 to 0

Set 00playerfame3 to 0

Set 00playerinfamy3 to 25

End

 

Begin OnEquip Player

Set 00tempcrimegold3 to player.getcrimegold ;saves the player's crime,fame,infamy to temp.

Set 00tempfame3 to player.getpcfame

Set 00tempinfamy3 to player.getpcinfamy

player.setcrimegold 00playergold3 ;takes variable from item and applies it to player.

player.setpcfame 00playerfame3

player.setpcinfamy 00playerinfamy3

End

 

Begin OnUnequip Player

set 00playergold3 to player.getcrimegold ;upon unequip, current player gold,fame,infamy is stored.

set 00playerfame3 to player.getpcfame

set 00playerinfamy3 to player.getpcinfamy

player.setcrimegold 00tempcrimegold3 ;sets player's current stats to saved temp.

player.setpcfame 00tempfame3

player.setpcinfamy 00tempinfamy3

End

 

Note: I may have to create a new script to work out all three of them... Is a script's variable allowed to be used in another script? Otherwise I would have to make it one huge script...

Link to comment
Share on other sites

First off, you might want to switch your little marker to something other than "OO" or "00". Both those are fairly common, and might lead to form and ID issues later on. Generally, you want to use atleast 3 characters so that there is a lower chance that someone else will use the same ones somewhere else. Maybe use something like "D6N" "DR6" of something else which nobody else would use. "DRG" or "DGN" would be a bad choice since anyone who uses the fairly common name Dragon, or Dagon, might use those.

 

As for scripts being able to share variables. That depends alot on what the script is on. Things like Quests, Activators (containers, doors), or NPCs can be referenced and have their variables altered by other scripts. Things like spells or inventory items cannot. This is because the referencing requires a persistant ID to pull that information from.

 

In this case, you would probably need to make a quest script linked to a startgame enabled quest without any journal entires. Then you can use that quest script to store and adjust whatever variables you need. Using global variables instead is a bad idea since those are more likely to run into conflicts.

Link to comment
Share on other sites

I Stopped trying to continue this, for 2 reason:

1) The idea is good but running into conflicts is bad.

2) My TES Construction Set is going glitchy and bitchy to me, so i wanna stop using it so much (everytime i close the construction set, whether i opened a file or not, it crashes)....

Link to comment
Share on other sites

I Stopped trying to continue this, for 2 reason:

2) My TES Construction Set is going glitchy and bitchy to me, so i wanna stop using it so much (everytime i close the construction set, whether i opened a file or not, it crashes)....

The CS crashes for pretty much everyone when closing. It's because it has trouble unloading information. It's when it crashes while you're working, and when you havn't done any of the dozen or so things that will always make it crash, that you should be concerned. It's a buggy application, but it's the best that is available, and the best we'll ever get.

Link to comment
Share on other sites

Archived

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

  • Recently Browsing   0 members

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