Jump to content

aoh125

Recommended Posts

That one is pretty sweet .. You may have seen ones like it for different weapons you can find in Skyrim all set up in an arrangement.

!! finally found a good pic site !!

logo.png

I'm just a basic programmer in papyrus with years of experience creating home mods ... IsharaMeradin's really know his stuff and has
a much deeper understanding of what you can do with it in Skyrim. I always look at his stuff and try to learn the concepts.
That size thing tells the size of a list. Great for, for next loops or stepping while loops to get your size right. Without having to define it.

Edited by NexusComa
Link to comment
Share on other sites

  • Replies 51
  • Created
  • Last Reply

Top Posters In This Topic

I just use lightshot far as screenshots go. it allows you to upload after taking it or save to local drive or a few other options. Mostly use it if im attempting to make some sort of guide or wiki type info though.

 

My army of soon to be deleted useless formlists lol.

 

[post=https://ibb.co/8zzR9VW]Link to the image, the site doesnt like the kind of files lightshot takes[/post]

 

Link to comment
Share on other sites

@NexusCome Yea i bet. With all the bells and whistles of that ship mod, can only imagine at least a thing or 2 probably gave some headaches lol.

 

@IsharaMeradin "nigh impossible" instantly made me think of some pirates of the Caribbean haha.

 

Might not be till some time tomorrow i start to implement the new forms and indexing system. been at it since the early am today and kinda half out of it at this point but i will certainly be going that route and seeing if i can manage to follow the instructions and format to make it all work.

 

Probably dive deeper into the whole image requirements alternative thing at some point if i keep regularing these forums so certainly nice to have some options to look into (:

 

 

https://prnt.sc/rpqzds <--Kinda shoty image of the displays im trying to disable and enable (some of the textures are still set to null to have made installing the statics easier)

Edited by aoh125
Link to comment
Share on other sites

Alright i got started on making the script as outlined in the tutorial this morning and then pulled away to do reality for a time but upon returning to the project and attempting to setup the actual script i got an error. Im still not familiar with the getsize section of the formlist or the specifics of how it all works (i get that it checks the formlists to get the index values but as to if i should change sections of that to match my properties or just 100% leave it alone as i did im unsure).

 

The error i got on my first attempt.

 

 

Starting 1 compile threads for 1 files...
Compiling "zzzBMI_TestingScript"...
D:\Games\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\zzzBMI_TestingScript.psc(85,2): function variable myF_value already defined in the same scope
No output generated for zzzBMI_TestingScript, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on zzzBMI_TestingScript

 

 

 

the script with my properties entered

 

 

Scriptname zzzBMI_TestingScript extends ObjectReference  
 
;master display formlist
FormList Property Weap_BMI_WL_Master_FL Auto
  ;contains the following:
    ;FormList Property BMI_Axe2hDisplays Auto  <-- at index 0
    ;FormList Property BMI_BowDisplays Auto  <-- at index 1
    ;FormList Property BMI_DaggerDisplays Auto  <-- at index 2
    ;FormList Property BMI_Sword2hDisplays Auto  <-- at index 3
    ;FormList Property BMI_MaceDisplays Auto  <-- at index 4
    ;FormList Property BMI_Sword1hDisplays Auto   <-- at index 5
    ;FormList Property BMI_Axe1hDisplays Auto  <-- at index 6
    ;FormList Property BMI_HammerDisplays Auto  <-- at index 7
 
;Keyword Properties Material Types
FormList Property Weap_BMI_MatType_FL Auto
  ;Keyword Property WeapMaterialDaedric Auto  <-- moved to index 0
  ;Keyword Property DLC1WeapMaterialDragonbone Auto  <-- moved to index 1
  ;Keyword Property WeapMaterialDwarven Auto  <-- moved to index 2
  ;Keyword Property WeapMaterialEbony Auto  <-- moved to index 3
  ;Keyword Property WeapMaterialElven Auto  <-- moved to index 4
  ;Keyword Property WeapMaterialGlass Auto  <-- moved to index 5
  ;Keyword Property WeapMaterialIron Auto  <-- moved to index 6
  ;Keyword Property WeapMaterialOrcish Auto  <-- moved to index 7
  ;Keyword Property WeapMaterialSteel Auto  <-- moved to index 8
  ;Keyword Property DLC2WeaponMaterialStalhrim Auto  <-- moved to index 9
 
;Keyword Properties Weapon Types
FormList Property Weap_BMI_WeaType_FL Auto
  ;Keyword Property WeapTypeBattleaxe Auto  <-- moved to index 0 
  ;Keyword Property WeapTypeBow Auto  <-- moved to index 1
  ;Keyword Property WeapTypeDagger Auto  <-- moved to index 2
  ;Keyword Property WeapTypeGreatsword Auto  <-- moved to index 3
  ;Keyword Property WeapTypeMace Auto  <-- moved to index 4
  ;Keyword Property WeapTypeSword Auto  <-- moved to index 5
  ;Keyword Property WeapTypeWarAxe Auto  <-- moved to index 6
  ;Keyword Property WeapTypeWarhammer Auto  <-- moved to index 7
 
Keyword Property VendorItemWeapon Auto
 
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
  If akBaseItem.HasKeyword(VendorItemWeapon)
    Int TypeIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_WeaType_FL)
    Int MatIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_MatType_FL)
    If TypeIndex != -1 && MatIndex != -1 ; both lists returned a valid entry
      FormList MaterialDisplayList = Weap_BMI_WL_Master_FL.GetAt(TypeIndex) as FormList
      ObjectReference myDisplay = MaterialDisplayList.GetAt(MatIndex) as ObjectReference
      If myDisplay.IsDisabled()
        myDisplay.Enable()
      EndIf
    EndIf
  EndIf
