Jump to content

need some scripting help...


JaytheCub

Recommended Posts

basically i'm trying to create a new script for a new trait/perk for the game called Acquired Savant Syndrome(A.S.S.) it will in summary take into account the player's tag skills and then base on that. it needs to do three things

1) Identify the tag skills the player has tagged

2) Then set one of the tag skills to 100 leaving the other two tag skills intact as they stand.

3) Then forcing all other skills to 0 that are non-tagged skills. To basically simulate the effect of acquiring Savant Syndrome.

 

i got it working under a different script but i t will only take into account all skills then set one of those skills to 100 while the rest to 0 based on a random number generator.

 

i'm pretty new to scripting and basically a novice. When it comes to doing anything that requires more then just Player.AddItem here or Player.RemoveItem there. or even when it comes to Player.ModAV Barter 15 for example. or even Player.ForceAV Barter 100 or 0.

 

part of my trouble with the script below is that i wrote it with ChatGPT. Basically it gives me a compiling error below:

 

SCRIPTS: Script 'AcquiredSavantSyndromeSCRIPT', line 17:
Invalid operands for operator <-
SCRIPTS: Script 'AcquiredSavantSyndromeSCRIPT', line 17:
Invalid operands for operator <-
SCRIPTS: Script 'AcquiredSavantSyndromeSCRIPT', line 17:
Invalid operands for operator <-
SCRIPTS: Script 'AcquiredSavantSyndromeSCRIPT', line 17:
Invalid operands for operator <-
SCRIPTS: Script 'AcquiredSavantSyndromeSCRIPT', line 17:
Invalid operands for operator <-
SCRIPTS: Script 'AcquiredSavantSyndromeSCRIPT', line 17:
Invalid operands for operator <-
SCRIPTS: Script 'AcquiredSavantSyndromeSCRIPT', line 17:
Invalid operands for operator <-
SCRIPTS: Script 'AcquiredSavantSyndromeSCRIPT', line 17:
Invalid operands for operator <-
SCRIPTS: Script 'AcquiredSavantSyndromeSCRIPT', line 17:
Invalid operands for operator <-
SCRIPTS: Script 'AcquiredSavantSyndromeSCRIPT', line 17:
Invalid operands for operator <-

i feel like it should work as intended if it would only compile correctly at some point. But of course its a little difficult to get it to compile here. any suggestions:

scn AcquiredSavantSyndromeSCRIPT

int iRand
array_Var aTagSkills
array_Var aSkills
int i
int iTagSkill

begin ScriptEffectStart
        ;initialize array of skill names
    let aSkills := Ar_Construct("Barter", "EnergyWeapons", "Explosives", "Guns", "Lockpick", "Medicine", "MeleeWeapons", "Repair", "Science", "Sneak", "Speech", "Survival", "Unarmed" )
    
    ; create an empty array to store tag skills
    let aTagSkills := Ar_Construct("Placeholder")
    
    ; identify the player's tag skills
    ForEach i <- aSkills
        if (IsPlayedTagSkill aSkills) ;checks if the skill is tagged
            Ar_Append aTagSkills, aSkills
        else
                ;set non-tag skills to
            ForceAV aSkill, 0
        endif
    Loop

    ;ensure we have exactly three tag skills in the array
    if (Ar_Size aTagSkills == 3)
        ;randomly select one of the tag skills to set to 100
        set iRand to Rand 0, 2
        set iTagSkill to aTagSkills[iRand]
    endif

    ;cleanup arrays
    Ar_Erase aSkills
    Ar_Erase aTagSkills
    
end

 

any help would be appreciated.

Link to comment
Share on other sites

 

IsPlayedTagSkill 

should be 

IsPlayerTagSkill 


    ;ensure we have exactly three tag skills in the array
    if (Ar_Size aTagSkills == 3)
        ;randomly select one of the tag skills to set to 100
        set iRand to Rand 0, 2 (unknown function "irand")
        set iTagSkill to aTagSkills[iRand] 
    endif

    ;cleanup arrays
    Ar_Erase aSkills
    Ar_Erase aTagSkills
    
end (error: end statement illegal outside of begin/end block)


based on validator errors this section has no begin function the end is invalid and wont compile im pretty sure. see if you can implement to a prior section of the script

perhaps that section needs to be its own separate script?

fix these and it might compile

be careful using the script validator it doesnt understand nvse so use it to check vanilla script portions

also another error im just seeing 

		;set non-tag skills to
		ForceAV aSkill, 0

the error is calling for a stat name instead of "askill" because "askill" isnt a skill

Link to comment
Share on other sites

  • Recently Browsing   0 members

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