Staredit Network > Forums > SC1 Mapping Tools > Topic: MacroTriggers production thread
MacroTriggers production thread
May 16 2008, 10:36 pm
By: Wormer
Pages: < 1 « 9 10 11 12 1315 >
 

Sep 28 2009, 9:43 am The Starport Post #201



Yeah it's definitely not hard. Even easier when you know how to code your own language parser instead of scripting bindings.

Of course, you'll need to wrap your brain around some programmatic concepts to do that. The main reason I like Wormers' is simply because, being written expressly for triggers, it requires the least "learning" of any comprehensive macro option; if you get the basic idea of trigedit, and you understand some simple stuff like variables and loops, you're set to do 90% of anything you could ever want.


If I can arse myself to do another map after my current set, I may try using a full-fledged scripting approach for a while and see if that level of power does indeed pay off when put to use.



None.

Sep 28 2009, 10:10 am Falkoner Post #202



I'm pretty much fluent in C++, I have enough programming experience to do that, that's not the problem, I just don't want to open up another project that could take an unknown amount of time.



None.

Sep 28 2009, 10:48 am The Starport Post #203



Well, if you want a reference, it only took me 2 and a half days to make a decent set of bindings in Javascript. I probably could have squeezed that into a single day (or less), if I were more efficient.

If you were to make something you'd want to release publicly, though, you'd want to allocate a week's worth of time. Alternatively, you could try to polish it as you work on a map project with it simultaneously. I'd be interested to see how something like that would turn out.



None.

Sep 29 2009, 6:17 pm poiuy_qwert Post #204

PyMS and ProTRG developer

Well I started to make a Python script which would make it quite easy to write triggers in Python code somewhat like MacroTriggers does, but with all of the power of Python. A very basic example would be:
Code
Trigger(Player1, Player2)
Always()
PreserveTrigger()

Which shows you don't need to do any extraneous syntax to make triggers. A more advanced example which easily makes your hyper triggers:
Code
for n in range(3):
 Trigger(AllPlayers)
 Always()
 for x in range(63):
   Wait(0)
 PreserveTrigger()

Another nifty thing is that the Triggers, Conditions, and Actions are all objects that can be easily accessed in any way you would like. For example, if you want to define your hyper triggers at the top of the code but still want them at the end of the trigger list, you can do:
Code
t = Trigger(AllPlayers, add=False)
Always()
for x in range(63):
 Wait(0)
PreserveTrigger()
...
other triggers
...
for x in range(3):
 t.addTrigger()

So in the code i made one trigger object (but told it not to add it to the trigger list with add=False) then defined its conditions and actions, then at the end I added the trigger to the trigger list 3 times (instead of making three different objects with the same conditions and actions).

So since Wormer has said he doesn't plan to fully support MacroTriggers anymore, is anyone interested in this?

Edit: Is there somewhere I can find the keywords etc. of SCMDraft triggers? Thats all i would really need to finish the project.

Post has been edited 2 time(s), last time on Sep 29 2009, 8:16 pm by poiuy_qwert.




Sep 29 2009, 8:23 pm The Starport Post #205



Those are useful features. If I start any new projects, I might give it a shot to see how much use I can make of scripting language features with triggers.


Hmm. All this discussion is making me think I should try finishing my trigger editor after all...

Post has been edited 3 time(s), last time on Sep 29 2009, 8:40 pm by Tuxedo-Templar. Reason: fucking typo



None.

Sep 30 2009, 1:13 am Falkoner Post #206



Ah yeah, I forgot to mention that little thing, I major reason I want to use MacroTriggers is the autocompletion and such in Notepad++, just the documentation for it makes it so much easier.



None.

Sep 30 2009, 7:14 am Wormer Post #207



Alright,
Quote from Falkoner
Hmm, it still seems like line breaks inside of a string should be converted to the linebreak character SCM Draft uses.
I personally don't hold adhere to the opinion. Most general programming languages don't allow linebreaks inside of strings, neither does MT. I believe the code formatting and it's essence must not influence each other in any way.

