Raised This Month: $ Target: $400
 0% 

[TF2] Pets


Post New Thread Reply   
 
Thread Tools Display Modes
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-16-2014 , 20:27   Re: [TF2] Pets
Reply With Quote #51

Quote:
Originally Posted by StayOx View Post
this plugin running using .mdl files?

eg:

Code:
pet_robro.mdl
pet_balloonicorn.mdl
pet_reinballoonicorn.mdl
It uses models, but it creates a prop_physics_override, so I believe the model you use needs to have a .PHY file.

This pet plugin is very similar to that SourceBot plugin. SourceBot is an interactive chatbot plugin with the option to make it a "bot" that floats around the map and has its own model. The way this plugin makes pets is very similar to the way SourceBot made the "bot" player. I tried using the Robro model once in the SourceBot plugin, but the thing just sat in one place and couldn't move. My best guess is that happened because the Robro model is an "item" model, and as such, lacks a .PHY file.

Here's the code for the Poison Headcrab pet from my screenshot:

PHP Code:
    {
        
"models/headcrabblack.mdl",                 // Model
        
1,                                             // Model - Skin
        
1,                                             // Model - Bodygroup
        
"npc/headcrab_poison/ph_idle2.wav",         // Sound: Idle
        
"npc/headcrab_poison/ph_jump2.wav",         // Sound: Jump
        
"npc/headcrab_poison/ph_idle1.wav",         // Sound: Taunt
        
"npc/headcrab_poison/ph_scream1.wav",         // Sound: Spawn
        
"misc/null.wav",                             // Sound: Crouch
        
"npc/headcrab_poison/ph_poisonbite1.wav",     // Sound: Attack
        
"npc/headcrab_poison/ph_hiss1.wav",         // Sound: Stunned
        
"npc/headcrab_poison/ph_step1.wav",         // Sound: Footstep (1)
        
"npc/headcrab_poison/ph_step2.wav",         // Sound: Footstep (2)
        
"npc/headcrab_poison/ph_step3.wav",         // Sound: Footstep (3)
        
"IdleSniff",                                 // Animation: Idle
        
"Scurry",                                     // Animation: Walking
        
"flinch1",                                     // Animation: Jumping
        
"IdleSumo",                                 // Animation: Taunting
        
"flinch",                                     // Animation: Spawning
        
"Idle01",                                     // Animation: Ducking
        
"Spitattack",                                 // Animation: Attacking
        
"Die",                                         // Animation: Stunned
        
"ghost_appearation",                         // Particle Effect - Death
        
"ghost_appearation",                         // Particle Effect - Spawn
        
"tf_projectile_cleaver",                     // Projectile
        
"models/empty.mdl",                         // Hat Model
        
"none",                                     // Hat Attachment Bone
        
"models/empty.mdl",                         // Weapon Model
        
"none",                                        // Weapon Attachment Bone
        
"none",                                        // Particle Effect
        
"none",                                        // Particle Effect Attachment Bone
        
1.0,                                        // Model Size
        
100,                                        // Sound Pitch
        
HEIGHT_GROUND,                                // Height
    
}, 

Last edited by 404UserNotFound; 01-16-2014 at 20:37.
404UserNotFound is offline
StayOx
SourceMod Donor
Join Date: Jun 2012
Location: Gliese 581g
Old 01-16-2014 , 20:31   Re: [TF2] Pets
Reply With Quote #52

Quote:
Originally Posted by abrandnewday View Post
Basically, it spawns a prop_physics_override, parenting it to the player. It gives it a model, animations and sounds which are all set up by the server owner.

The prop follows you around and imitates things you do, for example
- It "jumps" when you jump
- It "taunts" (uses the "taunt" animation you choose when setting up the pet) when you taunt
- As a Spy when you cloak, it "cloaks"
- It gets "stunned" when you get stunned
- It crouches when you crouch (depends on if you chose a model with a crouch anim)

