(resolved) Issue with wallset identifiers

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Gambit37
Should eat more pies
Posts: 13154
Joined: 31-May-00 11:57
Location: Location, Location
Contact:

(resolved) Issue with wallset identifiers

Post by Gambit37 » 11-Oct-18 16:28

This works:

Code: Select all

dsb_alt_wallset(wallset.wallwriting_style1, lev, x, y, d)
but this doesn't:

Code: Select all

wallwriting_style = "wallwriting_style1"
dsb_alt_wallset(wallset[wallwriting_style], lev, x, y, d)
I'm not sure what I'm doing wrong in the second example?

User avatar
Sophia
Concise and Honest
Posts: 3951
Joined: 12-Sep-02 19:50
Location: Nowhere in particular
Contact:

Re: Issue with wallset identifiers

Post by Sophia » 11-Oct-18 17:37

I think you'll need to post more code. The result of what you posted should be identical so something else is going wrong.

User avatar
Gambit37
Should eat more pies
Posts: 13154
Joined: 31-May-00 11:57
Location: Location, Location
Contact:

Re: Issue with wallset identifiers

Post by Gambit37 » 11-Oct-18 17:45

Gah, sorry, silly mistake. The above code was simplified and not exactly what I had written in my function.

Turns out I'd defined a variable in an (if..then) as local, so it never got returned to the rest of the function... feel free to delete this thread!

Post Reply