Jump to content

[LE] Scripting Help needed


Recommended Posts

I'm trying to make a mod that works similar to the Underground Bathhouse Mod. Ive copied and edited some of the scripts from that mod for personal use, but the issue im struggling with is clothes changing. I'm trying to set things up so that the followers gear is stored in a chest, based on what Alias they were assigned by the script when i invited them to my new place, but it is refusing to compile.

 

the scripts are as follows:

 

MoveIn compiles ok

 

 

Scriptname OBguestsMoveIn extends Quest


referencealias property OBguest01 auto
GlobalVariable property aa_OB_guest1inBH auto
referencealias property OBguest02 auto
GlobalVariable property aa_OB_guest2inBH auto
referencealias property OBguest03 auto
GlobalVariable property aa_OB_guest3inBH auto
referencealias property OBguest04 auto
GlobalVariable property aa_OB_guest4inBH auto
referencealias property OBguest05 auto
GlobalVariable property aa_OB_guest5inBH auto
referencealias property OBguest06 auto
GlobalVariable property aa_OB_guest6inBH auto
referencealias property OBguest07 auto
GlobalVariable property aa_OB_guest7inBH auto
referencealias property OBguest08 auto
GlobalVariable property aa_OB_guest8inBH auto
referencealias property OBguest09 auto
GlobalVariable property aa_OB_guest9inBH auto
referencealias property OBguest10 auto
GlobalVariable property aa_OB_guest10inBH auto
referencealias property OBguest11 auto
GlobalVariable property aa_OB_guest11inBH auto
referencealias property OBguest12 auto
GlobalVariable property aa_OB_guest12inBH auto
referencealias property OBguest13 auto
GlobalVariable property aa_OB_guest13inBH auto
referencealias property OBguest14 auto
GlobalVariable property aa_OB_guest14inBH auto
referencealias property OBguest15 auto
GlobalVariable property aa_OB_guest15inBH auto
referencealias property OBguest16 auto
GlobalVariable property aa_OB_guest16inBH auto
Faction property OBGuestFaction auto
Faction property OBPlaceholderFaction auto
GlobalVariable property aa_OB_guestCount auto


Function MoveGuestIn(Actor Guest)
If (aa_OB_guest1inBH.GetValueInt() == 0)
OBguest01.ForceRefTo(Guest)
aa_OB_guest1inBH.SetValueInt(1)
ElseIf (aa_OB_guest2inBH.GetValueInt() == 0)
OBguest02.ForceRefTo(Guest)
aa_OB_guest2inBH.SetValueInt(1)
ElseIf (aa_OB_guest3inBH.GetValueInt() == 0)
OBguest03.ForceRefTo(Guest)
aa_OB_guest3inBH.SetValueInt(1)
ElseIf (aa_OB_guest4inBH.GetValueInt() == 0)
OBguest04.ForceRefTo(Guest)
aa_OB_guest4inBH.SetValueInt(1)
ElseIf (aa_OB_guest5inBH.GetValueInt() == 0)
OBguest05.ForceRefTo(Guest)
aa_OB_guest5inBH.SetValueInt(1)
ElseIf (aa_OB_guest6inBH.GetValueInt() == 0)
OBguest06.ForceRefTo(Guest)
aa_OB_guest6inBH.SetValueInt(1)
ElseIf (aa_OB_guest7inBH.GetValueInt() == 0)
OBguest07.ForceRefTo(Guest)
aa_OB_guest7inBH.SetValueInt(1)
ElseIf (aa_OB_guest8inBH.GetValueInt() == 0)
OBguest08.ForceRefTo(Guest)
aa_OB_guest8inBH.SetValueInt(1)
ElseIf (aa_OB_guest9inBH.GetValueInt() == 0)
OBguest09.ForceRefTo(Guest)
aa_OB_guest9inBH.SetValueInt(1)
ElseIf (aa_OB_guest10inBH.GetValueInt() == 0)
OBguest10.ForceRefTo(Guest)
aa_OB_guest10inBH.SetValueInt(1)
ElseIf (aa_OB_guest11inBH.GetValueInt() == 0)
OBguest11.ForceRefTo(Guest)
aa_OB_guest11inBH.SetValueInt(1)
ElseIf (aa_OB_guest12inBH.GetValueInt() == 0)
OBguest12.ForceRefTo(Guest)
aa_OB_guest12inBH.SetValueInt(1)
ElseIf (aa_OB_guest13inBH.GetValueInt() == 0)
OBguest13.ForceRefTo(Guest)
aa_OB_guest13inBH.SetValueInt(1)
ElseIf (aa_OB_guest14inBH.GetValueInt() == 0)
OBguest14.ForceRefTo(Guest)
aa_OB_guest14inBH.SetValueInt(1)
ElseIf (aa_OB_guest15inBH.GetValueInt() == 0)
OBguest15.ForceRefTo(Guest)
aa_OB_guest15inBH.SetValueInt(1)
ElseIf (aa_OB_guest16inBH.GetValueInt() == 0)
OBguest16.ForceRefTo(Guest)
aa_OB_guest16inBH.SetValueInt(1)
EndIf
Guest.AddToFaction(OBGuestFaction)
Guest.AddToFaction(OBPlaceholderFaction)
Guest.EvaluatePackage()
aa_OB_guestCount.SetValueInt(aa_OB_guestCount.GetValueInt() + 1)
EndFunction