Etcetera. Using player models from TF2 like the MvM Robots, the Skeletons and player models is ok to do, but I advise against it because you have to resort to using the "swim" animation for "walking". If you use the walking animations, you won't see the "pet" walking, it'll just slide across the floor in the walk pose.....

incredible, I will follow the progress of this plugin was a good idea made this plugin!

thanks for the explanation and by Poison Headcrab

Last edited by StayOx; 01-16-2014 at 20:35. Reason: XD
StayOx is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-16-2014 , 20:50   Re: [TF2] Pets
Reply With Quote #53

Quote:
Originally Posted by StayOx View Post
incredible, I will follow the progress of this plugin was a good idea made this plugin!

thanks for the explanation and by Poison Headcrab
Not a problem. Speaking of the SourceBot plugin, that gave me an idea for a new feature in this plugin.

In the SourceBot plugin, if you chose to have the bot use a model and float around the map randomly, it could be shot at and hit by other players and eventually killed (it had its own HP setup that you could modify in the plugin, no convar for the health though).

Something like that could potentially be put into use here, letting players kill other players pets.

Here's the plugin, if you want to check it out, Arthur.
404UserNotFound is offline
StayOx
SourceMod Donor
Join Date: Jun 2012
Location: Gliese 581g
Old 01-16-2014 , 21:33   Re: [TF2] Pets
Reply With Quote #54

ok, after compiling using playerspets.inc below and:

Code:
sm_givepet @me 1
sm_givepet @bots 1
sm_givepet @red 1
I got such problem

Code:
[SM] Invalid pet index specified.
Spoiler
StayOx is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-16-2014 , 21:35   Re: [TF2] Pets
Reply With Quote #55

Quote:
Originally Posted by StayOx View Post
ok, after compiling using playerspets.inc below and:

Code:
sm_givepet @me 1
sm_givepet @bots 1
sm_givepet @red 1
I got such problem

Code:
[SM] Invalid pet index specified.
sm_givepet is for usage with just a pet index, for example

sm_givepet 1 will give you the pet.

If you have the CHEATS flag, you can use "sm_spawnpet" to spawn pets for @me/@bots/@red/@blue, like this:

sm_spawnpet @bots 1
404UserNotFound is offline
StayOx
SourceMod Donor
Join Date: Jun 2012
Location: Gliese 581g
Old 01-16-2014 , 22:08   Re: [TF2] Pets
Reply With Quote #56

Quote:
Originally Posted by abrandnewday View Post
sm_givepet is for usage with just a pet index, for example

sm_givepet 1 will give you the pet.

If you have the CHEATS flag, you can use "sm_spawnpet" to spawn pets for @me/@bots/@red/@blue, like this:

sm_spawnpet @bots 1
yeah nothing yet, I m have flag root

Code:
] sm_givepet @all 1
[SM] Invalid pet index specified.

] sm_spawnpet @bots 1
[SM] Invalid pet index specified.
 
] sm_spawnpet @red 1
[SM] Invalid pet index specified.
 
] sm_spawnpet @blue 1
[SM] Invalid pet index specified.

] sm_givepet 0
[SM] Invalid pet index specified.
StayOx is offline
arthurdead
Senior Member
Join Date: Jul 2013
Old 01-16-2014 , 22:11   Re: [TF2] Pets
Reply With Quote #57

your .inc file is wrong

PHP Code:
// Define pet states
#define STATE_IDLE 1
#define STATE_WALKING 2
#define STATE_JUMPING 3
#define STATE_SPAWNING 4
#define STATE_TAUNTING 5
#define STATE_DUCKING 6
#define STATE_ATTACKING 7
#define STATE_STUN 8

// Define pet heights
#define HEIGHT_GROUND 1
#define HEIGHT_HOVER 2
#define HEIGHT_FLY 3

