Staredit Network

Staredit Network -> Modding Assistance -> ICE assisstance with spellcasting
Report, edit, etc...Posted by Darius.DeValle on 2005-06-04 at 22:53:37
I need some help with ICE in making several units, namely the Dark Templar Hero, Zeratul, Hunter Killer, and Firebats capable of using spells, but everytime I try, it crashes. I use Memgraft to give them the spells and Arsenal III to give them energy, but once I attempt to use the ability...

So, of anyone can help me, either with a tutorial, an explanation, or both, that would help me out greatly. I'm planning a second mod and I want to add these elements to it.
Report, edit, etc...Posted by Slyence on 2005-06-04 at 23:06:21
Basic ICE Tutorial
Report, edit, etc...Posted by DT_Battlekruser on 2005-06-04 at 23:13:03
That doesn't help in the slightest. Try to answer the question next time. I could use an answer to this too.
Report, edit, etc...Posted by BSTRhino on 2005-06-05 at 02:55:57
I don't recommend you use ICE to learn how to do this, I think the code in IceCC makes it much easier to visualise and understand what's happening when you add a spellcasting animation to a unit.

I'm writing up how to do it right now. It's actually ended up kind of long, it could be a tutorial in its own right, if only it described how to do the Arsenal III and StarGraft parts. Perhaps if one of you guys wrote up how to do the Arsenal III and StarGraft parts, I could put my part on what to do with IceCC and what it all means and we'd have a tutorial to submit. But I have to go now, so I can't finish my write-up right now. I'll be back soon with a full description I hope.
Report, edit, etc...Posted by DT_Battlekruser on 2005-06-05 at 03:09:34
The Ar3/MEMGraft part is in the sticky now happy.gif All 87 or so steps tongue.gif
Report, edit, etc...Posted by Darius.DeValle on 2005-06-05 at 14:54:49
I know how to work with Memgraft and Arsenal III, so I'll try to help, but...

Anyhow, I'll await the IceCC tutorial before I make any serious moves.

ADDITION:
QUOTE(revolver_devalle @ Jun 5 2005, 01:41 PM)
I know how to work with Memgraft and Arsenal III, so I'll try to help, but...

Anyhow, I'll await the IceCC tutorial before I make any serious moves.
[right][snapback]227148[/snapback][/right]



While I wait for someone to help me with the spellcasting stuff, how would you make Photon Cannons do that? Now that I'm on the subject, I'm interested.
Report, edit, etc...Posted by DT_Battlekruser on 2005-06-05 at 14:59:42
You would apply it to the Photon Cannon the same way you would an SCV. Make it a spellcaster, and give it the button.
Report, edit, etc...Posted by scwizard on 2005-06-05 at 15:17:25
ICE is used to change the actuall spells (and for lots of other stuff).

So what DTBC said, you don't need it to give units spell casting.

The sticky at the top has been updated with a tutorial on how to give an SCV lockdown, malestrom and scanner sweep.
Report, edit, etc...Posted by DT_Battlekruser on 2005-06-05 at 15:18:38
Giving it animation frames in ICE doesn't stop you from needing to check "Spellcaster" in Ar3. All the spellcaster check does is give the unit energy.
Report, edit, etc...Posted by Darius.DeValle on 2005-06-05 at 23:10:28
QUOTE(DT_Battlekruser @ Jun 5 2005, 02:18 PM)
Giving it animation frames in ICE doesn't stop you from needing to check "Spellcaster" in Ar3.  All the spellcaster check does is give the unit energy.
[right][snapback]227180[/snapback][/right]


I know all of that. But, this isn't really helping me make non-spellcaster units capable of using spellcaster buttons. Everyone, ust assume that I can use Memgraft and Arsenal III near-perfectly. I just wish to know how to give the animation frames the aforementioned units would require so that the game would crash. Everything else I know how to do.

ADDITION:
QUOTE(DT_Battlekruser @ Jun 5 2005, 01:59 PM)
You would apply it to the Photon Cannon the same way you would an SCV.  Make it a spellcaster, and give it the button.
[right][snapback]227163[/snapback][/right]


