Raised This Month: $ Target: $400
 0% 

Stick a sprite to the wall/floor


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 09-17-2010 , 18:31   Stick a sprite to the wall/floor
Reply With Quote #1

How I can do that by placing a sprite using this code (by hunter_digital with a little editions):

PHP Code:
new Float:fOrigin[3]
   
   if(
enPortal[id-1])  
        
remove_entity(enPortal[id-1])  
   
   
enPortal[id-1] = create_entity("env_sprite")
   
   
   
IVecFVec(enOriginfOrigin)

   
   
entity_set_string(enPortal[id-1], EV_SZ_classname"portal_entrance")
   
entity_set_model(enPortal[id-1], "sprites/portal1.spr")
   
entity_set_int(enPortal[id-1], EV_INT_spawnflagsSF_SPRITE_STARTON)
   
entity_set_float(enPortal[id-1], EV_FL_framerate30.0)

   
DispatchSpawn(enPortal[id-1])

   
entity_set_origin(enPortal[id-1], fOrigin)
   
entity_set_size(enPortal[id-1], Float:{-25.0, -25.0, -25.0}, Float:{25.025.025.0})
   
entity_set_int(enPortal[id-1], EV_INT_solidSOLID_TRIGGER)
   
entity_set_int(enPortal[id-1], EV_INT_movetypeMOVETYPE_FLY)
   
entity_set_int(enPortal[id-1], EV_INT_rendermodekRenderTransAdd)
   
entity_set_float(enPortal[id-1], EV_FL_renderamt255.0)
   
entity_set_float(enPortal[id-1], EV_FL_scale1.0)
   