EndEvent
 
Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
  If (Self.GetItemCount(akBaseItem) == 0) ; only try to disable the display if no more of the object are present in the container
    If akBaseItem.HasKeyword(VendorItemWeapon)
      Int TypeIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_WeaType_FL)
      Int MatIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_MatType_FL)
      If TypeIndex != -1 && MatIndex != -1 ; both lists returned a valid entry
        FormList MaterialDisplayList = Weap_BMI_WL_Master_FL.GetAt(TypeIndex) as FormList
        ObjectReference myDisplay = MaterialDisplayList.GetAt(MatIndex) as ObjectReference
        If myDisplay.IsEnabled()
          myDisplay.Disable()
        EndIf
      EndIf
    EndIf
  EndIf
EndEvent
 
Int Function GetIndexValueFromKeywordList(Form TheItem,FormList TheList) 
; Checks the passed in item agains the passed in keyword formlist and returns the index of the first match found
; returns -1 if no match found
 
  Int myF_value = -1
  Int index = TheList.GetSize()
  While index > 0
    index -= 1
    Keyword myKW = TheList.GetAt(index)
    If TheItem.HasKeyword(myKW)
      myF_value = index
      index = -1 ; found match - exit loop
    EndIf
  EndWhile
  Reutrn myF_value
EndFunction

 

 

 

couple of example screenshots of how i setup the formlist (in case i botched that step somehow)

 

 

 

 

 

I am going to try editing that sections values to see if i can get it working but just wanted to post this now before i got to work on it in case its something simple i missed or am doing wrong that sticks out.

Edited by aoh125
Link to comment
Share on other sites

I do not know why it would give you that error. Is the script posted in your latest post the same one giving the compiling error?

 

Your form lists could be completely botched up and it wouldn't affect the compilation of the script. Something is wrong with the code but I cannot see it with the information given.

Link to comment
Share on other sites

Sorry was hard staring and combing threw the script for the last while but i found a single typo that likely is what caused the error posted. return was spelt reutrn in the script lol but now its giving this instead

 

 

 

Starting 1 compile threads for 1 files...
Compiling "zzzBMI_TestingScript"...
D:\Games\steamapps\common\Skyrim Special Edition\Data\Source\Scripts\temp\zzzBMI_TestingScript.psc(80,12): type mismatch while assigning to a keyword (cast missing or types unrelated)
No output generated for zzzBMI_TestingScript, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on zzzBMI_TestingScript

 

 

 

 

 

