Staredit Network > Forums > SC1 Mapping Tools > Topic: YATAPI - Python friendly API for trigger generation
YATAPI - Python friendly API for trigger generation
Feb 28 2019, 12:45 am
By: sethmachine  

Feb 28 2019, 12:45 am sethmachine Post #1



Hi everyone,

I have created a Python API to generate TrigEdit style triggers that can be copy and pasted into SCMDraft called YATAPI (Yet Another Trigger API).

Please see the GitHub repo for full information: https://github.com/sethmachine/yatapi

Yet Another Trigger API (YATAPI) is a Python based generator of SCMDraft TrigEdit triggers featuring type annotations, autocompletion (with a Python IDE) one-to-one correspondence with TrigEdit triggers, and object oriented programming design. YATAPI is designed to work with PyCharm, a modern Python IDE, and requires only basic Python scripting knowledge and how Starcraft Triggers work. YATAPI is minimalist and extensible, and can be used as the base for more advanced triggering. Since YATAPI is a whitebox--it has a one-to-one correspondence with Starcraft Triggers, there is no need to learn a new specialized triggering language or framework.

I am aware there are numerous other tools and frameworks that accomplish this and more. However, none of them were able to meet my development needs. In particular being easily usable in a modern IDE like PyCharm and easy to understand. It also appears many of the macro triggers projects aren't active anymore. I have a table in the GitHub repo README.md comparing YATAPI to other tools according to the dimensions I needed for my projects.

Note YATAPI does not add new triggers or features, just an OOP interface to easily and verifiably generate triggers in large numbers. YATAPI does not add new syntactic sugar or useful features like death counter management. I believe these could be developed in another Python based project that builds upon YATAPI (as a dependency).

YATAPI is not complete and most obviously is missing some Actions and Conditions. I encourage anyone to contribute to this open source project who is interested!



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:42 pm]
pallfy -- use bgh
[10:40 pm]
pallfy -- Wow thanks
[10:18 pm]
Suicidal Insanity -- On game start you could detect who is at which start location, store that in switches / dcs, and use that to permanently force alliances. Lots of combinations though
[09:43 pm]
MTiger156 -- That 2v2v2v2 mapping problem does sound like an interesting challenge. Its worth putting some experimentation into. I could make an example map for combining locked alliances (based on lobby forces) + random start location. Though an EUD solution would be the most efficient, I will avoid that for the sake of simplicity.
[08:53 pm]
NudeRaider -- *compromises
[08:52 pm]
NudeRaider -- pallfy
pallfy shouted: thanks, but that sounds complicated
well, that's the gist of sc mapping. Either accept the limits sc sets for you and work within those parameters, or get creative and find complicated solutions to achieve what you want. The latter can be most satisfying. Sometimes comprised are inevitable though. Also see my respnse in the thread.
[08:13 pm]
pallfy -- thanks, but that sounds complicated
[08:13 pm]
pallfy -- hey raider
[2019-3-21. : 7:18 am]
NudeRaider -- FaRTy1billion
FaRTy1billion shouted: also ya, I showed her my chair wasn't scary and now whenever I'm not in the chair she is
hard to believe that they are predators with almost no enemies in the wild
[2019-3-21. : 7:17 am]
NudeRaider -- Suicidal Insanity obviously francis
Please log in to shout.


Members Online: Roy, C(a)HeK, Zenmaster