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

Players breathing steam [REQ]


Post New Thread Reply   
 
Thread Tools Display Modes
RateX
Veteran Member
Join Date: Jun 2012
Location: 0o. SEA .o0
Old 10-14-2014 , 07:25   Re: Players breathing steam [REQ]
Reply With Quote #21

Quote:
So by using movetype_follow, i won't actually be able to see the attachment unless the player mdl is modified
Actually, I was talking about the attachment. If the attachment is a model, and you want it to be shown like back weapon model from Back Weapon plugin, it need to have bone. Else if it doesn't have bone or it's a sprite, it will be attached directly to player origin, so no need to modify player model.
Quote:
And pev_aiment can't be seen by the player that it is aimed to, right?
What do you mean?

Last edited by RateX; 10-14-2014 at 07:26.
RateX is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 10-16-2014 , 08:10   Re: Players breathing steam [REQ]
Reply With Quote #22

So it would be easier to be done with movetype_follow.

In what regards pev_aiment, i mean that the player itself won't be able to see the sprite coming out of his mouth/face (in 1st person view).
bLacK-bLooD is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 12-23-2020 , 06:18   Re: Players breathing steam [REQ]
Reply With Quote #23

4 years later, bump?
__________________
We all live under the same sky but we have different horizons.
bLacK-bLooD is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-23-2020 , 15:18   Re: Players breathing steam [REQ]
Reply With Quote #24


Code:
#include amxmodx #include engine #include fakemeta new g_breath, g_face; public plugin_init() {     register_plugin("Winter breath", "0.1", "SPiNX|2020");     register_forward(FM_PlayerPreThink, "client_prethink");     g_face = register_cvar("chin_level", "15"); } public plugin_precache()    g_breath = precache_model("sprites/steam1.spr"); public client_prethink(id) {     if ( is_user_connected(id) && is_user_outside(id) && (pev(id, pev_button) & IN_FORWARD) )     {         emessage_begin( MSG_BROADCAST, SVC_TEMPENTITY, { 0, 0, 0 }, 0 );         ewrite_byte(TE_PLAYERATTACHMENT);         ewrite_byte(id);         ewrite_coord(get_pcvar_num(g_face));         ewrite_short(g_breath);         ewrite_short(1);         emessage_end();     } } stock bool:is_user_outside(id) {     new Float:vOrigin[3];     pev(id, pev_origin, vOrigin);     while(engfunc(EngFunc_PointContents, vOrigin) == CONTENTS_EMPTY)         vOrigin[2] += 5.0;     if(engfunc(EngFunc_PointContents, vOrigin) == CONTENTS_SKY)         return true;     return false; }
__________________

Last edited by DJEarthQuake; 12-23-2020 at 16:55. Reason: Added IN_FORWARD. Remove if it does not suit your needs.
DJEarthQuake is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 12-24-2020 , 05:51   Re: Players breathing steam [REQ]
Reply With Quote #25

Quote:
Originally Posted by DJEarthQuake View Post

Code:
#include amxmodx #include engine #include fakemeta new g_breath, g_face; public plugin_init() {     register_plugin("Winter breath", "0.1", "SPiNX|2020");     register_forward(FM_PlayerPreThink, "client_prethink");     g_face = register_cvar("chin_level", "15"); } public plugin_precache()    g_breath = precache_model("sprites/steam1.spr"); public client_prethink(id) {     if ( is_user_connected(id) && is_user_outside(id) && (pev(id, pev_button) & IN_FORWARD) )     {         emessage_begin( MSG_BROADCAST, SVC_TEMPENTITY, { 0, 0, 0 }, 0 );         ewrite_byte(TE_PLAYERATTACHMENT);         ewrite_byte(id);         ewrite_coord(get_pcvar_num(g_face));         ewrite_short(g_breath);         ewrite_short(1);         emessage_end();     } } stock bool:is_user_outside(id) {     new Float:vOrigin[3];     pev(id, pev_origin, vOrigin);     while(engfunc(EngFunc_PointContents, vOrigin) == CONTENTS_EMPTY)         vOrigin[2] += 5.0;     if(engfunc(EngFunc_PointContents, vOrigin) == CONTENTS_SKY)         return true;     return false; }
Thank you for your effort!

I tried it with the code above and it looks like this:



Something wrong with the sprite maybe? It doesn't look at all like the gif you posted above
__________________
We all live under the same sky but we have different horizons.
bLacK-bLooD is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-24-2020 , 12:09   Re: Players breathing steam [REQ]
Reply With Quote #26