Sorry, I think I led you astray. I meant how would I make the Photon Cannon attack mutiple times, like the dragoon in the tutorial.
Report, edit, etc...Posted by Forsaken on 2005-06-05 at 23:10:31
QUOTE(revolver_devalle @ Jun 5 2005, 10:54 AM)
I know how to work with Memgraft and Arsenal III, so I'll try to help, but...

Anyhow, I'll await the IceCC tutorial before I make any serious moves.

ADDITION:
While I wait for someone to help me with the spellcasting stuff, how would you make Photon Cannons do that? Now that I'm on the subject, I'm interested.
[right][snapback]227148[/snapback][/right]


That is exactly where I am at. I know how to do everything in the FAQ because of what you have posted . (And yes I understand what is there). Here is some BASIC knowledge for ICE. StealthyDeath wrote this FAQ (I think).

Go Here!
Report, edit, etc...Posted by DT_Battlekruser on 2005-06-06 at 00:13:41
Well we stand here: BST is writing the ICECC part of this so just wait. The other part is in the sticky.

Revolver> Do the same as you would for the dragoon, copy the attack with 1 line 5 times and change missile properties to halo etc.
Report, edit, etc...Posted by BSTRhino on 2005-06-06 at 21:45:29
After you have fixed up your spellcasting unit in Arsenal III and StarGraft, the last element of giving a unit the ability to use an existing spell is to update its iscript animation. Every time a unit is ordered to cast a spell, StarCraft will attempt to run its spellcasting animation. The problem is that, most units don't have a spellcasting animation, and if StarCraft tries to find the spellcasting animation on one of these units, it will not find one, causing StarCraft to crash.

Let's take a look at how StarCraft calls animations. The text-based form of IceCC has a way of allowing easier visualisation of how iscripts flow, and so for this tutorial, IceCC will be used. However, once you understand the concepts, the program you use is your choice. Below is the iscript code for the SCV, extracted using IceCC.

CODE
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 247 SCV (terran\SCV.grp)
.headerstart
IsId            84
Type            15
Init            SCVInit
Death           SCVDeath
GndAttkInit     SCVGndAttkInit
AirAttkInit     [NONE]
SpAbility1      [NONE]
GndAttkRpt      SCVGndAttkInit
AirAttkRpt      [NONE]
SpAbility2      [NONE]
GndAttkToIdle   SCVGndAttkToIdle
AirAttkToIdle   [NONE]
SpAbility3      [NONE]
Walking         SCVWalking
Other           SCVOther
BurrowInit      [NONE]
ConstrctHarvst  [NONE]
IsWorking       SCVIsWorking
.headerend
# ----------------------------------------------------------------------------- #

SCVInit:
imgul09         248 0 7 # SCVShad (terran\SCV.grp)
playfram        0x00 # frame set 0
goto            SCVOther

SCVOther:
wait            125
goto            SCVOther

SCVDeath:
playsnd         369 # Terran\SCV\TSCDth00.WAV
imgol08         332 0 0 # TerranBuildingExplosionsmall (thingy\tBangS.grp)
wait            3
end            

SCVGndAttkInit:
shvertpos       0
wait            1
playfram        0x22 # frame set 2
attack25        1
wait            1
playfram        0x11 # frame set 1
wait            1
gotorepeatattk  
goto            SCVOther

SCVGndAttkToIdle:
playfram        0x00 # frame set 0
goto            SCVOther

SCVWalking:
playfram        0x00 # frame set 0
imgol08         249 0 0 # SCVGlow (thingy\tscGlow.grp)
shvertpos       0
goto            SCVOther

SCVIsWorking:
shvertpos       0
wait            1
local00:
playfram        0x22 # frame set 2
useweapon       14 # Fusion Cutter
wait            1
playfram        0x11 # frame set 1
waitrand        8 10
goto            local00


In IceCC, the scripts for each unit are made up of two parts. First, there is the header, which can be found between .headerstart and .headerend lines. Below the headers (usually) are the commands for the script, and throughout the commands are a series of labels, like "SCVWalking:" and statements, such as "attack25 1". To understand how animations are called in StarCraft, it is important to see how the header and the rest of the script are connected.

