www.ClassicTW.com
http://classictw.com/

Triggers in SWATH
http://classictw.com/viewtopic.php?f=15&t=35202
Page 1 of 1

Author:  Lionmane [ Mon Feb 19, 2018 10:18 am ]
Post subject:  Triggers in SWATH

I really enjoy triggers in SWATH. But there's one particular trigger that I have a problem getting to work.

When I create a trigger for the text "Probe Destroyed!" and assign a .wav file to play, it doesn't work. I also noticed that when I turn off ANSI graphics in the Computer menu and try again, it STILL doesn't work!?

Is there a way to use "Probe Destroyed!" with a SWATH trigger? Or is there a better solution? What does "better" mean?

Author:  LoneStar [ Mon Feb 19, 2018 11:12 pm ]
Post subject:  Re: Triggers in SWATH

Works on my Swath. So, I wonder if you understand what 'ProbeDestroyed' means(?) ....it means your probe hit a fig'd sector and was destroyed by the enemy fighter.

In case you're not aware:

ProbeSelfdestructs - means it reached it's destination and blowed itself up, real good.

ProbeEnteredSector - a probe entered the sector you're currently in, likely passes through --beit enemy or friendly

YouDestroyedProbe - iirc, means one of your fighters destroyed an enemy probe

..and of course the last bit of advice I can think of is: make sure your volume is up (!muted) 8)

Author:  Lionmane [ Tue Feb 20, 2018 8:07 am ]
Post subject:  Re: Triggers in SWATH

Ok, I got it to work.

Apparently, the script trigger doesn't accept special characters (exclamation point, etc.) This is why I was able to get it working with everything else except for this.

Thanks!

Author:  Lionmane [ Wed Feb 21, 2018 8:25 am ]
Post subject:  Re: Triggers in SWATH

How do I set a trigger to send these key commands?

$z

Edit: Whoops! I got it!? Create a Macro from the Macro menu and then assign a trigger to it. So I create two of the same triggers with a .wav file on one and my "Stop Script" macro on the other.

Author:  Deign [ Wed Feb 21, 2018 8:59 am ]
Post subject:  Re: Triggers in SWATH

First off, instead of creating your trigger on Game Text String you can set your trigger on the SWATH Event "ProbeDestroyed". This seems a lot cleaner and likely more efficient since Swath is throwing this event anyway.

If you want to send the text, first define a macro for "$Z" or whatever you want and choose the Action for that trigger to send your macro. If you want it to send the macro and also play the .wav file then you will probably have to write yourself a script to do both those things and launch that from your trigger.

Author:  Lionmane [ Wed Feb 21, 2018 10:57 am ]
Post subject:  Re: Triggers in SWATH

I wasn't familiar with the SWATH events. How do I define those?

Defining two separate triggers using the same text string works, so I assume two triggers with the same SWATH event will work also...?

Edit: Wow! SWATH events! Awesome! I still haven't tested multiple triggers for the same event, yet... But, wow!

Edit2: AND you can do BOTH the SWATH event trigger for ProbeDestroyed and the text string Probe Destroyed if you want to stop your scripts AND play a sound! Or you can do two text strings! Or you can do two SWATH events! Lol!

Author:  Deign [ Wed Feb 21, 2018 7:42 pm ]
Post subject:  Re: Triggers in SWATH

Well, I was only referring to the existing Swath events that are available in the Edit | Trigger List | Add dialogue where you can choose a "SWATH event" as opposed to what I assumed you had used, a "Game text string" which you designated as "Probe Destroyed". There are a number of events already available in the Java API, as well as a UserDefinedEvent class which you can extend to create your own events, but this is getting into deep stuff.

I think your idea of creating multiple triggers off the same event is a very clever alternative to my suggestion.

Author:  Lionmane [ Thu Feb 22, 2018 7:35 am ]
Post subject:  Re: Triggers in SWATH

Deign wrote:
...but this is getting into deep stuff.


Lol! I know what that means: late nights sitting in front of the computer! The same reason I'm avoiding scripting! Lol!

Thanks!

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/