Creating Easy Spells
Posted: April 30th, 2010, 2:29 pm
NOTE: This tutorial was created for Platinum Arts Sandbox 2.5. To retrieve your spells in PAS 2.6, place them under data>rpg>game.
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 ):
I'll break each component down, and explain what each does.
The "spawn_yournamehere" encompasses all the remaining components. Without this, there is no spell. The bracket is very, very important!!!
This shows what r_type of "ENT" or "Entitiy" the "spawn" is. In this case, it is an item.
"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)
This gives the description. Make it a one sentence to work best!
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.
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!
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: To this:
In the flashlight's case it would look like this:
"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!
It will show the game engine which spell you would like to spawn!
This is Venima's so all the right's go to him!
You know what "spawn_dust = [" is, so I don't need to dissemble. Look at the "r_type"
This r_type, is a spell, as indicated by $ENT_SPELL.
The icon, is: You all know what this means, however, this icon will show up.
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:
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: 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":
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
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 ):
Code: Select all
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
]
]
Code: Select all
spawn_flashlight = [
Code: Select all
r_type $ENT_ITEM
Code: Select all
r_icon flashlight
Code: Select all
r_description "A flashlight for searching with."
Code: Select all
r_item_slots $SLOT_RHAND
Code: Select all
r_addowneffect $STATUS_LIGHT 35 1000000000
Code: Select all
r_interact [
r_select $rpginteract
r_pickup $rpgself
]
]
One last bit of info. Every time you add a new item/spell, make sure you add:
Code: Select all
r_additem yourspellnamehere
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
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 flashlight
Code: Select all
spawn_flashlight = [
Now, for a spell!
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!
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
]
]
Code: Select all
r_type $ENT_SPELL
The icon, is:
Code: Select all
r_icon losehealth
Code: Select all
r_description "sprays flames"
r_name "Flame Spray"
The next part is important, so I'll explain as best as possible:
Code: Select all
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_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:
Code: Select all
r_addeffect $STATUS_HEALTH -10 1
And just like with the flashlight, you must place the r_additem at the end of your "spawn_player":
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 flashlight
r_additem dust
Arc