Jump to content

Dialogue WEIGHTs modification


Creepin

Recommended Posts

I'm trying to add some states to an existing dialogue. There's WEIGHTs on some of standard states already, with state 0 having lowest priority (weight # 3). While my custom states are having weights as well, I still want state 0 to retain lowest priority, so I tried to compile .d file structured like this:

SET_WEIGHT Keldda 0 #10

 

APPEND Keldda

IF WEIGHT #5 ~True()~

THEN BEGIN cr01

  SAY ~Blah~

  IF ~~ THEN REPLY ~Blah-blah~ EXIT

END

END

However, after compiling this into original dialogue state 0 still retain it's "lowest among original content" weight #3 and my custom state gets weight #4 - even lower priority than state 0. :)

Changing sequence of instructions in .d file (first append, then set_weight) yields no improvement sa well :)

The only way I found to circumvent this issue was splitting .d in 2 files (1st for adding new state and 2nd for changing state0 weight) and compiling them consequently, but I believe that it's too crude way to be right one, so I still wonder how should it be done correctly? :p

Link to comment

0 is always the lowest weight in a dialogue file. If you have a state with weight -1, then that's set to 0 and all others are incremented by 1 (effectively).

 

Edit: So yeah, if you want all your states to be lower than the current ones use negative weights. Use different negative weights relative to each other if you want to more finely order your new states.

Link to comment

Thank you for quick responce :)

 

Edit: So yeah, if you want all your states to be lower than the current ones use negative weights. Use different negative weights relative to each other if you want to more finely order your new states.
I'm afraid that mine is a bit more complicated case. Perhaps I wasn't quite clear in my first post, let me sketch you a brief example:

 

I have original dlg with

state 0 weight #3

state 1 weight #1

state 2 weight #2

and trying to add custom state that should be executed before certain original state but after other ones:

state 0 weight #4

state 1 weight #1

state 2 weight #2

state new weight #3

so I thought that I should 1) add new state and 2) change weight in existing state to large number. What I get out of my attempts is stated in an opening post...

 

P.S. please notice that I'm talking about lower priority, not lower weight - I know that lower priority equal higher weight :)

Link to comment

I just tried it - to no effect :)

Not that I'm too much worried - I find working, if crappy, solution after all, but I'm really curious to know how are those real, experienced modders here inserting new states in the middle of weights line :)

Link to comment
I just tried it - to no effect :)

Not that I'm too much worried - I find working, if crappy, solution after all, but I'm really curious to know how are those real, experienced modders here inserting new states in the middle of weights line :)

 

I avoid having to use weights like the plague. The only thing I ever use is -1 on a couple of new states.

Link to comment

Is state 0 being compiled at the same time you're trying to adjust its weight? I think what's happening here is subtle, if this is the case. Until compilation is finished, WeiDU uses the internal values for state names and does not assign numeric values. Ergo, when you try this:

 

SET_WEIGHT Keldda 0 #10

 

Keldda does not actually have a state 0 yet, which also explains why it works when this is in a sunsequent d file. (If this is the case, I'm very surprised WeiDU isn't even issuing a warning for an incorrect state label.) Try replacing the 0 with your internal state name.

Link to comment
Is state 0 being compiled at the same time you're trying to adjust its weight? I think what's happening here is subtle, if this is the case. Until compilation is finished, WeiDU uses the internal values for state names and does not assign numeric values. Ergo, when you try this:

 

SET_WEIGHT Keldda 0 #10

 

Keldda does not actually have a state 0 yet, which also explains why it works when this is in a sunsequent d file. (If this is the case, I'm very surprised WeiDU isn't even issuing a warning for an incorrect state label.) Try replacing the 0 with your internal state name.

Yes, I see what you mean.

No, state 0 in my case is already existing state from standard unmodded dialogue, that's why I ended up fiddling with a command specially to change it's weight. Were it a totally new state I would rather simply set it's weight as a part of snippet :)

Link to comment
I avoid having to use weights like the plague.  The only thing I ever use is -1 on a couple of new states.

Well... after a brief meditation upon your post I checked my custom states and find out that there should be no harm if I give all of them higher priority than all standard states have. So I changed all custom weights to negative values and after this all worked perfectly. Although it's not exactly what I was intended to do, I believe that it's still less crude than having 2 files in a row patching the same dialogue. :)

 

However, I'm still highly interested if someone would care to share some hints on how could one install custom states that will be built in the middle of line of already existing weighted states... just in case :)

Link to comment

You'd have to test the behavior to see how WeiDU shifts everything. Have you tried appending your state with WEIGHT #3? If that doesn't work, try appending your state first, and then setting the WEIGHT for state 0.

 

Since the "weight" corresponds to the order of the triggers in the DLG file, doing SET_WEIGHT first will have no effect (it's valid, but the trigger can only ever be the last in the list, which it looks like it already is).

Link to comment

Grim is right. I tried all things that you advised, devSin, and some more... none worked. Further, I stumbled upon weighting behaviour that makes my hair stands on end - like adding weights to all states with real triggers while I mention no weights in .d and there was none in original .dlg as well. :)

My guess that it might be somehow connected with me replacing some of the dialogue states and appending some other within the same .d... :)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...