Jump to content

ModAttribute command not working...


PierreBeauregard

Recommended Posts

Since Mod[Attribute] doesn't accept variables, I'm trying to get the "workaround" working by incrementing until the value I want is satisfied. Currently, I'm trying to get my guar mod to make the guar's speed and health fairly close to the player's, so it adjusts to your level.

 

I have the following code (tested for syntax errors already):

;make guar speed equal to player speed

set my_speed to GetSpeed

if ( my_speed < ( Player -> GetSpeed ) )

ModSpeed 1

set my_speed to GetSpeed

MessageBox "Guar speed: %g", my_speed

endif

 

;make guar health comparable to 2/3 player health

set my_health to GetHealth

set my_health to ( my_health / GetHealthGetRatio )

set player_health to ( Player -> GetHealth )

set player_health to ( player_health / ( Player -> GetHealthGetRatio ) )

if ( my_health < ( player_health * 2 / 3 ) )

ModHealth 1

set my_health to GetHealth

set my_health to ( my_health / GetHealthGetRatio )

MessageBox "Guar health: %.0f", my_health

endif

 

Ideally, the message box should pop up every single time the attribute gets modified (this is how I found out it *wasn't* working). It doesn't even seem to be satisfying the if statements. If you put the message box BEFORE the if statement, it spits out the guars preset health/speed values, which are smaller than the player's health/speed values.

 

Even more strangely, the ModSpeed works from the console in the middle of the game when you have the guar selected.

 

This has been driving me bonkers for the whole day. Can anybody help?

Link to comment
Share on other sites

Well, I figured out the problem. Apparently, TES3 scripts are much pickier than other programming languages I'm used to. I fixed it by making sure the if statements used variables without arithmetic, and no variable was a modification of itself.

 

If you guys want to see the result of my first attempt at modding, you can see for yourself:

http://mwsource.com/uploads/uploads/Intell...PackGuarCTN.zip

 

I just added it to the mod section :)

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