Creating easy spells

From Platinum Arts Sandbox Free 3D Game Maker
Jump to: navigation, search

I've seen several spells come my way while on the forums, and they're all pretty cool! But I myself didn't know how to create spells with different effects until just recently. So I decided to create a Tut for easy to create and use spells! I'll have some of my own, one of Venima's (with full credit given to him), and components for new spells!

The first spell is a simple light that comes from your right hand (Yes, I know there are already two of these type of spells, however, this spell is specifically like a flashlight :) ):

   spawn_flashlight = [
      r_type $ENT_ITEM
      r_icon flashlight
      r_description "A flashlight for searching with."
      r_item_slots $SLOT_RHAND
      r_addowneffect $STATUS_LIGHT 35 1000000000
      r_interact [
      r_select $rpginteract
      r_pickup $rpgself
      ]
   ]


I'll break each component down, and explain what each does.

   spawn_flashlight = [

The "spawn_yournamehere" encompasses all the remaining components. Without this, there is no spell. The bracket is very, very important!!!

   r_type $ENT_ITEM

This shows what r_type of "ENT" or "Entitiy" the "spawn" is. In this case, it is an item.

   r_icon flashlight

"r_icon" will show the "icon" of the item, when you pull up the inventory. In this case, a flashlight. (This doesn't work because RPG mode doesn't have an "icon" for it)

   r_description "A flashlight for searching with."

This gives the description. Make it a one sentence to work best!

   r_item_slots $SLOT_RHAND

The "r_item_slots" is for assigning the item to a certain spot on your character's body. $SLOT_RHAND is easily understood. Right hand. :P

   r_addowneffect $STATUS_LIGHT 35 1000000000

The addowneffect allows the user to put a certain limitation on the $STATUS. In this case, the $STATUS is LIGHT. There is a circle of light that surrounds the RC and will last for...... well let's just say it'll take a while to disappear! :D

   r_interact [
      r_select $rpginteract
      r_pickup $rpgself
      ]
   ]

This little bit of code round's out the spell, showing the game engine what the spell is interacting with. Namely, yourself!

One last bit of info. Every time you add a new item/spell, make sure you add:

   r_additem yourspellnamehere

To 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


In the flashlight's case it would look like this:

   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 flashlight

"Why the r_additem flashlight?" you might ask. The reason is this. Do you remember what we were spawning at the beginning? Yes! A flashlight!

   spawn_flashlight = [

It will show the game engine which spell you would like to spawn!

Now, for a spell! :D


Those are some main components for an $ENT_ITEM. Now, for a spell! This is Venima's so all the right's go to him!

   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
      ]
   ]


You know what "spawn_dust = [" is, so I don't need to dissemble. Look at the "r_type"

   r_type $ENT_SPELL

This r_type, is a spell, as indicated by $ENT_SPELL.

The icon, is:

   r_icon losehealth

You all know what this means, however, this icon will show up.

   r_description "sprays flames"
      r_name "Flame Spray"

You all know what the description does, and the name will appear when you open up the spell's tab.

The next part is important, so I'll explain as best as possible:

   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


The r_spell_type will represent what form the spell will take. There are three forms: Target, Cone, and Self. Alternatively, instead of r_spell_type $STYPE_CONE you may place a 1 next to the r_spell_type.

The r_spell_gravity is easily explained. This will be how much gravity will affect the attack. The r_spell_cost is 5. 5 mana. Mana is regenerated so don't worry about running out! The next part is important: the r_spell_range. You can have a long range, or a short range. It's up to you. However, the range is also affected by the gravity, so make sure these work together. The r_spell_effect I have yet to understand but as far as I know it is alright to leave out. Check out the fireball spell under data/game_rpg.cfg to learn more.

The addeffect:

   r_addeffect $STATUS_HEALTH -10 1

Shows what will happen when the spell reaches it's intended target. It will affect the health status of the target, reducing it by -10. The 1 next to it signifies that this spell with take health out once. This is not a continually draining spell.

And just like with the flashlight, you must place the r_additem at the end of your "spawn_player":

   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 flashlight
      r_additem dust


I hope that you all get some help from this, and will be able to create easy spells! I will go into more in-depth spells later, but this took awhile so just hold your horses. Don't hesitate to ask questions! Arc