I am totally taken up with an idea of an *ideal* trigger editor. What are one's expectations? What features are must for such an editor? Lets turn our imagination on. I want to share my thoughts and will imagine a trigger editor being a part of my favorite maps editor SCMD.
We are pushing mapmaking to the limit, aren't we? But when it comes to triggering one impacts considerable problems having their beginning in big amounts of information he is dealing with. As a result it is hard to manage and edit all that information.
Firstly, there are fierce indignations levelled at the lack of ability to organise triggers well. One can think of organising triggers using comments, the problem is comments eat up precious map resources, the string limit in particular. People want to organise their triggers without using up strings. Trigger comments are kind of external meta-information about triggers which is used throughout development process only. Moreover one can think of more complex ways of organising triggers unlike simple textual identification. One may wish to divide triggers on logical groups performing logically atomic task. Ususlly these groups are just solid blocks of triggers simply following one another, but there are cases when totally diversed triggers can make up a group and one trigger may be part of different groups. One may want to observe and manage these groups seperately. This is the place where now fashionable idea of labels or tags come in handly.
Since talk is considering trigger organization I should mention one more thing: naming objects. Let's take me for example. Sometimes I do want to use *different* names for the same objects. The reason I'm thinking of this object differently in several cases. Let's take a Terran Marine. Terran Marine is a unit, but I am using it as a death counter timer for players in my map and want to refer to him accordingly. Also I am using deaths of Terran Marine as a counter which holds progress of players for a computer, so I want to refer to him as a progress counter in this way. You can see that Terran Marine plays logically different roles and I dont want to mix them up. Moreover I might probably wish to change the timer death counter unit for players later, keeping the Terran Marine for the progress counter for computer. I can easily do this with global substitution (or something) when I have different names for logically diversed Terran Marine occurances.
The same thing concerns conditions and actions too. The most vidid example here might be EUD conditions. I wish to refer to an obscure EUD condition
Deaths(Player2, Exactly, 256, UnitID:1061) as to self explanatory EUDKeyPressedA(). Moreover when I want to check value at some adress I dont wish to calculate extended player value, but simply input the addres here like EUDCond1161(0x596A58, Exactly, 256). These are only EUD examples but I might want to mark out non EUD triggers as well. For example give self explanatory names for triggers working with my personal death counters like MyTimer(Add, 10), where 10 is not number of trigger loops but just time in game seconds.
Secondly, people have always invented tools to reduce the amount of tedious work. What I mean is that one may have a pattern of thousand triggers in his head but implementing all of those one by one is not a work for a white man. My imaginable trigger editor should contain abilities for easy triggers replication following one or another pattern the person might think of.
It becomes obvious all this meta information about triggers organisation should be stored somewhere. Of course, this might be a separate binary file which can be read only by the trigger editor program, but I have another solution. As far as SC map is actualy an MPQ archive we can store this info as a separate file inside of the map. One cant find a better place as the map itself! This file should be a text file written on a special language which allows to specify everything I discussed before. The file can be found inside MPQ for example: "\scmd\scenario.trigger".
The language should be designed the way to allow easy triggering for new users but also should give an opportunity for experienced mappers to specify advanced triggers. This could be achieved the next way: the language should allow to refer to the raw conditions and actions data of chk format specified in the wiki. It's *native* conditions and actions have the following form:
Code
RawCondition(dword, dword, dword, word, byte, byte, byte, byte, byte, byte)
RawAction(dword, dword, dword, dword, dword, dword, word, byte, byte, byte, byte, byte, byte)
RawAction(dword, dword, dword, dword, dword, dword, word, byte, byte, byte, byte, byte, byte)
But it's not handy to use them in that form. To achieve useability one can define new conditions and actions in some kind of *header files* stored along with the main triggers in the map's archive. There might be some kind of *standart* library with definitions of some standart triggers for new users. The best way to explain is to show an example of how it might work:
Code
enum Unit { TerranMarine, ZergZergling, ProtossZealot, ... }
enum Player {
Player1 = 0, Player2, Player3, Player4, Player5, Player6, Player7, Player8,
Player9, Player10, Player11, P12, Neutral = P12, ... }
enum NComp { AtLeast, AtMost, Exactly = 10 }
long offset1161 = 0x58A364
Location lHomeArea = 13
define RawCondition(dw1, dw2, dw3, w, b1, b2, b3, b4, ub5, ub6) Condition(dw1, dw2, dw3, w, b1, b2, b3, b4)
define RawAction(dw1, dw2, dw3, dw4, dw5, dw6, w, b1, b2, b3, ub4, ub5, ub6) Action(dw1, dw2, dw3, dw4, dw5, dw6, w, b1, b2, b3)
define Condition(0, 0, 0, 0, 0, 22, 0, 0) Always()
define Condition(0, p, qn, ut, c, 15, 0, 0) Deaths(Player p, NComp cmp, TUnit ut, long qn)
define Deaths((Player)(adress - offset1161)/4, cmp, 0, n) EUDCond1161(long adress, NComp cmp, long n)
define EUDCond1161(0x596A58, Exactly, 256) EUDKeyPressedA()
define Action(0, SID(text), 0, 0, 0, 0, u, 20, 0, 0) LeaderBoardKills(String text, Unit u)
define LeaderBoardKills(text, (Unit)(u+228)) LeaderBoardDeaths(String text, Unit u)
define Action(l, 0, 0, 0, p, s, u, 11, n, 0x08) CreateUnitWithProperties(Player p, Unit u, byte n, Location l, CUWPSlot s)
define CreateUnitWithProperties(p, u, n, l, s) CUWP(Player p, Unit u, byte n, LocationID l, CUWPSlot s)
Trigger {
Tags: "micro" "mysys"
Owners: Player1 Player11 Force2
Conditions:
Alwyays()
Actions:
CUWP(CurrentPlayer, TerranMarine, 12, LID("Home Area"), S16)
PreserveTrigger()
}
enum Player {
Player1 = 0, Player2, Player3, Player4, Player5, Player6, Player7, Player8,
Player9, Player10, Player11, P12, Neutral = P12, ... }
enum NComp { AtLeast, AtMost, Exactly = 10 }
long offset1161 = 0x58A364
Location lHomeArea = 13
define RawCondition(dw1, dw2, dw3, w, b1, b2, b3, b4, ub5, ub6) Condition(dw1, dw2, dw3, w, b1, b2, b3, b4)
define RawAction(dw1, dw2, dw3, dw4, dw5, dw6, w, b1, b2, b3, ub4, ub5, ub6) Action(dw1, dw2, dw3, dw4, dw5, dw6, w, b1, b2, b3)
define Condition(0, 0, 0, 0, 0, 22, 0, 0) Always()
define Condition(0, p, qn, ut, c, 15, 0, 0) Deaths(Player p, NComp cmp, TUnit ut, long qn)
define Deaths((Player)(adress - offset1161)/4, cmp, 0, n) EUDCond1161(long adress, NComp cmp, long n)
define EUDCond1161(0x596A58, Exactly, 256) EUDKeyPressedA()
define Action(0, SID(text), 0, 0, 0, 0, u, 20, 0, 0) LeaderBoardKills(String text, Unit u)
define LeaderBoardKills(text, (Unit)(u+228)) LeaderBoardDeaths(String text, Unit u)
define Action(l, 0, 0, 0, p, s, u, 11, n, 0x08) CreateUnitWithProperties(Player p, Unit u, byte n, Location l, CUWPSlot s)
define CreateUnitWithProperties(p, u, n, l, s) CUWP(Player p, Unit u, byte n, LocationID l, CUWPSlot s)
Trigger {
Tags: "micro" "mysys"
Owners: Player1 Player11 Force2
Conditions:
Alwyays()
Actions:
CUWP(CurrentPlayer, TerranMarine, 12, LID("Home Area"), S16)
PreserveTrigger()
}
I have not finally came up with a finished idea how this is working, but it seems that main features have already went into my head. Well actually I've not written even a half of what I have in my head. There is just too much to write! What I've written is just the main ideas. The idea is this is not a finished essay! You all can participate! I want to hear your opinions! Please tell me how do you like it, write your thoughts, suggestions, expectations! Let's imaginate together, who knows, probably some day this will become a reality!
Post has been edited 2 time(s), last time on Mar 5 2009, 2:03 pm by Wormer.
Some.