Mod Update

Discussion in 'General Modification' started by dulcaoin, Mar 23, 2005.

Remove all ads!
  1. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    I was certain that unset would do the trick.

    Here's an idea...

    Are you trying to

    attachee.critter_flag_unset( OCF_MUTE )
    <dialog command>
    attachee.critter_flag_set( OCF_MUTE )

    or something like that?

    Then it could be a timing thing. If you tried that, then I suggest you try the unset, followed by the dialog command, and then in the san_heartbeat, do something like

    if attachee.d20_query(Q_Mute) = 0 :
    attachee.critter_flag_set(OCF_MUTE)

    and, actually, I suggest you keep that part out of the mix until you see the unset() truly working.

    I'm probably all wet, and you already tried an open-ended unset, but it's worth a try if my guess was correct.


    -- d
     
  2. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    D -

    I thought for sure that attachee.critter_flag_unset( OCF_MUTE ) would work...

    But all my attempts to make this work have failed. I suspect they never had a use for unset so didn't code it...

    - Livonya
     
  3. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Can you give me a quick and easy way to play with this on my own? A script I can change for someone or something in Hommlet so I can walk up and have someone who's Mute, that I can deal with?

    Otherwise, it'll be the float_text that you don't like to use :-(

    -- d
     
    Last edited: Mar 25, 2005
  4. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    D -

    The easiest to use is the Murderous Thief in the Neutral Good opening.

    Just change his Protos.tab so that he is Mute.

    And then try to find a way to turn Mute off in his script.

    If you manage to turn Mute off then he will say his statement as he attacks.

    If you don't manage to turn Mute off then he will be silent.

    - Livonya
     
  5. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Wow. Super annoying. let's see if I can recall exactly everything I did...

    1) First, added OCF_MUTE to 14323's critter_flags

    2) Modified script 193, function san_enter_combat, to:

    def san_enter_combat( attachee, triggerer ):
    attachee.critter_flags_unset( OCF_MUTE )
    attachee.turn_towards(triggerer)
    attachee.float_line(1,triggerer)
    return RUN_DEFAULT

    3) Started Neutral Good party (heh, same as my first played game, I didn't realize we were talking about THIS guy...)

    combat starts, no dialog seen nor heard.

    So I did this (in console, my commands preceded by >>>, even though the TOEE python console doesn't issue a prompt):

    - First I collected a list of all the critters in the vicinity of my party (that includes the party members), calling it a

    >>> a = game.obj_list_vicinity(game.party[0].location, OLC_CRITTERS)

    - I then examined a and found out that the Murderous thief was item 5 (a[5]) with simply

    >>> a

    - I then examined OCF_MUTE to find out its binary value (it's 8192)

    >>> OCF_MUTE

    For reference, 8192 in binary is
    0000 0000 0000 0010 0000 0000 0000

    - Then I checked his critter flags

    >>> a[5].critter_flags_get()

    This returns 134488064, which is (in binary):
    1000 0000 0100 0010 0000 0000 0000

    So you can see that the mute flag IS set (the 0010 column lines up with a 1 between the two numbers in binary)


    - Then I unset the mute flag with

    >>> a[5].critter_flags_unset(OCF_MUTE)

    - I checked the results

    >>> a[5].critter_flags_get()

    this time, it was 134479872, or
    1000 0000 0100 0000 0000 0000 0000

    so you can see that the mute flag WAS cleared by the command

    ] If you'd prefer not to trust my binary skills (big grin), you can also
    ] check this with
    ]
    ] >>> a[5].critter_flags_get() & OCF_MUTE
    ]
    ] this returns 0 when OCF_MUTE is clear, and 8192 when it's set

    ------

    Now it gets annoying.

    * At NO time, whether OCF_MUTE is set in the critter flags or not, does

    >>> d20_query(Q_Mute)

    return anything but 0 (I'm still wondering if this is actually related to spell effects -- it's certainly not related this to this flag).

    * Furthermore, if I type

    >>> a[5].float_line(1, game.party[0])

    I get speech AND dialog, whether the OCF_MUTE flag is set OR NOT

    grrr.

    --------

    Edit: So, the upshot is, unset() _does_ work. The game just isn't paying attention to the flag like we thought, or trying to unset it in a combat_enter standard action doesn't work right [see my later posts below for more]

    -- d
     
    Last edited: Mar 25, 2005
  6. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    I'm still playing with this, but I've discovered that as soon as the line
    attachee.critter_flags_unset(OCF_MUTE)

    is executed in a script, all lines after that in the standard action handler get ignored.

    I tried assigning the return value to a variable, it didn't help.


    ----


    Also, I currently have set the OCF_MUTE in the protos.tab for my murderous thief, I removed the line that sets OCF_MUTE, and changed it so he has no callback for san_enter_combat, and DOES have one for san_start_combat.

    Now, even though he's set to OCF_MUTE in protos, and I never set nor clear it, he says his line every time he starts combat again (I put him to sleep to get multiple shots at it).

    My question then is, Liv, are you CERTAIN that float_line() cares about the OCF_MUTE flag?

    Edit: My suspicion currently is that only begin_dialog does.

    -- d
     
    Last edited: Mar 24, 2005
  7. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    one more try...

    I put the line back IN that sets OCF_MUTE on him. I have him set to mute in the protos.tab (OCF_MUTE there as well), and I removed his link for san_enter_combat and gave him an entry for san_start_combat (which of course runs every round, so I don't NEED to put him to sleep -- oops).

    He says the line EVERY time he makes a strike now.

    Ergo, I don't think float_line() pays attention to the mute status.

    Also, I used the console to make sure it's set as well; AND I removed his OCF_NOFLEE in protos.tab; and the check for no OCF_MUTE (in console) ALSO reflects the lack of the OCF_NOFLEE flag.

    -- d
     
  8. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    D -

    I guarantee you that you can not float text over a mute NPC, at least not a dialog line.

    To prove this you can do an extremly simple test.

    Leave all scripts exactly as they were before you started playing with them.

    Enter the Murderous Thief's range... he will shout and attack you.

    Now change the Protos file so that the Murderous Thief is mute.

    Now enter the Murderous Thief's range... he will say nothing and attack you.

    This was the test I did and unless I have made a huge error, which I will not rule out, then that is proof that it doesn't work.

    What you are doing via the console is not the same thing as what is necessary to float his dialog above his head...

    Again I will not rule out that I am wrong but every time I tested it this was what happened...

    Granted I can't actually see the script you are using, so you may have done something that I haven't tried...

    - Livonya
     
  9. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Liv --

    I was trying to tell you that that's exactly what I did do. This is all happening from his script. All that console stuff was the proof that unset does work.

    BTW, new info I just discovered: Any commands after attachee.critter_flag_set() is ignored (just as I said it was for ...flag_unset) in the script.

    To recap: Using my "non-tinker" set of data, I eliminated enter_combat and enabled start_combat, set his critter flags to OCF_MUTE (eliminating OCF_NO_FLEE for other testing I did). I used the vanilla script file, except I changed san_enter_combat to san_start_combat (to match the proto.tab changes I made), and got rid of the set(OCF_MUTE) line.

    That's it. And he says the line EVERY time he has a round of combat.

    In fact, read what I wrote again, I was very detailed. ONLY the first set of work was done with the console, all my follow-ups have been with the script.

    Edit: And before you say it... :) YES, I'm deleting my .pyc file EVERY time (and running TOEE from scratch -- no hot scripting attempts here)

    -- dulcaoin
     
    Last edited: Mar 25, 2005
  10. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    D -

    Did some more testing.

    I am wrong.

    You can float text via dialog above an NPCs head.

    It turns out what doesn't work is unset.

    attachee.critter_flags_unset( OCF_MUTE )

    If you put this in the script then it breaks the script.

    I added that line to test unset, and didn't comment it out. The unset phrase was the problem all along.

    But still I am wrong, you can float text over a mute NPCs head but you can't start dialog with them... which is perfect.

    My initial test was totally bogus because I tried using critter_flags_unset


    - Livonya
     
    Last edited: Mar 25, 2005
  11. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Liv --

    Yes, like I said. Either set or unset will "kill" your program flow, and any commands after them don't happen. I have my doubts that
    return RUN_DEFAULT is happening in the Troika-supplied script.

    How do I know this? I added some particle effects to the murderous thief script while testing. Between that and the float_line command... By moving the lines around, I can tell what's running and what isn't.

    Try moving the 'critter_flag_set' command above the 'float_line' command... it (the 'float_line') won't execute. Try putting a spell 'particles' command after the 'set' command, it (the 'particles' command) won't happen (but put the 'particles' command in front of the 'set' line, it will work)

    Suggest:
    game.particles( 'sp-Remove Disease', triggerer )

    -----

    Unset DOES do its job, but it also kills the program flow (and, as we can see, float_text doesn't care about the flag anyway). The reason the set() call is in script 193 in the first place (I believe) is so that you can't initiate dialog with him once combat has started.

    - dul
     
    Last edited: Mar 25, 2005
  12. Allyx

    Allyx Master Crafter Global Moderator Supporter

    Joined:
    Dec 2, 2004
    Messages:
    5,001
    Likes Received:
    250
    I've been reading all your posts here and while most of it may well be in another language, I was thinking... are pc's battle cries set to mute? the mp3 files are in the extracted toee3/sounds/pcvoices (I think) file but they never get played, is it possable to get these sounds back into the game? It just seems such a shame to have these sounds installed and never being able to hear them while playing the game.
     
  13. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Here's a resurrection from the vault...

    I did more work in this area.

    the calls have to be made right, or you don't get squat.

    * Use critter_flag_set(OCF_MUTE) to mute a critter
    NOTE: FLAG, not FLAGS

    * Use critter_flag_unset(OCF_MUTE) to un-mute a critter
    NOTE: FLAG, not FLAGS

    BOTH these calls DO work!

    * Use critter_flags_get() to get a critter's flags
    NOTE: FLAGS, not FLAG

    * !!!IGNORE!!! the previous point if your intent is to find out whether or not a critter is mute. Use d20_query(Q_Mute), NOT the critter flags, to determine a critter's mute status. Because critter_flags_get() only says whether the critter has been programmatically muted, not whether they're muted at all (such as by a silence spell).


    Now the fun part, making the murderous thief say his piece as he was meant to:

    Replace the existing san_enter_combat code in py00193murderous thief.py with the following code:

    Code:
    def san_enter_combat( attachee, triggerer ):
    	attachee.critter_flag_unset( OCF_MUTE )
    	attachee.turn_towards(triggerer)
    	attachee.float_line(1,triggerer)
    	attachee.critter_flag_set( OCF_MUTE )
    	return RUN_DEFAULT
    
    -- dulcaoin
     
    Last edited: Jun 4, 2005
  14. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    With regards to Allyx's suggestion, i tried that script for Elmo and put him through his paces to seee if any of the missing combat sounds were 'muted', no luck. :cry:

    Dulcaoin, other than that one thief in the opening vignette, is this a big issue? I mean, something sound modders should keep a regular eye out for?
     
  15. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    When Troika coded Arcanum, the NPC's had a LOT to say, they were all coded with "jabber". When TOEE came along, a lot of that was "backed out" simply by muting them right and left (by changing their prototypes). When muted, float_text gets ignored, so even if characters have something "real" to say (the murderous thief, for instance, has both text and spoken dialog to say, but unless you use the code above to unmute him, trying to have him say it does nothing), they'll not say it.

    You'll see earlier in the thread that Liv tried removing OCF_MUTE (That Object Critter Flag Mute) from the critter flags from the NPCs. She got all kinds of meaningless jabber.

    This *could* well be contributing to the fact that mysterious dialog has been found that isn't showing up.

    COULD.

    THere's also the fact that people HAVE gotten dialog out of these critters, which would point away from this being the source, potentially.

    There isn't too much special about the thief, other than the fact that Liv and I chose that character to do experimental surgery on because it's a good test case; it's easy to have him come up, there are no other characters around at the time to interfere; it's right at the start of the game, so you don't even need a save game (though I actually do have one to further save time). The point of this exercise was certainly not to get that guy talking; it was to figure out how to unmute a prototypically muted character in "special" circumstances to get him to talk.

    -- d
     
Our Host!