Scriptname zzzBMI_TestingScript extends ObjectReference  
 
 
;master display formlist
FormList Property Weap_BMI_WL_Master_FL Auto
  ;contains the following:
    ;FormList Property BMI_Axe2hDisplays Auto  <-- at index 0
    ;FormList Property BMI_BowDisplays Auto  <-- at index 1
    ;FormList Property BMI_DaggerDisplays Auto  <-- at index 2
    ;FormList Property BMI_Sword2hDisplays Auto  <-- at index 3
    ;FormList Property BMI_MaceDisplays Auto  <-- at index 4
    ;FormList Property BMI_Sword1hDisplays Auto   <-- at index 5
    ;FormList Property BMI_Axe1hDisplays Auto  <-- at index 6
    ;FormList Property BMI_HammerDisplays Auto  <-- at index 7
 
;Keyword Properties Material Types
FormList Property Weap_BMI_MatType_FL Auto
  ;Keyword Property WeapMaterialDaedric Auto  <-- moved to index 0
  ;Keyword Property DLC1WeapMaterialDragonbone Auto  <-- moved to index 1
  ;Keyword Property WeapMaterialDwarven Auto  <-- moved to index 2
  ;Keyword Property WeapMaterialEbony Auto  <-- moved to index 3
  ;Keyword Property WeapMaterialElven Auto  <-- moved to index 4
  ;Keyword Property WeapMaterialGlass Auto  <-- moved to index 5
  ;Keyword Property WeapMaterialIron Auto  <-- moved to index 6
  ;Keyword Property WeapMaterialOrcish Auto  <-- moved to index 7
  ;Keyword Property WeapMaterialSteel Auto  <-- moved to index 8
  ;Keyword Property DLC2WeaponMaterialStalhrim Auto  <-- moved to index 9
 
;Keyword Properties Weapon Types
FormList Property Weap_BMI_WeaType_FL Auto
  ;Keyword Property WeapTypeBattleaxe Auto  <-- moved to index 0 
  ;Keyword Property WeapTypeBow Auto  <-- moved to index 1
  ;Keyword Property WeapTypeDagger Auto  <-- moved to index 2
  ;Keyword Property WeapTypeGreatsword Auto  <-- moved to index 3
  ;Keyword Property WeapTypeMace Auto  <-- moved to index 4
  ;Keyword Property WeapTypeSword Auto  <-- moved to index 5
  ;Keyword Property WeapTypeWarAxe Auto  <-- moved to index 6
  ;Keyword Property WeapTypeWarhammer Auto  <-- moved to index 7
 
Keyword Property VendorItemWeapon Auto
 
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
  If akBaseItem.HasKeyword(VendorItemWeapon)
    Int TypeIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_WeaType_FL)
    Int MatIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_MatType_FL)
    If TypeIndex != -1 && MatIndex != -1 ; both lists returned a valid entry
      FormList MaterialDisplayList = Weap_BMI_WL_Master_FL.GetAt(TypeIndex) as FormList
      ObjectReference myDisplay = MaterialDisplayList.GetAt(MatIndex) as ObjectReference
      If myDisplay.IsDisabled()
        myDisplay.Enable()
      EndIf
    EndIf
  EndIf
EndEvent
 
Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
  If (Self.GetItemCount(akBaseItem) == 0) ; only try to disable the display if no more of the object are present in the container
    If akBaseItem.HasKeyword(VendorItemWeapon)
      Int TypeIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_WeaType_FL)
      Int MatIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_MatType_FL)
      If TypeIndex != -1 && MatIndex != -1 ; both lists returned a valid entry
        FormList MaterialDisplayList = Weap_BMI_WL_Master_FL.GetAt(TypeIndex) as FormList
        ObjectReference myDisplay = MaterialDisplayList.GetAt(MatIndex) as ObjectReference
        If myDisplay.IsEnabled()
          myDisplay.Disable()
        EndIf
      EndIf
    EndIf
  EndIf
EndEvent
 
Int Function GetIndexValueFromKeywordList(Form TheItem,FormList TheList) 
; Checks the passed in item agains the passed in keyword formlist and returns the index of the first match found
; returns -1 if no match found
 
  Int myF_value = -1 ;sets default value of myF_value to -1
  Int index = TheList.GetSize()  ;sets an interger called index to the value of TheList's returned index number
  While index > 0 ; as long as index is greater then 0 the rest of this function will run
    index -= 1   ;index is not = to 1?
    Keyword myKW = TheList.GetAt(index)  ;calls Keyword myKW to check it against the list and get a numeric value?
    If TheItem.HasKeyword(myKW) ;if the item has a keyword match from the list
      myF_value = index ;sets the value of myF_value from -1 (invalid) to the index value from the formlists
      index = -1 ; found match - exit loop 
    EndIf
  EndWhile
  Return myF_value ;sends the value to the event to use
