Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
phu54321 committed Jan 20, 2015
2 parents 30f8aed + 2975217 commit 1c4ec38
Show file tree
Hide file tree
Showing 19 changed files with 2,455 additions and 999 deletions.
Binary file modified Package/Plugins/TrigEditPlus.sdp
Binary file not shown.
Binary file removed Package/SciLexer.dll
Binary file not shown.
18 changes: 0 additions & 18 deletions Package/license_lua.txt

This file was deleted.

20 changes: 0 additions & 20 deletions Package/license_scintilla.txt

This file was deleted.

292 changes: 148 additions & 144 deletions Package/triggersyntax.txt
Original file line number Diff line number Diff line change
@@ -1,145 +1,149 @@
Trigger Syntax::

-- Anything after "--" in the line is comment. They are ignored.

Trigger {
players = {P1, P2, P8, P12, Force1, AllPlayers},
conditions = {

Disabled(Always()); -- Disable() disables condition.

CountdownTimer(Comparison, Time);
Command(Player, Comparison, Number, Unit);
Bring(Player, Comparison, Number, Unit, Location);
Accumulate(Player, Comparison, Number, ResourceType);
Kills(Player, Comparison, Number, Unit);
CommandMost(Unit);
CommandMostAt(Unit, Location);
MostKills(Unit);
HighestScore(ScoreType);
MostResources(ResourceType);
Switch(Switch, State);
ElapsedTime(Comparison, Time);
Briefing();
Opponents(Player, Comparison, Number);
Deaths(Player, Comparison, Number, Unit);
CommandLeast(Unit);
CommandLeastAt(Unit, Location);
LeastKills(Unit);
LowestScore(ScoreType);
LeastResources(ResourceType);
Score(Player, ScoreType, Comparison, Number);
Always();
Never();

-- 16 actions maximum
},
actions = {

Disabled(Victory()); -- Disable() disables action.

Victory();
Defeat();
PreserveTrigger();
Wait(Time);
PauseGame();
UnpauseGame();
Transmission(Unit, Where, WAVName, TimeModifier, Time, Text, AlwaysDisplay);
PlayWAV(WAVName);
DisplayText(Text, AlwaysDisplay);
CenterView(Where);
CreateUnitWithProperties(Count, Unit, Where, Player, Properties);
SetMissionObjectives(Text);
SetSwitch(Switch, State);
SetCountdownTimer(TimeModifier, Time);
RunAIScript(Script);
RunAIScriptAt(Script, Where);
LeaderBoardControl(Unit, Label);
LeaderBoardControlAt(Unit, Location, Label);
LeaderBoardResources(ResourceType, Label);
LeaderBoardKills(Unit, Label);
LeaderBoardScore(ScoreType, Label);
KillUnit(Unit, Player);
KillUnitAt(Count, Unit, Where, ForPlayer);
RemoveUnit(Unit, Player);
RemoveUnitAt(Count, Unit, Where, ForPlayer);
SetResources(Player, Modifier, Amount, ResourceType);
SetScore(Player, Modifier, Amount, ScoreType);
MinimapPing(Where);
TalkingPortrait(Unit, Time);
MuteUnitSpeech();
UnMuteUnitSpeech();
LeaderBoardComputerPlayers(State);
LeaderBoardGoalControl(Goal, Unit, Label);
LeaderBoardGoalControlAt(Goal, Unit, Location, Label);
LeaderBoardGoalResources(Goal, ResourceType, Label);
LeaderBoardGoalKills(Goal, Unit, Label);
LeaderBoardGoalScore(Goal, ScoreType, Label);
MoveLocation(Location, OnUnit, Owner, DestLocation);
MoveUnit(Count, UnitType, Owner, StartLocation, DestLocation);
LeaderBoardGreed(Goal);
SetNextScenario(ScenarioName);
SetDoodadState(State, Unit, Owner, Where);
SetInvincibility(State, Unit, Owner, Where);
CreateUnit(Number, Unit, Where, ForPlayer);
SetDeaths(Player, Modifier, Number, Unit);
Order(Unit, Owner, StartLocation, OrderType, DestLocation);
Comment(Text);
GiveUnits(Count, Unit, Owner, Where, NewOwner);
ModifyUnitHitPoints(Count, Unit, Owner, Where, Percent);
ModifyUnitEnergy(Count, Unit, Owner, Where, Percent);
ModifyUnitShields(Count, Unit, Owner, Where, Percent);
ModifyUnitResourceAmount(Count, Owner, Where, NewValue);
ModifyUnitHangarCount(Add, Count, Unit, Owner, Where);
PauseTimer();
UnpauseTimer();
Draw();
SetAllianceStatus(Player, Status);

-- 64 actions maximum
},
flag = {
actexec, -- Execute actions once without checking conditions.
preserved, -- Make trigger preserved. Acts like PreserveTrigger() action.
disabled, -- Make trigger disabled
},

starting_action = 3 -- Used in pair with actexec : Starting action.
-- This option is ignored for trigger without actexec flag.
}


