|
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
|
01-01-2020
, 15:12
Re: Restoring entities from invalid single-player global states
|
#13
|
off.
Guys, have you any sample to mark entity be transitional?
Recentry, I tried to do something with "trigger_transition" for L4D game, however, without luck.
Spoiler
PHP Code:
int transi = CreateEntityByName("trigger_transition");
if (transi != -1)
{
int landmark = FindEntityByClassname(-1, "info_landmark");
if (landmark != -1)
{
char sLandName[64];
float vVecMin[3], vVecMax[3];
GetEntPropString(landmark, Prop_Data, "m_iName", sLandName, sizeof(sLandName));
GetEntPropVector(witch, Prop_Send, "m_vecOrigin", vVecMin);
GetEntPropVector(witch, Prop_Send, "m_vecMaxs", vVecMax);
vVecMin[0] -= 30.0;
vVecMin[1] -= 30.0;
vVecMin[2] -= 30.0;
vVecMax[0] += 30.0;
vVecMax[1] += 30.0;
vVecMax[2] += 30.0;
DispatchKeyValue(transi, "name", sLandName);
DispatchKeyValue(transi, "targetname", sLandName);
DispatchKeyValueVector(transi, "origin", pos);
DispatchKeyValueVector(transi, "angles", ang);
DispatchSpawn(transi);
ActivateEntity(transi);
TeleportEntity(transi, pos, ang, NULL_VECTOR);
SetEntPropVector(transi, Prop_Send, "m_vecMins", vVecMin);
SetEntPropVector(transi, Prop_Send, "m_vecMaxs", vVecMax);
SetEntProp(transi, Prop_Send, "m_nSolidType", 2);
SetEntProp(transi, Prop_Send, "m_fEffects", 32);
}
}
__________________
|
|
|
|