View Single Post
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 04-22-2015 , 09:00   Re: [TF2] Remote Control/Build/Limit buildings plugin
Reply With Quote #108

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(iBuildingTFObjectType:iObject)
{
    
SetEntProp(iBuildingProp_Send"m_bBuilding"02);
    
SetEntProp(iBuildingProp_Send"m_bClientSideFrameReset"02);
    
SetEntPropFloat(iBuildingProp_Send"m_flPercentageConstructed"1.0);
    
SetEntPropFloat(iBuildingProp_Send"m_flPlaybackRate"0.0);
    
SetEntProp(iBuildingProp_Send"m_iState"11);
    
SetEntProp(iBuildingProp_Send"m_nNewSequenceParity"2);
    
SetEntProp(iBuildingProp_Send"m_nResetEventsParity"2);

    switch (
iObject)
    {
        
// case TFObject_Sentry:
        // {
        //     SetEntProp(iBuilding, Prop_Send, "m_nModelIndex", g_iSentModel);
        // }
        
case TFObject_Dispenser:
        {
            
SetEntProp(iBuildingProp_Send"m_nModelIndex"g_iDispModel);
        }
        case 
TFObject_Teleporter:
        {
            
SetEntProp(iBuildingProp_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.
__________________

Last edited by Chdata; 04-22-2015 at 09:03.
Chdata is offline