Various constants:

============= =================================================================
Field Allowed constants
------------- -----------------------------------------------------------------
AllyStatus Enemy, Ally, AlliedVictory
Comparison AtLeast, AtMost, Exactly
Modifier SetTo, Add, Subtract
Order Move, Patrol, Attack
Player P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12,
CurrentPlayer, Foes, Allies, NeutralPlayers, AllPlayers,
Force1, Force2, Force3, Force4, NonAlliedVictoryPlayers
PropState Enable, Disable, Toggle
Resource Ore, Gas, OreAndGas
Score Total, Units, Buildings, UnitsAndBuildings, Kills, Razings,
KillsAndRazings, Custom
SwitchAction Set, Clear, Toggle, Random
SwitchState Set, Cleared
============= =================================================================



- 'Unit' field accepts unit name:

SetDeaths(P1, SetTo, 0, "Boss #1"); // Name of Terran Marine inside the map is "Boss #1".

- 'Location' field accepts location name.

- 'String' field accepts string.

- All field accepts numeric value:

SetDeaths(12345678, SetTo, 9101112, 13141);
Trigger Syntax
==============

TrigEditPlus works with lua code.
::

-- Anything after "--" in the line is comment. They are ignored.

Trigger {
players = {P1, P2, P8, P12, Force1, AllPlayers},
conditions = {

Disabled(Always()); -- Disable() disables condition.

CountdownTimer(Comparison, Time);
Command(Player, Comparison, Number, Unit);
Bring(Player, Comparison, Number, Unit, Location);
Accumulate(Player, Comparison, Number, ResourceType);
Kills(Player, Comparison, Number, Unit);
CommandMost(Unit);
CommandMostAt(Unit, Location);
MostKills(Unit);
HighestScore(ScoreType);
MostResources(ResourceType);
Switch(Switch, State);
ElapsedTime(Comparison, Time);
Briefing();
Opponents(Player, Comparison, Number);
Deaths(Player, Comparison, Number, Unit);
CommandLeast(Unit);
CommandLeastAt(Unit, Location);
LeastKills(Unit);
LowestScore(ScoreType);
LeastResources(ResourceType);
Score(Player, ScoreType, Comparison, Number);
Always();
Never();

-- 16 actions maximum
},
actions = {

Disabled(Victory()); -- Disable() disables action.

Victory();
Defeat();
PreserveTrigger();
Wait(Time);
PauseGame();
UnpauseGame();
Transmission(Unit, Where, WAVName, TimeModifier, Time, Text, AlwaysDisplay);
PlayWAV(WAVName);
DisplayText(Text, AlwaysDisplay);
CenterView(Where);
CreateUnitWithProperties(Count, Unit, Where, Player, Properties);
SetMissionObjectives(Text);
SetSwitch(Switch, State);
SetCountdownTimer(TimeModifier, Time);
RunAIScript(Script);
RunAIScriptAt(Script, Where);
LeaderBoardControl(Unit, Label);
LeaderBoardControlAt(Unit, Location, Label);
LeaderBoardResources(ResourceType, Label);
LeaderBoardKills(Unit, Label);
LeaderBoardScore(ScoreType, Label);
KillUnit(Unit, Player);
KillUnitAt(Count, Unit, Where, ForPlayer);
RemoveUnit(Unit, Player);
RemoveUnitAt(Count, Unit, Where, ForPlayer);
SetResources(Player, Modifier, Amount, ResourceType);
SetScore(Player, Modifier, Amount, ScoreType);
MinimapPing(Where);
TalkingPortrait(Unit, Time);
MuteUnitSpeech();
UnMuteUnitSpeech();
LeaderBoardComputerPlayers(State);
LeaderBoardGoalControl(Goal, Unit, Label);
LeaderBoardGoalControlAt(Goal, Unit, Location, Label);
LeaderBoardGoalResources(Goal, ResourceType, Label);
LeaderBoardGoalKills(Goal, Unit, Label);
LeaderBoardGoalScore(Goal, ScoreType, Label);
MoveLocation(Location, OnUnit, Owner, DestLocation);
MoveUnit(Count, UnitType, Owner, StartLocation, DestLocation);
LeaderBoardGreed(Goal);
SetNextScenario(ScenarioName);
SetDoodadState(State, Unit, Owner, Where);
SetInvincibility(State, Unit, Owner, Where);
CreateUnit(Number, Unit, Where, ForPlayer);
SetDeaths(Player, Modifier, Number, Unit);
Order(Unit, Owner, StartLocation, OrderType, DestLocation);
Comment(Text);
GiveUnits(Count, Unit, Owner, Where, NewOwner);
ModifyUnitHitPoints(Count, Unit, Owner, Where, Percent);
ModifyUnitEnergy(Count, Unit, Owner, Where, Percent);
ModifyUnitShields(Count, Unit, Owner, Where, Percent);
ModifyUnitResourceAmount(Count, Owner, Where, NewValue);
ModifyUnitHangarCount(Add, Count, Unit, Owner, Where);
PauseTimer();
UnpauseTimer();
Draw();
SetAllianceStatus(Player, Status);

-- 64 actions maximum
},
flag = {
actexec, -- Execute actions once without checking conditions.
preserved, -- Make trigger preserved. Acts like PreserveTrigger() action.
disabled, -- Make trigger disabled
},

starting_action = 3 -- Used in pair with actexec : Starting action.
-- This option is ignored for trigger without actexec flag.
}


