Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Question about Sprite

Recommended Posts

I have little question.
I did a tutorial , and then i run a map and see my weapon without sprite...

I do this tutorial http://zdoom.org/wiki/Creating_new_weapons
And maybe error in first line or no ?
" Actor UberShotgun : SuperShotgun 20024 " .
Without quotes .

my DECORATE.txt in my map.wad (note).
Help me,please.

Share this post

Link to post

Can you explain me , how use sprite in script , because in tutorial i don't see the path to sprite.
Explain me step by step,please.
Because it's important for me.

Share this post

Link to post

You have to make the sprites yourself. It even says so in the second paragraph of the tutorial. (which was sneakily added by Gez a while ago :P)

Note: This tutorial uses custom sprites, which are not provided. You should provide sprites with these names or adapt the code to use standard sprite names if you want to actually test this code in ZDoom.

I have to point out that I do not like this tutorial very much. Don't get me wrong, it does a great job at explaining the basics of designing a weapon in DECORATE (which is ultimately the goal of this tutorial), but the "missing" sprites make it very confusing for someone new to scripting and it makes it hard for them to test if it works correctly. I believe such tutorials should rely on IWAD resources only. I can see the relevance of new sprite names, but in that case it would be advisable to include a download link to a wad containing sprites (even simple rectangles would do their job). But even then another question will be brought up sooner or later - why is my gun quiet. While this is a DECORATE tutorial and it does mention the need to define sounds in the SNDINFO lump, it would be better if that was also covered.

Share this post

Link to post
sevenx said:

okey, for example , i have decorate code, such as http://zdoom.org/wiki/Classes:SuperShotgun , but how i can specify a sprite path in
code ?
What i shall write in code, that my decorate code use the my sprite ?
This is my problem. Understand ?


In this tutorial, Hotwax breaks down the DECORATE code and explains step by step. That should help you out.

Share this post

Link to post

Read this. OK, now let's look at a really simple DECORATE actor, for example the pool of blood. This is the one you see when a body gets crushed by a crusher or a door.

If you search its sprite in your IWAD, you will find that it is named POB2A0. How does this relate to the sprite name format? Well, the sprite name format is NNNNFA[FA].
The NNNN part corresponds to POB2 - this is the sprite name.
The F part corresponds to A - this is the frame position. This actor only has one frame.
The A part corresponds to 0 - this is the angle of the frame. This frame has no rotations, so it is set to 0.

Let's take a look at the DECORATE code:

ACTOR SmallBloodPool 80
  Game Doom
  SpawnID 148
  Radius 20
  Height 1
    POB2 A -1
Our actor is named SmallBloodPool. As you can see, it only has one state named Spawn. In this state you can see this: POB2 A -1. What does it say?
It says that the frame A of a sprite named POB2 will be displayed for -1 tics (-1 means forever).

OK, now let's try a more complicated object, for example the evil eye.

Like before we will search for its sprites. We can see it uses three sprites CEYEA0, CEYEB0 and CEYEC0; this gives us three frames of animation. We can see that all three have the same sprite name CEYE, but they have three different frame names A, B and C. None of the frames have rotations, so they all have angles set to 0.

On to the DECORATE:
ACTOR EvilEye 41
  Game Doom
  Radius 16
  Height 54
    CEYE ABCB 6 bright
Our actor is named EvilEye. It only has one state named Spawn. What does CEYE ABCB 6 bright tell us?
It tells us that frames will be displayed in the following order: frame A first, frame B second, frame C third, frame B fourth; each one lasting 6 tics. bright means that it will glow in the dark.

Now let's take a look at a more complicated actor, e.g. the demon.

We can look at the sprites again. Because we learned more about sprite naming, we can quickly figure out that all its sprites are named SARG, and that it has eight states with rotations (A-H) and six states without them (I-N).

Let's list all sprites belonging to frame A:
SARGA1 (this is the first angle | NNNN=SARG, F=A, A=1)
SARGA2A8 (this is the 2nd angle and its mirror image, the 8th angle | NNNN=SARG, F=A, A=2, F=A, A=8)
SARGA3A7 (this is the 3rd angle and its mirror image, the 7th angle | NNNN=SARG, F=A, A=3, F=A, A=7)
SARGA4A6 (this is the 4th angle and its mirror image, the 6th angle | NNNN=SARG, F=A, A=4, F=A, A=6)
SARGA5 (this is the fifth angle | NNNN=SARG, F=A, A=5)

You can easily figure out the others yourself.

Finally we will take a quick look at the DECORATE definition:
ACTOR Demon 3002
  Game Doom
  SpawnID 8
  Health 150
  PainChance 180
  Speed 10
  Radius 30
  Height 56
  Mass 400
  SeeSound "demon/sight"
  AttackSound "demon/melee"
  PainSound "demon/pain"
  DeathSound "demon/death"
  ActiveSound "demon/active"
  Obituary "$OB_DEMONHIT" // "%o was bit by a demon."
    SARG AB 10 A_Look
    SARG EF 8 A_FaceTarget
    SARG G 8 A_SargAttack
    Goto See
    SARG H 2
    SARG H 2 A_Pain
    Goto See
    SARG I 8
    SARG J 8 A_Scream
    SARG K 4
    SARG L 4 A_NoBlocking
    SARG M 4
    SARG N -1
    SARG N 5
    Goto See
We can see that our actor named Demon has six states: Spawn, See, Melee, Pain, Death and Raise. We can see that the demon uses frames A and B when it is waiting to hear or see you (you can see them walk in place when they are not active), frames A-D for walking, frames E-G for attacking, frame H is the pain frame (displayed when it is hurt), frames I-N are its death frames (displayed when it gets killed) and frames N-I are its raise frames (death in reverse - displayed when an arch-vile resurrects it).

I hope I was able to explain how sprite naming works. You should now be able to modify your DECORATE code to display your sprites and do all sorts of other cool things. You can also read up on the specifics of sprite creation here.

Share this post

Link to post

Thank you very much,Xtroose, for this great explanation.
I understand,now.
And Thank you all,aslo.

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now