Jump to content

Request to Scale Player


etayorius

Recommended Posts

Hi, i would like to request a mod that Checks if the Player has been rescaled through the Console command "SetScale" and will immediately Scale him to what the User SetScale Value just as soon as the Game Loads. Reason is since i play with scale characterd (0.95) every time i load my game my character height always reverts to the default value of 1, either i need to reload the same Save or open the console and type scale it back to .95"... If i die or reload the save Game, the character reverts back to 1 and i need to rescale back to .95 and is driving me MAD.

 

I would also like to know if it would if be possible to implement some sort of console command to scale Only the Head? i am supposed to be playing a Teen but the head seems rather small and i can´t seem to find a way to Scale the head just a tiny bit, i tried to play with the Skeleton by scaling only the head through NifSkope but something is reverting the head back to default and since there is only 1 Skeleton shared with every single Race, sometimes NPC head will grow and revert back to default for some reason, this happens randomly, Perhaps it could be done similar to the way Blockhead works by allowing PerRace Skeleton?

 

Per NexusMods Terms of Service:

 

Do not solicit services from other Nexus members in exchange for monetary compensation or promise of such compensation in connection with content that falls within the scope of a game publishers EULA.

 

Donate line removed.

 

Your NexusMods Staff

Link to comment
Share on other sites

 

ScriptName AAAScaleQuestscr

short Gloadednum
short grestnum
float curScale
begin gamemode

set Gloadednum to GetGameLoaded
set grestnum to GetGameRestarted
if Gloadednum == 1 || grestnum == 1
player.setscale 0.95
endif
set curScale to player.getscale
message "curscale-%.2f ", curScale

end

 

This is a simple script that contains the commands you may need if you know little about scripting - atouch this to a quest

As far as i know scaling from the console isnt the right way to scale player -i think you should create a script for the entire race

Anyway ! .About the blockhead i dont know how to use it but there are some Races that are close to teens - x117 -x110 etc which means how much they csale the headmesh

Link to comment
Share on other sites

The above script should work (just set the desired scale).

 

@kastano: I have few tips for you, but first let's optimize this script a bit:

ScriptName AAAScaleQuestscr

Short curScale

Begin Gamemode
  If GetGameLoaded
    Player.SetScale 0.95
  EndIf
  Set curScale to Player.GetScale
  Message "Cur scale: %.2f", curScale
End
  • Allocate memory for a variable, assign it the result of a command, then read the variable in the condition and free the memory... mmmh it's better to directly pass the command to the condition and minimize accesses to RAM.
  • In Oblivion, conditions are true if their result is != 0, so "== 1" is redundant with boolean commands or when you want anything but 0, while "!= 0" is always useless in any case at the end of a condition.
    Boolean command can only return 0 (false) or 1 (true). The game check "!= 0", which is "== 1", so you don't need to write "== 1".
    If you want "anything but 0", the condition is already true if its result is != 0 (which "is anything but 0"), so you don't need to write "!= 0".
    Those conditions are logically correct, but the "== 1" is an additional (and useless) work for the CPU (very little extra work, so you won't notice it, but why waste it?).
  • "GetGameLoaded || GetGameRestarted" is a useless condition in GameMode blocks, as both commands will return true at the same time after the first load, and GetGameLoaded will return true for all next loads, while GetGameRestarted will never return true alone (in GameMode blocks). So you can remove GetGameRestarted (redundant) and leave GetGameLoaded.
  • GetGameRestarted is really only useful in a "MenuMode 1044" blocks to initialize (in the Main menu) event handlers, game settings and anything which must be initialized only once per game session.
Edited by forli
Link to comment
Share on other sites

  • 4 weeks later...

Thank you both, i have zero knowledge on scripts but it can´t be too hard so i will check for a couple tutorials online and try to attach the given script. If i want this script to run on a specific Race, what should i be adding to that script and how it should look after the line?

 

To moderators, Sorry for the donation line... it won´t happen again.

 

[Edit]

 

I am getting a Syntax error at line 6 when trying to save the script, unknown command "GetGameLoaded", i assume the engine is not recognizing that command? i can´t seem to save the script due to that line. I saw few examples of the GetGameLoaded onlne and they seem to use Parenthesis with it, yet it will still say unknown command.

Edited by etayorius
Link to comment
Share on other sites

Still trying to get this to work... any help with the script? i am not sure what i am doing wrong.

Link to comment
Share on other sites

GetGameLoaded is an OBSE command.

You need to run CS in OBSE mode to make it compile (look at the OBSE documentation).

There's no need to use parenthesis in the Oblivion scripts. They can be used for expressions or aesthetic reasons.

Link to comment
Share on other sites

I got it to work by creating a shortcut to Obse_loader.exe and added -editor in the Target, i was able to Create a new Quest (aaaScalePlayerQST) and added the script , loaded up the game and it scales my character like 5 seconds after the game loads, it´s good but i keep seeing a "CurScale: 0.00" text like every 10 seconds, is this supposed to happen? also the script is running on every other race on load or new game, i tried to add my Custom race into the Quest Target, added a new "Target Ref" with Condition "GetPCIsRace" to "SilimaureLightElf" Value to "1" and "Run on Target", but it is still running on other races. I assume it need to be done through the Script but i have zero knowledge on how to add a line that checks for "SilimaureLightElf" Race.

Link to comment
Share on other sites

It's normal: GameMode scripts run continuously.

Normally all quest scripts run every 5 seconds (or better, the setting fQuestScriptDelayTime in your Oblivion.ini), but you can change this time for a specific script by defining a special variable in the script itself: float fQuestDelayTime. Declare it as any other variable and set it to the desired time. The game will use this time from now on.

NOTE: if you don't set a value in the variable, the game will still use the Oblivion.ini's value.

 

How to stop it?

  • StopQuest <yourQuest> completely stop the quest and its script. Just put it before the End statement: the script will run only once then stop itself. Drawback: it won't be able to restart itself. You can only restart it from the console, from a quest's result script or from another script.
  • Use a doOnce variable and an if If doOnce == 0 which contains all the code and the command set doOnce to 1. This will ensure the variable will be 0 the first time (and run the code in the if block), then it will be 1 for good (and it won't run the code anymore, as the condition become false). The script will still run, it but won't be able to do anything until you restore that variable (from the console, from a quest's result script, from another script or even from the same script).
  • Directly put the code in the GetGameLoaded condition, if you want to make it run once every time you load the game.

 

Finally: those conditions on the quest apply on the quest dialogues, compass marker, etc, ... but not on the script.

To filter the race, you need to open the script and check the Player's race with the command GetIsRace.

Edited by forli
Link to comment
Share on other sites

Got it to work:

ScriptName aaaScaleRaceQuestScript
Short curScale
Begin Gamemode
if(GetGameLoaded && Player.GetIsRace SilimaureLightElf == 1)
Player.SetScale 0.95
message "Scaling Player"
Endif
End
Thank you.
Edited by etayorius
Link to comment
Share on other sites

  • Recently Browsing   0 members

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