Mod Update

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

Remove all ads!
  1. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    I wish I could understand what you guys are talking about. Nonetheless, it sounds encouraging. (I think?)
     
  2. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Yeah from my own fiddling around I'd agree with all that, thanks for the detailed answer.

    I'll keep on fiddling I guess (so to speak).
     
  3. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Please ask questions as appropriate; I'll try to get this explained, to benefit everyone's knowledge...

    We'll start with some terminology:

    a 'critter' is the term for a PC or NPC (including just simple creatures) in the game.

    Every game object is represented in TOEE as a data structure that is called a "PyObjHandle" in Python (python objects start with "Py"), which holds (up to) over 400 "fields" of information about that object/creature/etc. There are 14 different types of objects.

    Background:

    Objects begin life as a prototype, defined in protos.tab, a tab-delimited table of information describing the prototype information for the objects in the game.

    For a given map, an object is placed on that map using a ".mob" file, which references a given prototype, and then can add to (override) any information that comes from the proto for that object. There are a lot more fields available here that protos never defines (for example, the location of the item on a map, since protos are of course prototypes; it's the .mob file that "turns" a prototype into an actual object).

    As an example, Goblins in general might by default (protos) belong to a given faction, having a faction list in the protos.tab file. A .mob file defining a goblin can either "choose" not to define a faction list for that goblin being defined, in which case it uses the defaults, or it can declare an entirely new list for the subject goblin on the subject map.

    Now, objects work in ascending size; the first object in the list has fewer fields than the last in the list (an arrow doesn't have all the fields needed to support an NPC, for instance). What this means is, a given object might have a series of flags that go with it. It might have its standard object flags, it might have item flags, and it might have critter flags (if, indeed, the object is a critter).

    One of the critter flags that's possible to be set is OCF_MUTE (Object Critter Flag: Mute). When this is set, the critter cannot speak. So, even if Sargeant Darkstar of the Flaming Fist has been coded in his script to yell "Death to the Infidels!" (and randomly, "Kaaaahn!") every time he attacks, if the proto for Darkstar is set to OCF_MUTE, then the code to make him yell those things will never trigger speech, because he's been muted.

    One of the main commands to MAKE him speak in code is float_line(); and Liv and I went round and round about whether "mute" status blocks those calls from happening (earlier in this thread). She was right, it does.

    There are a lot of spots in the game where cool dialog was entered in (apparently -- see the murderous thief I posted the fix for; he's supposed to say "You have seen too much!" (does "Prepare to die" go on the end? Can't recall for sure at the mo')), but also a lot of meaningless "chatter" exists as well. As I understand it, this (all the 'chatter') is/was a carryover from Arcanum.

    What happened, apparently, is that a WHOLE lot of critters were muted through the protos.tab file, in order to keep that random chatter out of the game. At one point, Liv tried removing the mute status from everyone, and she got all kinds of weird phrasing.

    So, our workaround to be attempted was to leave everyone "muted" as a matter of course, and then in SPECIFIC scripting situations, diasable the mute status, say the line, and then reenable it. A cleaner solution would/will be to check the mute status first, making sure any of that is necessary, otherwise one will end up muting a character that shouldn't be.

    This thread started because in testing, neither of us could get the functionality to work, and a lot of "it's broken!" was thrown around.

    But I reopened the case because I realized that we were throwing around a whole lot of "flags" versus "flag", and we may have misspelled the command while trying. Low and behold, I was right.

    You see, the calls to get at the critter flags look like this:

    obj.critter_flag_set( OCF_xxx )
    obj.critter_flag_unset ( OCF_xxx )

    Both of these take a single flag to set the status of on the object. When getting flags back OUT, you get them all at once, as a single number representing all the values at once (a bitmask)

    critter_flags = obj.critter_flags_get()

    and we were not being careful enough about our spelling to get it going.

    Gaear, does this help?

    -- dulcaoin

    P.S. let me say one more time; there is more than one way to mute a critter. obj.critter_flag_set( OCF_MUTE ) is the way to do it from a script, and that will "stick" until obj.critter_flag_unset( OCF_MUTE ) is called. But a critter might have a spell effect in place (Silence, anyone?) and that will NOT set the critter flag for mute. Therefore, when scripting, to find out whether a critter is current muted (either through obj.critter_set_flag() or other means), use obj.D20_query(Q_Mute) rather than checking the return value of obj.critter_flags_get() against the OCF_MUTE flag.
     
  4. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Hey dul -

    I really appreciate you going to all the trouble above. I'm a lost cause though. Hopefully it will be helpful to other modders.

    For the record, my quote above was sort of tongue-in-cheek. I mainly post in the modding forum to add encouragement and provide some impetus for getting things done.

    "Peace-out," as they say. :mrhappy:
     
  5. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    I'm gonna flip this around a little bit, in my reply...

    "Peace out"?!? I've been the cause for a "peace out"? Yikes! :-D

    Well, I'm not sure I came on too strong with my comment; didn't mean to. Admittedly, I did just come off the other thread with Drifter; but I really used that experience to encourage me to doc more, not raise any ire. So if I did (and I'm not even sure that's what you mean), I didn't mean to.

    Yeah, I knew it would (might) be helpful to other modders in general, so it certainly wasn't a waste of time.

    The thing is, if I had managed to explain it to YOU, then I would have covered more than enough detail for a modder; presuming you're actually truly a "lost cause" :)

    -- dulcaoin
     
  6. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    :D dul, you're quite honestly a treasure. You're presence and wit (as well as earnestness) have been missed on the general board, btw. Don't work too hard, bro!

    Not to worry . . . "peace-out" is a slang term in my corner of the world that combines the salutations "Goodbye" and "Peace be unto you," (er, or something). It's not meant to imply that you should "chill-out" or anything.

    You could probably do a lot less and still get through to a genuine modder. I'm not just a lost cause, I'm a cause that never was. I have absolutely zero coding experience or background. (I am a fairly mean tester, however. :twisted: ) Don't cry for me though: I can still be useful by dusting, taking out the trash, and running coffee for you guys. ;)

    All is well, my friend.

    (Uh, peace-out?) :hug:
     
  7. Morpheus

    Morpheus Mindflayer Veteran

    Joined:
    Nov 11, 2003
    Messages:
    539
    Likes Received:
    1
    If it's of some comfort to you, dulcaoin: I had some trouble following the thread so far, just like all the others where awe-inspiring terms like "object handles" etc. are thrown around. This is coming from someone who has at least dabbled in modding a bit, albeit with meager results. Your explanation was very helpful indeed. The fog is lifting ...

    In other words, you rock! :rock:
     
  8. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Ok, the $64 question: Dulc, can we use your new console printing device thing to tell us if our NPC's are muted at moments that they should be saying stuff? If so, i have a save game where they CONSISTENTLY speak in places they don't normally (at the doors and throne of the temple) so mayhap we could pull it apart and see what is firing that isn't normally.

    And does mute only mean the sound, or the text as well? I realise this was addressed above but what was written just confused me - i can tell u, i have played with text on and the missing sounds are just plain missing, there is no text coming up either.

    Keep in mind I am 'gameless' for a few days til i change hard drives again, so i can't test even simple things and hence have to ask obvious questions.
     
  9. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    If there were a script being fired, and we knew the script that was running...

    Backing up slightly... if there were TWO scripts that happened, both of which tried to make an NPC speak at different points in the story; and it seemed from anecdote that the NPC only spoke in ONE of the two spots, then by turning on the prints, we could add a printout of the mute flag in each spot, and see if that was indeed changing in between the two spots in the story. That's about the extent of help turning on that bit will help us.

    (if that did indeed happen, then we'd want to scan the entire script source for a spot where the MUTE status changes, and figure out what that happens to that NPC at that spot).

    In other words, it would be a minor tool for reaching a conclusion, not a panacea.

    As for mute status, what it will do is to cause a "float_line()" call to "do nothing" when called. Float_line allows you to cause a line of dialog, described in a .mes file, to appear ("float") above the head of an NPC. That .mes file can, in addition, specify a spoken "wave" file to be played back at the same time, so you both read and hear the dialog. The specifics of that (including whether it's actually .wav or .acm or whatnot), I'm not currently privvy to (indeed, that might actually be your bailiwick at the moment, since it is where you've been concentrating lately), but that's my understanding of things.

    I would (educatedly) guess that, if text does not appear, things are "broken," whether because of internal coding, scripting errors, or mute status. If you get text but not sound (and yet have indeed found such recordings), then it's likely more a pathing issue inside some .mes file where the right file path isn't being specified.

    -- d
     
  10. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Fair enough.

    The combat comments etc turn up in the .mes files (of course) but as you no doubt know, they're not 'scripted' in the .dlg or .py files for the NPCs (I mean they are in the dlg files but i am of the current opinion it is something coded that triggers them, not a script we can easily change).

    That'd be too simple.
     
  11. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    Whoa! Whoa whoa whoa!

    Back up the truck, mac!

    <whispered> Do you want your internet access disabled?!?</whispered>

    Whatta trying to do, Gaear? Make the Internet pleasant and respectful?

    <looks left>

    <looks right>

    <runs!>

    :)

    But honestly, thanks for the compliment. How very un-net of you :p


    Roger.

    and Wilco.


    Back atcha, homey!


    --- dulcaoin

    Side Note: oh, crap. As a moderator, I should probably ban myself for this off-topic silliness. <sigh> :)
     
  12. dulcaoin

    dulcaoin Established Member Veteran

    Joined:
    Mar 10, 2005
    Messages:
    213
    Likes Received:
    0
    If it's a case of the NPCs being MUTEd at the wrong times, there are events that DO fire at the start and end of combat, so perhaps we can unmute the relevant critters and then remute again at the end, presupposing that no errant "banter" has been supplied that would trigger DURING combat. (in that case, perhaps "undefining" the banter from the .mes would work?)

    All conjecture. Need to keep beating that horse until he performs, I guess.

    -- d
     
    Last edited: Jun 9, 2005
Our Host!