enum petContent
{
    
String:iModel[PLATFORM_MAX_PATH],
    
String:iSkin[PLATFORM_MAX_PATH],
    
String:iBodyGroup[PLATFORM_MAX_PATH],
    
String:iSoundGeneric[PLATFORM_MAX_PATH],
    
String:iSoundJump[PLATFORM_MAX_PATH],
    
String:iSoundTaunt[PLATFORM_MAX_PATH],
    
String:iSoundSpawn[PLATFORM_MAX_PATH],
    
String:iSoundDuck[PLATFORM_MAX_PATH],
    
String:iSoundAttack[PLATFORM_MAX_PATH],
    
String:iSoundStun[PLATFORM_MAX_PATH],
    
String:iSoundFoot0[PLATFORM_MAX_PATH],
    
String:iSoundFoot1[PLATFORM_MAX_PATH],
    
String:iSoundFoot2[PLATFORM_MAX_PATH],
    
String:iAnimIdle[PLATFORM_MAX_PATH],
    
String:iAnimWalk[PLATFORM_MAX_PATH],
    
String:iAnimJump[PLATFORM_MAX_PATH],
    
String:iAnimTaunt[PLATFORM_MAX_PATH],
    
String:iAnimSpawn[PLATFORM_MAX_PATH],
    
String:iAnimDuck[PLATFORM_MAX_PATH],
    
String:iAnimAttack[PLATFORM_MAX_PATH],
    
String:iAnimStun[PLATFORM_MAX_PATH],
    
String:iDeathParticle[PLATFORM_MAX_PATH],
    
String:iSpawnParticle[PLATFORM_MAX_PATH],
    
String:iProjectile[PLATFORM_MAX_PATH],
    
String:iHat[PLATFORM_MAX_PATH],
    
String:iHatBone[PLATFORM_MAX_PATH],
    
String:iWep[PLATFORM_MAX_PATH],
    
String:iWepBone[PLATFORM_MAX_PATH],
    
String:iParticle[PLATFORM_MAX_PATH],
    
String:iParBone[PLATFORM_MAX_PATH],
    
Float:iModelSize,
    
iPitch,
    
iHeight,
};

stock petInfo[][petContent] = 
{
    {
        
// Do not remove this. This counts as Pet Index 0.
        // You can also use this as a base for creating a new pet
        
"models/empty.mdl",     // Model
        
0,                         // Model - Skin
        
0,                         // Model - Bodygroup
        
"misc/null.wav",         // Sound: Idle
        
"misc/null.wav",         // Sound: Jump
        
"misc/null.wav",         // Sound: Taunt
        
"misc/null.wav",         // Sound: Spawn
        
"misc/null.wav",         // Sound: Crouch
        
"misc/null.wav",         // Sound: Attack
        
"misc/null.wav",         // Sound: Stunned
        
"misc/null.wav",         // Sound: Footstep (1)
        
"misc/null.wav",         // Sound: Footstep (2)
        
"misc/null.wav",         // Sound: Footstep (3)
        
"idle",                 // Animation: Idle
        
"idle",                 // Animation: Walking
        
"idle",                 // Animation: Jumping
        
"idle",                 // Animation: Taunting
        
"idle",                 // Animation: Spawning
        
"idle",                 // Animation: Ducking
        
"idle",                 // Animation: Attacking
        
"idle",                 // Animation: Stunned
        
"unknown",                 // Particle Effect - Death
        
"unknown",                 // Particle Effect - Spawn
        
"unknown",                 // Projectile
        
"models/empty.mdl",     // Hat Model
        
"none",                 // Hat Attachment Bone
        
"models/empty.mdl",     // Weapon Model
        
"none",                    // Weapon Attachment Bone
        
"none",                    // Particle Effect
        
"none",                    // Particle Effect Attachment Bone
        
0.0,                    // Model Size
        
0,                        // Sound Pitch
        
0,                        // Height
    
},
    {
        
"models/headcrabblack.mdl",                 // Model
        
1,                                             // Model - Skin
        
1,                                             // Model - Bodygroup
        
"npc/headcrab_poison/ph_idle2.wav",         // Sound: Idle
        
"npc/headcrab_poison/ph_jump2.wav",         // Sound: Jump
        
"npc/headcrab_poison/ph_idle1.wav",         // Sound: Taunt
        
"npc/headcrab_poison/ph_scream1.wav",         // Sound: Spawn
        
"misc/null.wav",                             // Sound: Crouch
        
"npc/headcrab_poison/ph_poisonbite1.wav",     // Sound: Attack
        
"npc/headcrab_poison/ph_hiss1.wav",         // Sound: Stunned
        
"npc/headcrab_poison/ph_step1.wav",         // Sound: Footstep (1)
        
"npc/headcrab_poison/ph_step2.wav",         // Sound: Footstep (2)
        
"npc/headcrab_poison/ph_step3.wav",         // Sound: Footstep (3)
        
"IdleSniff",                                 // Animation: Idle
        
"Scurry",                                     // Animation: Walking
        
"flinch1",                                     // Animation: Jumping
        
"IdleSumo",                                 // Animation: Taunting
        
"flinch",                                     // Animation: Spawning
        
"Idle01",                                     // Animation: Ducking
        
"Spitattack",                                 // Animation: Attacking
        
"Die",                                         // Animation: Stunned
        
"ghost_appearation",                         // Particle Effect - Death
        
"ghost_appearation",                         // Particle Effect - Spawn
        
"tf_projectile_cleaver",                     // Projectile
        
"models/empty.mdl",                         // Hat Model
        
"none",                                     // Hat Attachment Bone
        
"models/empty.mdl",                         // Weapon Model
        
"none",                                        // Weapon Attachment Bone
        
"none",                                        // Particle Effect
        
"none",                                        // Particle Effect Attachment Bone
        
1.0,                                        // Model Size
        
100,                                        // Sound Pitch
        
HEIGHT_GROUND,                                // Height
    
}
}; 

