Tiled plugin

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Tiled plugin

#1 Post by yufra »

So I was taking another look at the Tiled plugin and think I found a potential bug. I think the " and \ characters both need to be escaped in Lua when not inside the double square brackets, and currently that is not robust. I want to change the multiple character handling to use the square brackets, for example:

Code: Select all

defineTile("\"\"", "GRASS", nil, nil, {random_filter={add_levels=5}})
...
return {
...
{[[$]],[[,]],[[,]],[[""]],[[""]],[[""]],[[""]],[[,]],[[,]],[[$]],},
{[[$]],[[$]],[[$]],[[$]],[[%]],[[$]],[[$]],[[$]],[[$]],[[$]],},}
The single character handling will be handled like this:

Code: Select all

defineTile("\"", "GRASS", nil, nil, {random_filter={add_levels=5}})
...
return [[
...
$,,"""",,$
$$$$&$$$$$]]
Does that seem ok?
<DarkGod> lets say it's intended

darkgod
Master of Eyal
Posts: 10750
Joined: Wed Jul 24, 2002 9:26 pm
Location: Angolwen
Contact:

Re: Tiled plugin

#2 Post by darkgod »

Sounds valid, you can use luac (which comes with lua) to test syntax validity BTW:
luac -p foo.lua
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)

yufra
Perspiring Physicist
Posts: 1332
Joined: Tue Jul 13, 2010 2:53 pm

Re: Tiled plugin

#3 Post by yufra »

Patch submitted.
<DarkGod> lets say it's intended

Post Reply