Commit d9a131aa authored by Mikleo's avatar Mikleo
Browse files

Add raiders battleroyale.

Fix uvs of platforms.
parent 01a91c00
Pipeline #12624 passed with stages
in 20 seconds
......@@ -10,7 +10,7 @@
#include <SteamWorks>
#define PluginVersion "1.37"
#define PluginVersion "1.38"
float pVersion;
// note linearmap field is unstable
......@@ -904,16 +904,18 @@ public OnClientPutInServer(int client)
}
public OnClientDisconnect(int client)
{
// release grab before clearing selected entities. relys on selected.
if(grabbedEntity[client] != -1)
{
Release_Grab(client);
}
if(selectedEntities[client] != null)
{
DeselectAllEntities(client);
delete selectedEntities[client];
selectedEntities[client] = null;
}
if(grabbedEntity[client] != -1)
{
Release_Grab(client);
}
}
......@@ -1047,7 +1049,8 @@ public Action Command_Action(int client,int args)
if(!GetCmdArg(1, arg, sizeof(arg)))
{
PrintToChat(client,"Options: flag,respoint, rax, armory, vf, radar, rs, ml, mg,ref ,wall, ammocrate, healthcrate, spawnpoint, vehicle,preset, buildable, static, physics");
PrintToChat(client,"Options: flag,respoint, rax, armory, vf, vehicle, prefab, static and more. See console for all options...");
PrintToConsole(client,"\nCreate Options\n__________\n flag \n respoint \n rax \n ref \n vf \n vehicle \n prefab \n static \n radar \n rs \n ml \n mg \n armory \n wall \n ammocrate \n healthcrate \n spawnpoint \n buildable \n physics \n playerclip \n ______ \n");
return Plugin_Handled;
}
float angles[3] = {0.0,0.0,0.0};
......@@ -1129,6 +1132,10 @@ public Action Command_Action(int client,int args)
{
createdEntity = Create_Prop(true,client,position,angles);
}
else if(StrEqual(arg,"playerclip",false))
{
createdEntity = Create_Brush("playerclip","trigger_brush",client,position,angles);
}
else
{
PrintToChat(client,"%s is not a recognised entity, Options: flag,respoint, rax, armory, vf, radar, rs, ml, mg,ref ,wall, ammocrate, healthcrate,vehicle, buildable, static",arg);
......@@ -1222,6 +1229,49 @@ public Action Command_Action(int client,int args)
}
int Create_Brush(char[] name, char[] className,int client,float position[3], float angles[3])
{
char arg[32];
if(!GetCmdArg(2 , arg, sizeof(arg)))
{
PrintToChat(client,"please specify a size, eg. /create %s 200",name);
return -2;
}
float size = StringToFloat(arg);
// first get size
int entindex = CreateEntityByName(className);
// Enable handles first before entity is added.
EnableHandles();
DispatchSpawn(entindex);
TeleportEntity(entindex, position,angles , NULL_VECTOR);
ActivateEntity(entindex);
ConfigureBrushSimple(entindex,size);
if(StrEqual(name,"playerclip",false))
{
// only affect playermovement.
SetEntProp(entindex,Prop_Data,"m_CollisionGroup",8);
// try making this volumetric.
SetEntProp(entindex,Prop_Data,"m_usSolidFlags",0x0020);
}
return entindex;
}
int Create_Prop(bool physprop, int client,float position[3], float angles[3])
{
......@@ -1275,7 +1325,10 @@ int Create_Prop(bool physprop, int client,float position[3], float angles[3])
if(physprop)
entindex = CreateEntityByName("prop_physics_override");
else
{
entindex = CreateEntityByName("prop_dynamic_override");
}
DispatchKeyValue(entindex, "model", model);
......@@ -1662,7 +1715,8 @@ bool BaseSpawnPrefab(int client,char[] presetName,bool isVehicle,float position[
}
else
{
bool iterate = kv.JumpToKey("0",false);
// should only jump to keys not values.
bool iterate = kv.GotoFirstSubKey(true);
do
{
......@@ -2069,9 +2123,9 @@ public Action Edit_Entity(int client, int entity,float position[3],bool editExis
float min = -max;
char output[32];
Format(output,sizeof(output),"%f %f %f",min,min,min);
Format(output,sizeof(output),"%f %f 0",min,min,min);
kv.SetString("mins",output);
Format(output,sizeof(output),"%f %f %f",max,max,max);
Format(output,sizeof(output),"%f %f %f",max,max,max * 2);
kv.SetString("maxs",output);
setKey = true;
}
......@@ -2708,6 +2762,7 @@ public Action Copy_Entity(int client,int entity, float position[3])
selectedEnt = CloneEntity(selectedEnt,className,entityPos,timeID);
SwitchSelection(client,i,selectedEnt);
OnCustomEntityCreated(selectedEnt);
}
if(selectedEntities[client].Length > 0)
{
......@@ -2833,8 +2888,12 @@ public void Release_Grab(int client)
selectedEnt = RespawnEntity(selectedEnt,className);
// we have to add the entity at this exact index.
AddToSelection(client,selectedEnt,i);
}
// reorient brush handle.
UpdateBrushHandleSize(selectedEnt,classInfo);
}
......@@ -2897,7 +2956,6 @@ public Action Grab_Entity(int client,int entity,float position[3], bool report)
}
if(!grabBasic[client])
{
// create a template entity and parent all items to that template
grabbedEntity[client] = CreateEntityByName("prop_dynamic");
DispatchKeyValue(grabbedEntity[client],"model", "models/seagull.mdl");
......@@ -2908,7 +2966,7 @@ public Action Grab_Entity(int client,int entity,float position[3], bool report)
TeleportEntity(grabbedEntity[client], position,mainAng , NULL_VECTOR);
DispatchSpawn(grabbedEntity[client]);
SetEntPropFloat(grabbedEntity[client], Prop_Data, "m_flModelScale", 0.1);
SetEntPropFloat(grabbedEntity[client], Prop_Data, "m_flModelScale", 0.01);
}
......@@ -3235,6 +3293,39 @@ public int Create_Resource_Point(int client,int args,float position[3], float an
return entindex;
}
void ConfigureBrushSimple(int entindex, float size)
{
size /= 2.0;
float mins[3];
float maxs[3];
mins[0] = -size;
mins[1] = -size;
mins[2] = 0.0;
maxs[0] = size;
maxs[1] = size;
maxs[2] = size * 2;
ConfigureBrush(entindex,mins,maxs);
}
void ConfigureBrush(int entindex, float mins[3],float maxs[3])
{
SetEntityModel(entindex, "models/nf/buildings/armory/nf_armory.mdl");
SetEntProp(entindex, Prop_Send, "m_nSolidType", 2);
new enteffects = GetEntProp(entindex, Prop_Send, "m_fEffects");
enteffects |= 32;
SetEntProp(entindex, Prop_Send, "m_fEffects", enteffects);
SetEntPropVector(entindex, Prop_Send, "m_vecMins", mins);
SetEntPropVector(entindex, Prop_Send, "m_vecMaxs", maxs);
}
public int Create_Flag(int client,int args,float position[3], float angles[3])
{
......@@ -3411,23 +3502,11 @@ public int Create_Flag(int client,int args,float position[3], float angles[3])
TeleportEntity(entindex, position, NULL_VECTOR, NULL_VECTOR);
new Float:minbounds[3] = {-120.0, -120.0, 0.0};
new Float:maxbounds[3] = {120.0, 120.0, 200.0};
SetEntPropVector(entindex, Prop_Send, "m_vecMins", minbounds);
SetEntPropVector(entindex, Prop_Send, "m_vecMaxs", maxbounds);
SetEntityModel(entindex, "models/nf/buildings/armory/nf_armory.mdl");
SetEntProp(entindex, Prop_Send, "m_nSolidType", 2);
new enteffects = GetEntProp(entindex, Prop_Send, "m_fEffects");
enteffects |= 32;
SetEntProp(entindex, Prop_Send, "m_fEffects", enteffects);
ConfigureBrushSimple(entindex,240.0);
OnCustomEntityCreated(entindex);
// spawns
if(isSpawnLocation)
......@@ -5044,14 +5123,8 @@ RestoreEntity(int entity,KeyValues kv,any[] classInfo ,char[] className)
float maxs[3];
kv.GetVector("mins",mins);
kv.GetVector("maxs",maxs);
SetEntPropVector(entity, Prop_Send, "m_vecMins", mins);
SetEntPropVector(entity, Prop_Send, "m_vecMaxs", maxs);
SetEntityModel(entity, "models/nf/buildings/armory/nf_armory.mdl");
SetEntProp(entity, Prop_Send, "m_nSolidType", 2);
new enteffects = GetEntProp(entity, Prop_Send, "m_fEffects");
enteffects |= 32;
SetEntProp(entity, Prop_Send, "m_fEffects", enteffects);
ConfigureBrush(entity,mins,maxs);
}
......@@ -5069,6 +5142,7 @@ RestoreEntity(int entity,KeyValues kv,any[] classInfo ,char[] className)
AcceptEntityInput(entity,"DisableDrawInFastReflection");
}
else if(StrEqual(className,"prop_physics",true) )
......@@ -5800,8 +5874,8 @@ public Action Command_Enable_Editor(int client, int args)
{
return Plugin_Handled;
}
ServerCommand("sv_specaccelerate 0");
if(!EU_HasGameStarted())
ServerCommand("sv_specaccelerate 0");
CreateTimer(1.0,Timer_Reticle,client,TIMER_REPEAT);
FakeClientCommand(client,"sm_editorinfo");
......@@ -7037,6 +7111,13 @@ void OnCustomEntityCreated(int entity)
{
GetOrAddHammerID(entity);
CreateTimer(0.1,Timer_AfterEntityCreated,entity);
}
public Action Timer_AfterEntityCreated(Handle timer,int entity)
{
// add handle after so we can get the absolute position.
char className[64];
any classInfo[classdataenum];
GetEntityClassname(entity, className, sizeof(className));
......@@ -7044,8 +7125,6 @@ void OnCustomEntityCreated(int entity)
{
AddHandle(entity,classInfo);
}
}
public void LoadEntData()
......@@ -7307,6 +7386,9 @@ public Action Command_Handles(int client, int args)
public void EnableHandles()
{
if(EU_HasGameStarted())
return;
if(displayHandles == true)
return;
......@@ -7339,21 +7421,25 @@ public void EnableHandles()
}
void UpdateBrushHandleSize(int entity,any[] classInfo)
void UpdateBrushHandleSize(int entity,any[] classInfo, int handle = -1)
{
if(!displayHandles)
return;
int handle = FindEntityHandle(entity);
if(handle == -1)
handle = FindEntityHandle(entity);
if(handle != -1 && classInfo[data_isBrushEntity])
{
float min[3];
float max[3];
GetEntPropVector(entity, Prop_Send, "m_vecMins", min);
GetEntPropVector(entity, Prop_Send, "m_vecMaxs", max);
// set same size
// set same size
float angles[3];
GetEntPropVector(entity, Prop_Data, "m_angAbsRotation", angles);
if(max[0] + min[0] <10.0 && max[1] + min[1] <10.0)
......@@ -7364,7 +7450,7 @@ void UpdateBrushHandleSize(int entity,any[] classInfo)
}
else
{
SetEntPropFloat(handle, Prop_Data, "m_flModelScale", 0.002);
SetEntPropFloat(handle, Prop_Data, "m_flModelScale", 0.0025);
for(int i = 0;i<3;i++)
{
......@@ -7377,12 +7463,14 @@ void UpdateBrushHandleSize(int entity,any[] classInfo)
SetEntPropVector(handle, Prop_Send, "m_vecMins", min);
SetEntPropVector(handle, Prop_Send, "m_vecMaxs", max);
float zeroVector[3];
zeroVector[0] = 0.0;
zeroVector[1] = 0.0;
zeroVector[2] = 0.0;
// doesent work, aiming to zero rotation
TeleportEntity(handle,NULL_VECTOR,zeroVector,NULL_VECTOR);
for(int i = 0;i<3;i++)
{
// reverse the rotation of the object to maintain axis alignment
angles[i] = -angles[i];
}
TeleportEntity(handle,NULL_VECTOR,angles,NULL_VECTOR);
}
......@@ -7411,7 +7499,11 @@ public void AddHandle(int target,any[] classInfo)
if(BreakArg(tempcolor,arg,sizeof(arg),argIndex))
g = StringToInt(arg);
if(BreakArg(tempcolor,arg,sizeof(arg),argIndex))
b = StringToInt(arg);
b = StringToInt(arg);
r += GetRandomInt(-20,20);
g += GetRandomInt(-20,20);
b += GetRandomInt(-20,20);
int entindex = CreateEntityByName("prop_dynamic_override");
......@@ -7427,9 +7519,11 @@ public void AddHandle(int target,any[] classInfo)
// set solid to 2 aabb
DispatchKeyValue(entindex, "solid", "2");
DispatchKeyValue(entindex, "skin", "12");
DispatchKeyValue(entindex, "skin", "10");
DispatchKeyValue(entindex, "effects", "80");
// need to disable the vphysics for this entity. moves stuff.
}
else
{
......@@ -7450,7 +7544,7 @@ public void AddHandle(int target,any[] classInfo)
float origin[3];
float angles[3];
// need abs origin.
GetEntPropVector( target, Prop_Data, "m_vecAbsOrigin", origin );
GetEntPropVector(target, Prop_Data, "m_angRotation", angles);
......@@ -7467,6 +7561,7 @@ public void AddHandle(int target,any[] classInfo)
DispatchSpawn(entindex);
ActivateEntity(entindex);
// set parent to the target
SetVariantString("!activator");
AcceptEntityInput(entindex, "SetParent", target);
......@@ -7479,11 +7574,14 @@ public void AddHandle(int target,any[] classInfo)
SetEntityRenderMode(entindex, RENDER_TRANSCOLOR);
SetEntityRenderColor(entindex, r, g, b,220);
SetEntityRenderColor(entindex, r, g, b,230);
// prevent vphysics colliding with
SetEntProp(entindex,Prop_Data,"m_CollisionGroup",13);
if(classInfo[data_isBrushEntity])
UpdateBrushHandleSize(target,classInfo);
UpdateBrushHandleSize(target,classInfo,entindex);
}
// its simpler to use find rather than entity refs.
......
// Do Not Edit this File. It will be overriden. Use custom_modelshortcuts instead.
"ModelShortcuts"
{
"cube"
"cube4"
{
"model" "models/empfun/cube4.mdl"
}
"handle2"
{
"model" "models/props_junk/cardboard_box001a.mdl"
}
"platform1"
{
"model" "models/empfun/platform2.mdl"
"model" "models/empfun/platform2b.mdl"
}
"platform2"
{
"model" "models/empfun/platform4.mdl"
"model" "models/empfun/platform4b.mdl"
}
"platform3"
{
"model" "models/empfun/platform8.mdl"
"model" "models/empfun/platform8b.mdl"
}
"be_crate1"
{
"model" "models/imperial/props/imp_crate1.mdl"
......
// this file will be overriden. create a seperate file if needed.
"Resources"
{
"models/empfun/platform2.dx80.vtx" "file"
"models/empfun/platform2.dx90.vtx" "file"
"models/empfun/platform2.mdl" "file"
"models/empfun/platform2.phy" "file"
"models/empfun/platform2.vvd" "file"
"models/empfun/platform4.dx80.vtx" "file"
"models/empfun/platform4.dx90.vtx" "file"
"models/empfun/platform4.mdl" "file"
"models/empfun/platform4.phy" "file"
"models/empfun/platform4.vvd" "file"
"models/empfun/platform8.dx80.vtx" "file"
"models/empfun/platform8.dx90.vtx" "file"
"models/empfun/platform8.mdl" "file"
"models/empfun/platform8.phy" "file"
"models/empfun/platform8.vvd" "file"
"models/empfun/platform2b.dx80.vtx" "file"
"models/empfun/platform2b.dx90.vtx" "file"
"models/empfun/platform2b.mdl" "file"
"models/empfun/platform2b.phy" "file"
"models/empfun/platform2b.vvd" "file"
"models/empfun/platform4b.dx80.vtx" "file"
"models/empfun/platform4b.dx90.vtx" "file"
"models/empfun/platform4b.mdl" "file"
"models/empfun/platform4b.phy" "file"
"models/empfun/platform4b.vvd" "file"
"models/empfun/platform8b.dx80.vtx" "file"
"models/empfun/platform8b.dx90.vtx" "file"
"models/empfun/platform8b.mdl" "file"
"models/empfun/platform8b.phy" "file"
"models/empfun/platform8b.vvd" "file"
"models/empfun/cube4.dx80.vtx" "file"
"models/empfun/cube4.dx90.vtx" "file"
"models/empfun/cube4.mdl" "file"
......
......@@ -8,7 +8,7 @@
"$float_ShrinkSpeed" "50"
"i_BlockArty" "OnCommand *emp_comm_research 34* Handle -> PrintToTarget *Artillery tanks are disabled in this scenario*"
"i_BlockArty" "OnCommand *emp_comm_research 36* Handle -> PrintToTarget *Artillery tanks are disabled in this scenario*"
"i_StartingTimer" "TextTimer -1 *$string_MainText* _ BRTimer"
"s_StartTimer" "Run WaitTimer"
......
......@@ -22,7 +22,6 @@
"$int_WaitTime" "240"
"$int_ShrinkTime" "30"
"$float_ShrinkSpeed" "50"
"i_BlockArty" "OnCommand *emp_comm_research 34* Handle -> PrintToTarget *Artillery tanks are disabled in this scenario*"
"i_StartingTimer" "TextTimer -1 *$string_MainText* _ BRTimer"
"s_StartTimer" "Run WaitTimer"
"s_Enable_hurts" "TargetNameAll ~KillZone_hurt -> Input Enable"
......
This diff is collapsed.
......@@ -1353,6 +1353,34 @@
}
}
"trigger_brush"
{
"extend" "brush"
"version" "1.37"
"customOnly" "1"
"handleOnly" "1"
"fields"
{
"CollisionGroup"
{
"prop" "m_CollisionGroup"
"type" "int"
"propType" "data"
"postSpawn" "true"
"defaultValue" "0"
}
"SolidFlags"
{
"prop" "m_usSolidFlags"
"type" "int"
"propType" "data"
"postSpawn" "true"
"defaultValue" "0"
}
}
}
"emp_info_params"
{
"extend" "entity"
......
......@@ -4,7 +4,7 @@
{
"Version"
{
"Latest" "1.37"
"Latest" "1.38"
}
}
......@@ -46,6 +46,8 @@
"Plugin" "Path_Mod/scenarios/emp_temple/mik_kingofthehill.snr"
"Plugin" "Path_Mod/scenarios/emp_temple/votelist_base.txt"
"Plugin" "Path_Mod/scenarios/emp_raiders/mik_battleroyale.snr"
"Plugin" "Path_Mod/scenarios/emp_highpass/mik_ctf.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