Each line in the header is made up of a keyword then a value, separated by a space. For instance, if we skip the first two lines of the header - they might be explained in another tutorial - there is the keyword "Init" and its value is "SCVInit". That is saying to StarCraft, when you have to run the "Init" animation for this image, execute the code starting from "SCVInit". Notice that a label name "SCVInit" is in the code, right below the header. Yes, take a look at it, don't take my word for it, go up there and look, it's fun to see it for yourself.

The Init animation will be run when the SCV unit is first created. So, StarCraft knows to call SCVInit when the SCV initialises because it is written in the iscript header. In the same way, StarCraft knows to call SCVGndAttkInit when the SCV needs to play its ground attack animation because it is written right next to the GndAttkInit keyword in the header.

As you can also see, some of the keywords in the header have the word [NONE] next to them, like AirAttkInit does. Guess what happens if StarCraft tries to play the SCV's air attack animation when it's got [NONE] for its code label? That's right, you guessed it, StarCraft will not know what code to run, and so it will crash. Perhaps you already knew that, but now that you can see the parts that are causing the crash, maybe you can guess how you would fix this.

For spellcasting, the concept is the same. If StarCraft tries to run the non-existent spellcasting animation, then it will crash. So you need to go to the spellcasting animation for your unit and change the [NONE] to a code block, which you might even write yourself. However, if you look at all the animation types the SCV has above, there is just one problem that could be stopping you from giving the SCV a spellcasting animation. Do you see it? Think about it.

Looking at the iscript for the SCV, there seem to be three spellcasting animations - SpAbility1, SpAbility2 and SpAbility3. Which one are you meant to change? I could tell you directly, but I'm going to teach you something even better - how to find out the answer for yourself.

Here's the Queen's iscript.

CODE
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 046 Queen (zerg\queen.grp)
.headerstart
IsId            27
Type            12
Init            QueenInit
Death           QueenDeath
GndAttkInit     QueenGndAttkInit
AirAttkInit     QueenGndAttkInit
SpAbility1      [NONE]
GndAttkRpt      QueenGndAttkInit
AirAttkRpt      QueenGndAttkInit
SpAbility2      QueenSpAbility2
GndAttkToIdle   QueenGndAttkToIdle
AirAttkToIdle   QueenGndAttkToIdle
SpAbility3      [NONE]
Walking         QueenWalking
Other           QueenGndAttkToIdle
BurrowInit      [NONE]
.headerend
# ----------------------------------------------------------------------------- #

QueenInit:
imgul09         47 0 42 # QueenShad (zerg\queen.grp)
playfram        0x00 # frame set 0
waitrand        1 4
QueenGndAttkToIdle:
playfram        0x00 # frame set 0
wait            2
playfram        0x11 # frame set 1
wait            2
playfram        0x22 # frame set 2
wait            2
playfram        0x33 # frame set 3
wait            2
playfram        0x44 # frame set 4
wait            2
goto            QueenGndAttkToIdle

QueenDeath:
playsndbtwn     925 927 # Zerg\Queen\ZQuDth00.WAV, Zerg\Queen\ZQuDth02.WAV
sprol0f         156 0 0 # QueenBirth (zerg\zquDeath.grp)
wait            1
end            

QueenGndAttkInit:
shvertpos       0
playfram        0x55 # frame set 5
wait            1
playfram        0x66 # frame set 6
wait            1
playfram        0x77 # frame set 7
wait            1
playfram        0x88 # frame set 8
playsnd         90 # Bullet\ZQuFir00.wav
attack25        1
wait            1
playfram        0x99 # frame set 9
wait            1
playfram        0xaa # frame set 10
gotorepeatattk  
goto            QueenGndAttkToIdle

QueenSpAbility2:
shvertpos       0
playfram        0x55 # frame set 5
nobrkcodestart  
wait            1
playfram        0x66 # frame set 6
wait            1
playfram        0x77 # frame set 7
wait            1
playfram        0x88 # frame set 8
castspell      
sigorder        2
wait            1
playfram        0x99 # frame set 9
wait            1
playfram        0xaa # frame set 10
nobrkcodeend    
gotorepeatattk  
goto            QueenGndAttkToIdle