Increment CVAR to adjust the height on the fly. I have 2 different chin settings for 2 different mods.
__________________
DJEarthQuake is offline
bLacK-bLooD
AlliedModders Donor
Join Date: Jun 2008
Old 12-24-2020 , 15:08   Re: Players breathing steam [REQ]
Reply With Quote #27

The height is not the issue. The spr looks nothing like your gif and the animation looks very bad
__________________
We all live under the same sky but we have different horizons.
bLacK-bLooD is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-24-2020 , 15:22   Re: Players breathing steam [REQ]
Reply With Quote #28

You have it in 3rd person. I didn't.
__________________
DJEarthQuake is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-27-2021 , 23:41   Re: Players breathing steam [REQ]
Reply With Quote #29

Quote:
Originally Posted by bLacK-bLooD View Post
Thank you for your effort!

I tried it with the code above and it looks like this:



Something wrong with the sprite maybe? It doesn't look at all like the gif you posted above
The gifs were from 2 different mods. There's an offset. That's where the chin cvar came from. Move it up. Increment the number, then it is not on the chest. My ticrate was double digit. I am guessing yours was much higher? 3rd person does look like that on the mods I validated script on.
Just slow it down.

Quote:
Originally Posted by bLacK-bLooD View Post
Ok guys, i have been doing some testing myself for a while and i came up (modified) one combo sprite plugin that i have found and modified it according to my needs (or i think i did).
This concept code works perfectly already on default clocked servers. Make it not fire off as often via Amxx.

My gif was also a bot with a particular under-clocked think. That is how everything on my system usually is. Update the script as needed. MSG_PVS is what I had it on used initially and I shared it as MSG_BROADCAST. Otherwise the comment would have been I cannot see it or cannot see it all the time. Every little detail will effect what we see on the screen.

Now you have the mechanics. Just start coding. There isn't just 1 way to handle this. Share what you come up with. I had a post about this lengthy beforehand. It was abbreviated to so where you were at.
__________________
DJEarthQuake is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 11-17-2021 , 11:49   Re: Players breathing steam [REQ]
Reply With Quote #30

In some places. It is getting cold again. Upgraded the code. Slowed it down from think to a task with CVAR: winter_breath <float>. This opens up the possibility to set the timing in seconds. It saves resources. It will make the puffs more like the gif. I reinstalled plugin and could not duplicate that breath rate either until this change was made. Likely reason gif is series of screenshot bitmaps globed together.

PHP Code:
#include amxmodx
#include engine
#include fakemeta
#define SEND_MSG_ALLPLAYERS 0
new g_breathg_faceg_pant;

public 
plugin_init()
{
    
register_plugin("Winter breath""0.2""SPiNX|2021");

    
g_face register_cvar("chin_level""37"); //Chin 37 was tested on OP4. 15 was former starting number.
    //Where steam comes off player. Higher the number the higher the breath

    
g_pant register_cvar("winter_breath""1.5");
    
//How frequent puffs
}

public 
plugin_precache()
{
   
g_breath precache_model("sprites/steam1.spr");
   
//Switch over to generic. Allegedly easier on the server.
   
precache_generic("sprites/steam1.spr"); //from valve folder
}

public 
client_putinserver(id)
    
set_task(1.5,"fw_PlayerPostThink",id,.flags="b")

public 
client_disconnected(id)
    if(
task_exists(id))
        
remove_task(id)

public 
fw_PlayerPostThink(id,{Float,_}:...)
{

    if (
is_user_alive(id) && is_user_outside(id) && get_pcvar_float(g_pant))
    {
        
emessage_beginMSG_PVSSVC_TEMPENTITY _SEND_MSG_ALLPLAYERS );
        
ewrite_byte(TE_PLAYERATTACHMENT);
        
ewrite_byte(id); //who
        
ewrite_coord(get_pcvar_num(g_face)); //where
        
ewrite_short(g_breath); //what
        
ewrite_short(1//life
        
emessage_end();

        if(
task_exists(id))
            
change_task(idget_pcvar_float(g_pant))
    }

}

stock bool:is_user_outside(id)
{
    new 
Float:vOrigin[3];
    
pev(idpev_originvOrigin);

    while(
engfunc(EngFunc_PointContentsvOrigin) == CONTENTS_EMPTY)
        
vOrigin[2] += 5.0;

    if(
engfunc(EngFunc_PointContentsvOrigin) == CONTENTS_SKY)
        return 
true;

    return 
false;

__________________

Last edited by DJEarthQuake; 11-17-2021 at 14:16. Reason: grammar
DJEarthQuake 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 14:36.


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