Raised This Month: $51 Target: $400
 12% 

TF2: Possible to spawn a sentry gun?


Post New Thread Reply   
 
Thread Tools Display Modes
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 01-09-2008 , 10:46   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #11

wtf ... how can I stop steam overwriting my gametypes.txt when i start TF2 ? :-O
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
BAILOPAN
Join Date: Jan 2004
Old 01-09-2008 , 11:07   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #12

We're going to be releasing a solution to this soon.
__________________
egg
BAILOPAN is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 01-09-2008 , 11:10   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #13

ok ... i spawned the sentry ... and updated it to level 2 ... heres the result:

Code:
delta entity: 58
+ DT_ObjectSentrygun m_flCycle, DPT_Float, index 1, bits 10, value 0.000
+ DT_ObjectSentrygun m_nNewSequenceParity, DPT_Int, index 6, bits 3, value 7
+ DT_ObjectSentrygun m_nResetEventsParity, DPT_Int, index 7, bits 3, value 5
+ DT_ObjectSentrygun m_iAmmoShells, DPT_Int, index 9, bits 9, value 120
+ DT_ObjectSentrygun m_nModelIndex, DPT_Int, index 264, bits 11, value 364
+ DT_ObjectSentrygun m_iHealth, DPT_Int, index 305, bits 13, value 90
+ DT_ObjectSentrygun m_iMaxHealth, DPT_Int, index 306, bits 13, value 90
+ DT_ObjectSentrygun m_iUpgradeLevel, DPT_Int, index 320, bits 3, value 2
+ DT_ObjectSentrygun m_iState, DPT_Int, index 323, bits 3, value 3
+ DT_ObjectSentrygun m_iUpgradeMetal, DPT_Int, index 324, bits 10, value 0
= 156 bits (20 bytes)
i have added all these changes to my spawn script, but it has no effect ... still the same problems :-/

here my current test-code:
PHP Code:
#include <sourcemod>
#include <dbi>
#include <timers>
#include <events>
#include <clients>
#include <sdktools>

new Float:ori[3];

public 
Plugin:myinfo = {
    
name "bla",
    
author "bla",
    
description "bla",
    
version "bla",
    
url "bla"
};

public 
OnPluginStart() {
    
RegConsoleCmd("say"Command_Say);
}

public 
Action:Command_Say(clientargs) {
    new 
String:text[192];
    
GetCmdArg(1,text,sizeof(text));

    if ( 
StrEqual(text,"sentry") ) {
        
//time to move away
        
GetClientAbsOrigin(client,ori);
        
CreateTimer(1.0,CreateSentry,client);
        return 
Plugin_Handled;
    }
    return 
Plugin_Continue;
}

public 
Action:CreateSentry(Handle:timer,any:client) {
    new 
Float:vbm[3];
    
vbm[0] = 24.0;
    
vbm[1] = 24.0;
    
vbm[2] = 66.0;

    new 
Float:mwc[3];
    
mwc[0] = 1.0;
    
mwc[1] = 0.5;
    
mwc[2] = 0.0;

    new 
Float:angle[3];
    
GetClientAbsAngles(client,angle);
    
angle[0] = 0.0;
    
angle[2] = 0.0;

    new 
team GetClientTeam(client);

    new 
ent CreateEntityByName("obj_sentrygun");
    
DispatchSpawn(ent);
    
//
    
TeleportEntity(entori angle NULL_VECTOR );
    
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_flAnimTime") , 51 true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_nNewSequenceParity") , true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_nResetEventsParity") , true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iAmmoShells") , 150 4true );
    
//SetEntData( ent , FindSendPropOffs("CObjectSentrygun","m_nModelIndex") , 353 , 4 , true );
    
SetEntityModel(ent,"models/buildables/sentry1.mdl");
    
SetEntDataEntent FindSendPropOffs("CObjectSentrygun","m_nSequence") , true );
    
SetEntDataFloatent FindSendPropOffs("CObjectSentrygun","m_flPlaybackRate") , 1.0 true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iMaxHealth") , 200 4true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iHealth") , 200 4true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_bBuilding") , 2true );
    
