Skip to content

[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: 2,367
    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: 2,367
    That table does not get sorted, whatever position you specify is where it gets displayed.
    cmorgan
  • cmorgancmorgan Member Posts: 707
    Thank you!
Sign In or Register to comment.