Last edited by arthurdead; 01-16-2014 at 22:15.
arthurdead is offline
StayOx
SourceMod Donor
Join Date: Jun 2012
Location: Gliese 581g
Old 01-16-2014 , 22:43   Re: [TF2] Pets
Reply With Quote #58

Quote:
Originally Posted by arthurdead View Post
your .inc file is wrong
work now, yes you're right. thanks

Bug: pets dont use "cloak" when you're the spy

My suggestions for the plugin

a menu, use a config file .cfg to configure pets like Model Manager by flaminsarge
StayOx is offline
arthurdead
Senior Member
Join Date: Jul 2013
Old 01-16-2014 , 22:50   Re: [TF2] Pets
Reply With Quote #59

Quote:
Originally Posted by StayOx View Post
work now, yes you're right. thanks

Bug: pets dont use "cloak" when you're the spy

My suggestions for the plugin

a menu, use a config file .cfg to configure pets like Model Manager by flaminsarge
i am gonna try to fix about the cfg stuff i cant do it i dont understand keyvalues very well 2hard4me
arthurdead is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 01-18-2014 , 01:18   Re: [TF2] Pets
Reply With Quote #60

Here's a few suggestions that would be neat:

1. New animation: Crouchwalking (detect when a player is crouched and walking, and make the pet use the crouchwalk animation if one is set up (could just be a standing walk/run animation)

2. Make the jump animation optional/make it so that pets mimicking players when they jump is optional, that way if someone were to use the Zombie torso from HL2 as a pet, it wouldn't "jump" when the player jumps which would just look dumb

3. Pet speed option (make the pet "walk" faster/slower)

Side note, you can use the Robro/Balloonicorn/Raindeernicorn item models, they actually work quite well, which is surprising because the Sourcebot plugin didn't like those models.

The three pet items are located in "models/player/items/all_class" and all start with "pet_" (i.e. "pet_robro.mdl")

Last edited by 404UserNotFound; 01-18-2014 at 01:29.
404UserNotFound 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 00:48.


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