Skip to content

Random questions I have regarding modding

elminsterelminster Member, Developer Posts: 16,317
edited December 2014 in General Modding
Rather than making a new thread every time I have a modding related question I figure I'll just repurpose this one.

At the moment it concerns an issue I'm having with getting quests to appear in the journal (see below).
Post edited by elminster on
«13

Comments

  • CrevsDaakCrevsDaak Member Posts: 7,155
    It's not via a script what you want ;p
    You'd prefer adding an actor to the .are and editing the flags in the appareance time with WeiDU.
    http://www.weidu.org/~thebigg/README-WeiDU.html#htoc51
    http://gibberlings3.net/iesdp/file_formats/ie_formats/are_v1.htm#formAREAV1_0_Actor


    No idea about those soldiers... Look at thier destination fields [x.y] on their actor entry in the .are and see if it's that.
  • elminsterelminster Member, Developer Posts: 16,317
    Thanks :)
  • CoM_SolaufeinCoM_Solaufein Member Posts: 2,606
    You can have a creature assigned to an area and use the area file that lets it know what time.they should be there. Also can be done with a script file. I'm not on my computer so I really can't give you the specifics on it
  • elminsterelminster Member, Developer Posts: 16,317
    edited December 2014
    So would it look something like this then in my Tp2 file?

    COPY_EXISTING ~ar3300.are~ ~override~
    LPF fj_are_structure
    INT_VAR
    fj_loc_x = 1442
    fj_loc_y = 955
    fj_dest_x = 1442
    fj_dest_y = 955
    fj_schedule = 0b100000000000000011111111 // 20:30 - 5:30
    fj_animation = 0x6310 //thief female human
    fj_orientation = 15 //SSE
    STR_VAR
    fj_structure_type = actor
    fj_name = Bethi
    fj_cre_resref = k9bethi
    END

    Edit: Looks like I've gotten the timing to work to a degree. I still need to figure out its specifics but so far so good.
    Post edited by elminster on
  • CrevsDaakCrevsDaak Member Posts: 7,155
    yeah, that should work OK.
  • elminsterelminster Member, Developer Posts: 16,317
    edited December 2014
    @CrevsDaak So what would I need to type in if I just wanted to outright remove a creature from an area file.

    For instance AR3323 (in BGEE) has two townsfolk in it that I'd like to remove.
  • CrevsDaakCrevsDaak Member Posts: 7,155
    @elminster‌ something like this moves the creature. I think you should use DELETE_BYTES and adjust the actors count and offset.
    COPY_EXISTING ar400.are override
    PATCH_IF SOURCE_SIZE > 0x139 BEGIN
    READ_LONG 0x54 actors_offset
    READ_SHORT 0x58 actors_count
    SET found = 0
    FOR (j = 0; j < actors_count && found > 1; ++j) BEGIN
    READ_SHORT 0x20 current_x
    READ_SHORT 0x22 current_y
    PATCH_IF (current_x > 1350 && current_x < 1450 && current_y > 600 && current_y < 700) BEGIN
    WRITE_SHORT 0x20 1044
    WRITE_SHORT 0x22 694
    WRITE_SHORT 0x24 1044
    WRITE_SHORT 0x26 694
    SET found = 1
    END
    END
    END ELSE BEGIN
    PATCH_FAIL ~%SOURCE_FILE% is corrupt: below minimum length.~
    END
    BUT_ONLY
    Also, you could just use a script like this:
    IF
    OR(2)
    Exists("commoner1")
    Exists("commoner2")
    !Global("checkcheck","GLOBAL",1)
    THEN
    RESPONSE #100
    ActionOverride("commoner1",DestroySelf())
    ActionOverride("commoner2",DestroySelf())
    END
    and append it to the area's script.
  • elminsterelminster Member, Developer Posts: 16,317
    Thanks :)
  • elminsterelminster Member, Developer Posts: 16,317
    edited December 2014
    @CrevsDaak (or anyone who has experience with dialogue) another question.

    I added in

    AddJournalEntry(@105,QUEST)

    for one of my dialogues. Everything installs fine and when I go through the dialogue I get a message saying that the journal has been updated, but when I look in the journal there isn't anything in it.

    IF ~~ THEN
    BEGIN k9gooddarren2
    SAY ~I've heard he spends his days and nights in either the Feldpost Inn, the Burning Wizard, or the Red Sheaf. If you can't find him in one of these places then he likely will be found in one of the other two. Now, if you excuse me I must get back to other pressing matters. Please return to me after you have talked to him.~ IF ~~ THEN DO ~AddJournalEntry(@105,QUEST)~ EXIT
    END

    Any thoughts about what I might be missing?
  • CrevsDaakCrevsDaak Member Posts: 7,155
    @elminster you're not patching the bgee.sql--which rules the journal entries--so they aren't showing up.
    Check in this thread's OP http://gibberlings3.net/forums/index.php?showtopic=26671 (you'll have to scroll down a bit) where it says Journal Entries or something like that.
  • elminsterelminster Member, Developer Posts: 16,317
    Thanks :)
  • elminsterelminster Member, Developer Posts: 16,317
    Yea I'm trying to use an area script and have it unlock a door at a certain chapter

    So far I have

    IF
    Global("Chapter","GLOBAL",3) Global("k9unlocked", "GLOBAL", 0)
    THEN
    RESPONSE #100
    SetGlobal("k9unlocked", "GLOBAL", 1)
    Unlock("Door3323")
    OpenDoor("Door3323")
    END

    Weidu has no problems with this but when it comes time to see if the door is unlocked it isn't (even if I'm in chapter 3).
  • CrevsDaakCrevsDaak Member Posts: 7,155
    May I ask what are you developing here :) ?
    First, does the door require a key? If not, make so, and use an invisible creature with the key to open the door.
    And second, you could use the check:
    0x4076 OpenState(O:Object*,I:Open*BOOLEAN)
    (Returns true only if the open state of the specified door matches the state specified in the 2nd parameter).
    ^ shamelessly stole form the IESDP
  • elminsterelminster Member, Developer Posts: 16,317
    edited December 2014
    Edit: I think I'm just going to take a different approach. Nothing I do seems to want to work and its such a trivial aspect of the mod that I don't want to spend any more time on it haha.
    Post edited by elminster on
  • elminsterelminster Member, Developer Posts: 16,317
    edited March 2015
    @CrevsDaak hey I think I asked you this earlier but how do you edit map notes?

    (I know the command ADD_MAP_NOTE but obviously that is just adding one)

    Edit: I found this online

    RemoveMapNote(P:Position*,I:STRREF*)

    Will this still work in BGEE?
  • elminsterelminster Member, Developer Posts: 16,317
    Nevermind. I figured it out :)
  • elminsterelminster Member, Developer Posts: 16,317
    Weird. So I'm trying to remove two map notes using that command. I'm able to remove one, but the second one doesn't want to disappear.


    This is what I have for the BAF file I'm using for it

    //Nashkel Inn name

    IF
    GlobalGT("Chapter","GLOBAL",0) Global("k9Nashkel1", "GLOBAL", 0)
    THEN
    RESPONSE #100
    SetGlobal("k9Nashkel1", "GLOBAL", 1)

    RemoveMapNote ([1300.564], 16266)




    END

    //Nashkel Store Name

    IF
    GlobalGT("Chapter","GLOBAL",0) Global("k92", "GLOBAL", 0)
    THEN
    RESPONSE #100
    SetGlobal("k92", "GLOBAL", 1)

    RemoveMapNote ([1684.820], 16267)


    END



    The top one (for the nashkel inn) works but the bottom one doesn't.
  • argent77argent77 Member Posts: 3,478
    The map note coordinates in your scripts are slightly off and the actually used strref of the "Nashkel Inn" note is different (I'm surprised it still worked). Try the following code snippet instead:
    //Nashkel Inn name IF GlobalGT("Chapter","GLOBAL",0) Global("k9Nashkel1", "GLOBAL", 0) THEN RESPONSE #100 SetGlobal("k9Nashkel1", "GLOBAL", 1) RemoveMapNote([1330.652], 16268) END //Nashkel Store Name IF GlobalGT("Chapter","GLOBAL",0) Global("k92", "GLOBAL", 0) THEN RESPONSE #100 SetGlobal("k92", "GLOBAL", 1) RemoveMapNote([1655.867], 16267) END
    Btw, the script actions AddMapNote/RemoveMapNote were very unreliable in the original BG2. Sometimes it worked, sometimes it added new strings to existing map markers instead of replacing them (in the case of AddMapNote()) and sometimes it did nothing at all. I don't know if this issue has been fixed in the Enhanced Editions of the games.
  • elminsterelminster Member, Developer Posts: 16,317
    I can't test it at the moment but thanks for the help!
  • elminsterelminster Member, Developer Posts: 16,317
    edited March 2015
    Yea with that it basically just adds the string to the existing string for the top one. So in this case it now says

    Nashkel Inn
    Northern Light Inn


    when I scroll over it when I just want it to say Northern Light Inn.

    Whereas with the bottom one it removes the old map marker and replaces it with a new one with the correct text.

    So looks like the issue you mentioned hasn't been fixed.
  • elminsterelminster Member, Developer Posts: 16,317
    edited March 2015
    Anyways, another thing I'd like to be able to do is change the probability of snowfall in a number of areas. Any ideas on how I would go about programming that? (using weidu)
  • elminsterelminster Member, Developer Posts: 16,317
    edited March 2015
    Also I'm trying to create an STO file for a temple. However, for whatever reason after Weidu compiles it it changes the "type" of the store from 3 (temple) to some crazy high number. How do you set the store type in Weidu?

    Edit: Nevermind I figured out what I was doing wrong based on this :)

    http://forums.pocketplane.net/index.php?topic=11555.0
    Post edited by elminster on
  • elminsterelminster Member, Developer Posts: 16,317
    edited March 2015
    Right now I have

    APPEND INNKN2


    IF WEIGHT #1 ~ InParty("VICONIA") InParty("BAELOTH")~ THEN BEGIN k9wizard
    SAY @2050

    ++ @2051 DO ~ Enemy()~ EXIT
    END

    END

    Yet when I talk to the person I need to talk to this dialogue is ignored (even when I have both Baeloth and Viconia in my party). Any ideas why?
  • IsayaIsaya Member, Translator (NDA) Posts: 752
    elminster said:

    Anyways, another thing I'd like to be able to do is change the probability of snowfall in a number of areas. Any ideas on how I would go about programming that? (using weidu)

    Probability is a offset 0x4C in the ARE structure.
    So something like this should update it:
    COPY_EXISTING ~MYAREA.ARE~ ~override/MYAREE.ARE~ WRITE_SHORT 0x4C value
    elminster said:

    Yet when I talk to the person I need to talk to this dialogue is ignored (even when I have both Baeloth and Viconia in my party). Any ideas why?

    State weight in game dialog start at 0, which is the higher priority, according to the WeiDU readme. Since that weight might already be used in the dialog, and prior to anything you append (in case of equal weight, the first to appear in file will trigger), you are allowed to specify negative number for weight when you append something.
    See example in chapter 8.7 state WEIGHTs of the WeiDU readme for explanations and example:
    APPEND BJAHEIR IF WEIGHT #-999 ~MyCondition()~ THEN BEGIN mystate SAY ~My Stuff~ END END
  • elminsterelminster Member, Developer Posts: 16,317
    edited March 2015
    Yea I had thought about it being 1 instead of 0 (and did change it), but even when I changed it to zero that didn't change anything.

    This is the dialog file that I am appending. There isn't really much to it.

    // creator : weidu (version 23600)
    // argument : INNKN2.DLG
    // game : .
    // source : ./DATA/DIALOG.BIF
    // dialog : lang\en_us/dialog.tlk
    // dialogF : (none)

    BEGIN ~INNKN2~

    IF ~ True()
    ~ THEN BEGIN 0 // from:
    SAY #3586 /* ~Ya should do yerself a favor and stay indoors tonight. I've heard of all sorts of weird things happening at night.~ */
    IF ~~ THEN REPLY #15275 /* ~What can you give me today?~ */ DO ~StartStore("Inn4801",LastTalkedToBy(Myself))
    ~ EXIT
    IF ~~ THEN REPLY #15276 /* ~I don't need anything at the moment.~ */ EXIT
    END

    IF ~ False()
    ~ THEN BEGIN 1 // from:
    SAY #3587 /* ~Have you ever danced with the devil in the pale moonlight? Well, neither have I.~ */
    IF ~~ THEN EXIT
    END
  • elminsterelminster Member, Developer Posts: 16,317
    edited March 2015
    This is a copy of what I am appending it with


    EXTEND_TOP INNKN2 0
    +~CheckStatGT(Player1,14,CHR)~+ @2045 GOTO 3
    +~CheckStatLT(Player1,15,CHR)~+ @2045 GOTO 4
    END


    APPEND INNKN2


    IF WEIGHT #0 ~~ THEN BEGIN k9wizard
    SAY @2044

    +~InParty("VICONIA") InParty("BAELOTH") Kit(player1,DARK_MOON)~+ #15275 GOTO k9ViconiaBaelothMonk
    +~InParty("VICONIA") InParty("BAELOTH") !Kit(player1,DARK_MOON)~+ #15275 GOTO k9ViconiaBaeloth
    +~InParty("VICONIA") !InParty("BAELOTH") Kit(player1,DARK_MOON)~+ #15275 GOTO k9ViconiaMonk
    +~InParty("VICONIA") !InParty("BAELOTH") !Kit(player1,DARK_MOON)~+ #15275 GOTO k9Viconia
    +~!InParty("VICONIA") InParty("BAELOTH") Kit(player1,DARK_MOON)~+ #15275 GOTO k9BaelothMonk
    +~!InParty("VICONIA") InParty("BAELOTH") !Kit(player1,DARK_MOON)~+ #15275 GOTO k9Baeloth
    +~!InParty("VICONIA") !InParty("BAELOTH") Kit(player1,DARK_MOON)~+ #15275 GOTO k9Monk
    END

    IF ~~ THEN BEGIN k9ViconiaBaelothMonk
    SAY @2051 IF ~~ THEN DO ~ Enemy()~ EXIT
    END

    IF ~~ THEN BEGIN k9ViconiaBaeloth
    SAY @2050 IF ~~ THEN DO ~ Enemy()~ EXIT
    END

    IF ~~ THEN BEGIN k9ViconiaMonk
    SAY @2052 IF ~~ THEN DO ~ Enemy()~ EXIT
    END

    IF ~~ THEN BEGIN k9Viconia
    SAY @2049 IF ~~ THEN DO ~ Enemy()~ EXIT
    END

    IF ~~ THEN BEGIN k9BaelothMonk
    SAY @2053 IF ~~ THEN DO ~ Enemy()~ EXIT
    END

    IF ~~ THEN BEGIN k9Baeloth
    SAY @2049 IF ~~ THEN DO ~ Enemy()~ EXIT
    END

    IF ~~ THEN BEGIN k9Monk
    SAY @2048 IF ~~ THEN DO ~ Enemy()~ EXIT
    END


    IF ~~ THEN BEGIN 3
    SAY @2047
    ++ #15275 /* ~What can you give me today?~ */ DO ~StartStore("Inn4801",LastTalkedToBy(Myself))
    ~ EXIT
    ++ #15276 /* ~I don't need anything at the moment.~ */ EXIT
    END

    IF ~~ THEN BEGIN 4
    SAY @2046
    ++ #15275 /* ~What can you give me today?~ */ DO ~StartStore("Inn4801",LastTalkedToBy(Myself))
    ~ EXIT
    ++ #15276 /* ~I don't need anything at the moment.~ */ EXIT
    END

    END

    Somehow the weight must be related to the issue because when I tried basically just replacing the file with my own (but without any weight and after making some adjustments) and it had no issues.
  • IsayaIsaya Member, Translator (NDA) Posts: 752
    edited March 2015
    As the WeiDU readme explains, state weight are implicit starting at 0 for the very first state in the dialog. So you IF ~true~, that will always be a candidate because of true, has state weight equal to 0. The readme also tells that, In case of equal weight with several states with active trigger, the first state to appear in the file will be used.
    If you append another state with weight 0 later in the file, it will always be behind the very first state in terms of priority. As I wrote, use a negative weight in your append if you want it to trigger.
  • elminsterelminster Member, Developer Posts: 16,317
    Yea I tried making the weight #-99 (I also tried #-1 at first) and its still not working. They show up in the dialog file in Near Infinity they just don't happen when they should be happening.

  • elminsterelminster Member, Developer Posts: 16,317
    Ahh...I figured it out. I didn't also have True() there. Anyways thanks for your help @argent77 and @Isaya this was also stopping me from getting other mods from working :)
  • elminsterelminster Member, Developer Posts: 16,317
    edited April 2015
    I'm trying to program a quest to be considered solved. How do I go about doing that? I'm doing this on BGEE and I've been using the new ADD_JOURNAL system.

    The problem I think is that I'm trying to use more than one SOLVED_JOURNAL in the same block. Its only recognizing the last one though.

    What I have for it is this.

    IF ~~ THEN
    BEGIN k9militiathings3
    SAY ~Did ye now? Well much appreciated. I've not got much myself but you deserve a reward all the same. Its not much but take it.~ IF ~~ THEN DO
    ~SetGlobal("k9pints", "GLOBAL",3)
    AddexperienceParty(2000)
    EraseJournalEntry(@110)
    EraseJournalEntry(@111)
    EraseJournalEntry(@112)
    EraseJournalEntry(@113)
    EraseJournalEntry(@114)
    EraseJournalEntry(@115)
    EraseJournalEntry(@116)
    EraseJournalEntry(@117)
    EraseJournalEntry(@118)
    EraseJournalEntry(@119)
    EraseJournalEntry(@120)
    EraseJournalEntry(@121)
    EraseJournalEntry(@122)
    EraseJournalEntry(@123)
    EraseJournalEntry(@124)
    EraseJournalEntry(@125)
    EraseJournalEntry(@126)
    EraseJournalEntry(@127)
    EraseJournalEntry(@128)
    EraseJournalEntry(@129)
    EraseJournalEntry(@130)
    EraseJournalEntry(@131)
    EraseJournalEntry(@132)
    EraseJournalEntry(@133)~

    SOLVED_JOURNAL @107 SOLVED_JOURNAL @1071 SOLVED_JOURNAL @1072 SOLVED_JOURNAL @1073 EXIT
    END
    Post edited by elminster on
Sign In or Register to comment.