Jump to content

csbx

Supporter
  • Posts

    649
  • Joined

  • Last visited

Posts posted by csbx

  1. 19 hours ago, xkkmEl said:

    The thing is that I have it working fine without this intermediate topicinfo.

    Here's an example of a dialogue that shows a configuration option stored in a global variable being updated.  The followup topic list's 1st item is that very same topic info (it loops back on itself).  In game it always works... It always show the correct current content for the globals, updates correctly on a single click.  The condition is correctly evaluated...  I don't understand what it is that makes it work... I tried and failed to reproduce that same pattern elsewhere, just as you are having trouble.

      Reveal hidden contents

    Screenshot2024-05-04053057.thumb.gif.0636e343d1eafc30617bb22ee6eb07f0.gif

     

    I wouldn't spend so much time sorting this out except it's the heart of my mod. The pertinent dialogue is iterated across multiple npcs and will be frequently engaged with (at least in concept) by the player.

    Buffeted by your comment about it being possible, I did a little more testing to see how your case might look different from my case. Mine looks like:

    [normal dialogue] => [invisible dialogue form that runs the function] => [npc response either saying 'here's your stuff' or 'sorry, not familiar with that' etc. set by condition]

    What I changed was to generate the .wav files for the middle / invisible dialogue + lip file --essentially a 1 second silent clip. It never shows up obviously. But I can confirm things did NOT function normally before I did this. I made the edit and then things functioned normally and perfectly. Because the dialogue never shows up, I didn't think it was necessary to generated fake clips, but from what I can see it does alter the flow sufficient for the conditions of the next dialogue to grab the new values.

    Thank to everyone in the thread that gave me clues about how to think about this--especially you, xkkm !

     

    • Like 1
  2. Updatecurrentinstanceglobal didn't update the readiness of that dialogue to prepare the conditions to look for an update of the globvar.

    However, the workaround, as discussed above, does seem to work. I simply added a 
    Dialogue (2)
    Between
    Dialogue (1) = the one with the fragment that runs the function that updates the globalvar, and
    Dialogue(3) = the dialogue where the npc reacts in the appropriate way based on conditions relying on looking at the globalvar.

    The bummer is that the Dialogue(2) interlude being invisibly linking through doesn't seem to work. So the player will awkwardly have to click at whatever I put in there. Flow doesn't feel comfy as vanilla, so I consider this a tideover until I can get to a real solution.

  3. 6 hours ago, xkkmEl said:

    Being a globalvar hater, I'm not the best reference.

    You are definitely right about the text replacement (though the syntax is <global=gv>), and about accessing globalvars from scripts.  I am less sure about conditions within the scope of an owning quest.  This uncertainty is what fuels my hate of globals.

    Where I have successfully used globals with changing values in dialogues, I have calls to updateCurrentInstanceGlobal.  I have not tried removing them, but I added them in the face of failures similar to yours, though I do not know if I also changed other things at the same time.  The other thing I may have changed at the same time is putting the script in the left-hand pane instead of the right.

    Thanks for your input here. I tried using the property/getvmquestvariable method, but saw no difference, probably because the structure itself was the same re: flow.

    I tried making a new globalvar that I could willy nilly change via console. Worked totally normally. So there's nothing wrong with the dialogue and conditions at all. As indicated by probably everyone in the thread, it does seem like there's something about the flow and the loading of the dialogue that doesn't pick up the mid-dialogue globvar change.

    Scripts are in left pane.

    I'll try updating via updatecurrentinstanceglobal but think it's a long shot. That's how desperate I am atm 😕

  4. 5 hours ago, xkkmEl said:

    You do use UpdateCurrentInstanceGlobal ?  And you did put the globalvar in the quest's "Text Display Globals"?

    I hate globalvars.  I use quest properties and GetVMQuestVariable wherever I can.

    Sorry if I have this wrong, but AFAIK, updating via updatecurrentinstantglobal is relevant for the <alias=globalvariabe> stuff that is in dialogue. The global variable checks via conditions are looking at the GV themselves. Thus far in the development in my mod they have worked that way.

  5. Okay, I hate to say it, but it's a sufficiently ugly problem that I'd like to dig a little deeper. It's back, friends !

    So here's the problem. We thought the issue may have been a timing issue in terms of dialogue windows loading up perhaps before a function has done its thing within a previous dialogue's fragment.
    But the case I have now is as follows: the function runs and sets a globalvar to, say, 90. I'd understand if the next dialogue with the >= 90 condition didn't satisfy so didn't show up (could be timing). However, if I run the same dialogue again, that global var is still at 90. And so if I choose the exact same dialogue that runs the same function that will yield globalvar = 90, the globalvar will be 90 no matter the timing. And yet the >=90 conditioned dialogue doesn't show and the dialogue just exits. Hilariously, if I make the condition <90, the dialogue shows up. I also tried setting the condition to = 90. It doesn't show up. I check the globalvar in console and it is 90.000 throughout the process.

    I'm losing my mind and don't know how to proceed.

  6. 2 hours ago, AaronOfMpls said:

    Do they have some prefix in common, showing what mod they're from?

    Or, if you're using Mod Organizer, these files will be either in your mod's own folder (inside your Mods folder) or in your Overwrite folder.  Making them relatively easy to track down, though probably no less tedious.

    Beyond that, no idea really.

    Sorry if I'm not clear. 99% of files are from the mod I'm creating. Because I'm learning as I go, I (for example) add a script fragment somewhere then decide to restructure, deleting the fragment in the CK but obviously these remain lurking in the mod's folders. If there was an easy way to track down these files (that aren't associated with any form in the mod) and dialogue files that also aren't associated with any form anymore.

    Maybe there isn't an easy way to do this.

  7. In the process of creating a mod I'm noticing that while I try to clean up as I go, there are definitely script fragments (in my own forms) that are obsolete. There are also likely dialogue audio files that are obsolete, e.g. while moving some to sharedinfo ones.  Having a large number of these files, it's quite painstaking to go through every one to find ones to delete.  Ain't nobody got time for that.

    Is there a way to easily track down some of these now irrelevant files to clean things up a little ?

  8. On 4/25/2024 at 6:38 PM, xkkmEl said:

    Please do report of success/failure of your lip file experiment!

    Okay - I have a second data point here. It happened again on a different portion of dialogue. Generating .lip file did nothing. I also tried deleting conditions, exiting out, and re-adding them. No change.

    Finally, I just deleted the topicinfos (with the conditions that were getting ignored) altogether and re-added them. Solved.

    My conclusion: when npc responses that are supposed to be chosen via conditions behave erratically, just delete the topics and re-write them.

  9. On 4/25/2024 at 6:38 PM, xkkmEl said:

    Please do report of success/failure of your lip file experiment!

    From what I've experienced in testing, there's zero problem now. I'll confess, though, that there also was no topicinfo available with all conditions satisfied--but that shouldn't have forced showing a topic that certainly wasn't satisfied either.

    Ghost ejected from machine for now.

  10. You guys gave me an idea about one possibility unconsidered. It just so happened that the pertinent dialogue had no .iip files. I generated them and it seems that has solved things--question mark. I earlier tried the force prompt between dialogues and that didn't seem to take so I'm probably looking at a forcegreet if this turns out not to be solved--though it would be a PIA to implement here.

  11. 38 minutes ago, Vagrant0 said:

    I believe that is exactly the issue. The variable change needs to exist in the needed state before the dialogue recognizes it. Essentially, if you are using variables to control dialogue options, you need to set a variable, have a dialogue, then check the variable for the condition to be registered with the dialogue.

     

    To be honest, I used to only have topic [A] with the function running in the 'pre' fragment (generating the globvar) and the conditions (with the globvar) in the same topic. I recognized the issue and so split it to [A] and {B} thinking that would split the setting of the globvar and the checking of the condition. Apparently that's a no. It's as if [A] and {B} topics load up simultaneously.

  12. So I have 2 final dialogue topics TopicA and TopicB

    In the 'begin' fragment of TopicA I run a function that calculates some stuff then sets a globalVar.

    In my test cases globalvar x was set to 91.

    TopicA then flows via invisible continue into TopicB, which has dialogue with condition globalvar x <= 80

    I run a debug in the function and in the fragment in TopicA which shows that x is indeed 91.

    The dialogue with condition globalVar x <= 80 displays, despite the reality that x = 91.

    I'm totally baffled and the only thing I can think of is that it's a timing issue with the globvar being set and then checked almost immediately. But I don't know.

    Any ideas ?

  13. 11 hours ago, xkkmEl said:

    You mean for the condition system?  You need the conjunctive normal form... The wikipedia page does as good a job as anyone will do in explaining it.

    For your A & (B | C) example, you get:

    A (AND)

    B (OR)

    C (AND; though the very last one is a "don't care")

     

    It quickly gets hairier... and in such cases thinking of the negation of your condition is often simpler.

     

    Yep--that's it. Thank you. I'm steeped in the math way to resolve these so will have to adjust. I'll check out the wiki !

  14. 1 hour ago, xkkmEl said:

    Locations are hierarchical, so Bannered Mare is a separate location child of WhiterunHold...  You do need the isInLocation, or isSameLocation test.

    However, if you refer to a colored map showing you borders between holds, most cells won't correspond to the map because they do not have a location set at all, and others will have a location that is not attached to any hold.

    I know of no way to fill in the gaps in order to get a clean and complete cell-to-hold mapping.

    In my WIP mod, I have processing that is triggered by a change of hold... I assume the player is in the last hold visited until he enters a cell that is positively attached to a different hold...  The gaps are large... so very few cells have an actual location set.

    Well sheeeit. That's rough. I actually have my setup working now, but, yes, it only works if the player is talking to an npc that is currently in a normal kind of location. E.g. if the npc is outside whiterun city, works beautifully. if it's the fisherman you're talking to down below the standing stones south of riverwood, it fails--presumably because of the

    PlayerLoc = game.getplayer().GetCurrentLocation()

    that I'm then running through 

    If (PlayerLoc.IsSameLocation(PlaceInWhiterunHold, loctype)) 

     

    I guess I should have really understood the topology around the topic before delving in headfirst presuming it would work.

  15. Location Property PlayerLoc auto
    
    PlayerLoc = game.getplayer().getcurrentlocation()           
    
    debug.messagebox(playerLoc)
    
        if PlayerLoc.isSameLocation(w, keyword.getkeyword("LocTypeHold"))

    the debug yields NONE so clearly I don't understand even the basic portion of this 😕

    EDIT: I just remembered something you said in another thread about locations in the wilderness potentially being NONE. So my code may potentially be set up almost correctly after all.

    So PlayerLoc is getting me nothing here--but I need to return the hold level info; then I could just use If PlayerLoc == w   ;whiterunholdlocation

  16. 3 hours ago, xkkmEl said:

    Add more traces to confirm the content of your variables and properties.

    PlayerRef.IsInLocation(w) 

    The above never gets satisfied, though the player is definitely in Whiterun Hold (tamriel worldspace). Property w is assigned to WhiterunHoldLocation.

    I think I know what's wrong here. I should be asking if WhiterunHoldLocation is a 'parent' to the location that is currency in my code. I think..

  17. 8 hours ago, xkkmEl said:

    Use Location.isSameLocation:

    Keyword property LocTypeHold auto
    
    ObjectReference testThis
    ObjectReference mapMarker
    
    if testThis.getCurrentLocation().isSameLocation( mapMarker.getCurrentLocation(), LocTypeHold)
    	isThere()
    else
    	isNotThere()
    endif

    Either that, or I didn't get what you're looking for.

    So rather than a comparison, what ends up making sense for my situation is the following. Now, the following does NOT work, so I'm hoping you have an idea why that is !

    If PlayerRef.IsInLocation(w)                                 ; w is a location property and is filled by "WhiterunHoldLocation"
    		debug.messagebox("player is indeed in whiterun")
    		If MapMarker.IsInLocation(w) || MapMarker.IsInLocation(h) || MapMarker.IsInLocation(f)				h,f are loc properties for other hold locations
    			debug.messagebox("work normally, help the player")
    		Else
    			csbmagmapchosen.setvalue(93)																
    			debug.messagebox("can't help the player")
    		Endif
    
    elseif ..
    endif

     

  18. 10 hours ago, scorrp10 said:

    You did not modify those quest forms.    You modified  TopicBranch and TopicInfo forms which have those quests as their parents.   Unfortunately,  CK does not list those forms in the Object Window.    You can open up your mod in SSEEdit, and look through the TopicInfos in your mod, and make a note of their quest  parents.

     

    Very much appreciated. It's indeed annoying not to be able to quickly view the quests whose elements I'm touching in some way in the CK--but I at least understand the logic of that and am happy it's not something weird going on.

  19. 18 hours ago, Sphered said:
    Bool InTheSameAreaA = WhateverRef.GetCurrentLocation() == PlayerRef.GetCurrentLocation()
    
    Bool InTheSameAreaB = WhateverList.HasForm(PlayerRef.GetCurrentLocation())
    
    Bool InTheSameAreaC = WhateverMapMarker.GetDistance(PlayerRef) < 5000.0

    Many ways to scan, and perhaps all the above are not ideal. Depends mainly what your specific goal is, before good specific advice can be offered, but above are some ways to wing it with proximity

    Right ! I'll have a look at these possible angles.  Much appreciated.

    4 hours ago, xkkmEl said:

    Use Location.isSameLocation:

    Keyword property LocTypeHold auto
    
    ObjectReference testThis
    ObjectReference mapMarker
    
    if testThis.getCurrentLocation().isSameLocation( mapMarker.getCurrentLocation(), LocTypeHold)
    	isThere()
    else
    	isNotThere()
    endif

    Either that, or I didn't get what you're looking for.

    Thanks for taking the time. What happens if the player is currently in Dragonreach (just as an example) or in some cave in Whiterun hold. Does the game count the parent location (type hold) as Whiterun hold ? I'm worried my checks will work 95% of the time, but that I'm not solid enough on how the game designates this stuff that I'll fail to properly formulate conditions.

  20. e.g if I have a map marker ObjRef in a Formlist ?

    I'm trying to compare the Hold location of the player (a) with the Hold location of a particular place (b) (via its map marker). 

    If a = b
            give information (cuz npc is in the region and knows)
    else
           tell player to ask around in (b).

     

    EDIT: I guess I'm doing something like: 

    if player.IsInSameCurrentLocAsRef MapMarkerInFormlist LocTypeHold
         give information blah blah

     

    But I don't understand how to set up the following more complex checks:

    If currentHoldofPlayer == 0   ;   e.g if player is in whiterun hold currently
          If (holdofAParticularLocation(via map marker) == 0) || (holdofAParticularLocation(via map marker) == 3) || (holdofAParticularLocation(via map marker) == 5)   ;ie,a nearby hold 																																		
               give information to player because npc is in the hold or a nearby hold.
          Else
              npc tells player they don't know, and sends them to hold (of mapmarker) 
          Endif
    Elseif currentholdofplayer == 1
    ...
    Endif


     

     

  21. ElseIf (QI == 4 || QI == 5 || QI == 6 || QI == 7 || QI == 8 || QI == 9 || QI == 10 || QI == 11 || QI == 12 || QI == 14 || QI == 15 || QI == 16 || QI == 17 || QI == 18 || QI == 19 || QI == 20 || QI == 21 || QI == 22 || QI == 23)


    There has to be a nicer way to write this. Something like, "Elseif (QI IsOneOf [4,5,6,7,8])" or "Elseif (QI isOneOf[4..12,14..19]).

    I suppose if ((QI >= 4) && (QI <= 12)) || ((QI >= 14) && (QI <= 23)) or similar would work.

    Are there related syntax moves that would be better ?

    Here's another even uglier one:

    If (csbmagellanquest04locations.isrunning() && SavedText[0] != CorrectReplacementText && SavedText[1] != CorrectReplacementText && SavedText[2] != CorrectReplacementText && SavedText[3] != CorrectReplacementText && SavedText[4] ......

    If the above goes to index 19, that's just a monstrosity. 

    Is there a better way to tackle this ?

  22. As I would expect, I notice an asterisk next to a couple of vanilla quests / objects that I have made an edit to. But I also am noticing that there are a subset of vanilla quests that have been altered but which do not include an asterisk and don't show up when I click on the 'show active forms' checkbox. These are vanilla quests that I've added a fragment AND property assignment to within its dialogue. Shouldn't these quests show up in the 'show active forms' selection ? Or is this expected behavior ?

×
×
  • Create New...