Quote from Falkoner
Wormer, within 2 weeks I'll finish up doing small test maps and I'm going to begin work on my actual map, so I'd really appreciate it if you fixed up any bugs, or inconveniences, I don't mind doing workarounds, but if you're going to fix it, I'd rather you did it now, instead of me learning it one way then having it get fixed.
Okay Falk, there are no crucial bugs I know of. I'll try to fix any revealed essential bugs as fast as I can, though at the moment I don't mind fixing something which has admissible workarounds, namely 1) @AllPlayers not being acceptable as trigger owner (defining "FORCE AllPlayers = @F('All Players')" works perfect) and 2) defining local variables in loops (workaround is to introduce "IF @True THEN ... ENDIF" for the local scope).

Further, I am sorry Falky, but I really don't know when I am going to implement such new features as the customizable conditions and LOOP/IF-statements inside of triggers. Such changes will have extremely spontaneous nature, it might be done during the next month, during the next year or not be done ever, with all variants being equally feasible.

That way, my personal suggestion for you is to start the map and don't rely on the fickle circumstances. Look, if you accomplish the map with the features available and then a new feature will appear don't be upset - your map would be done at least, but if you'll wait for the new features you're very risking not to accomplish the map ever.



Well poiuy_qwert, this nifty thing with the defining the trigger before it's usage might sound nice and funny and everything, but what is it's real use in real triggering? I can't think when and why one would want to define some trigger before it's usage? As a side note, you can achieve the same effect defining a macros in MT.

Then, I personally don't like saving up a couple of words omitting keywords "Actions" and "Conditions". This makes triggers less visual which matters a lot in large projects.

Quote from poiuy_qwert
So since Wormer has said he doesn't plan to fully support MacroTriggers anymore, is anyone interested in this?
I want to be clearly understood. I do support MT but I don't develop it at the moment.

Quote from poiuy_qwert
Is there somewhere I can find the keywords etc. of SCMDraft triggers? Thats all i would really need to finish the project.
There is a list of actions and conditions coming with the SCMD distribution (the file "trigedit help.txt"). What else do you need?



Some.

Sep 30 2009, 12:43 pm poiuy_qwert Post #208

PyMS and ProTRG developer

Quote from Wormer
Well poiuy_qwert, this nifty thing with the defining the trigger before it's usage might sound nice and funny and everything, but what is it's real use in real triggering? I can't think when and why one would want to define some trigger before it's usage? As a side note, you can achieve the same effect defining a macros in MT.
This was just an example to show that Triggers, Conditions, and Actions are just basic Python objects which can be treated as such. Its not the best example.

Quote from Wormer
Then, I personally don't like saving up a couple of words omitting keywords "Actions" and "Conditions". This makes triggers less visual which matters a lot in large projects.
It is pure Python so I can't just add in my own keywords/blocks. If it was really needed a comments and even a useless if could be used for formatting:
Code
Trigger(Player1)
# Conditions:
Always()
# Actions:
PreserveTrigger()

# For this trigger Conditions and Actions are global variables set to True
Triggers(Player2)
if Conditions:
    Always()
if Actions:
    PreserveTrigger()


Quote from Wormer
Quote from poiuy_qwert
So since Wormer has said he doesn't plan to fully support MacroTriggers anymore, is anyone interested in this?
I want to be clearly understood. I do support MT but I don't develop it at the moment.
Ah, my mistake.

Quote from Wormer
Quote from poiuy_qwert
Is there somewhere I can find the keywords etc. of SCMDraft triggers? Thats all i would really need to finish the project.
There is a list of actions and conditions coming with the SCMD distribution (the file "trigedit help.txt"). What else do you need?
I just need Keywords as in the valid argument settings. So things like "At least", "At most", "ore and gas", etc. I finished all the types that are present in the conditions (when I got access to a Windows comp) but I need the left overs that are only in actions.

Post has been edited 1 time(s), last time on Sep 30 2009, 8:00 pm by poiuy_qwert.




Oct 11 2009, 6:32 pm l)ark_ssj9kevin Post #209

Just here for the activity... well not really

I already use NP++, and Macro Trigger's color scheme clashes badly with my skin. (I can't what I'm editing without highlighting :( )
Under style configurator, what language is it?



guy lifting weight (animated smiley):

O-IC
OI-C

"Oh, I see it"


Oct 11 2009, 9:22 pm Wormer Post #210



In NP++ go View -> User Define Dialog...
Choose mtrigger under the User Language box.
Adjust colors you wish.



Some.

Oct 12 2009, 5:15 pm Falkoner Post #211



