Jump to content

OBSE - GetSoulLevel


proutos

Recommended Posts

I'm using a short "totalsoul", which should increase by one each time the player catch a soul. I just put directly a SetStage here, because you can't see in game if the short has increased.

 

 

"So if you kill a npc and have a black soul gem it will increment. "

 

Yes, but it means you can just kill a NPC without taking his soul. Even if you have not casted a soul trap on him, or hit him with an echanted weapon. It will work, even if the time of the soul trap is over.

 

Plus, catching a human soul is harder than simply killing him, that's why i can't use this.

 

A specific soul trap spell will maybe work, but i want the player free to catch the souls the way he wants, with the vanilla spells or any enchanted weapon. Well, it's hard.

Link to comment
Share on other sites

I agree that controlling the quest through the someway unpredictable soulgem may be difficult. You can aways use it for quest purpose, forcing it's fill if the quest conditions are met. So the mentioned global variable may be useful... but... you shall avoid using them whenever possible and variables defined in quest scripts acts like them, being so preferable.

 

All and every variable defined in a quest script may be accessed from any script in your mod... they retain the values even between game sessions and the quest don't need even to be active at the time, so even a dummy quest that start and immediately terminate itself does the trick. And have a bonus advantage over global variables (that may be of any type but are treated as float by the engine, leading to strange behaviors sometimes)... they are treated as defined: int, float, ref, etc. The only drawback is the quest must be in the same mod it is called (having another mod loaded in the CS together the actual one is bad modding practice most of the times anyway).

 

PS: To summarize and avoid misunderstandings, you can define variables in quest scripts just to act as global ones simulacrum, they don't need to be used by this quest script although can, they can be accessed by any other script in the mod, you need just prefix them. They retain values between sessions, so they can be used as counters; being bridges between scripts... and so on.

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...