QueenWalking:
playfram        0x00 # frame set 0
wait            1
playfram        0x11 # frame set 1
wait            1
playfram        0x22 # frame set 2
wait            1
playfram        0x33 # frame set 3
wait            1
playfram        0x44 # frame set 4
wait            1
goto            QueenWalking


Does the Queen use SpAbility1, SpAbility2 or SpAbility3 for its spellcasting animation? If you haven't worked it out yet, look again, it is quite obvious. Or highlight this text: Correct answer: SpAbility2

What you did there was look at something else which does what you want and learnt from it. Where you can, that's what you should do when you want to know the answer to something, it will expand your modding knowledge in a way that explanations or tutorials cannot, because you are actively seeking answers.

However, there are things that would take you weeks to understand yourself but only minutes for another experienced modder to explain. Writing the code for a spellcasting script might be one of these. So I've got a quick example of how I would write the spellcasting animation code for the SCV here to make sure all the important points are covered.

First, I would write the code for spellcasting to the SCV's script. In most cases, a good place to start for this is to just copy the code from one of the attack animations. This will be a good place for you to start if you are creating a spellcasting animation. So after copying the attack animation, here would be my first draft of the spellcasting code...
CODE
MyCastSpellAnimation:
shvertpos       0
wait            1
playfram        0x22 # frame set 2
attack25        1
wait            1
playfram        0x11 # frame set 1
wait            1
gotorepeatattk  
goto            SCVOther


Of course, spellcasting doesn't involve attacking, so I'd have to replace the attack command with the cast spell command. By looking at the Queen's (or any other spellcaster unit's) script I can see the commands that are used to cast the spell are these ones:
CODE
castspell
sigorder 2

The castspell command casts the spell, and the sigorder 2 command says to StarCraft "I'm finished casting the spell" and unactivates the button. If you want to see what it does exactly, try making a script without the sigorder 2 command.

CODE
MyCastSpellAnimation:
shvertpos       0
wait            1
playfram        0x22 # frame set 2
castspell
sigorder 2
wait            1
playfram        0x11 # frame set 1
wait            1
gotorepeatattk  
goto            SCVOther


And that's the complete script. You can edit this further if you want to have flares, spinning, jumping or whatever else before the spell is cast. The order of the different blocks in the script actually doesn't matter, so if this code was put at the top, bottom, or somewhere in the middle of the script it wouldn't make a difference, as long as it isn't put right in the middle of an existing block.

Like the spellcasting animation of the Queen, the spellcasting animation also should always have a gotorepeatattk command just before it goes to the idle animation of the unit. This signals StarCraft that the unit is ready to repeat casting the spell, it's not actually a jump command like its name indicates.

Now that the spellcasting animation code is created, the header of course needs to be updated. As you now know, that means making SpAbility2 point to the new code block label, not just [NONE].

CODE
SpAbility2      MyCastSpellAnimation


So that is how I would give the SCV's spellcasting animation. This description is by no means a definitive set of steps that must be performed in a specific order, it is just the way I would go about achieving the required parts. In summary, the necessary parts you need to have for a spellcasting animation to work are:
  • Change SpAbility2 to point to a spellcasting code block, not just [NONE]
  • In your spellcasting code block, make sure you have a castspell, sigorder 2, gotorepeatattk and at the end of the block you jump to the idle animation part of the code.

As long as you got those two things, you can have a spellcaster unit. The way I would do the SCV might not be the best way to do it for you, play around and find out how you would do it.

