Jump to content

HALP Getting Offset Level


Noggog

Recommended Posts

So, just for an example, look at the goblin with editorID CreatureGoblin4Shaman:

It is PC level offset

Max of 0

Min of 13

Offset of -5

 

Meaning that if you're level 21, this goblin will be level 16, but won't be lower than level 13 ever.

 

I know OBSE has functions that return the max and min values, but I can't seem to find a way to obtain the -5 offset value.

 

I tried doing a standard getlevel, but it didn't seem to work. Here's some example code:

 

set tmpRef to CreatureGoblin4Shaman
set tmpshort to tmpRef.getlevel
printc "tmpshort is %g", tmpshort

 

This code will skip over the printc, as if it wasn't there.

 

If I simply change it to this, it prints 1:

 

set tmpRef to CreatureGoblin4Shaman
set tmpshort to 1
printc "tmpshort is %g", tmpshort

 

Making me feel like the getlevel command is "failing" silently.

 

 

It's probably because it's a base creature instead of a "real actor". Nonetheless, I feel there should be some way to get that offset number? I had the idea of actually spawning the creature in some cell, doing a getlevel, and then deleting it. But that seems pretty unnecessary.

Edited by Leviathan1753
Link to comment
Share on other sites

I don't think something counts as a reference unless it's actually inside the game. So even "set tmpRef to CreatureGoblin4Shaman" probably isn't working.

 

From http://cs.elderscrolls.com/constwiki/index.php/Reference_functions :

 

NOTE: you can also run reference functions on reference variables, just as if they were the object themselves, and refer to the object by its hexadecimal FormID in double-quotes. The object needs to be loaded in-game or a persistent ref. (always loaded) for this to work.
Edited by fg109
Link to comment
Share on other sites

Yeah, that's probably the reason it's failing for the CS .getlevel command. However, I have used this setup for OBSE's GetActorMinLevel / MaxLevel commands and it has returned the correct values.

 

I'm not looking to make the CS .getlevel command work, as it probably won't. I'm thinking/hoping OBSE has one that work for level/offset that is similar to its min/max functions.

Edited by Leviathan1753
Link to comment
Share on other sites

I looked over the OBSE command doc and couldn't find what you wanted either.

 

I'm not sure how you'll be able to get it other than to actually spawn the NPC in the game and check its levels...

Edited by fg109
Link to comment
Share on other sites

Vury silly, it's strange some of the things OBSE just doesn't have.. especially FOSE/NVSE.

 

Level offset is not a property of a reference, it's a property of the base.

 

GetActorBaseLevel- returns the level of the base actor. In the editor, for creatures this is the "Level Offset" field; for NPCs it is the "Level" field. For either, the meaning of the return value depends on whether or not the PC Level Offset flag is set for the base actor. (level:int) reference.GetActorBaseLevel actorBase:ref

 

IsPCLevelOffset-returns 1 if the actor's level is calculated relative to the player's level (isLevOffset:bool) reference.IsPCLevelOffset actor:ref

Edited by Astymma
Link to comment
Share on other sites

You're the man!

 

Vury silly, It's strange some of the things we miss while searching through the OBSE documentation.. XP

 

Edit:

Ah, it's a new function in the BETAv20. Wasn't an extreme brainlapse on my part then, hehe

Edited by Leviathan1753
Link to comment
Share on other sites

You're the man!

 

Vury silly, It's strange some of the things we miss while searching through the OBSE documentation.. XP

 

Edit:

Ah, it's a new function in the BETAv20. Wasn't an extreme brainlapse on my part then, hehe

 

Oh yup, GetActorBaseLevel is v0020... IsPCLevelOffset has been around since v0014 I believe. People have been screaming for access to the actual offset for a long time hehe :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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