You should replace the Unused Units list in Tuxlar's Information with this one:
Collapsable Box


That's a list of all units that can't be killed in game, so basically any unit that you can use for Death Counts without any fear of them being killed.



None.

Oct 12 2009, 7:38 pm Wormer Post #212



Can Khalis and Uraj crystals (powerups) be killed?



Some.

Oct 12 2009, 8:37 pm Falkoner Post #213



Donno, maybe I missed a few :ermm:



None.

Nov 4 2009, 9:32 pm NothingZ Post #214



Hey everyone,
Is there a way to randomize 64 different possibilities using switches, while for each one of the many possible outcomes contain a different "create unit" trigger by using arrays?

I've been stuck trying to figure this out for a while, so help would be greatly appreciated. :)



None.

Nov 4 2009, 9:41 pm The Starport Post #215



You can easily map an array to individual fields of a trigger action, but you cannot map conditions or actions to individual triggers. Wormer hasn't implemented the ability to treat conditions, actions, or whole triggers as data.



None.

Nov 4 2009, 9:52 pm NothingZ Post #216



I am afraid I was unable to comprehend what you were suggesting.
Does that mean I can place a "FOR" syntax JUST for the condition and another "FOR" syntax just for the action parts of a trigger?
If not, please correct me, and add a few examples if you have the time.



None.

Nov 4 2009, 11:42 pm Wormer Post #217



NothingZ, this is the example you need.
64 = 2^6, hence q=6 and you're using 6 switches instead of 8 in the provided example.

Afterwards, if I understand right, you need the replicated trigger to contain the action CreateUnit(m, u, p, l), but each time with different parameters. The simplest (in terms of understandability) way (or if each outcome is completely individual) is to make an array of 64 elements for each 'changeable' parameter m, u, p and l: CreateUnit(m[n], u[n], p[n], l[n]).



Some.

Nov 8 2009, 12:19 am Falkoner Post #218



NothingZ, I wouldn't even do it that way, I would use single switch randomization to get your number, and THEN you could use MacroTriggers to create the outcomes if necessary.



None.

Nov 8 2009, 6:26 pm Wormer Post #219



Falkoner, actually using direct switches randomization requires less triggers and hence is more effective.



Some.

Nov 8 2009, 7:37 pm Falkoner Post #220



Quote
Falkoner, actually using direct switches randomization requires less triggers and hence is more effective.

Depends on what you're going for, also, using switches becomes impossible when you require numbers any more than 65536 outcomes, I mainly like it because it's easier to work with, but the main advantage of it is if you need a non-binary amount(can be done by using larger numbers and dividing it up), or if you want multiple outcomes within a range to have the same outcome.



None.

Options
Pages: < 1 « 9 10 11 12 1315 >
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[02:26 pm]
UndeadStar -- Vrael, since the ad messages get removed, you look like a total madman for someone that come late
[2024-5-02. : 1:19 pm]
Vrael -- IM GONNA MANUFACTURE SOME SPORTBALL EQUIPMENT WHERE THE SUN DONT SHINE BOY
[2024-5-02. : 1:35 am]
Ultraviolet -- Vrael
Vrael shouted: NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
Gonna put deez sportballs in your mouth
[2024-5-01. : 1:24 pm]
Vrael -- NEED SOME SPORTBALL> WE GOT YOUR SPORTBALL EQUIPMENT MANUFACTURING
[2024-4-30. : 5:08 pm]
Oh_Man -- https://youtu.be/lGxUOgfmUCQ
[2024-4-30. : 7:43 am]
NudeRaider -- Vrael
Vrael shouted: if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
Yeah I'm not a big fan of Westernhagen either, Fanta vier much better! But they didn't drop the lyrics that fit the situation. Farty: Ich bin wieder hier; nobody: in meinem Revier; Me: war nie wirklich weg
[2024-4-29. : 6:36 pm]
RIVE -- Nah, I'm still on Orange Box.
[2024-4-29. : 4:36 pm]
Oh_Man -- anyone play Outside the Box yet? it was a fun time
[2024-4-29. : 12:52 pm]
Vrael -- if you're gonna link that shit at least link some quality shit: https://www.youtube.com/watch?v=uUV3KvnvT-w
[2024-4-29. : 11:17 am]
Zycorax -- :wob:
Please log in to shout.


Members Online: UndeadStar, Enfie