Function MoveGuestOut(Actor Guest, referencealias OBguestAlias)
Guest.RemoveFromFaction(OBGuestFaction)
Guest.RemoveFromFaction(OBPlaceholderFaction)
If (aa_OB_guestCount.GetValueInt() > 16)
aa_OB_guestCount.SetValueInt(16)
EndIf
If (OBguestAlias == OBguest01)
aa_OB_guest1inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest02)
aa_OB_guest2inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest03)
aa_OB_guest3inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest04)
aa_OB_guest4inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest05)
aa_OB_guest5inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest06)
aa_OB_guest6inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest07)
aa_OB_guest7inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest08)
aa_OB_guest8inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest09)
aa_OB_guest9inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest10)
aa_OB_guest10inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest11)
aa_OB_guest11inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest12)
aa_OB_guest12inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest13)
aa_OB_guest13inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest14)
aa_OB_guest14inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest15)
aa_OB_guest15inBH.SetValueInt(0)
EndIf
If (OBguestAlias == OBguest16)
aa_OB_guest16inBH.SetValueInt(0)
EndIf
OBguestAlias.Clear()
aa_OB_guestCount.SetValueInt(aa_OB_guestCount.GetValueInt() - 1)
Guest.EvaluatePackage()
EndFunction

 

this is attached to the clothing dialogue quest to try and set which container to use. it compiles ok.

Scriptname OBItems extends OBguestsMoveIn


referencealias property aa_OB_ItemsContREF auto
ObjectReference Property aa_OB_ItemsCont1 auto
ObjectReference Property aa_OB_ItemsCont2 auto
ObjectReference Property aa_OB_ItemsCont3 auto
ObjectReference Property aa_OB_ItemsCont4 auto
ObjectReference Property aa_OB_ItemsCont5 auto
ObjectReference Property aa_OB_ItemsCont6 auto
ObjectReference Property aa_OB_ItemsCont7 auto
ObjectReference Property aa_OB_ItemsCont8 auto
ObjectReference Property aa_OB_ItemsCont9 auto
ObjectReference Property aa_OB_ItemsCont10 auto
ObjectReference Property aa_OB_ItemsCont11 auto
ObjectReference Property aa_OB_ItemsCont12 auto
ObjectReference Property aa_OB_ItemsCont13 auto
ObjectReference Property aa_OB_ItemsCont14 auto
ObjectReference Property aa_OB_ItemsCont15 auto
ObjectReference Property aa_OB_ItemsCont16 auto