If there's anything I want you take from this tutorial, it's not the part about how to give a unit a spellcasting animation. I hope you learn that the best way to find answers is to find them yourself, and one way to do this is to look at the way Blizzard have created an effect using the StarCraft engine. The only way someone can become an expert at modding is if they are willing to experiment, so don't be afraid to experiment.
Report, edit, etc...Posted by Darius.DeValle on 2005-06-07 at 21:14:44
QUOTE(BSTRhino @ Jun 6 2005, 08:45 PM)
After you have fixed up your spellcasting unit in Arsenal III and StarGraft, the last element of giving a unit the ability to use an existing spell is to update its iscript animation. Every time a unit is ordered to cast a spell, StarCraft will attempt to run its spellcasting animation. The problem is that, most units don't have a spellcasting animation, and if StarCraft tries to find the spellcasting animation on one of these units, it will not find one, causing StarCraft to crash.

Let's take a look at how StarCraft calls animations. The text-based form of IceCC has a way of allowing easier visualisation of how iscripts flow, and so for this tutorial, IceCC will be used. However, once you understand the concepts, the program you use is your choice. Below is the iscript code for the SCV, extracted using IceCC.

CODE
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 247 SCV (terran\SCV.grp)
.headerstart
IsId            84
Type            15
Init            SCVInit
Death           SCVDeath
GndAttkInit     SCVGndAttkInit
AirAttkInit     [NONE]
SpAbility1      [NONE]
GndAttkRpt      SCVGndAttkInit
AirAttkRpt      [NONE]
SpAbility2      [NONE]
GndAttkToIdle   SCVGndAttkToIdle
AirAttkToIdle   [NONE]
SpAbility3      [NONE]
Walking         SCVWalking
Other           SCVOther
BurrowInit      [NONE]
ConstrctHarvst  [NONE]
IsWorking       SCVIsWorking
.headerend
# ----------------------------------------------------------------------------- #

SCVInit:
imgul09         248 0 7 # SCVShad (terran\SCV.grp)
playfram        0x00 # frame set 0
goto            SCVOther

SCVOther:
wait            125
goto            SCVOther

SCVDeath:
playsnd         369 # Terran\SCV\TSCDth00.WAV
imgol08         332 0 0 # TerranBuildingExplosionsmall (thingy\tBangS.grp)
wait            3
end            

SCVGndAttkInit:
shvertpos       0
wait            1
playfram        0x22 # frame set 2
attack25        1
wait            1
playfram        0x11 # frame set 1
wait            1
gotorepeatattk  
goto            SCVOther

SCVGndAttkToIdle:
playfram        0x00 # frame set 0
goto            SCVOther

SCVWalking:
playfram        0x00 # frame set 0
imgol08         249 0 0 # SCVGlow (thingy\tscGlow.grp)
shvertpos       0
goto            SCVOther

SCVIsWorking:
shvertpos       0
wait            1
local00:
playfram        0x22 # frame set 2
useweapon       14 # Fusion Cutter
wait            1
playfram        0x11 # frame set 1
waitrand        8 10
goto            local00


In IceCC, the scripts for each unit are made up of two parts. First, there is the header, which can be found between .headerstart and .headerend lines. Below the headers (usually) are the commands for the script, and throughout the commands are a series of labels, like "SCVWalking:" and statements, such as "attack25 1". To understand how animations are called in StarCraft, it is important to see how the header and the rest of the script are connected.

Each line in the header is made up of a keyword then a value, separated by a space. For instance, if we skip the first two lines of the header - they might be explained in another tutorial - there is the keyword "Init" and its value is "SCVInit". That is saying to StarCraft, when you have to run the "Init" animation for this image, execute the code starting from "SCVInit". Notice that a label name "SCVInit" is in the code, right below the header. Yes, take a look at it, don't take my word for it, go up there and look, it's fun to see it for yourself.

The Init animation will be run when the SCV unit is first created. So, StarCraft knows to call SCVInit when the SCV initialises because it is written in the iscript header. In the same way, StarCraft knows to call SCVGndAttkInit when the SCV needs to play its ground attack animation because it is written right next to the GndAttkInit keyword in the header.

As you can also see, some of the keywords in the header have the word [NONE] next to them, like AirAttkInit does. Guess what happens if StarCraft tries to play the SCV's air attack animation when it's got [NONE] for its code label? That's right, you guessed it, StarCraft will not know what code to run, and so it will crash. Perhaps you already knew that, but now that you can see the parts that are causing the crash, maybe you can guess how you would fix this.

