Commit 393f0763 authored by Mikleo's avatar Mikleo

--

parent 40952bf7
Pipeline #9873 passed with stages
in 22 seconds
......@@ -10,7 +10,7 @@
#include <SteamWorks>
#define PluginVersion "1.13"
#define PluginVersion "1.14"
float pVersion;
// note linearmap field is unstable
......@@ -4737,6 +4737,7 @@ RestoreEntity(int entity,KeyValues kv,any[] classInfo ,char[] className)
// any brush entities
if(classInfo[data_isBrushEntity])
{
float mins[3];
float maxs[3];
kv.GetVector("mins",mins);
......
......@@ -50,7 +50,7 @@ void Funcs_OnPluginStart()
AddCommand("After",AfterCommand,2);
AddCommand("Every",EveryCommand,2);
AddCommand("Input",InputCommand,3);
AddCommand("OnOutput",OnOutputCommand,3);
AddCommand("HookOutput",HookOutputCommand,3);
AddCommand("ChatText",ChatTextCommand,3);
AddCommand("HudText",HudTextCommand,5);
AddCommand("TextTimer",TextTimerCommand,6);
......@@ -241,6 +241,7 @@ bool LoadScript(char[] scriptname,int entRef)
{
KeyValues kv = currentScenarioKV;
kv.Rewind();
bool found = false;
if(kv.JumpToKey("Scripts"))
{
char buffer[400];
......@@ -251,11 +252,12 @@ bool LoadScript(char[] scriptname,int entRef)
ReplaceString(buffer, 400, "*", "\"", false);
RunEntityFunctionInternal(entRef,buffer);
return true;
found = true;
}
}
kv.Rewind();
return false;
return found;
}
bool HasScript(char[] scriptname)
......@@ -317,33 +319,24 @@ RunEntityFunctionInternal(int entRef,char[] funcString)
if(!funcString[0])
return;
int findIndex = StrContains(funcString, " -> ");
int remainingStart;
if(findIndex == -1)
{
// should be at null character.
remainingStart = strlen(funcString);
findIndex = remainingStart + 1;
}
else
{
remainingStart = findIndex + 4;
funcString[findIndex] = '\0';
}
// cut off the funcString at this point.
funcString[findIndex] = '\0';
//char args[400];
//strcopy(args,findIndex,funcString);
int argIndex;
......@@ -624,7 +617,7 @@ public int InputCommand(int entity,char[] args,char[] remainder)
}
public int OnOutputCommand(int entity,char[] args,char[] remainder)
public int HookOutputCommand(int entity,char[] args,char[] remainder)
{
int argIndex;
char arg1[32];
......@@ -632,9 +625,14 @@ public int OnOutputCommand(int entity,char[] args,char[] remainder)
{
char className[64];
GetEntityClassname(entity, className, sizeof(className));
PrintToServer("Hooking output %s %s", arg1,className);
HookSingleEntityOutput(entity,arg1,OnOutput_Hook);
// do a userIdentifier as well.
char callIdentifier[64];
BreakArg(args,callIdentifier,sizeof(callIdentifier),argIndex);
// do a userIdentifier as well.
char userIdentifier[64];
BreakArg(args,userIdentifier,sizeof(userIdentifier),argIndex);
......@@ -647,16 +645,13 @@ public int OnOutputCommand(int entity,char[] args,char[] remainder)
targetActivator = 1;
}
CreateCommand(entity,INVALID_HANDLE,OnOutput_Close,remainder,userIdentifier,arg1,targetActivator);
return -1;
}
else
{
return entity;
CreateCommand(entity,INVALID_HANDLE,OnOutput_Close,callIdentifier,userIdentifier,arg1,targetActivator);
}
return entity;
}
public void OnOutput_Hook(const char[] output, int caller, int activator, float delay)
{
int entRef = EntIndexToEntRef(caller);
......@@ -671,7 +666,8 @@ public void OnOutput_Hook(const char[] output, int caller, int activator, float
if(commandTrack.intSlot1 == 1)
ent = activator;
RunEntityFunctionInternal(ent,commandTrack.remainder);
LoadScript(commandTrack.remainder,ent);
}
}
// find the commands associated with this caller and output
......@@ -888,7 +884,7 @@ public Action Timer_TextTimer(Handle timer,DataPack dataPack1)
DataPackPos packPos = GetPackPosition(dataPack1);
int time = ReadPackCell(dataPack1);
if(EU_HasGameStarted())
if(EU_HasGameStarted() && time != -1)
time --;
char timeString[8];
FormatSeconds(time,timeString,sizeof(timeString));
......@@ -911,7 +907,7 @@ public Action Timer_TextTimer(Handle timer,DataPack dataPack1)
int r = 150;
int g = 150;
int b = 150;
if(time < 100)
if(time < 100 && time >= 0)
{
r += (100 - time);
if(time < 60)
......@@ -1249,6 +1245,7 @@ public int CancelCommand(int entity,char[] args,char[] remainder)
{
commands.GetArray(j,commandTrack);
if(commandTrack.index != -1 && StrEqual(commandTrack.userIdentifier,identifier,false))
{
// only apply to current entity if it has an ENT_ prefix.
......@@ -1332,7 +1329,6 @@ public int HookCommand(int entity,char[] args,char[] remainder)
BreakArg(commandString,firstCommand,sizeof(firstCommand),first);
AddCommandListener(Command_OnCommandHook,firstCommand);
PrintToServer("hooking %s",commandString);
int handleCommand = 0;
char blockCommand[32];
BreakArg(args,blockCommand,sizeof(blockCommand),argIndex);
......
......@@ -9,9 +9,9 @@
"OnScenarioLoaded" "Run Introduction Introduction2 Setup BlockArty"
"Introduction" "After 60 -> ChatText *Gen. Strickland:TXTCLR_DF Listen up, the artifact in the ruins will provide us an enormous technological advantage in the war to come* *Gen. Mendez:TXTCLR_DF Intel has detected an artifact in the south east ruins with enormous strategic value* **"
"Introduction2" "After 65 -> ChatText *Gen. Strickland:TXTCLR_DF Our objective is clear, defend the artifact at any cost.* *Gen. Mendez:TXTCLR_DF Our objective is clear, destroy the artifact at any cost.* **"
"Setup" "TargetName artifact -> AddDamageFilter NoTeamDamage -> Run ObjectiveTimer DestroyTrigger"
"Setup" "TargetName artifact -> AddDamageFilter NoTeamDamage -> HookOutput OnBreak NFVictory -> Run ObjectiveTimer"
"ObjectiveTimer" "TextTimer 1200 *Defend The Artifact\TIME_LEFT $[m_iHealth]HP* *Destroy The Artifact\TIME_LEFT $[m_iHealth]HP* -> TargetParams -> Input InputNFWin 0 EndActivator"
"DestroyTrigger" "OnOutput OnBreak -> TargetParams -> Input InputImpWin 0 EndActivator"
"NFVictory" "TargetParams -> Input InputImpWin 0 EndActivator"
"BlockArty" "OnCommand *emp_comm_research 34* Handle -> PrintToTarget *Artillery tanks are disabled in this scenario*"
"OnGameStart" "Run Warning AirStrikeExec1 AirStrikeExec2 SmartIdeas AirStrikeExec3"
"Warning" "After 600 -> ChatText *Gen. Strickland:TXTCLR_DF Intel has revealed that the enemy are planning airstrikes on key buildings at our location. Don't take any defences for granted!* *Gen. Mendez:TXTCLR_DF Be alert, We have allied bombers in the area which will deliver precision airstrikes on enemy targets* **"
......
This diff is collapsed.
......@@ -17,6 +17,13 @@
"tags_override" "-"
"description_override" "-"
}
"mik_kingofthehill"
{
"min_players" "0"
"max_players" "64"
"tags_override" "-"
"description_override" "-"
}
}
"enabled" "1"
}
......@@ -311,6 +311,10 @@
"type" "vector"
"postSpawn" "true"
}
"effects"
{
"ignore" "true"
}
}
}
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "1.13"
"Latest" "1.14"
}
}
......@@ -28,6 +28,7 @@
"Plugin" "Path_Mod/scenarios/emp_duststorm/mik_flags.snr"
"Plugin" "Path_Mod/scenarios/emp_duststorm/mik_artifact.snr"
"Plugin" "Path_Mod/scenarios/emp_duststorm/mik_kingofthehill.snr"
"Plugin" "Path_Mod/scenarios/emp_duststorm/votelist_base.txt"
"Plugin" "Path_Mod/scenarios/emp_palmbay/mik_boats.snr"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment