Raised This Month: $ Target: $400
 0% 

Spawn trigger and set it's size.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 02-14-2009 , 15:49   Spawn trigger and set it's size.
Reply With Quote #1

I'm trying to simulate some props with special effects like a prop that hurt peoples near it. I've done the prop and the special effect but the hurt trigger is just to small or null. How could I size a trigger from code?

PHP Code:
public Action:Command_Create_Melon(clientargs)
{
    new 
ent FindOpenSlot(); //Custom stock
    
if(ent == -1)
    {
        
ReplyToCommand(client"There are no open slots.");
        return 
Plugin_Handled;
    }
    
decl Float:Origin[3], String:Temp[128];
    
GetClientViewPos(clientOrigin30.050.0); //Custom stock
    
    
Props[ent] = CreateEntityByName("prop_physics_override");
    new 
Prop Props[ent];
    
Format(Tempsizeof(Temp), "specialentityprop%i"ent);
    
DispatchKeyValue(Prop"targetname"Temp);
    
DispatchKeyValue(Prop"model""models/props_junk/watermelon01.mdl");
    
DispatchKeyValue(Prop"spawnflags""256");
    
DispatchSpawn(Prop);
    
TeleportEntity(PropOriginNULL_VECTORNULL_VECTOR);
    
    
Triggers[ent] = CreateEntityByName("trigger_hurt");
    new 
Trigger Triggers[ent];
    
DispatchKeyValue(Trigger"parentname"Temp);
    
DispatchKeyValue(Trigger"spawnflags""15");
    
DispatchKeyValue(Trigger"damage""90");
    
DispatchKeyValue(Trigger"damagecap""20");
    
DispatchKeyValue(Trigger"damagetype""256");
    
DispatchKeyValue(Trigger"damagemodel""0");
    
DispatchKeyValue(Trigger"StartDisabled""0");
    
DispatchSpawn(Trigger);
    
    
Envs[ent] = CreateEntityByName("env_spark");
    new 
Env Envs[ent];
    
DispatchKeyValue(Env"parentname"Temp);
    
DispatchKeyValue(Env"MaxDelay""1");
    
DispatchKeyValue(Env"TrailLength""1");
    
DispatchKeyValue(Env"Magnitude""1");
    
DispatchKeyValue(Env"spawnflags""64");
    
DispatchSpawn(Env);

    
ReplyToCommand(client"Shocking melon spawned.");
    return 
Plugin_Handled;

It was suppose to spawn a watermelon that shock things near (Even walls and props) but the trigger_hurt is to small to actualy do anything. How could I size it? Thank you.

If you see anything wrong let'me know.
Sammy-ROCK! is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 02-14-2009 , 18:44   Re: Spawn trigger and set it's size.
Reply With Quote #2

You cant spawn brush entitys with sourcemod (triggers are brush entities)
__________________
CrimsonGT is offline
teddyruxpin
Overseer of lost packets
Join Date: Feb 2008
Old 02-14-2009 , 18:58   Re: Spawn trigger and set it's size.
Reply With Quote #3

Try taking a look at these. I use the first in my maps when blowing up walls to blow up buildables behind them and kill everything in the radius around it that can take damage.

http://developer.valvesoftware.com/w..._physexplosion

http://developer.valvesoftware.com/wiki/Env_explosion

http://developer.valvesoftware.com/wiki/Env_shake


-Teddy
__________________
Black Tusk Labs Home of Turbo TF2 and Turbo L4D:
http://blacktusklabs.com/ - Mah blog and stuff

My Crappy Plugins: SuperBuilds, Parent Buildables,
L4D Player Info
teddyruxpin is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 02-14-2009 , 19:29   Re: Spawn trigger and set it's size.
Reply With Quote #4

Thanks teddy. But I think It's possible to do my original idea.
I found some datamaps that may make my idea.

- m_vecPosition1 (Save)(12 Bytes)
- m_vecPosition2 (Save)(12 Bytes)
- m_vecMoveAng (Save)(12 Bytes)
- m_vecAngle1 (Save)(12 Bytes)
- m_vecAngle2 (Save)(12 Bytes)
- m_flHeight (Save)(4 Bytes)

I think with the right usage of those I can make what I want.
Sammy-ROCK! is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 02-16-2009 , 11:27   Re: Spawn trigger and set it's size.
Reply With Quote #5

Its not impossible to spawn brush entities, sourcemod just cant do it.
__________________
CrimsonGT is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 02-16-2009 , 11:59   Re: Spawn trigger and set it's size.
Reply With Quote #6

Quote:
Originally Posted by Sammy-ROCK! View Post
Thanks teddy. But I think It's possible to do my original idea.
I found some datamaps that may make my idea.

- m_vecPosition1 (Save)(12 Bytes)
- m_vecPosition2 (Save)(12 Bytes)
- m_vecMoveAng (Save)(12 Bytes)
- m_vecAngle1 (Save)(12 Bytes)
- m_vecAngle2 (Save)(12 Bytes)
- m_flHeight (Save)(4 Bytes)

I think with the right usage of those I can make what I want.
The SDK appears to use m_vecPosition1 and 2 for buttons, doors, func_movelinear, and trains. Those values are defined in CBaseToggle which trigger_hurt inherits, but I don't believe they are used by the trigger_hurt itself.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 02-16-2009 , 13:13   Re: Spawn trigger and set it's size.
Reply With Quote #7

I gotta find where trigger's sizes are stored.
Sammy-ROCK! is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 02-16-2009 , 14:02   Re: Spawn trigger and set it's size.
Reply With Quote #8

It's stored in the bsp file. Listen to Crimson, he knows what he's talking about. You can't do what you're asking for with SourceMod right now.
bl4nk 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 18:22.


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