Creating spell effects

Learn more on how to use Sandbox, or submit your own tutorials or resources.
chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Creating spell effects

Postby chocolatepie33 » April 27th, 2010, 11:12 pm

This tutorial was made for 2.5 and may not work in 2.6 and above.

I think I saw somewhere someone asking about changing spells, or making spells, like the fireball in RPG. So this is how to change the animation/effect. This works with 2.5, not sure about new versions. Oh, and I don't know how to make a wolf. That was the spell question. These are just projectiles.

r_proj_new = this creates a new effect (place the effect number after //, it helps)
r_proj_part = the particle you want to use.
r_proj_mdl = the (map)model you want to use (Like Dan's rock, or Hirato's arrow)
r_proj_size = the size of the particle
r_proj_projcol = the color of the particle
r_proj_basevel = the velocity (speed) of the particle/model
r_proj_gravity = how gravity affects the particle
r_proj_kickback = when you hit a spawn, that affects how far it flies away
r_proj_trailpart = the particle alongside the main particle.
r_proj_trailcol = the color of said trail
r_proj_trailsize = the size of the trail
r_proj_trailfade = the time for the trail to disappear
r_proj_deathpart = the particle that appears when the spell connects with an object or the ground
r_proj_deathpartcol = the color of the death particle
r_proj_deathpartsize = the size of the explosion, etc that you use
r_proj_deathfade = the time for the deathparticle to disappear

for example:

Code: Select all

r_proj_new //5
r_proj_mdl dan/rock
r_proj_basevel 200
r_proj_kickback 50
r_proj_trailpart $PART_LIGHTNING
r_proj_trailcol 0x7F7F7F
r_proj_trailsize 1
r_proj_trailfade 500
r_proj_gravity 200
r_proj_lightradius 64
r_proj_deathpart $PART_LIGHTNING
r_proj_deathpartcol 0xFFBF00
r_proj_deathpartsize 5
r_proj_deathfade 400


This should create a spell that uses dan's rock with lightning chasing after it.
Last edited by chocolatepie33 on December 30th, 2010, 4:54 pm, edited 2 times in total.
Julius wrote:Contribute to http://www.opengameart.org NOW!

Save the wiki!

arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Creating spell effects

Postby arcones » April 28th, 2010, 6:51 am

I just experimented with spells the other day and created at least 5 new ones which gave ideas for at least 7 more... But you seem to be missing something. Where is the health decrease? As far as I can see, you don't have anything to do with health. Do you know for sure that this works?

My spells look similar to this:

Code: Select all

spawn_dust = [
   r_type $ENT_SPELL
   r_icon losehealth
   r_description "sprays flames"
   r_name "Flame Spray"
   r_spell_type $STYPE_CONE
   r_spell_gravity 60
   r_spell_cost 5
   r_spell_range 8
   r_spell_effect 5
   r_addeffect $STATUS_HEALTH -10 1

   r_interact [
      r_select $rpginteract
      r_pickup $rpgself
   ]
]

The $STATUS_HEALTH -10 1 shows how much health is taken away and for how long. Also, to create particle effects, all that you need to do is add an $ATTACK and a $STATUS and that will work.
This spell creates a very sweet looking effect:

Code: Select all

spawn_magic = [
   r_type 2
   r_icon magic
   r_description "This magic is potent. Use it carefully."
   r_name "Magic"
   r_spell_type $STYPE_TARGET
   r_spell_cost 125
   r_spell_effect 50
   r_spell_gravity 70
   r_addeffect $STATUS_HEALTH -50 60000 $ATTACK_WATER
   r_addeffect $STATUS_HEALTH -40 (| $ATTACK_AIR $ATTACK_MAGIC)
      
   r_interact [
      r_select $rpginteract
      r_pickup $rpgself
   ]
]

Try it out! And don't forget to add this: r_additem magic
to the bottom of this:

Code: Select all

spawn_player = [
   r_additem item
   r_additem item2
   r_additem spell
   r_additem spell2
   r_additem frost
   r_additem magicarrow
   r_additem light
   r_additem eth_vis1
   r_additem minehelm

So that it looks like this:

Code: Select all

spawn_player = [
   r_additem item
   r_additem item2
   r_additem spell
   r_additem spell2
   r_additem frost
   r_additem magicarrow
   r_additem light
   r_additem eth_vis1
   r_additem minehelm
   r_additem magic       

Just wondering how this spell hurts anything... :)
Arc :geek:
Image
Want a user bar like this one? PM Leo!

chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Creating spell effects

Postby chocolatepie33 » April 28th, 2010, 6:26 pm

Okay, okay, Arc, fine. That's supposed to change the appearance of the spell, not what it does. It's at the bottom of the data/game_rpg file. But you're right, I should have mentioned the spell effects code, too. Oh, and did you see this youtube video? I don't know if you posted it, so... http://www.youtube.com/watch?v=l-VjCdJ4eUc&feature=related
Last edited by chocolatepie33 on July 10th, 2010, 7:17 pm, edited 1 time in total.
Julius wrote:Contribute to http://www.opengameart.org NOW!

Save the wiki!

User avatar
GR1M
Support Team
Support Team
Posts: 1305
Joined: August 22nd, 2009, 4:35 pm
Name: Luke
IRC Username: Gr1m
Location: Texas
Contact:

Re: Creating spell effects

Postby GR1M » April 29th, 2010, 12:51 am

I made some spells please tell me if you like them.

Code: Select all

spawn_magic1 = [
        r_type 2
        r_icon Death Arrows
        r_description "Death!"
        r_name "Arrows of Death"
        r_spell_type $STYPE_CONE
        r_spell_cost 10
        r_spell_effect 2
        r_spell_gravity 20
        r_addeffect $STATUS_HEALTH -50 100000 $ATTACK_WATER
        r_addeffect $STATUS_HEALTH -40 (| $ATTACK_AIR $ATTACK_MAGIC)
       
        r_interact [
       
        ]
]


Code: Select all

spawn_magic2 = [
        r_type 2
        r_icon Fireworks
        r_description "Green Fireworks"
        r_name "Fireworks"
        r_spell_type $STYPE_CONE
        r_spell_cost 5
        r_spell_effect 6
        r_spell_gravity 20
        r_addeffect (| $ATTACK_WATER)

        r_interact [
       
        ]
]


Code: Select all

spawn_magic3 = [
        r_type 2
        r_icon Wonder
        r_description "Purple Wonder!"
        r_name "Magic Purpleness!"
        r_spell_type $STYPE_CONE
        r_spell_cost 5
        r_spell_effect 5
        r_spell_gravity 40
        r_addeffect (| $ATTACK_EARTH)

        r_interact [
       
        ]
]
Image
Want a user bar like this one? PM Leo

arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Creating spell effects

Postby arcones » April 30th, 2010, 8:51 am

Sure! Will do! :)

EDIT: Purple Wonder!! MAGIC PURPLENESS!!! :D :lol:
Image
Want a user bar like this one? PM Leo!

arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Creating spell effects

Postby arcones » April 30th, 2010, 9:20 am

chocolatepie33 wrote:Well, you know what, Arc, SORRY! That's supposed to change the appearance of the spell, not what it does. It's at the bottom of the data/game_rpg file. But you're right, I should have mentioned the spell effects code, too. Oh, and did you see this youtube video? I don't know if you posted it, so... http://www.youtube.com/watch?v=l-VjCdJ4eUc&feature=related


If that vid is about projectiles, then no, I did not post it. That would probably be Mike! ;)

