Oreo Triggers, A new trigger preprocessor
Post #1
Kaias
Jun 2 2012, 9:22 am
|
![]() Oreo triggers is an SCMDraft trigger preprocessor that runs on php. More than a macro-triggerer, it adds modularity, intuitive triggering, EUD and Deathcounter support, helps you manage your resources and allows for custom built actions and conditions. ( It doesn't let you do anything you couldn't already do in Scmdraft, it just helps you do it more easily. ) Note about php: If I had started with what this project ended up being in mind (and if I had planned to release it to people) I wouldn't've used php. As it happens, I originally started this as a simple preprocessor for Wormer's Macrotriggers (to add another layer of abstraction), which, at that level php was a natural choice. As it stands, however, php is great for people just being introduced to programming as it is a loosely typed language. To use Oreo triggers, you'll have to familiarize yourself with the php syntax (or at least, how it's used in Oreo triggers). Just so you have a better idea of what this is before I go on, here's an example of what triggers might look like using Oreo triggers: Installation and Usage 1. Install/Setup Oreos package
4. Visit your project in a web browser to generate the triggers
Using Mint After some collaboration with yoonkwun (thanks yoonkwun), we developed an extension called 'Mint', which lets you write triggers to your map merely by compiling. With Mint enabled, you no longer have to copy/paste the generated text into Scmdraft, the triggers are added for you. This also gives you the ability to generate units and locations to your map within Oreo trigs. (Mint is not a separate download, its included in the Oreos package, and is completely optional). To use mint, you must provide a path to your input file and an output file path to the Mint() function. Ex: ![]() Mint takes your input map file and adds the triggers Oreo generates to it. Your input map should not have the triggers in it. There are few reasons we do it this way instead of overwriting the triggers onto the original file- it protects your map from the off chance that it gets corrupted, it keeps the triggers units and locations (made by OT) from being added to your map multiple times, and it makes it so that you don't have to reload the map in Scmdraft after compiling. Your typical work flow would go like this- keep the original/input map open in Scmdraft (for making physical changes to the map, like terran, units, sprites) and oreo triggers in whatever IDE your using (for making changes to the triggers). Whenever you make a change to the map in either Scmdraft or in Oreo Trigs, you recompile OT and the changes will appear in the output map. When you test in Starcraft, you test with your output map file (where all the physical map and triggers are combined). To create a preplaced unit or location to the map using Mint Oreos, simply use these functions: ![]() Download Latest: http://www.mediafire.com/?g7gg4is0zynm69k (0.9.6) http://www.mediafire.com/?krvtr5chehnigyh (0.9.5) http://www.mediafire.com/?ip3vukvy2v49dkn (0.9.4) http://www.mediafire.com/?s9ff64op5c9dbjl (0.9.3) http://www.mediafire.com/?5f52tuh0okxau39 (0.9.2) http://www.mediafire.com/?8ku895s94z745t2 (0.9.1) http://www.mediafire.com/?314bqvc3dww5mle (0.9.0) http://www.mediafire.com/?i2ge65z9fpa8lof (0.8.5) http://www.mediafire.com/?6w1uk4idger78ex (0.8.4) http://www.mediafire.com/?ybhdc5xcspu2bgz (0.8.3) http://www.mediafire.com/?e8do8gta41kud7e (0.8.2) http://www.mediafire.com/?z82q778izt50i4s (0.8.1) http://www.mediafire.com/?06kqb8050gk1458 (0.8) Creating triggers Every oreo trigger begins with a player object which must be defined before the trigger. Player objects can hold any number of players. Example of creating new Player object (we're naming ours $Players): $Players = new Player("Player 1", "Player 2", "Player 3");Any trigger created with the player object you define will be owned by the players you specified when you created it. There are 4 ways to start a trigger: Version History
Other Remarks There are more classes I haven't touched and much more to tell, but it's late I'm tired of writing and I'm eager to release. Special thanks to Lethal Illusion for volunteering to do the Deathcounter math functions, the EUD classes and helping me test. More thanks: Roy, Yoonkwun, Farty1Billion for EUD work, Wormer for Macrotriggers documentation, and R1SKED911 for ever existing. Remember, it's still in beta stage. Feel free to rifle through the code and change things to your liking (I recommend putting any additions you might make to a separate document and then just including them onto the proper page). Also feel free to contribute and make this thing even better. This post was edited 19 times, last edit by Kaias: Nov 16 2012, 11:02 pm. ![]() ![]() ![]() ![]() ![]() ![]() |
Post #3
Jack[RCDF
Jun 2 2012, 10:15 am
|
Skin to bone, steel to rust, ash to ashes, dust to dust.
|
Very nice, I'll have to try this out and see if I can get the hang of it in time for the 1 week contest.
![]() ![]() ![]() ![]() ![]() ![]() Red classic. I have mostly left SEN except for the Temple Siege 2 forum (hidden to most of you). I am available via PM still, and Skype as JackRCDF. If it is important to you, you will find a way. Otherwise, you will find an excuse. -Unknown Magnificent! Perhaps you shouldn't be on SEN as much, too... Better than the iPad! |
Post #6
Jack[RCDF
Jun 2 2012, 8:44 pm
|
Skin to bone, steel to rust, ash to ashes, dust to dust.
|
With the deathcounters, does it automatically assign DCs? It seems so from your example code, but that would presumably interfere with any pre-selected DCs you might have in an existing map if you were copying and pasting just one trigger system, for example.
![]() ![]() ![]() ![]() ![]() ![]() Red classic. I have mostly left SEN except for the Temple Siege 2 forum (hidden to most of you). I am available via PM still, and Skype as JackRCDF. If it is important to you, you will find a way. Otherwise, you will find an excuse. -Unknown Magnificent! Perhaps you shouldn't be on SEN as much, too... Better than the iPad! |
Post #7
Lethal_Illusion
Jun 2 2012, 11:29 pm
Post #8
Jack[RCDF
Jun 3 2012, 1:29 am
|
Skin to bone, steel to rust, ash to ashes, dust to dust.
|
What is the empty value at the end of each trigger?
Code''); EDIT On your tutorial, you may want to add that you need to be running the server executable to be able to run the .php script. And that you need to hit the Compile button in SCMDraft. Most people will work that out anyway but it's worth noting. ![]() ![]() ![]() ![]() ![]() ![]() Red classic. I have mostly left SEN except for the Temple Siege 2 forum (hidden to most of you). I am available via PM still, and Skype as JackRCDF. If it is important to you, you will find a way. Otherwise, you will find an excuse. -Unknown Magnificent! Perhaps you shouldn't be on SEN as much, too... Better than the iPad! |
Post #10
samsizzle!
Jun 3 2012, 10:00 pm
Post #11
Kaias
Jun 3 2012, 10:34 pm
|
If you're using 'require_once("Oreo/initialize.php");' to initialize the oreos package then your project file needs to be in the same directory as the Oreo folder (but not in the Oreo folder). If you want to put your projects in a different folder you'll need to change the path to find it properly.
"Oreo/initialize.php" is a relative path. You can make an absolute path like this: require_once($_SERVER['DOCUMENT_ROOT']."/Oreo/initialize.php"); which would point to htdocs/Oreo/initialize.php. You'd then be able to put your project anywhere in htdocs. ![]() ![]() ![]() ![]() ![]() ![]() |
Post #13
Kaias
Jun 8 2012, 2:11 am
|
New Update 0.8.2:
Download Link: http://www.mediafire.com/?e8do8gta41kud7e Next: After gathering some opinions I'm going to make it so using Player objects in conditions treats it as though it were a force. For instance: Bring( $players, 'Terran Marine', AtLeast, 1, 'Anywhere' ) (Where $players is a player object) will act like this: "If any of the players in $players bring at least 1 Marine to Anywhere then..." as opposed to "If all of the players in $players bring at least 1 Marine to Anywhere then..." This post was edited 1 time, last edit by Kaias: Jun 8 2012, 2:21 am. ![]() ![]() ![]() ![]() ![]() ![]() |
Post #15
Kaias
Jun 8 2012, 10:24 pm
|
New Update
Download Link: http://www.mediafire.com/?6w1uk4idger78ex This post was edited 1 time, last edit by Kaias: Jun 9 2012, 7:27 am. ![]() ![]() ![]() ![]() ![]() ![]() |
Post #17
Kaias
Jun 13 2012, 1:48 am
|
@Jack
It's a capitalization issue Change location('_p1Range'); to be Location('_p1Range'); It seems that my version of PHP is less picky than yours (it didn't mind the capitalization issue). By the way, I use PhpStorm as an IDE. I didn't like it at first because of how certain things worked and how ugly it was, but it is extremely configurable so I've been able to fix all my reservations (including the ugliness) and its better for Php than anything else I've used. ![]() ![]() ![]() ![]() ![]() ![]() |
Post #18
Jack[RCDF
Jun 13 2012, 1:52 am
|
Skin to bone, steel to rust, ash to ashes, dust to dust.
|
Excellent, that worked. Thanks for your help!
I'm using Notepad++ at the moment, it's nice and minimalist, and quick to load. ![]() ![]() ![]() ![]() ![]() ![]() Red classic. I have mostly left SEN except for the Temple Siege 2 forum (hidden to most of you). I am available via PM still, and Skype as JackRCDF. If it is important to you, you will find a way. Otherwise, you will find an excuse. -Unknown Magnificent! Perhaps you shouldn't be on SEN as much, too... Better than the iPad! |
Post #19
Kaias
Jun 13 2012, 2:33 am
|
I prefer PhpStorm primarily because it has good code hinting and error detection. So when you forget a comma or a parenthesis you know right away and when you want to use the Bring function it tells you exactly what its expecting. Using Notepad++ is indeed a great minimalist environment, however.
By the way, a location name like "_p1Range" screams poor triggering practice. Instead of dedicating a _p1Range location to the hero, I would use a general purpose location that's the same size and just center it on the hero when needed (assuming you're using the way I think you are). ![]() ![]() ![]() ![]() ![]() ![]() |
Post #20
Jack[RCDF
Jun 13 2012, 2:36 am
|
Skin to bone, steel to rust, ash to ashes, dust to dust.
|
Yeah I was just making a quick map to see how well Oreo works, I wasn't worried about location reuse and such. In a proper map I would be.
Also, http://templesiege.com/test1.php was generated via Oreo Triggers, it works pretty well might be a few errors in it but I'm happy with how quick it is and how it works. Thanks very much for making this Kaias. ![]() ![]() ![]() ![]() ![]() ![]() Red classic. I have mostly left SEN except for the Temple Siege 2 forum (hidden to most of you). I am available via PM still, and Skype as JackRCDF. If it is important to you, you will find a way. Otherwise, you will find an excuse. -Unknown Magnificent! Perhaps you shouldn't be on SEN as much, too... Better than the iPad! |
0 members in this topic (italic members are currently writing a reply): None
+ guest(s)
+ guest(s)
[07:25 pm]
[07:25 pm]
[07:25 pm]
[04:22 pm]
[03:04 pm]
[03:04 pm]
[02:25 pm]








might be a few errors in it but I'm happy with how quick it is and how it works. Thanks very much for making this Kaias. ![[close]](/images/up.gif)