Jump to content

Folded Banners Won't Disable When Corresponding Banners Are Hung (XMarkers/Script Problem?)


Zylice

Recommended Posts

I got the folded versions of the corresponding banners to disappear when they're hung. But as soon as I decided to link them to an XMarker which is initially disabled and enabled when crafted, they don't disappear anymore. I think it's something to do with the folded banners being linked to other XMarkers besides the one that is initially disabled. It's not a big deal but I would like it if there is a way to get around this.

Here's the script I've used:

 

 

 

Scriptname WS_Banner_Script extends ObjectReference  
{This script enables the set of banners you select and packs the others away.}
 
ObjectReference Property Banners_Mage Auto
ObjectReference Property Banners_Theif Auto
ObjectReference Property Banners_Warrior Auto
ObjectReference Property Banners_Atronach Auto
ObjectReference Property Banners_Shadow Auto
ObjectReference Property Banners_Steed Auto
 
ObjectReference Property Banners_Folded_Mage Auto
ObjectReference Property Banners_Folded_Theif Auto
ObjectReference Property Banners_Folded_Warrior Auto
ObjectReference Property Banners_Folded_Atronach Auto
ObjectReference Property Banners_Folded_Shadow Auto
ObjectReference Property Banners_Folded_Steed Auto
 
ObjectReference Property Banners2Enable Auto
 
Event OnActivate(ObjectReference akActionRef)
 
DisBanners()
Banners2Enable.enable()
EnFoldedBanners()
debug.notification("Banners Changed")
Self.disable()
 
EndEvent
 
 
 
Function DisBanners()
 
Banners_Mage.disable()
Banners_Theif.disable()
Banners_Warrior.disable()
Banners_Atronach.disable()
Banners_Shadow.disable()
Banners_Steed.disable()
 
EndFunction
 
 
 
Function EnFoldedBanners()
 
Banners_Folded_Mage.enable()
Banners_Folded_Theif.enable()
Banners_Folded_Warrior.enable()
Banners_Folded_Atronach.enable()
Banners_Folded_Shadow.enable()
Banners_Folded_Steed.enable()
 
EndFunction

 

 

 

Thanks for any help! :)

Edited by Zylice
Link to comment
Share on other sites

You can't Disable/Enable the Child of a Parent.

As soon as you make an xMarker a parent of the banner, the banner becomes a Child, so when you try to disable or enable the child banner itself, then it will fail.

 

Use Linked Refs to do what your after.

I get you. So what do I make Linked Refs of? The folded banners?

Link to comment
Share on other sites

I did a tester.

 

Created 2 Formlists, 1 for the Banner References, 1 for the Folded Banners Activator References

Created 5 activators that represent the folded banners and attached this script to each activator:

Scriptname WS_Banner_Script Extends ObjectReference

FormList Property Banners Auto
FormList Property Banners_Folded Auto

Event OnActivate(ObjectReference akActionRef)
    Int idx = Banners_Folded.Find(Self)
    If idx >= 0
        (Banners_Folded.GetAt(idx) As ObjectReference).Disable()
        (Banners.GetAt(idx) As ObjectReference).Enable()
        Int i = Banners_Folded.GetSize()
        While i
            i -= 1
            If i != idx
                (Banners.GetAt(i) As ObjectReference).Disable()
                (Banners_Folded.GetAt(i) As ObjectReference).Enable()
            EndIf
        EndWhile
    EndIf
EndEvent

I edited the script 2 formlist properties to point to my 2 formlists on all 5 activators.

I dropped the 5 activators into the render window.

I set the each activator Initially disabled.

I then dragged the 5 activator references from the render window to the Banners_Folded formlist.

I then dropped 5 Banners into the render window and set them initially disabled.

I then dragged the 5 Banner references from the render window into the Banners formlist.

 

I dropped an xmarker in the render window, set it as Initially disabled and attached this script to it:

Scriptname WS_BannerxMarker_Script Extends ObjectReference

Bool bDone

Event OnLoad()
    If !bDone
        Int i = 0
        ObjectReference LR = Self.GetLinkedRef()
        While LR
            LR.Enable()
            i += 1
            LR = LR.GetLinkedRef()
        EndWhile
        bDone = True
    EndIf
EndEvent

I then added a Linked Ref to the xMarker pointing to my first folded banner reference.

I then added a Linked Ref to the 1st folded banner reference pointing to my 2nd folded banner reference.

I then added a Linked Ref to the 2nd folded banner reference pointing to my 3rd folded banner reference.

I then added a Linked Ref to the 3rd folded banner reference pointing to my 4th folded banner reference.

I then added a Linked Ref to the 4th folded banner reference pointing to my 5th folded banner reference.

 

I added a one line dialogue to a NPC "Enable my banner items please."

Which basically enables the xmarker and it works for me.

 

Can post the test esp if you want.

Link to comment
Share on other sites

@sLoPpYdOtBiGhOlE I did everything that you listed but the folded banner activators don't work once I've crafted them. In case you didn't know, I have different XMarkers linked to each banner and each folded banner is linked to an XMarker that is initially disabled and enabled once crafted. That's the XMarker That I put your script on.

Edited by Zylice
Link to comment
Share on other sites

It would make things easier if you posted the esp with it's required files.
If the required files that esp requires is to big then create a small sample just using the related resources only without anything more then needs to be worked out.

From what I can interpret you have just said:
You have 5 xMarkers
Each xMarker is enables 1 of the 5 folded banners when purchased.
Only one Banner out of 5 is showing at any time when you activate one of the purchased folded banners.