What I was trying to say is this. Spells have to be able to do something in order to be a spell. Your projectile may fire, but does it heal you, hurt them, or just create a sweet projectile with dan's rock? (Which I have no doubt looks awesome :) )

Mike showed the proj off as something fun to use and play around with! But he didn't say they would replace the spells, that's all ;)

Arc :geek:
Image
Want a user bar like this one? PM Leo!

chocolatepie33
Support Team
Support Team
Posts: 2458
Joined: April 27th, 2010, 5:31 pm
IRC Username: CP

Re: Creating spell effects

Postby chocolatepie33 » May 1st, 2010, 10:21 pm

Now, to get off topic (a bit), (I know how much you like Off-Topicicity, Arc), speaking of color (green fireworks, purple wonder), do you guys know anything about creating spell colors? I Googled 0xFFFFFF and 32-bit colour code, but that didn't help. I just copied some text for the spell I mentioned earlier.
arcones wrote:EDIT: Purple Wonder!! MAGIC PURPLENESS!!! :D :lol:
Julius wrote:Contribute to http://www.opengameart.org NOW!

Save the wiki!

arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Creating spell effects

Postby arcones » May 2nd, 2010, 2:14 pm

Okay, well the color is really defined by what components you have for $ATTACK and $STATUS. There's an attack that shoots arrows, but it's because of the $ATTACK. It's in the data/game_rpg.cfg ;)

And yes, Purple Wonder! MAGIC PURPLENESS! :D :lol:
chocolatepie33 wrote:(I know how much you like Off-Topicicity, Arc)

Thanks Chocolate! :P
Image
Want a user bar like this one? PM Leo!

User avatar
GR1M
Support Team
Support Team
Posts: 1305
Joined: August 22nd, 2009, 4:35 pm
Name: Luke
IRC Username: Gr1m
Location: Texas
Contact:

Re: Creating spell effects

Postby GR1M » May 2nd, 2010, 5:03 pm

I want to make a cookie love spreading gun :) Cookie particles flying every where.
Image
Want a user bar like this one? PM Leo

arcones
Support Team
Support Team
Posts: 2734
Joined: January 13th, 2010, 12:42 pm
Name: Timothy
IRC Username: I use Steam
Location: Looking over your shoulder...
Contact:

Re: Creating spell effects

Postby arcones » May 2nd, 2010, 5:09 pm

Good luck finding the animation for that! :lol: :lol: :lol:

Anyway, sounds YUMMY! :D
Image
Want a user bar like this one? PM Leo!


Return to “Tutorials and Resources”

Who is online

Users browsing this forum: No registered users and 1 guest