AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   MvM / Spawned Sentry + Sentry Busters (https://forums.alliedmods.net/showthread.php?t=233171)

friagram 01-10-2014 18:56

MvM / Spawned Sentry + Sentry Busters
 
What Do? The sentry busters will path to spawned sentry, and will detonate, but won't destroy it. Robots will shoot them and kill them though. Here's my spawning code:

PHP Code:

        new sentry CreateEntityByName("obj_sentrygun");
        if (
sentry != -1)
        {
            
decl Float:normal[3], Float:normalAng[3];    
            
TR_GetPlaneNormal(TraceRaynormal);

            
GetClientEyeAngles(targetAngles);
            
GetVectorAngles(normalnormalAng);
                
            if(
normalAng[0] > 0.0 && normalAng[0] <= 90.0)
            {
                
CloseHandle(TraceRay);
                return;
            }
                
            
EndOrigin[0] += normal[0]*2.0;
            
EndOrigin[1] += normal[1]*2.0;
            
EndOrigin[2] += normal[2]*2.0;
                
            
Angles[0]  = normalAng[0] -270;

            if (
normalAng[0] != 270)
            {
                
Angles[1]  = normalAng[1];
            }

            
DispatchKeyValueVector(sentry"origin"EndOrigin);
            
DispatchKeyValueVector(sentry"angles"Angles);

            
DispatchSpawn(sentry);

            
SetEntityModel(sentryMODEL_SENTRYGUN);
            
SetEntPropFloat(sentryProp_Send"m_flModelScale"0.5);    

            
ActivateEntity(sentry);

            
SetEntProp(sentryProp_Send"m_iAmmoShells"200);
            
SetEntProp(sentryProp_Send"m_iMaxHealth"100);
            
SetEntProp(sentryProp_Send"m_iHealth"100);
            
SetEntProp(sentryProp_Send"m_iObjectType"_:TFObject_Sentry);
            
SetEntProp(sentryProp_Send"m_iState"1);

            
SetEntProp(sentryProp_Send"m_iTeamNum"2);
            
SetEntProp(sentryProp_Send"m_nSkin"0);
            
SetEntProp(sentryProp_Send"m_iUpgradeLevel"1);
            
SetEntProp(sentryProp_Send"m_iAmmoRockets"0);
            
//SetEntProp(sentry, Prop_Send, "m_bMiniBuilding", 1);

            
SetEntPropFloat(sentryProp_Send"m_flPercentageConstructed"1.0);

            
SetEntProp(sentryProp_Send"m_bDisabled"1);
            
SetEntProp(sentryProp_Send"m_CollisionGroup"2);
        } 

Probly don't need the angle checks, since the sentries will always spawn downward, though every now and again one will be tilted enough that it may orient sideways enough to not fire (dunno). I spawn them disabled so that nobody will get stuck in them, then make them solid later with a tracehull.

There's probably some netprop that needs to be set somewhere to make the sentries die to them. Also, It would be nice to make it so they can't be wrangled (like the mini sentry). I mean, they can be wrangled, but they won't fire, they just disabled and show the laser sight.

bl4nk 01-10-2014 20:12

Re: MvM / Spawned Sentry + Sentry Busters
 
It might require an owner.

friagram 01-10-2014 22:37

Re: MvM / Spawned Sentry + Sentry Busters
 
I set the owner and enabled in the timer, which makes it solid and activated, so it gets one, Just don't want the owner to become trapped inside of it. I only grant them to engineers.

friagram 01-11-2014 22:00

Re: MvM / Spawned Sentry + Sentry Busters
 
Looked this over more today, setting the owner, effectentity, etc does nothing.
Alsl, seems about any relevant netprop on a valid building is -1, so I don't know. Even in mvm the disposable sentries do not seem to get the disposable netprop set on them, its also -1.

Could be i'm completely lost, or the info is just stored somewhere else :/


All times are GMT -4. The time now is 14:25.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.