|
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: Mon Nov 02, 2009 8:50 pm
[3.12] help with #THREAD |
Hi all
I have a script that is supposed to capture maps as the one below:
Code: |
<MAPSTART>
---------------
#.# #.# #!# #.#|
--- --- |
|#!#| |#!#|
--- --- |
#!# <.# #!# ###|
--- -------
|#.#|
| |
|#.#|
<MAPEND>
|
I have the following script to capture this:
#TRIGGER {^~<MAPSTART~>} {
#THREAD mapcapture {
#T+ MapCapture2
#GAG
}}
#TRIGGER MapCapture2 {(*)} {#CAP maps}
#TRIGGER MapCapture1 {^\<MAPEND\>} {
#T- MapCapture2
#GAG
}
When I move slowly, it's fine... mostly, when I move quicker, the capturing gets messed up. It doesn't stop capturing at MAPEND, or it won't always capture the entier map. I've tried having #GAG before #T- MapCapture2 and such, but no difference.
When it doesn't stop capturing, it captures everything (of course) until the map shows up again, then (hopefully it stops)...
How can I make it work properly? I'm really trying to learn to use the #THREAD command, would really appreciate the help.
Thanks alot!
//DanteX |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Nov 03, 2009 12:30 am |
I don't see where #THREAD would be necessary here, but what I would do is use a two-state trigger:
#trigger "tMapCap" {<MAPSTART>} {#gagspace}
#condition {(*)} {#if (%1 != "<MAPEND>") {#capture maps} {#state tMapCap 0};#gagspace} |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: Tue Nov 03, 2009 7:09 am |
Hi Matt
First, thanks for showing me this cool new feature that I didn't know existed, I'll get the hang on it soon...
I've implemented it, and it only seems to fire once, which is on the <MAPSTART> line and the following 1 line, the other lines seem to be ignored. So it's not capturing anything except the line with the gagged <MAPSTART>.
With regards
//DanteX |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Tue Nov 03, 2009 1:41 pm |
Multistate triggers are not new. I believe they existed under Zmud (am I misremembering?)
Try this variation:
Code: |
#trigger "tMapCap" {<MAPSTART>} {#gagspace}
#condition {(*)} {#if (%1 != "<MAPEND>") {#capture maps;#state tMapCap 1} {#state tMapCap 0};#gagspace}
|
|
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Tue Nov 03, 2009 1:54 pm |
Make it easier on yourself, really.
See: http://textsnip.com/49f273
for my automap.
Charneus
Edited to put correct URL link. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Tue Nov 03, 2009 7:31 pm |
I forgot to specify the #condition as manual. Not sure that this absolutely matters, but I use the same trigger and it works flawlessly.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
DanteX Apprentice
Joined: 13 Aug 2007 Posts: 166
|
Posted: Tue Nov 03, 2009 8:49 pm |
Thanks for the help people!
Charneus: I tried your script and I felt that it ran slowly, making my CMUD run slower than with my old one.
Matt: your script works ok, runs with ok speed and in the same way as mine... I'm giving up the #THREAD in my old script...
Thanks alot for all the help and input.
//DanteX |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Tue Nov 03, 2009 9:39 pm |
Weird that it makes your CMUD run slowly. Mine runs pretty quickly, honestly, and that is with over 1600 triggers in the package...
Oh well. At least you got it to work! That is what is most important! :D
Charneus |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Wed Nov 04, 2009 6:09 pm |
Yes, making the condition Manual does make the difference. If it is set to Manual, it will not change state automatically, it has to be done manually, with the #state command.
|
|
|
|
|
|