For spellcasting, the concept is the same. If StarCraft tries to run the non-existent spellcasting animation, then it will crash. So you need to go to the spellcasting animation for your unit and change the [NONE] to a code block, which you might even write yourself. However, if you look at all the animation types the SCV has above, there is just one problem that could be stopping you from giving the SCV a spellcasting animation. Do you see it? Think about it.

Looking at the iscript for the SCV, there seem to be three spellcasting animations - SpAbility1, SpAbility2 and SpAbility3. Which one are you meant to change? I could tell you directly, but I'm going to teach you something even better - how to find out the answer for yourself.

Here's the Queen's iscript.

CODE
# ----------------------------------------------------------------------------- #
# This header is used by images.dat entries:
# 046 Queen (zerg\queen.grp)
.headerstart
IsId            27
Type            12
Init            QueenInit
Death           QueenDeath
GndAttkInit     QueenGndAttkInit
AirAttkInit     QueenGndAttkInit
SpAbility1      [NONE]
GndAttkRpt      QueenGndAttkInit
AirAttkRpt      QueenGndAttkInit
SpAbility2      QueenSpAbility2
GndAttkToIdle   QueenGndAttkToIdle
AirAttkToIdle   QueenGndAttkToIdle
SpAbility3      [NONE]
Walking         QueenWalking
Other           QueenGndAttkToIdle
BurrowInit      [NONE]
.headerend
# ----------------------------------------------------------------------------- #

QueenInit:
imgul09         47 0 42 # QueenShad (zerg\queen.grp)
playfram        0x00 # frame set 0
waitrand        1 4
QueenGndAttkToIdle:
playfram        0x00 # frame set 0
wait            2
playfram        0x11 # frame set 1
wait            2
playfram        0x22 # frame set 2
wait            2
playfram        0x33 # frame set 3
wait            2
playfram        0x44 # frame set 4
wait            2
goto            QueenGndAttkToIdle

QueenDeath:
playsndbtwn     925 927 # Zerg\Queen\ZQuDth00.WAV, Zerg\Queen\ZQuDth02.WAV
sprol0f         156 0 0 # QueenBirth (zerg\zquDeath.grp)
wait            1
end            

QueenGndAttkInit:
shvertpos       0
playfram        0x55 # frame set 5
wait            1
playfram        0x66 # frame set 6
wait            1
playfram        0x77 # frame set 7
wait            1
playfram        0x88 # frame set 8
playsnd         90 # Bullet\ZQuFir00.wav
attack25        1
wait            1
playfram        0x99 # frame set 9
wait            1
playfram        0xaa # frame set 10
gotorepeatattk  
goto            QueenGndAttkToIdle

QueenSpAbility2:
shvertpos       0
playfram        0x55 # frame set 5
nobrkcodestart  
wait            1
playfram        0x66 # frame set 6
wait            1
playfram        0x77 # frame set 7
wait            1
playfram        0x88 # frame set 8
castspell      
sigorder        2
wait            1
playfram        0x99 # frame set 9
wait            1
playfram        0xaa # frame set 10
nobrkcodeend    
gotorepeatattk  
goto            QueenGndAttkToIdle

QueenWalking:
playfram        0x00 # frame set 0
wait            1
playfram        0x11 # frame set 1
wait            1
playfram        0x22 # frame set 2
wait            1
playfram        0x33 # frame set 3
wait            1
playfram        0x44 # frame set 4
wait            1
goto            QueenWalking


Does the Queen use SpAbility1, SpAbility2 or SpAbility3 for its spellcasting animation? If you haven't worked it out yet, look again, it is quite obvious. Or highlight this text: Correct answer: SpAbility2

What you did there was look at something else which does what you want and learnt from it. Where you can, that's what you should do when you want to know the answer to something, it will expand your modding knowledge in a way that explanations or tutorials cannot, because you are actively seeking answers.

However, there are things that would take you weeks to understand yourself but only minutes for another experienced modder to explain. Writing the code for a spellcasting script might be one of these. So I've got a quick example of how I would write the spellcasting animation code for the SCV here to make sure all the important points are covered.

