Raised This Month: $ Target: $400
 0% 

Sprite Solid?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 02-13-2022 , 01:02   Sprite Solid?
Reply With Quote #1

Hi, I wanted to know if it is possible to make the created sprite remain solid, and can make other players touch it?

PHP Code:
public fireshot(id)
{
   
// Get position from eyes
    
new aimvec[3]
    
get_user_origin(idaimvec3)
    
// Throw fire
    
fireEffects(idaimvec)
}

public 
fireEffects(idaimvec[3])
{

   
// Fire - this way it's just a sprite but it is not solid
    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    
write_byte(3)
    
write_coord(aimvec[0])
    
write_coord(aimvec[1])
    
write_coord(aimvec[2])
    
write_short(gSpriteBurning)
    
write_byte(22)
    
write_byte(10)
    
write_byte(0)
    
message_end()


    
// this way is the solid sprite but it is seen with all the black background of the sprite
     
new Float:vOrigin[3]
    
vOrigin[0] += aimvec[0]
    
vOrigin[1] += aimvec[1]
    
vOrigin[2] += 30.0
    
    
new amaterasuaowner id
    
new amaterasu create_entity("info_target")
    
entity_set_string(amaterasuEV_SZ_classname"amaterasu"
    
entity_set_model(amaterasu"sprites/shmod/blue_flame.spr")     
    
entity_set_size(amaterasuFloat:{-2.5, -2.5, -1.5}, Float:{2.52.51.5})
    
entity_set_edict(amaterasuEV_ENT_owneramaterasuaowner)
    
entity_set_int(amaterasuEV_INT_solid2)
    
entity_set_int(amaterasuEV_INT_movetype6)
    
entity_set_vector(amaterasuEV_VEC_originvOrigin)


Arje is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-13-2022 , 04:19   Re: Sprite Solid?
Reply With Quote #2

create_entity("info_target")



create_entity("env_sprite")


Then add

entity_set_int(amaterasu, EV_INT_rendermode, kRenderTransTexture);
entity_set_float(amaterasu, EV_FL_renderamt, 255.0);
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-13-2022 at 04:24.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 02-13-2022 , 10:44   Re: Sprite Solid?
Reply With Quote #3

First thanks again for the help and guidance

i try this, but the black background was still
PHP Code:
entity_set_int(amaterasuEV_INT_rendermodekRenderTransTexture);
entidad_set_float(amaterasuEV_FL_renderamt255.0); 
so i try, and now remove the black background, but the animation of the sprite is not done, is it possible to do it?

PHP Code:
new Float:vOrigin[3]
    
vOrigin[0] += aimvec[0]
    
vOrigin[1] += aimvec[1]
    
vOrigin[2] += aimvec[2]
    
    new 
amaterasuaowner id
    
new amaterasu create_entity("env_sprite")
    
    
entity_set_string(amaterasuEV_SZ_classname,"amaterasu")
    
entity_set_model(amaterasu,"sprites/shmod/blue_flame.spr")
    
entity_set_int(amaterasuEV_INT_solid2// solid
    
    // I wanted to remove this to see if it made the animation but no
    //entity_set_int(amaterasu, EV_INT_movetype, MOVETYPE_NONE) // don't move
    
    
entity_set_edict(amaterasuEV_ENT_owneramaterasuaowner)
    
entity_set_int(amaterasuEV_INT_rendermodekRenderFxNoDissipation);
    
set_rendering(amaterasukRenderFxNoDissipation02550kRenderGlow255// put this to remove the black background of the sprite
    
    
entity_set_origin(amaterasuvOrigin// put your origin here : Float:{X , Y , Z}
    
entity_set_vector(amaterasuEV_VEC_originvOrigin
I don't know if you can see it in the image, but the size of the sprite is blue, green is what I do with the code, I would like it to be like blue

Arje is offline
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 02-13-2022 , 11:14   Re: Sprite Solid?
Reply With Quote #4

well i found the solution find the solution to achieve the animation:

PHP Code:
entity_set_float(amaterasuEV_FL_animtime1.0// I'm not entirely sure about this, but I think it is the time in which the sprite will animate.
    
entity_set_float(amaterasuEV_FL_framerate1.0// Frames per second.
    
entity_set_int(amaterasuEV_INT_spawnflagsSF_SPRITE_STARTON// Essential if the animation is playing, I think.
    
dllfuncDLLFunc_Spawnamaterasu 
but how can I increase the size of the sprite so that the green is more similar to the blue?
Arje is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-13-2022 , 11:20   Re: Sprite Solid?
Reply With Quote #5

Using engine entity_set_float(amaterasu, EV_FL_scale, 2.0); // 2.0 is double the sprite size.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-13-2022 at 11:21.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 02-13-2022 , 12:18   Re: Sprite Solid?
Reply With Quote #6

Thanks!
but i have another question, I realized that the green flame is not generated on the floor, as if the blue one does, how can I solve this?

i try drop_to_floor(amaterasu) but it didn't do anything, and i guess it's not the solution either
Arje is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-13-2022 , 15:53   Re: Sprite Solid?
Reply With Quote #7

make the entity MOVETYPE_TOSS then use the function drop_to_floor
__________________
@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
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 02-13-2022 , 16:42   Re: Sprite Solid?
Reply With Quote #8

thanks but it didn't work either, but i realized i could do this:

PHP Code:
vOrigin[2] += aimvec[2
to
PHP Code:
vOrigin[2] += aimvec[2] + 60 
now it displays correctly as I want, I don't know if it's the best way but it works for me, thanks again for the help.
Arje is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 02-13-2022 , 16:50   Re: Sprite Solid?
Reply With Quote #9

You're very welcome.

You probably need to change the entity move type after you spawn the entity with DLLFunc_Spawn
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 02-13-2022 at 16:51.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 19:11.


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