Eh, I tried setting HighestUpgradeLevel and UpgradeLevel to 3 during player_builtobject, but it didn't change my dispenser or teleporters in such a way that you can upgrade them to level 4. And infact, I couldn't make them level 4 by setting UpgradeLevel.
I tried making a level 4 minisentry too, but haven't tried it on normal sentry yet.
I also tried making a stock to instantly change a building to level 3 [to use during player_objbuild while the building is still in the "isbuilding state"].
PHP Code:
stock InstantBuild(iBuilding, TFObjectType:iObject)
{
SetEntProp(iBuilding, Prop_Send, "m_bBuilding", 0, 2);
SetEntProp(iBuilding, Prop_Send, "m_bClientSideFrameReset", 0, 2);
SetEntPropFloat(iBuilding, Prop_Send, "m_flPercentageConstructed", 1.0);
SetEntPropFloat(iBuilding, Prop_Send, "m_flPlaybackRate", 0.0);
SetEntProp(iBuilding, Prop_Send, "m_iState", 1, 1);
SetEntProp(iBuilding, Prop_Send, "m_nNewSequenceParity", 2);
SetEntProp(iBuilding, Prop_Send, "m_nResetEventsParity", 2);
switch (iObject)
{
// case TFObject_Sentry:
// {
// SetEntProp(iBuilding, Prop_Send, "m_nModelIndex", g_iSentModel);
// }
case TFObject_Dispenser:
{
SetEntProp(iBuilding, Prop_Send, "m_nModelIndex", g_iDispModel);
}
case TFObject_Teleporter:
{
SetEntProp(iBuilding, Prop_Send, "m_nModelIndex", g_iTeleModel);
}
}
//SetEntProp(iBuilding, Prop_Send, "m_bBuilding", 1, 2);
//SetEntProp(iBuilding, Prop_Send, "m_bClientSideFrameReset", 1, 2);
//SetEntPropFloat(iBuilding, Prop_Send, "m_flPercentageConstructed", 0.995);
//SetEntPropFloat(iBuilding, Prop_Send, "m_flPlaybackRate", 0.5);
//SetEntProp(iBuilding, Prop_Send, "m_iState", 0, 1);
//SetEntProp(iBuilding, Prop_Send, "m_nNewSequenceParity", 1);
//SetEntProp(iBuilding, Prop_Send, "m_nResetEventsParity", 1);
}
However this seems to turn it into a dud until you pick it up and set it back down, and it gets rid of whatever health you give it via
PHP Code:
SetVariantInt(648);
AcceptEntityInput(iBuilding, "SetHealth");
//SetEntityHealth(iBuilding, 648);
-----------------------
I was hoping to make a level 4 dispenser [gives overheal] and level 4 teleporter [gives TFCond_SpeedBuffAlly]. The only other way I can imagine is to just use SyncHudText and make it auto-upgrade if it remains active uninterrupted for X seconds [based on how long it would take to upgrade a building if you constantly hit it]. Interruptions being pickup/place/takedamage.
__________________