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

[ Unachievable ] Mirroring/Changing sprite angle?


Post New Thread Reply   
 
Thread Tools Display Modes
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 03-29-2021 , 10:54   Re: Changing sprite angle?
Reply With Quote #21

Quote:
Originally Posted by Natsheh View Post
it doesn't flip like the picture, it rather just rotates around the forward axis
It takes 2 flips. Flip both vertically and horizontally. That's 180 degrees from X and Y axes.
__________________
DJEarthQuake is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-29-2021 , 16:12   Re: [ Unachievable ] Mirroring/Changing sprite angle?
Reply With Quote #22

What are you talking about it depends on the type of the sprite...!!!
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
redivcram
Veteran Member
Join Date: Jul 2014
Location: Serbia
Old 03-29-2021 , 17:12   Re: [ Unachievable ] Mirroring/Changing sprite angle?
Reply With Quote #23

Are you talking about sprites that rotate in respect to the player's position or static ones? (IIRC env_sprite vs temp entity)
redivcram is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 03-29-2021 , 18:33   Re: [ Unachievable ] Mirroring/Changing sprite angle?
Reply With Quote #24

"it rather just rotates around the forward axis".

Did you test the other 2 axes?

So close. That's plus or minus 180 degrees. Test all 3 axes!
Code:
entity_get_vector(g_model,EV_VEC_angles,Axis);
I mirror all 3 angles of grenade ent as it touches things otherwise my effects are 2D not 3D.
__________________
DJEarthQuake is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-30-2021 , 02:28   Re: [ Unachievable ] Mirroring/Changing sprite angle?
Reply With Quote #25

Do you have a test code?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 04-01-2021 , 03:13   Re: Changing sprite angle?
Reply With Quote #26

Quote:
Originally Posted by Natsheh View Post
I don't need a code for a simple question.

You have a env_sprite entity, wondering if it's possible to change the sprite view from right to left .

An example Image




Edit : I think it will be solved if I changed the entity scale to negative. I only need to test and give a feedback.
When you make the ent facing left and you make a 2nd ent and it is also facing left and need to make it face right like this?

Use angles and show the code that is failing to accomplish that. It can be done multiple ways.

Code:
/* * Appears unfinished/needs tested ::: Github * stock EF_ChangeYaw(const ENTITY)     return engfunc(EngFunc_ChangeYaw, ENTITY); stock EF_ChangePitch(const ENTITY)     return engfunc(EngFunc_ChangePitch, ENTITY) * */ //Pitch Yaw Roll (Y Z X) new g_angles[3] g_angles = { 180.0, 180.0, 180.0 } new const Float:shift = HALF_A_CIRCLE new Float:X = Axis[0] new Float:Y = Axis[1] new Float:Z = Axis[2] set_pev(ent, pev_owner, 0); new Float:Origin[3] new Float:Axis[3] entity_get_vector(ent,EV_VEC_origin,Origin); entity_get_vector(ent,EV_VEC_angles,Axis); set_pev( ent, pev_angles, Y) set_pev( ent, pev_angles, Z) set_pev( ent, pev_angles, X) set_pev( ent, pev_angles, g_angles) fm_set_kvd(ent, "angles", "0 -270 0") //sliding left fm_set_kvd(ent, "angles", "0 270 0") //sliding right

Quote:
Sprites also have five orientation types:
  • Parallel - Most common default type; image always faces camera
  • Parallel Upright - Locked to z-axis so only rotates to face camera (best for things that need to be placed on ground, for example trees or fire effect)
  • Oriented - Does not rotate to camera; has a fixed orientation defined in hammer (not for use with env_glow)
  • Parallel Oriented - Faces camera just like Parallel but can be rotated in hammer (not for use with env_glow)
  • Facing Upright - Lesser used mode that works just like Parallel upright, but rotation aligns with player origin instead of camera. (can be buggy at close distances, would only recommend for a specific effect)


https://developer.valvesoftware.com/wiki/Env_sprite

https://sites.google.com/site/svenma...ide/env_sprite


Quote:
Originally Posted by Natsheh View Post
Yeah this won't work.

It will not affect the sprite in any way the only possible method is to add more frames to the sprite.
Draw Type can be handled with the GoldSrc engine like you hoped.



Code:
fm_set_kvd(ent, "vp_type", "4")
I find env_spritetrain a bit more intriguing as it can be way-pointed via path_corners. That's how the osprey is made. Once you are happy with the orientation by whatever means necessary you should be free to finish creating whatever you are working on.
__________________

Last edited by DJEarthQuake; 04-01-2021 at 05:02.
DJEarthQuake is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-01-2021 , 10:23   Re: [ Unachievable ] Mirroring/Changing sprite angle?
Reply With Quote #27

thanks alot for your time and dedication ill test it when i have time, it seems i had no clue about which vp_type affects the angles of the sprite.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 04-01-2021 , 11:58   Re: [ Unachievable ] Mirroring/Changing sprite angle?
Reply With Quote #28

You are most welcome sir. You have helped many people. Everytime I do something like this 10 new plugins I thought were impossible turn up.

I made movable exploding walls that drop munitions. Heads up markers like on DoD. Search and destroy apaches. I can target them to whatever certain area. Just make a waypoint/target and then .apache and there she blows!

Be advised that might only work on Sven/ I have not had to use it. They do a lot of convenience coding. Also I made a new well started out as a stock to change angles. Test that FM YAWCHANGE. It very well might do what I did.



EF_ChangePitch might do this!
Code:
#include amxmodx #include engine #include fakemeta //clock-wise yaw  tail-spin fish-tailing public ChangeAngle(ent) {     set_pev(ent, pev_owner, 0);     new Float:LEFT = 270.0     new Float:Origin[3]     new Float:Axis[3]     if(pev_valid(ent))     {         entity_get_vector(ent,EV_VEC_angles,Axis);         new Float:X = Axis[0]         new Float:Y = Axis[1]         new Float:Z = Axis[2]         if( Y == LEFT )         {             Y = Axis[1]-180.0             set_pev( ent, pev_angles, Y)             client_print(0, print_console, "Dead on!");             return         }         if( Y != LEFT )         {             Y = Axis[1]+90.0             set_pev( ent, pev_angles, Y)             client_print(0, print_console, "Flipping...");         }         else         set_pev( ent, pev_angles, Axis[1]+90.0)     } }
__________________

Last edited by DJEarthQuake; 04-09-2021 at 06:43. Reason: Delete filler
DJEarthQuake is offline
Reply


Thread Tools
Display Modes

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 15:39.


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