Ok, so I'm looking at this mapper. And I'll be honest, I haven't a clue how it works. I'm hoping to puzzle that out later. As I learn some Lua maybe in a month or so. I think the first step is to get triggers to feed this thing the necessary raw room information (and I can worry about fixing it later). I have working triggers that can capture room info for another project I had started prior to seeing this mapper. So... how do I adapt them for this?
<triggers>
<trigger
enabled="y"
lines_to_match="3"
keep_evaluating="y"
match="^([A-Za-z\'\,\- ]+)\n([^\n]*)\nThere are no obvious exits\.$"
multi_line="y"
regexp="y"
script="ProcessRoom0"
sequence="100"
>
</trigger>
<trigger
enabled="y"
lines_to_match="3"
keep_evaluating="y"
match="^([A-Za-z\'\,\- ]+)\n([^\n]*)\nThere (is|are) (\w+) (obvious exit|exits)\: (.[^\.]+)\.$"
multi_line="y"
regexp="y"
script="ProcessRoom1"
sequence="100"
>
</trigger>
<trigger
enabled="y"
lines_to_match="4"
keep_evaluating="y"
match="^([A-Za-z\'\,\- ]+)\n([^\n]*)\nThere (is|are) (\w+) (obvious exit|exits)\: (.[^\.]+)\n(.[^\.]+)\.$"
multi_line="y"
regexp="y"
script="ProcessRoom2"
sequence="100"
>
</trigger>
<trigger
enabled="y"
lines_to_match="5"
keep_evaluating="y"
match="^([A-Za-z\'\,\- ]+)\n([^\n]*)\nThere (is|are) (\w+) (obvious exit|exits)\: (.[^\.]+)\n(.[^\.]+)\n(.[^\.]+)\.$"
multi_line="y"
regexp="y"
script="ProcessRoom3"
sequence="100"
>
</trigger>
The old version is written in python, and I'll have to convert the specifics later. But here are those functions:
def ProcessRoom0(TriggerName, trig_line, wildcards):
ProcessRoom(str(wildcards[0]), str(wildcards[1]), 'There are no obvious exits.')
def ProcessRoom1(TriggerName, trig_line, wildcards):
ProcessRoom(str(wildcards[0]), str(wildcards[1]), str(wildcards[5]))
def ProcessRoom2(TriggerName, trig_line, wildcards):
ProcessRoom(str(wildcards[0]), str(wildcards[1]), str(wildcards[5])+str(wildcards[6]))
def ProcessRoom3(TriggerName, trig_line, wildcards):
ProcessRoom(str(wildcards[0]), str(wildcards[1]), str(wildcards[5])+str(wildcards[6])+str(wildcards[7]))
def ProcessRoom(tName, tDesc, tExits):
global gRoomName, gRoomDescription, gExitDescription
world.Note('Debug Note: Room Trigger Fired')
gRoomName = tName
gRoomDescription = tDesc
gExitDescription = tExits
ProcessText()
As you can expect I have further code that does all sorts of things to get these to be the same every time you go to a room (i.e. extract information that is character dependent/time of day dependent/etc...)
For now, I'd be ecstatic if I can get that working, the rest is a matter of me figuring out Lua enough to rewrite my python code. |