Jump to content

Vit-o-matic and Intense Training


Cylentnyte

Recommended Posts

Hi all. New guy to modding here but am in school for Game Programming, so have a decent handle on general syntax and what not.

 

Anywho, just got a mod that comes with an Auto-doc, and one of the message options is to open the Vit-o-matic machine to re-allocate points in SPECIAL. Problem is it sends in the integer 40 as the parameter, which doesn't account for the player spending points in Intense Training at a higher level. Ended up subtracting 10 points from my overall point base before I could accept the changes and exit the machine, thus nullifying the bonuses from Intense Training. Here's the code I've got so far:

 

Scn AAAAutoDocScript

Short Button
Short DoOnce
Short DoArmor
Float Timer2
Float Timer3

Short PATCheck
Float Timer
Float ArmorHealth
Float ArmorCond
Float HelmetHealth
Float HelmetCond
Short MakeArmor
Float MakeTimer

;Used for re-arranging SPECIAL when player has ranks in Intense Training
Int iSpecialTotal

Begin OnActivate

If AAAReactor == 0
ShowMessage AAAReactorNoPower
Else
ShowMessage AAAAutoDocStartMsg01
Set DoOnce to 1
EndIf

END

Begin GameMode

If DoOnce == 1
Set Button to GetButtonPressed
If Button == -1
	Return
ElseIf Button == 0	; Leave It Alone
	Set DoOnce to 0
ElseIf Button == 1
	Set DoOnce to 0
	GetPlayerName
ElseIf Button == 2
	Set DoOnce to 0
	ShowBarberMenu
ElseIf Button == 3
	ShowPlasticSurgeonMenu
	Set DoOnce to 2
Elseif Button == 4
	Set iSpecialTotal to Player.GetPermAV Strength							;The problem is in here somewhere I believe...
	Set iSpecialTotal to iSpecialTotal + Player.GetPermAV Perception
	Set iSpecialTotal to iSpecialTotal + Player.GetPermAV Endurance
	Set iSpecialTotal to iSpecialTotal + Player.GetPermAV Charisma
	Set iSpecialTotal to iSpecialTotal + Player.GetPermAV Intelligence
	Set iSpecialTotal to iSpecialTotal + Player.GetPermAV Agility
	Set iSpecialTotal to iSpecialTotal + Player.GetPermAV Luck
	ShowLoveTesterMenuParams iSpecialTotal
	set DoOnce to 0
ElseIf Button == 5
	AAASortActivatorChemsREF.activate player 1
	Set DoOnce to 0
ElseIf Button == 6
	ShowMessage ZZTeslaArmorStartMsg
	Set DoOnce to 0
	Set DoArmor to 1
ElseIf Button == 7
	Player.AddItemHealthPercent ArmorRemnantsTesla 1 ArmorCond
	Player.AddItemHealthPercent ArmorRemnantsTeslaHelm 1 HelmetCond
	Set MakeArmor to 0
EndIf
EndIf

 

I try to save the script but it doesn't seem to care, and when I try to close the script window it keeps asking if I want to save the script. I hit yes, then goes back to the window. Dumb. According to others it's because Bethesda got rid of error throwing in the NV Geck and won't save a broken script, but also won't tell you what's wrong with it to begin with? :wallbash:

 

Any help is appreciated. I'd love to start helping others with mods but need to get a grasp on the Geck's basic functions before I can move on. :( Thanks

Link to comment
Share on other sites

Tuna is correct, the HasPerk function will return as an integer the perk rank (not sure if it starts at 0 or 1, you'll need to check that). Otherwise it'll return the value in rank form (1, 2, 3, etc).
Link to comment
Share on other sites

Tuna is correct, the HasPerk function will return as an integer the perk rank (not sure if it starts at 0 or 1, you'll need to check that). Otherwise it'll return the value in rank form (1, 2, 3, etc).

0 = no perk

>1 = perk ranks

Link to comment
Share on other sites

  • Recently Browsing   0 members

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