Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Neverwinter Nights: Enhanced Edition has been released! Visit nwn.beamdog.com to make an order. NWN:EE FAQ is available.
Soundtracks for BG:EE, SoD, BG2:EE, IWD:EE, PST:EE are now available in the Beamdog store.
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

[Tutorial] jastey's SoD NPC Modding Tutorials

2»

Comments

  • jasteyjastey Member Posts: 1,011
    edited April 12
    Update of Tutorial no 1 to version 4!

    Please note: In xxbd0101.baf, the trigger of the second script block was changed to close an oversight that prevented Biff to spawn in case the player met him in the city before but did not take him into the group.
    Also, there were copy&paste errors where Minsc's death variable was still present, but of course it needs to be Biff's.

    And: The tutorial has two new components!
    - "Add Biff to Corwin's list about companions in BG city" - before going into BG city, Corwin can be asked about former companions who are now to be found inside the city. Biff will be mentioned here, too, in case he was in the party before (which is in principle not possible but it's an example in case your NPC will be).
    - "Make the Mod EET compatible" This paragraph deals with EET compatibility for an SoD only NPC mod - which is the kind of mod with the least work, at least compared with BG:EE or BGII mods.

    Changes:
    • corrected copy&paste errors where Minsc's death variable was inside scripts instead of Biff's
    • fixed oversight in xxbd0101.baf: in case Biff was taken into the group in BG city but then left standing before the last night before the coalition marches against the crusade, he wouldn't spawn in front of the Ducal Palace
    • added new paragraph: "Add Biff to Corwin's list about companions in BG city"
    • added new paragraph: "Make the Mod EET compatible"

    RaduzielGusinda
  • jasteyjastey Member Posts: 1,011
    And the tutorial no 2 was updated, too.

    Version 2 comes with the changes:
    -added paragraph: "Biff visits the PC in Prison"

    RaduzielGusinda
  • jasteyjastey Member Posts: 1,011
    And of course the Tutorial NPC Mod "Biff the Understudy" was updated in accordance with the tutorials.
    Version 2 comes with bugfixes and new content.

    Changes:
    -added EET compatibility
    -corrected copy&paste errors where Minsc's death variable was inside scripts instead of Biff's
    -corrected trigger of second script block in xxbd0101.baf to close the oversight that Biff wouldn't (re)spawn here in case he was already spawned in bd0010.are but not taken into the group
    -added "Biff visits PC in prison"
    -added "Corwin will mention Biff's whereabouts in BG city if asked about the former companions"
    -the mod now uses a tra file (albeit only for the line needed for EET fate spirit) and HANDLE_CHARSETS for text conversion

    RaduzielGusinda
  • jasteyjastey Member Posts: 1,011
    ...And tutorial 2 updates to v3, now with the missing dialogue needed for the paragraph "Biff visits PC in Prison"...

    Raduziel
  • ArdanisArdanis Member, Developer Posts: 1,440
    edited April 13
    jastey wrote: »
    I used the SmallWait() because BeamDog used them, but I made experiences with script commands not being executed in cutscenes unless there is a short waiting, so I just left them in, trusting on the devs experiences. I don't know how many times I fought with cutscenes not working properly although all commands where ok in principle, and then finally a "Wait(1)" did the miracle, so if I have a template that uses a (Small)Wait() somewhere, I'm not going to try whether it will work without. :D
    Yep. Also note you can stack several ActionOverride() for an actor in cutscene mode to make an action queue - in this case inserting waits will instead disrupt the queue.

    Couple other non-obvious things to not accidentally change, lest they destroy your weekend:
    1) SaveLocation("LOCALS","variable",[x.y]) must be in uppercase, otherwise it won't work. Coordinate variables are about the only place I know where case matters.
    2) Trigger overrides for objects that may not exist in the area need to be the last in condition block:
    OR(2)
        !Range("ff_camp",999) //"Name" of a trigger which detects the camps
        !TriggerOverride("ff_camp",IsOverMe("xxBiff"))
    
    Even merely switching positions of TO() and Range() here will break it if you're not in any camp area (1000, 7100 or 3000). Happens with dialog triggers as well. I think a temporary solution was to place a dummy ff_camp dot in all SoD areas so that it wouldn't bug out, but as the new locations kept getting added I opted for a combo like this.

    jastey wrote: »
    Ha! :) Yeah, I went for option one, instead.
    EDIT: Just so this doesn't make the wrong impression: I complained to @Raduziel via PM that I can't get one of the cutscenes to work and will either leave it or throw my comp out of the window.
    If you still have the script, I can take a look at it.
    Raduziel wrote: »
    One question: why do you keep changing the creature AI Script at every camp transition?
    Safety measure, really, in case something unpredictable happens.

    Gusindajastey
  • RaduzielRaduziel Member Posts: 4,265
    Thanks for the insight, @Ardanis .

    As for case-sensitive stuff, Weidu-highlighter in Notepad++ wasn't recognizing "locals" but did recognize "LOCALS". Ditto for globals/GLOBALS.

    I don't know if it is relevant, though.

    Gusinda
  • jasteyjastey Member Posts: 1,011
    edited April 14
    @Ardanis Thank you very much for the insight!
    Thank you very much for your generous offer. I don't have the cutscene any more (it was the attempt to let a non-party member walk along in the very last SoD area, but it's such a short moment and I don't even need it for any of my own private NPC projects.) I might come back to your offer if I have similar difficulties in one of the other cutscenes where all characters in SoD are supposed to move / gather / do something else, though!
    Also note you can stack several ActionOverride() for an actor in cutscene mode to make an action queue - in this case inserting waits will instead disrupt the queue.
    If someone would give me a quick explanation what an action queue and also disrupting it actually means (and whether there are instances where one would want one or the other), maybe with an example, that would be great.

    @Raduziel That might be because the highlighter was probably created before SoD used small letters for locals and global. I didn't know that is actually possible before that. (It probably wasn't, in the old engine.)

    Raduziel
  • ArdanisArdanis Member, Developer Posts: 1,440
    edited April 14
    jastey wrote: »
    If someone would give me a quick explanation what an action queue and also disrupting it actually means (and whether there are instances where one would want one or the other), maybe with an example, that would be great.
    One example is NEWGAME.BCS in BG2:
    CreateCreature("ISHADDUD",[3269.3264],SW)
        CreateVisualEffect("ICSPAIN",[3510.3100])
        PlaySound("EFF_M38")
        SmallWait(7)
        ActionOverride("ishaddud",MoveToPoint([3758.2946]))
        ActionOverride("ishaddud",SmallWait(8))
        ActionOverride("ishaddud",Face(SW))
        ActionOverride("ishaddud",SmallWait(8))
        ActionOverride("ishaddud",DisplayStringHead(Myself,54407))
        ActionOverride("ishaddud",PlaySound("TUTHH04"))
    
    This will make the shadow thief execute all the overrides given to him (first move, then wait, then face etc.), and the cutscene id won't need to bother with directing him any further. On the other hand, if those AOs had waits between them:
    ActionOverride("ishaddud",MoveToPoint([3758.2946]))
        Wait(1)
        ActionOverride("ishaddud",SmallWait(8))
    
    Then the thief would start moving to designated point, only to be overridden a second later with SmallWait(8), making him stop walking and do that instead.

    This is particularly useful if you have multiple non-unique actors (i.e. sharing DV aka scripting name) spawned and need them to follow complex instructions simultaneously. Best example that springs to mind is the looping BDCUT11A.BCS from SoD (initiated in BDCUT11.BCS), which spawns few random crusaders every second and makes them march across the screen.


    On the other hand, you may have a character ordered to walk away and then have them stop and turn back. While it's possible to time it perfectly, it's usually easier to just send them farther than they need to be and stop them in the middle with override action.

    RaduzielGusinda
  • jasteyjastey Member Posts: 1,011
    Interesting! Thank you very much for the explanations,

  • jasteyjastey Member Posts: 1,011
    The third tutorial, mainly dealing with interjection points and general reactions is on hold until after the next patch. Reason is here.

Sign In or Register to comment.