EndFunction

 

 

 

Doesnt like myKW for some reason to sum up what the error says without opening it.

 

and to answer your question, the script i posted was a full ctrl A paste into the spoiler/code tags in the post from when i got the error.

 

i tried making sense of the section of script i didnt understand while slowly going threw it (hence the added notes)

Edited by aoh125
Link to comment
Share on other sites

That is another one of those things I missed. I forgot to cast the entry in the form list from form to keyword. I caught it on the ones pulling the form lists from the 'master form list' but missed this one somehow.

 

Nonetheless, change

Keyword myKW = TheList.GetAt(index)

into

Keyword myKW = TheList.GetAt(index) as Keyword

 

and I will go back and edit the original post where I put the sample code so no one has to deal with it again...

Link to comment
Share on other sites

Alright will do, thanks for spoon feeding me this. There is 0 chance i would have gone about it in this fashion had you not thrown out a premade script for me to fill in.

 

Cant believe i missed the typo before i posted though. Was much quicker to ask for help this time though since i really had no idea about that last section and it was fairly above my head xD

 

Compiled fine after that alteration you gave me to do and so i loaded it up in game to give it a test in practice. Thing works 110% as intended. Thanks yet again for taken the time to help me get it going.

 

Final revision of the test script before i figure out what to call it and make it its final verison.

 

 

Scriptname zzzBMI_TestingScript extends ObjectReference  
 
;Script created by IsharaMeradin for my project
 
;Master Display Formlist
 
FormList Property Weap_BMI_WL_Master_FL Auto
 
;Keyword Properties Material Types Formlist
 
FormList Property Weap_BMI_MatType_FL Auto
 
;Keyword Properties Weapon Types Formlist
 
FormList Property Weap_BMI_WeaType_FL Auto
 
Keyword Property VendorItemWeapon Auto
 
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
  If akBaseItem.HasKeyword(VendorItemWeapon)
    Int TypeIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_WeaType_FL)
    Int MatIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_MatType_FL)
    If TypeIndex != -1 && MatIndex != -1 ; both lists returned a valid entry
      FormList MaterialDisplayList = Weap_BMI_WL_Master_FL.GetAt(TypeIndex) as FormList
      ObjectReference myDisplay = MaterialDisplayList.GetAt(MatIndex) as ObjectReference
      If myDisplay.IsDisabled()
        myDisplay.Enable()
      EndIf
    EndIf
  EndIf
EndEvent
 
Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
  If (Self.GetItemCount(akBaseItem) == 0) ; only try to disable the display if no more of the object are present in the container
    If akBaseItem.HasKeyword(VendorItemWeapon)
      Int TypeIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_WeaType_FL)
      Int MatIndex = GetIndexValueFromKeywordList(akBaseItem,Weap_BMI_MatType_FL)
      If TypeIndex != -1 && MatIndex != -1 ; both lists returned a valid entry
        FormList MaterialDisplayList = Weap_BMI_WL_Master_FL.GetAt(TypeIndex) as FormList
        ObjectReference myDisplay = MaterialDisplayList.GetAt(MatIndex) as ObjectReference
        If myDisplay.IsEnabled()
          myDisplay.Disable()
        EndIf
      EndIf
    EndIf
  EndIf
EndEvent
 
Int Function GetIndexValueFromKeywordList(Form TheItem,FormList TheList) 
; Checks the passed in item agains the passed in keyword formlist and returns the index of the first match found
; returns -1 if no match found
 
  Int myF_value = -1
  Int index = TheList.GetSize()
  While index > 0
    index -= 1
    Keyword myKW = TheList.GetAt(index) as Keyword
    If TheItem.HasKeyword(myKW)
      myF_value = index
      index = -1
    EndIf
  EndWhile
  Return myF_value ;sends the value to the event to use
EndFunction

Edited by aoh125
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...