Question about showing sprites, etc...
I was wondering if there already is a tutorial about how the sprites work in the .sma files, or if someone could write one. They seem pretty hard to figure out.
Also, I had a question about origins... Just in general, how does it work, how does vec and aimvec work, etc... I just need some general explanation that I havn't found in tutorials anywhere. I'm learning little by little from hero .sma files, but there are many things I still need to figure out. |
1 Attachment(s)
Ok, well I will give you a brief tutotial on creating messages, these can be used to create Tracers, lighting, User messages ect ect, basically very many and very varied graphical effects, i will be using Daredevils code as a base. I will also attach the HL SDK const.h for convenience.
First off, let me help you with origins as they are used in most messages. When creating a origin the first thing you need is a place to save it, this is done with an array, for a origin the array needs 3 slots to place information, therefore we create the array like so: Code:
Code:
originA[0] will have the X origin originA[1] will have the Y origin originA[2] will have the Z origin now that is a basic origin, it will get the exact location of where a player is standing, you can also get origins based on other things. for example Code:
the numbers corrispond to this 0 - current position. 1 - position from eyes (weapon aiming). 2 - end position from player position. 3 - end position from eyes (hit point for weapon). 4 - position of last bullet hit (only CS). So putting a 4 at the end of that origin will save the co-ordinates of where your last bullet hit, this is useful for things like bullet tracers. Now, one to Messages, i will give you a line by line help here Code:
+SVC_TEMPENTITY -> This is the type of message you will creating, tempentity is as the name suggests, a temporary entity, which can take the form of many graphical effects. there are more types but this is the most common for graphics, check the const.h for more +originA -> This is the Origin, as explained above, sometimes it is not needed, and other times a simple {0,0,0} will do (sets X Y and Z to zero, somewhere in the middle of the map) +id -> this is the player ID that will be messaged Code:
NOW, it is important to note that everything after this is based entierly on what message type you are using, the const.h file lists what it needs after defining the message type you wish to use, most, if not all messages use differnt bytes,co-ords, shorts etc. i will list a some of them and explain what they do. These Paticular ones are used by TE_BEAMCYLINDER which im using as an example. Code:
-> The Second set of 3 are in fact still using the same origin, but with a differnce, this basically is telling the graphic where you want the final stage of the beamcylinder to be, in this case 600 units (90-100 units is how high a player is as reference) So it will then create the cylindir and expand until it reaches that distance, The time it takes is dependent on the life of the graphic (defined below) if the life is high, the beam will take its time getting to its destination Code:
Code:
Code:
Code:
Code:
Code:
This is relativly brief, as there are alot of other types that are available, mostly if you use your brain and using heros that other people have made you should be able to get a grasp on it relativly quickly |
Perfect.
Perhaps you can repost your tutorial on the site and get it stickied? And of course, keep the included file. Thanks much prowler, I understand now. |
No problems, its just a pleasure to help someone who actually has some idea of what they are doing :P
as for the tutorial idea, it was something i had in mind for awhile, i just really needed a subject, and you handed me one :P I'll wright a few other tutorials that arent coverd in the ones that are already there, when i have 2 or 3 done i'll post them as a sperate thread, what the mod team wants to do with them after that is up to them |
| All times are GMT -4. The time now is 07:48. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.