First, I would write the code for spellcasting to the SCV's script. In most cases, a good place to start for this is to just copy the code from one of the attack animations. This will be a good place for you to start if you are creating a spellcasting animation. So after copying the attack animation, here would be my first draft of the spellcasting code...
CODE
MyCastSpellAnimation:
shvertpos       0
wait            1
playfram        0x22 # frame set 2
attack25        1
wait            1
playfram        0x11 # frame set 1
wait            1
gotorepeatattk  
goto            SCVOther


Of course, spellcasting doesn't involve attacking, so I'd have to replace the attack command with the cast spell command. By looking at the Queen's (or any other spellcaster unit's) script I can see the commands that are used to cast the spell are these ones:
CODE
castspell
sigorder 2

The castspell command casts the spell, and the sigorder 2 command says to StarCraft "I'm finished casting the spell" and unactivates the button. If you want to see what it does exactly, try making a script without the sigorder 2 command.

CODE
MyCastSpellAnimation:
shvertpos       0
wait            1
playfram        0x22 # frame set 2
castspell
sigorder 2
wait            1
playfram        0x11 # frame set 1
wait            1
gotorepeatattk  
goto            SCVOther


And that's the complete script. You can edit this further if you want to have flares, spinning, jumping or whatever else before the spell is cast. The order of the different blocks in the script actually doesn't matter, so if this code was put at the top, bottom, or somewhere in the middle of the script it wouldn't make a difference, as long as it isn't put right in the middle of an existing block.

Like the spellcasting animation of the Queen, the spellcasting animation also should always have a gotorepeatattk command just before it goes to the idle animation of the unit. This signals StarCraft that the unit is ready to repeat casting the spell, it's not actually a jump command like its name indicates.

Now that the spellcasting animation code is created, the header of course needs to be updated. As you now know, that means making SpAbility2 point to the new code block label, not just [NONE].

CODE
SpAbility2      MyCastSpellAnimation


So that is how I would give the SCV's spellcasting animation. This description is by no means a definitive set of steps that must be performed in a specific order, it is just the way I would go about achieving the required parts. In summary, the necessary parts you need to have for a spellcasting animation to work are:

  • Change SpAbility2 to point to a spellcasting code block, not just [NONE]
  • In your spellcasting code block, make sure you have a castspell, sigorder 2, gotorepeatattk and at the end of the block you jump to the idle animation part of the code.

As long as you got those two things, you can have a spellcaster unit. The way I would do the SCV might not be the best way to do it for you, play around and find out how you would do it.

If there's anything I want you take from this tutorial, it's not the part about how to give a unit a spellcasting animation. I hope you learn that the best way to find answers is to find them yourself, and one way to do this is to look at the way Blizzard have created an effect using the StarCraft engine. The only way someone can become an expert at modding is if they are willing to experiment, so don't be afraid to experiment.
[right][snapback]228386[/snapback][/right]



Whew...long-winded, but useful. Thank you. If only I could get IceCC to, you know, work, I'd use that. But, I'm stuck with ICE for now. But, once I figure out why it won't load load the ARR units file, I'll be set. Thank you. With this info, I should be capable of creating a good mod. Again, I thank all who have been, you know, helpful in my endeavors. If I can provide anyone with assistance, just let me know. *bows in respect*
Report, edit, etc...Posted by scwizard on 2005-06-07 at 21:27:02
Umm, there is a tutorial on that now.

I made it pretty idiot proff acutally.

ADDITION:
http://www.staredit.net/index.php?showtopic=16184

With this tutorial you should be using IceCC in no time!
Report, edit, etc...Posted by Darius.DeValle on 2005-06-07 at 22:34:20
QUOTE(m.r.bob @ Jun 7 2005, 08:27 PM)
Umm, there is a tutorial on that now.

I made it pretty idiot proff acutally.

ADDITION:
http://www.staredit.net/index.php?showtopic=16184

With this tutorial you should be using IceCC in no time!
[right][snapback]229166[/snapback][/right]



Ah, that's what I did wrong! I didn't unzip it to C:\

Thanks!
Next Page (1)