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!

[Modding BG2EE] using lua travel

cmorgancmorgan Member Posts: 707
Hello! I have a mod added area that shows up successfully in masterarea.2da, and NI and DLTCEP both show the related .wed and .tis files. I can access the area in-game.

I noticed that the lua console has a travel function - but my area does not show up there. Is there a way that I can patch that in, instead of manually setting up MoveToArea commands? It sure would speed up troubleshooting...

Comments

  • kjeronkjeron Member Posts: 1,775
    APPEND ~BGEE.LUA~ ~table.insert(%table%, {"AR####", "Name"} )~ Or copy your own "M_*.LUA~ file to override with the same:
    table.insert(%table%, {"AR####", "Name"} )
    %table% would be one of the following, depending on game:
    cheatAreas
    cheatAreasArena
    cheatAreasTutorial
    cheatAreasExpansion
    cheatAreasHoW

    cmorganGwendolyne
  • cmorgancmorgan Member Posts: 707
    Coooool... it looks like this wrapped in a GAME_IS means I could install this for BGEE BG2EE and EET for any user, and of course more importantly back it out when the mod is uninstalled. Thank you - I will try this out tomorrow morning!

  • cmorgancmorgan Member Posts: 707
    ...and @kjeron , it works beautifully - my area popped up there at the end and worked. I looked up lua and tried out this slight modification:

    /* add area to cheat console in BG2EE/EET for testing/jumping about */
    /* lua table operation: table.insert (table, [pos,] value) with default being n+1 at end */
    ACTION_IF GAME_IS ~bg2ee eet~ BEGIN
    APPEND ~BGEE.LUA~ ~table.insert(cheatAreas, 1, {"C-AR01", "The Broken Sword Inn"} )~
    END // of lua addition
    It looks like the list populated correctly - from your experience, tossing this at the front, lua automatically reorders the table, right? Or am I safest just adding to the bottom?

  • kjeronkjeron Member Posts: 1,775
    That table does not get sorted, whatever position you specify is where it gets displayed.

    cmorgan
Sign In or Register to comment.