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

Touch TE_BLODDSTREAM


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 04-11-2014 , 15:45   Touch TE_BLODDSTREAM
Reply With Quote #1

It is possible to detect if someone touches this? Or in any other way?

PHP Code:
 message_begin(MSG_BROADCASTSVC_TEMPENTITY)
 
write_byte(TE_BLOODSTREAM)
 
write_coord(Origin[0])
 
write_coord(Origin[1])
 
write_coord(Origin[2])
 
write_coord(Velocity[3])
 
write_coord(Velocity[4])
 
write_coord(Velocity[5])
 
write_byte(125)
 
write_byte(160)
 
message_end() 
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-11-2014 , 19:00   Re: Touch TE_BLODDSTREAM
Reply With Quote #2

Most likely not possible. Such temporary entity is fully handled on the client. Now, maybe there is some tricky way to visually detect or something. Maybe calculating if blood will be near of player. No idea.
__________________

Last edited by Arkshine; 04-11-2014 at 19:04.
Arkshine is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 04-12-2014 , 03:58   Re: Touch TE_BLODDSTREAM
Reply With Quote #3

Hmm I want to create something like "blood shoot", maybe someone can give ideas. It should be like

PHP Code:
public shot(id)
{
    new 
iOrigin[3], FloatflOrigin[3], FloatVelocity[3]
    
// pev(id, pev_origin, Origin);

    
get_user_origin(idiOrigin1)

    
entity_get_vector(idEV_VEC_velocity,  Velocity)

    new 
Ent create_entity("info_target"// env_sprite?

    
entity_set_string(EntEV_SZ_classname"shot")

    
entity_set_model(Entg_MyModel// TE_BLOODSTREAM

    
new FloatMins[3] = { -2.5, -2.50.0 }
    new 
FloatMaxs[3] = { 2.52.52.0 }
    
entity_set_size(EntMinsMaxs)

    
IVecFVec(iOriginflOrigin)
    
entity_set_vector(EntEV_VEC_originflOrigin)

    
entity_set_int(EntEV_INT_movetypeMOVETYPE_TOSS)
    
entity_set_int(EntEV_INT_solidSOLID_TRIGGER)

    
entity_set_edict(EntEV_ENT_ownerid)

    
velocity_by_aim(idget_pcvar_num(Cvar_Force), Velocity)
    
entity_set_vector(EntEV_VEC_velocityVelocity)

instead of model use TE_BLOODSTREAM, maybe it's possible then?

Last edited by ~Ice*shOt; 04-12-2014 at 03:58.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-15-2014 , 16:24   Re: Touch TE_BLODDSTREAM
Reply With Quote #4

The best idea I have is to create an entity to fall along with the bloodstream and detect touching.
It depends on how much the blood effect varies though. Too much variation can't be covered obviously.

I don't think you can use bloodstream as a model because it's more of a particle effect. But I'm not very good at entities.
__________________
Black Rose is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 04-15-2014 , 17:10   Re: Touch TE_BLODDSTREAM
Reply With Quote #5

Quote:
to create an entity to fall along with the bloodstream
But how?

Last edited by ~Ice*shOt; 04-15-2014 at 17:53.
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 04-15-2014 , 18:26   Re: Touch TE_BLODDSTREAM
Reply With Quote #6

This is the best method I've got...
This one is just an example. You can fine-tune it and add the second, smaller, arced stream as well.
Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("Test Plugin 3", "", "[ --{-@ ]");     register_touch("blood", "player", "icky");         set_task(1.0, "test", _, _, _, "b"); } public icky(toucher, touched) {     server_print("%d touched %d, that's gonna leave a stain", toucher, touched); } public plugin_precache() {     precache_model("models/head.mdl"); } public test() {         new Float:flOrigin[3] = { 0.0, -3300.0, -200.0 };     new iOrigin[3] = { 0, -3300, -200 };         new Float:flVelocity[3] = { 100.0, 100.0, 0.0 };     new iVelocity[3] = { 100, 100, 0 };         message_begin(MSG_BROADCAST, SVC_TEMPENTITY)     write_byte(TE_BLOODSTREAM)     write_coord(iOrigin[0])     write_coord(iOrigin[1])     write_coord(iOrigin[2])     write_coord(iVelocity[0])     write_coord(iVelocity[1])     write_coord(iVelocity[2])     write_byte(125)     write_byte(160)     message_end()         for ( new i ; i < 10 ; i++ ) {                 new ent = create_entity("info_target");                 entity_set_string(ent, EV_SZ_classname, "blood");                 entity_set_model(ent, "models/head.mdl");                 new Float:flMins[3] = { -2.5, -2.5, 0.0 };         new Float:flMaxs[3] = { 2.5, 2.5, 2.0 };         entity_set_size(ent, flMins, flMaxs);                 entity_set_vector(ent, EV_VEC_origin, flOrigin);                 entity_set_int(ent, EV_INT_movetype, MOVETYPE_TOSS);         entity_set_int(ent, EV_INT_solid, SOLID_TRIGGER);                 flVelocity[0] = float(iVelocity[0]) * ( 0.2 * i );         flVelocity[1] = float(iVelocity[1]) * ( 0.2 * i );         entity_set_vector(ent, EV_VEC_velocity, flVelocity)                 entity_set_float(ent, EV_FL_gravity, 0.22);                 set_task(3.0, "killme", ent);     } } public killme(ent) {     remove_entity(ent); }
__________________
Black Rose is offline
Fr33m@n
Veteran Member
Join Date: May 2008
Location: France Marne
Old 04-15-2014 , 18:38   Re: Touch TE_BLODDSTREAM
Reply With Quote #7

if you know what sprite is used, it's better for you to reproduce it with an entity env_sprite.

https://github.com/ValveSoftware/sou...loodstream.cpp
This may help you.

Last edited by Fr33m@n; 04-15-2014 at 18:39.
Fr33m@n is offline
~Ice*shOt
Veteran Member
Join Date: Mar 2009
Location: Lithuania
Old 04-17-2014 , 05:15   Re: Touch TE_BLODDSTREAM
Reply With Quote #8

Thank you both
~Ice*shOt is offline
Send a message via Skype™ to ~Ice*shOt
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 16:48.


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