Raised This Month: $32 Target: $400
 8% 

TF2: Possible to spawn a sentry gun?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 12-19-2007 , 09:12   TF2: Possible to spawn a sentry gun?
Reply With Quote #1

hello,

is it possible to spawn a sentry gun to a specific location ?
if yes ... any tipps how to code it?

andreas
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
KMFrog
Senior Member
Join Date: Oct 2007
Old 12-19-2007 , 16:14   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #2

I would think they have written it so the SG must be attached to a player to credit them with the kills etc... For this reason it may not be possible to just spawn them and have fully functioning SGs.... but then again, ive never tired anything like it
__________________
Was I helpful or not? Rate Me!
KMFrog is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 12-19-2007 , 19:06   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #3

i can attach it to a player by editing the owner variable (i changed the owner of my own sentry to 0, it worked, my sentry made frags for no real player) ... the team, upgrade level etc can be edited too ...

but i don't know if it's possible to spawn a sentry itself into a map ...does sourcemod support any functions for this?
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 12-19-2007 , 21:38   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #4

Look for the Dispatch functions in sdktools_functions.inc. Start with CreateEntityByName, then use the dispatch fucntions to setup and spawn the entity.
__________________
I'm a blast from the past!
ferret is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 01-06-2008 , 18:16   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #5

ok i have tested a little bit and i have some problems ... to spawn a sentry gun i use the following code:

PHP Code:
new Float:or[3];
GetClientAbsOrigin(client,or);

new 
ent CreateEntityByName("obj_sentrygun");
DispatchSpawn(ent);
TeleportEntity(ent, or, NULL_VECTORNULL_VECTOR);

SetEntDataent FindSendPropOffs("CObjectSentrygun","m_bPlacing") , );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_bBuilding") , );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_bDisabled") , );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iObjectType") , );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iState") , );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iTeamNum") , );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iUpgradeMetal") , 150 );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_bHasSapper") , );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_hBuilder") , client );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_bServerOverridePlacement") , );
SetEntDataFloatent FindSendPropOffs("CObjectSentrygun","m_flPercentageConstructed") , 1.0 );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iUpgradeLevel") , ); //1-3
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_nModelIndex") , 294 );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iAmmoShells") , 100 );
SetEntDataent FindSendPropOffs("CObjectSentrygun","m_iMaxHealth") , 150 ); 
but i have the following problems with it:

1. the sentry is active (i hear the bibip), but it looks into the ground
2. it has no animations. no turning from right to the left
3. it does not shoot -> grrrrr

here is a screenshot: http://images.saigns.de/cp_dustbowl0074.jpg

any ideas how the fix it ?
thx in advance

andi
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
WoZeR
Donor
Join Date: Nov 2007
Old 01-06-2008 , 20:27   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #6

Maybe this will help out
http://www.3-pg.com/forums/index.php...indpost&p=2593
WoZeR is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 01-09-2008 , 09:45   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #7

ok ... the most does work ... i have attached the complete source of the test-plugin ... just type "sentry" in the server-chat to spawn a sentry ...

but i have still two big problems:
1. Is use my angle of view to set the direction of the sentry ... it works, you can see it on the foots of it ... but when it begins to turn from right to left and from left to right ... it's always the same direction ...

2. add some bots ( server command is "bot" ) and use a spawned sentry to kill them ... it shoots from the ground ( take a look on the shoot sprites ) ... hit it one time to set it to level 2, then it's working ...

when my spawned sentry begins to shot ... it spams the following into my console ( use "developer 2" ):
Code:
GetTracerOrigin: Couldn't find attachment 0 on model models/buildables/sentry1.mdl
after it's upgrade the error is gone ...

i have absolutely no idea how to fix that things
any help would be great ...
Attached Files
File Type: sp Get Plugin or Get Source (sentry.sp - 1129 views - 3.5 KB)
File Type: smx sentry.smx (2.9 KB, 514 views)
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 01-09-2008 , 10:08   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #8

Try this:
http://developer.valvesoftware.com/w...ies#dtwatchent

Use it on a level 1 sentry you have spawned, then upgrade that sentry to level 2. The above command should show you which props are changed with the upgrade. That might give you a clue as to whats wrong with your spawned level 1 sentrys, since the upgrade seems to fix or correct some necessary value.

Only good for network sendprops though. Datamap stuff won't be shown.
__________________
I'm a blast from the past!
ferret is offline
Scuzzy
Senior Member
Join Date: Oct 2007
Old 01-09-2008 , 10:34   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #9

Quote:
Originally Posted by ferret View Post
Try this:
http://developer.valvesoftware.com/w...ies#dtwatchent

Use it on a level 1 sentry you have spawned, then upgrade that sentry to level 2. The above command should show you which props are changed with the upgrade. That might give you a clue as to whats wrong with your spawned level 1 sentrys, since the upgrade seems to fix or correct some necessary value.

Only good for network sendprops though. Datamap stuff won't be shown.
I'd like to try this to watch my own client entity, but am fairly new to the source engine. I've looked around for determining the actual index of an entity, and tried the example "dtwatchent 1", but received no results both in console on a dedicated server, in my client on a dedicated server, and creating a "server" on my own home machine. I know it's hand holding, but could you walk me through how I could use this command to watch my own CTFPlayer entity? (determining what my own index is, when/where to run the command,etc)

Thanks,
Scuzzy
Scuzzy is offline
Tauphi
SourceMod Donor
Join Date: Sep 2004
Location: Germany
Old 01-09-2008 , 10:37   Re: TF2: Possible to spawn a sentry gun?
Reply With Quote #10

stupid question ... but is that normal, that metamod does no work when i start a listenserver ? it seems that i can't use the command on a remote server
__________________
Tauphi is offline
Send a message via ICQ to Tauphi Send a message via Skype™ to Tauphi
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 08:25.


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