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

Balloon (floating, exploding, balloon animal)


Post New Thread Reply   
 
Thread Tools Display Modes
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 01-19-2009 , 12:07   Re: Balloon (floating, exploding, balloon animal)
Reply With Quote #21

PHP Code:
        // setup explosion
        
SetEntPropEnt(entityProp_Data"m_hLastAttacker"client); 
Makes sure the person dropping the balloon gets credit for any kills.

PHP Code:
        // send "kill" event to the event queue
        
new String:addoutput[64];
        
Format(addoutputsizeof(addoutput), "OnUser1 !self:break::%f:1"GetConVarFloat(cvLife));
        
SetVariantString(addoutput);
        
AcceptEntityInput(entity"AddOutput");
        
AcceptEntityInput(entity"FireUser1"); 
Adds the "break" input to the entity queue so the balloon will explode after XX seconds (determined by the cvLive convar handle).

PHP Code:
        GetConVarString(cvRadiustmpsizeof(tmp));
        
DispatchKeyValue(entity"ExplodeRadius"tmp);
        
GetConVarString(cvDamagetmpsizeof(tmp));
        
DispatchKeyValue(entity"ExplodeDamage"tmp);
        
Format(tmpsizeof(tmp), "!self,Break,,0,-1");
        
DispatchKeyValue(entity"OnHealthChanged"tmp);
        
Format(tmpsizeof(tmp), "!self,Kill,,0,-1");
        
DispatchKeyValue(entity"OnBreak"tmp); 
Sets the radius and damage. Sets the OnHealthChanged input to break the entity (so it explodes when shot). Sets the OnBreak input to delete the entity when it breaks (explodes).

Quote:
I try to add a PrintHintTextToAll("%s", "A Balloon just exploded") for the same time when this entity explodes but I am somehow not able to do so . I guess that we need to add another event queue?... much thanks for help
The code above sets the entity up so that the game engine handles the explosion of the balloon. No code in the plugin is running when it explodes. You could probably use a SM entity output hook to catch the OnBreak event and send a message, but there isn't any function already in the plugin that runs when it explodes.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
BenSib
Senior Member
Join Date: Aug 2008
Old 01-19-2009 , 13:04   Re: Balloon (floating, exploding, balloon animal)
Reply With Quote #22

Quote:
Originally Posted by L. Duke View Post
The code above sets the entity up so that the game engine handles the explosion of the balloon. No code in the plugin is running when it explodes. You could probably use a SM entity output hook to catch the OnBreak event and send a message, but there isn't any function already in the plugin that runs when it explodes.
Thanks a lot, you are right. I currently found a way how to run a function when an entity exploded. Just tested it:

PHP Code:
HookEntityOutput("prop_physics""OnBreak"EntityOutput:OnEntityOutPut)

public 
OnEntityOutPut(blue_entity)
{
ServerCommand("sv_gravity 600")

Great

Last edited by BenSib; 01-20-2009 at 08:46.
BenSib is offline
BenSib
Senior Member
Join Date: Aug 2008
Old 01-20-2009 , 08:37   Re: Balloon (floating, exploding, balloon animal)
Reply With Quote #23

Can we somehow disable that player can make the balloon explode by shooting on it?

Anyway thanks again.

Last edited by BenSib; 01-20-2009 at 10:26.
BenSib is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 01-20-2009 , 10:29   Re: Balloon (floating, exploding, balloon animal)
Reply With Quote #24

I haven't tested it, but I believe that removing
PHP Code:
        Format(tmpsizeof(tmp), "!self,Break,,0,-1");
        
DispatchKeyValue(entity"OnHealthChanged"tmp); 
would do the trick.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
BenSib
Senior Member
Join Date: Aug 2008
Old 01-20-2009 , 10:38   Re: Balloon (floating, exploding, balloon animal)
Reply With Quote #25

It does.

Last edited by BenSib; 01-20-2009 at 17:45.
BenSib is offline
MrSaturn
SourceMod Donor
Join Date: Jan 2009
Old 01-25-2009 , 07:46   Re: Balloon (floating, exploding, balloon animal)
Reply With Quote #26

Could we get an enable/disable cvar? Or maybe a way to make it certain admin flags only?
MrSaturn is offline
NEXSO
Junior Member
Join Date: May 2007
Old 04-22-2009 , 22:54   Re: Balloon (floating, exploding, balloon animal)
Reply With Quote #27

Nice Plugin. Thanks L.Duke


NEXSO is offline
vempajor
Member
Join Date: Mar 2009
Old 05-12-2009 , 16:16   Re: Balloon (floating, exploding, balloon animal)
Reply With Quote #28

Any way to change the killer's name when killing somebody with the balloon? I wanna give a name to the balloon for eg "Balloon killed XY" in place of my name. Is it possible? Thanks for any directions!
__________________
Quote:
To all Day of Defeat: Source server admins:

http://dodsourceplugins.net/
vempajor is offline
TechKnow
Senior Member
Join Date: Nov 2007
Old 06-07-2009 , 05:20   Re: Balloon (floating, exploding, balloon animal)
Reply With Quote #29

Can you get it to work for CSS? I have extracted the pink dog balloon and recompiled it so it can work for any mod, I have also added a file download for the plugin but i cant get it to work for CSS, something in console says cant load due to cant get prop entity...or something like that. also if someone wants it compiled to remove the blood splat on launch let me know.

here is what I got so far.. balloon model and my plugin work.

can anyone help?
Attached Files
File Type: rar plugin-work.rar (7.9 KB, 104 views)
File Type: rar balloon-model_css.rar (31.4 KB, 121 views)
File Type: rar plugin-work-V2.rar (65.8 KB, 129 views)
__________________
"Stupd is what Stupid dose"
MY MODELS SITE
http://techknowmodels.19.forumer.com/index.php

Last edited by TechKnow; 07-05-2009 at 11:32. Reason: Updateing my plugin work V2
TechKnow is offline
TechKnow
Senior Member
Join Date: Nov 2007
Old 07-05-2009 , 11:33   Re: Balloon (floating, exploding, balloon animal)
Reply With Quote #30

BUMP!
__________________
"Stupd is what Stupid dose"
MY MODELS SITE
http://techknowmodels.19.forumer.com/index.php
TechKnow 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 02:19.


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