entity_set_edict(enPortal[id-1],EV_ENT_ownerid
spit it on a wall or in the ground?

And how can i rotate the sprite to have a proper view of it
See this screenshots:
http://img832.**************/img832/8...ancity0004.png
http://img441.**************/img441/3...ancity0005.png
http://img121.**************/img121/8...ancity0006.png
http://img255.**************/img255/7...ancity0007.png

Thatīs what i wnat to fix putting the sprite on the ground/wall with the correct angles

Sorry for my english if you donīt understand, just ask me
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.

Last edited by S34Qu4K3; 09-17-2010 at 19:23.
S34Qu4K3 is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 09-17-2010 , 19:21   Re: Stick a sprite to the wall/floor
Reply With Quote #2

Quote:
Originally Posted by S34Qu4K3 View Post
How I can do that by placing a sprite using this code (by hunter_digital with a little editions):

PHP Code:
new Float:fOrigin[3]
   
   if(
enPortal[id-1])  
        
remove_entity(enPortal[id-1])  
   
   
enPortal[id-1] = create_entity("env_sprite")
   
   
   
IVecFVec(enOriginfOrigin)

   
   
entity_set_string(enPortal[id-1], EV_SZ_classname"portal_entrance")
   
entity_set_model(enPortal[id-1], "sprites/portal1.spr")
   
entity_set_int(enPortal[id-1], EV_INT_spawnflagsSF_SPRITE_STARTON)
   
entity_set_float(enPortal[id-1], EV_FL_framerate30.0)

   
DispatchSpawn(enPortal[id-1])

   
entity_set_origin(enPortal[id-1], fOrigin)
   
entity_set_size(enPortal[id-1], Float:{-25.0, -25.0, -25.0}, Float:{25.025.025.0})
   
entity_set_int(enPortal[id-1], EV_INT_solidSOLID_TRIGGER)
   
entity_set_int(enPortal[id-1], EV_INT_movetypeMOVETYPE_FLY)
   
entity_set_int(enPortal[id-1], EV_INT_rendermodekRenderTransAdd)
   
entity_set_float(enPortal[id-1], EV_FL_renderamt255.0)
   
entity_set_float(enPortal[id-1], EV_FL_scale1.0)
   
entity_set_edict(enPortal[id-1],EV_ENT_ownerid
spit it on a wall or in the ground?

And how can i rotate the sprite to have a proper view of it
See this screenshots:
http://img832.**************/img832/8...ancity0004.png
http://img441.**************/img441/3...ancity0005.png
http://img121.**************/img121/8...ancity0006.png
http://img255.**************/img255/7...ancity0007.png

Thatīs what i wnat to fix putting the sprite on the ground/wall with the correct angles

Sorry for my english if you donīt understand, just ask me
1 x 1 pictures? Nice.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 09-17-2010 , 19:24   Re: Stick a sprite to the wall/floor
Reply With Quote #3

Srry bad copy & paste, fixed
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-17-2010 , 19:34   Re: Stick a sprite to the wall/floor
Reply With Quote #4

These may help:
http://forums.alliedmods.net/showthread.php?t=91474
http://forums.alliedmods.net/showthread.php?t=66411
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 09-17-2010 , 19:46   Re: Stick a sprite to the wall/floor
Reply With Quote #5

Thanks exolent iīm reading Position Velocities and Angles
And iīve tried to adapt lie flat to the conde by doesnīt work
iīve added the stock and when i create a sprie iīve put: lie_flat(exPortal[id-1])
and doesnīt work

And iīm seeing the Wall Text Code
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.

Last edited by S34Qu4K3; 09-17-2010 at 19:50.
S34Qu4K3 is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 09-18-2010 , 05:51   Re: Stick a sprite to the wall/floor
Reply With Quote #6

Sprites rotate differently from models, one axis is flipped, try flipping them one by one.

One question... why do you do all that "id-1" ?
__________________
Hunter-Digital is offline
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 09-18-2010 , 07:33   Re: Stick a sprite to the wall/floor
Reply With Quote #7

Iīve tried the sprite fixer but itīs the same

Iīve made an array[33] so thath the players can make his Own portal, if i use only enPortal, when a player make a portal, other portal from a player is deleted
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.
S34Qu4K3 is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 09-18-2010 , 13:33   Re: Stick a sprite to the wall/floor
Reply With Quote #8

Sprite fixer doesn't do that, you already used it for what was needed... sprites to obey angles.
But I said that oriented sprites are flipped on a axis comparing to models and if you're using the lie_flat() thing, you should flip some coordinates until you can see the sprite correctly.

Flipping:
Code:
new Float:fAngles[3]

entity_get_vector(id, EV_VEC_v_angle, fAngles) /* just an example */

fAngles[2] *= -1.0 /* flip the Z axis */
And about the ID thing, I was asking WHY do you substract 1 from the id ? If you're declaring as 33, you should just use id.
__________________
Hunter-Digital is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 09-18-2010 , 13:41   Re: Stick a sprite to the wall/floor
Reply With Quote #9

this may help you: http://forums.alliedmods.net/showthread.php?t=49566
lazarev is offline
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 09-18-2010 , 14:17   Re: Stick a sprite to the wall/floor
Reply With Quote #10

Quote:
Originally Posted by lazarev View Post
Iīve already readed it ^^

Quote:
Originally Posted by Hunter-Digital View Post
Sprite fixer doesn't do that, you already used it for what was needed... sprites to obey angles.
But I said that oriented sprites are flipped on a axis comparing to models and if you're using the lie_flat() thing, you should flip some coordinates until you can see the sprite correctly.

Flipping:
Code:
new Float:fAngles[3]

entity_get_vector(id, EV_VEC_v_angle, fAngles) /* just an example */

fAngles[2] *= -1.0 /* flip the Z axis */
And about the ID thing, I was asking WHY do you substract 1 from the id ? If you're declaring as 33, you should just use id.
Itīs the same, the sprite doesnīt rotate flipping the axix before lie_flat(enPortal[id-1])
EDIT: Iīve solved something, iīve removed:
PHP Code:
if (pev(entpev_flags) & ~FL_ONGROUND) return 
And the lie flat works only in this case:
http://img208.**************/img208/3...ancity0008.png
When shot at a wall or ground, the lie flat donīt change the angle
ID: It is not to leave an open slot in the array ([0]), but i think that i can use only [id]
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.

Last edited by S34Qu4K3; 09-18-2010 at 15:15.
S34Qu4K3 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 07:57.


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