Function Dressing(Actor Guest, referencealias OBguestAlias)
If (OBguestAlias == OBguest01)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont1)
EndIf
If (OBguestAlias == OBguest02)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont2)
EndIf
If (OBguestAlias == OBguest03)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont3)
EndIf
If (OBguestAlias == OBguest04)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont4)
EndIf
If (OBguestAlias == OBguest05)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont5)
EndIf
If (OBguestAlias == OBguest06)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont6)
EndIf
If (OBguestAlias == OBguest07)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont7)
EndIf
If (OBguestAlias == OBguest08)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont8)
EndIf
If (OBguestAlias == OBguest09)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont9)
EndIf
If (OBguestAlias == OBguest10)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont10)
EndIf
If (OBguestAlias == OBguest11)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont11)
EndIf
If (OBguestAlias == OBguest12)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont12)
EndIf
If (OBguestAlias == OBguest13)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont13)
EndIf
If (OBguestAlias == OBguest14)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont14)
EndIf
If (OBguestAlias == OBguest15)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont15)
EndIf
If (OBguestAlias == OBguest16)
aa_OB_ItemsContREF.ForceRefTo(aa_OB_ItemsCont16)
EndIf
EndFunction

then i add this as a fragment on the dialogue and it refused to compile.
(GetOwningQuest() As OBItems).Dressing(akSpeaker)
if(akSpeaker.IsPlayerTeammate())
akSpeaker.Removeallitems(aa_OB_ItemsContREF, 1, false)
endif
It keeps giving this error

Starting 1 compile threads for 1 files...
Compiling "TIF__04014C7C"...
D:\ApplicationData\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__04014C7C.psc(9,30): argument obguestalias is not specified and has no default value
D:\ApplicationData\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__04014C7C.psc(12,25): variable aa_OB_ItemsContREF is undefined
No output generated for TIF__04014C7C, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__04014C7C

Link to comment
Share on other sites

In your fragment you neither declared nor assigned a value to the variable aa_OB_ItemsContRef. The script you have attached to the quest is distinct from the fragments on dialogue and so anything you need to share needs to be moved like it would be between any other two unrelated scripts.

 

Fortunately for you, this is pretty easy in this case because the script you need to access is on the owning quest.

OB_Items kmyQuest = GetOwningQuest() as OBItems
kmyQuest.Dressing(akSpeaker)
if(akSpeaker.IsPlayerTeammate())
      akSpeaker.Removeallitems(kmyQuest.aa_OB_ItemsContREF, 1, false)
endif

If I understand your code structure correctly this should solve the compilation error.

Edited by foamyesque
Link to comment
Share on other sites

i tried it, but i get this error instead.

 

Starting 1 compile threads for 1 files...
Compiling "TIF__04014C7C"...
D:\ApplicationData\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__04014C7C.psc(9,9): unknown type ob_items
D:\ApplicationData\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__04014C7C.psc(9,9): type mismatch while assigning to a ob_items (cast missing or types unrelated)
D:\ApplicationData\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__04014C7C.psc(10,9): ob_items is not a known user-defined type
D:\ApplicationData\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__04014C7C.psc(12,40): ob_items is not a known user-defined type
No output generated for TIF__04014C7C, compilation failed.

i noticed the issue with your code being OB_Items instead of OBItems to start and now i get
Starting 1 compile threads for 1 files...
Compiling "TIF__04014C7C"...
D:\ApplicationData\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__04014C7C.psc(10,9): argument obguestalias is not specified and has no default value
D:\ApplicationData\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\TIF__04014C7C.psc(12,16): type mismatch on parameter 1 (did you forget a cast?)
No output generated for TIF__04014C7C, compilation failed.
so now the issue lies in the line Function Dressing(Actor Guest, referencealias OBguestAlias
Edited by ShaKelTa
Link to comment
Share on other sites

the reference alias was supposed to be assigned by the first script OBguestsMoveIn.

 

basicly you as a follower to move in, and they are assigned a alias #.

 

im trying to have the second sript read that assigned alias and choose the right safe for their items to be stored in.

i can then have them reeqiup those items if i have them leave the place.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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