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

[ Unachievable ] Mirroring/Changing sprite angle?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-26-2020 , 07:58   [ Unachievable ] Mirroring/Changing sprite angle?
Reply With Quote #1

Is it possible to change the sprite/Mirror angle from right to left?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 12-09-2020 at 14:31.
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 11-26-2020 , 09:37   Re: Changing sprite angle?
Reply With Quote #2

Post your code
redivcram is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-26-2020 , 11:07   Re: Changing sprite angle?
Reply With Quote #3

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.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 11-26-2020 at 11:23.
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 #4

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
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-26-2020 , 12:57   Re: Changing sprite angle?
Reply With Quote #5

Scale with a negative value is mirroring so your idea should work, at least in theory.
__________________

Last edited by HamletEagle; 11-26-2020 at 12:57.
HamletEagle is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-26-2020 , 18:24   Re: Changing sprite angle?
Reply With Quote #6

an update it doesn't work the sprite gets gigantic when setting the entity scale to -1.0


Test Code
PHP Code:

public clcmd_test(id)
{
    new 
ent create_entity("env_sprite");
    
    new 
Float:fOrigin[3];
    
entity_get_vector(idEV_VEC_originfOrigin);
    
entity_set_origin(entfOrigin);
    
    
entity_set_int(entEV_INT_movetypeMOVETYPE_FLY);
    
entity_set_model(entszModel);
    
entity_set_size(entFloat:{-1.0,-1.0,-1.0}, Float:{1.0,1.0,1.0});
    
    
// Set the animation's framerate
    
set_peventpev_frame0.0 )
    
set_peventpev_framerate0.5 )
    
entity_set_float(entEV_FL_scale, -1.0);
    
set_peventpev_spawnflagsSF_SPRITE_STARTON )
    
    
dllfuncDLLFunc_Spawnent )

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 11-26-2020 at 18:53.
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 12-08-2020 , 20:03   Re: Changing sprite angle?
Reply With Quote #7

EngFunc_ChangeYaw
__________________
DJEarthQuake is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 11-26-2020 , 20:54   Re: Changing sprite angle?
Reply With Quote #8

what happens with changing pev_angles?
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-26-2020 , 21:42   Re: Changing sprite angle?
Reply With Quote #9

it doesn't flip like the picture, it rather just rotates around the forward axis
__________________
@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 03-29-2021 , 10:54   Re: Changing sprite angle?
Reply With Quote #10

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
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 04:40.


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