Various constants:

============= =================================================================
Field Allowed constants
------------- -----------------------------------------------------------------
AllyStatus Enemy, Ally, AlliedVictory
Comparison AtLeast, AtMost, Exactly
Modifier SetTo, Add, Subtract
Order Move, Patrol, Attack
Player P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12,
CurrentPlayer, Foes, Allies, NeutralPlayers, AllPlayers,
Force1, Force2, Force3, Force4, NonAlliedVictoryPlayers
PropState Enable, Disable, Toggle
Resource Ore, Gas, OreAndGas
Score Total, Units, Buildings, UnitsAndBuildings, Kills, Razings,
KillsAndRazings, Custom
SwitchAction Set, Clear, Toggle, Random
SwitchState Set, Cleared
============= =================================================================



- 'Unit' field accepts unit name:

SetDeaths(P1, SetTo, 0, "Boss #1"); // Name of Terran Marine inside the map is "Boss #1".

- 'Location' field accepts location name.

- 'String' field accepts string.

- All field accepts numeric value:

SetDeaths(12345678, SetTo, 9101112, 13141);

Binary file modified Release/TrigEditPlus.sdp
Binary file not shown.
8 changes: 6 additions & 2 deletions TrigEditPlus/Editor/Encoder/basescript.lua
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,19 @@ end


function Transmission(Unit, Where, WAVName, TimeModifier, Time, Text, AlwaysDisplay)
if AlwaysDisplay == nil then AlwaysDisplay = 4 end
if AlwaysDisplay == nil then
AlwaysDisplay = 4
end

Unit = ParseUnit(Unit)
Where = ParseLocation(Where)
WAVName = ParseString(WAVName)
TimeModifier = ParseModifier(TimeModifier)
Text = ParseString(Text)
return Action(Where, Text, WAVName, Time, 0, 0, Unit, 7, TimeModifier, AlwaysDisplay)
return Action(Where, Text, WAVName, 0, 0, Time, Unit, 7, TimeModifier, AlwaysDisplay)
end

-- Location Text Wav TotDuration 0 DurationMod UnitType 7 NumericMod 20

function PlayWAV(WAVName)
WAVName = ParseString(WAVName)
Expand Down
7 changes: 6 additions & 1 deletion TrigEditPlus/Editor/LuaStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@

void ApplyEditorStyle(TriggerEditor* te) {
// Lua syntax highlighting
const char* luaKeywords =
"and break do else elseif end false for function if"
"in local nil not or repeat return then true until while";

te->SendSciMessage(SCI_SETLEXER, SCLEX_LUA, 0);
te->SendSciMessage(SCI_SETKEYWORDS, 0, (LPARAM)luaKeywords);

// Korean thing
te->SendSciMessage(SCI_SETCODEPAGE, 949, 0);
Expand Down Expand Up @@ -58,7 +63,7 @@ void ApplyEditorStyle(TriggerEditor* te) {
te->SendSciMessage(SCI_STYLESETFORE, 18, RGB(0x00, 0x00, 0x7F));
te->SendSciMessage(SCI_STYLESETFORE, 19, RGB(0x00, 0x00, 0x7F));
te->SendSciMessage(SCI_STYLESETFORE, 20, RGB(0x7F, 0x7F, 0x00));
te->SendSciMessage(SCI_STYLESETFORE, 32, RGB(0xCC, 0xCC, 0xCC));
te->SendSciMessage(SCI_STYLESETFORE, 32, RGB(0xA8, 0xA8, 0xA8)); // Fold line

te->SendSciMessage(SCI_STYLESETBACK, 1, RGB(0xD0, 0xF0, 0xF0));
te->SendSciMessage(SCI_STYLESETBACK, 8, RGB(0xE0, 0xFF, 0xFF));
Expand Down
Loading

0 comments on commit 1c4ec38

Please sign in to comment.