SetEntDataFloatent FindSendPropOffs("CObjectSentrygun","m_flPercentageConstructed") , 1.0 true );  
    
SetEntDataVectorent FindSendPropOffs("CObjectSentrygun","m_vecOrigin") , ori true );
    
SetEntDataVectorent FindSendPropOffs("CObjectSentrygun","m_angRotation") , angle true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_bPlacing") , 2true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_bDisabled") , true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iObjectType") , 3true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iState") , 1true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iUpgradeMetal") , 199 true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_bHasSapper") , true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_nSkin") , team==3?1:true ); //paint red or blue
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_bServerOverridePlacement") , true);
    
SetEntDataVectorent FindSendPropOffs("CObjectSentrygun","m_vecBuildMaxs") , vbm true );
    
SetEntDataVectorent FindSendPropOffs("CObjectSentrygun","m_flModelWidthScale") , mwc true );
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iUpgradeLevel") , 4true );  
    
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iAmmoRockets") , 4true );
    
SetEntDataEnt(entFindSendPropOffs("CObjectSentrygun","m_hBuilder"), client true);
    
SetEntDataFloatent FindSendPropOffs("CObjectSentrygun","m_flCycle") , 0.0 true );

    
SetVariantInt(team//Prep the value 3 for the call below
    
AcceptEntityInput(ent"TeamNum", -1, -10); //Change TeamNum to 3, 3=Blue Team | 2 = Red Team

    
SetVariantInt(team//Same thing again but we are changing SetTeam
    
AcceptEntityInput(ent"SetTeam", -1, -10); 

ah ... and when i spawn it, i got the following errors:
Code:
CBaseAnimating::SequenceDuration( -1 ) out of range
CBaseAnimating::SequenceDuration( -1 ) out of range
CBaseAnimating::SequenceDuration( -1 ) out of range
CBaseAnimating::SequenceDuration( -1 ) out of range
CBaseAnimating::SequenceDuration( -1 ) out of range
__________________

Last edited by Tauphi; 01-09-2008 at 11:29.
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
BAILOPAN
Join Date: Jan 2004
Old 01-09-2008 , 11:47   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #14

You should DispatchSpawn() after setting those properties.
__________________
egg
BAILOPAN is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 01-09-2008 , 12:02   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #15

but the most settings have no effect, when i set them before i spawn it ... has no model ... no updatemetal ... no team ...

or do i have to set them in another way ?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
BAILOPAN
Join Date: Jan 2004
Old 01-09-2008 , 12:59   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #16

Another option would be snapshotting two sentry guns (one from the game and one from you) and seeing what the difference was. However I don't think there's a way to do this in a script yet... might be an interesting feature request
__________________
egg
BAILOPAN is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 01-09-2008 , 13:06   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #17

i did that for hours ... building one sentry ... save all numbers bigger than 0 and use them in my spawned one ...

could you make one or two tests with my test-plugin, too? perhaps you have an idea? you are more skilled in those things than me ;D
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
Scuzzy
Senior Member
Join Date: Oct 2007
Old 02-07-2008 , 08:50   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #18

did anyone ever get the spawning of a TF2 sentry to work?

Scuzzy
Scuzzy is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 02-07-2008 , 09:26   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #19

I tried to do it, and unless it belonged to a player, it wouldn't funciton properly.
bl4nk is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 02-15-2008 , 11:42   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #20

Quote:
Originally Posted by Tauphi View Post
wtf ... how can I stop steam overwriting my gametypes.txt when i start TF2 ? :-O
Change the ownership of gametypes.txt to a user other than what you use to update steam and run the games as (and DON'T update or run as root).

I use a steam user (and a steam group) to run the game and he owns all the files.

in /opt/steam/ or whereever you put your server files:

as root:
chown -R steam:steam *

chown root:root gametypes.txt
chmod go-w gametypes.txt

use this command to update (or login as steam to do it)

sudo -u steam ./steam -command update -game tf2 -yada yada yada

use this command to run the game (I put it in a script)

sudo -u steam srcds_run -yada yada yada

or even better, run it in a screen so you can see the output

sudo -u steam screen -d srcds_run -yada yada yada

Last edited by naris; 02-15-2008 at 11:48.
naris is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:22.


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