If this is the case then it sounds like a lot of fuddling around, but completely doable.
I just assumed that one xMarker was used and the user purchased the whole five folded banners in one go.
From there the user could select which of the five banners they want hanging by activating the associated folded banner anytime they felt like.

I'll adapt what I posted prior to compensate for what I assumed. :)

Link to comment
Share on other sites

It would make things easier if you posted the esp with it's required files.

If the required files that esp requires is to big then create a small sample just using the related resources only without anything more then needs to be worked out.

 

From what I can interpret you have just said:

You have 5 xMarkers

Each xMarker is enables 1 of the 5 folded banners when purchased.

Only one Banner out of 5 is showing at any time when you activate one of the purchased folded banners.

 

If this is the case then it sounds like a lot of fuddling around, but completely doable.

I just assumed that one xMarker was used and the user purchased the whole five folded banners in one go.

From there the user could select which of the five banners they want hanging by activating the associated folded banner anytime they felt like.

 

I'll adapt what I posted prior to compensate for what I assumed. :smile:

All of the folded banners will appear once crafted, not individually. Each type of banner (not folded) is linked to it's own XMarker and the folded activator banners are connected to one XMarker which is initially disabled. Although the folded banners no longer disable once the corresponding banner is hung up, it still works fine and I don't mind if that is how it has to be. I can provide the file that I was working on prior to making your suggested changes if you wish so you can see what I have done. Just PM your email address so I can send the file.

Link to comment
Share on other sites

Well I'm on assuming once again, that as the user purchases the Folded Banner, that any prior purchased folded banners stay enabled?

 

So I...

Created 3 Formlists. 1 for Folded Banner Activator References, 1 for Banner reference, 1 for Banner xMarker references.

Created 5 Folded Banner Activators and attached this script to each of them:

Scriptname WS_Banner_Script Extends ObjectReference

FormList Property Banners Auto
FormList Property Banners_Folded Auto
FormList Property Banners_xMarkers Auto

Event OnActivate(ObjectReference akActionRef)
    Int idx = Banners_Folded.Find(Self)
    If idx >= 0
        (Banners_Folded.GetAt(idx) As ObjectReference).Disable()
        (Banners.GetAt(idx) As ObjectReference).Enable()
        Int i = Banners_Folded.GetSize()
        While i
            i -= 1
            If (i != idx) && (Banners_xMarkers.GetAt(i) As ObjectReference).IsEnabled()
                (Banners.GetAt(i) As ObjectReference).Disable()
                (Banners_Folded.GetAt(i) As ObjectReference).Enable()
            EndIf
        EndWhile
    EndIf
EndEvent

I then assigned the formlist properties on each folded banner activator to point to each of the formlists.

I dropped the 5 Folded Banner Activators into the render window.

I set each folder banner activator reference to be initially disabled.

I did not set any parents for any of the folded banner activator references.

I then dragged the 5 Folded Banner Activator References from the render window into the Banners_Folded formlist.

 

I then dropped 5 xMarkers in the render window and attached this script to each xMarker reference:

Scriptname WS_BannerxMarker_Script Extends ObjectReference

Event OnLoad()
    If Self.GetLinkedRef().IsDisabled()
        Self.GetLinkedRef().Enable()
    EndIf
EndEvent

I set each xMarker reference to be initially disabled.

I then added a Linked Ref from the 1st xMarker to my 1st folded banner.

I then added a Linked Ref from the 2nd xMarker to my 2nd folded banner.

I then added a Linked Ref from the 3rd xMarker to my 3rd folded banner.

I then added a Linked Ref from the 4th xMarker to my 4th folded banner.

I then added a Linked Ref from the 5th xMarker to my 5th folded banner.

I then dragged the 5 xMarker references from the render window to my Banners_xMarkers formlist.

 

I then dropped 5 Banners into the render window and set them all initially disabled.

I did not set any parents for any of the banner references.

I then dragged the banner references from the render window to the Banners formlist.

 

To test what I've done works, I added 5 lines of dialogue to a NPC.

Each line off dialogue enables one of the xMarkers.

All works as intended for me, but once again I have to assume and it probably isn't the way you vision it should be...lol

 

My test esp is attached;

Whiterun Bannered Mare Inn, talk to Hulga at the bar and select the "I'd like to see your banner options." dialogue option.

Obviously I don't have the banners and folded banners your using so I improvised :tongue:

But you'll get the idea if it's what your after or not.

 

 

Note: make sure you don't have any loose scripts in your Data\scripts\ directory.

eg: WS_Banner_Script.pex or WS_BannerxMarker_Script.pex

Link to comment
Share on other sites

@sLoPpYdOtBiGhOlE Okay. Just before I try the above, could you possibly check my esp so you can see what I have done and determine whether I should do what you have stated above. I can send you the file via an email if it is no trouble.

Link to comment
Share on other sites

Providing the file is small under 1MB, I'm limited to 1GB a month atm, 7 days an under 100 mb left.

I'm struggling with bandwidth to make it to the end of the month atm.

 

Hence why I never get to see pretty pictures on the net, I disable flash, java and everything else that consumes bandwidth just for the sake of advertising...lol

Windows services and any other program that tries to help you in the background by hitting the net is also disabled.

Steam is an absolute No No, that I barely ever let out of offline mode and if I do it's only when I have access to unlimited bandwidth.

Just the text is all i want and need when on such a tight bandwidth budget :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

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