Page 1 of 3

Creating Spells

Posted: March 7th, 2010, 1:58 pm
by Leo_V117
okay, I want to know how to make custom spells for use in an RPG, i managed to partially replace the Fireball spell with a custom one, although i cant remember how i did that. Im wanting to add atleast 10 new spells and keep the existing ones or modify them. How do i do this?

Re: Creating Spells

Posted: March 7th, 2010, 4:45 pm
by arcones
So lets say you start with a basic spell

Code: Select all

spawn_spell = [
	r_type 2
	r_icon fire
	r_description "FIRE!!!"
	r_name "fireball"
	r_spell_type $STYPE_TARGET
	r_spell_gravity 20
	r_spell_cost 20
	r_spell_range 64
	r_addeffect $STATUS_HEALTH -40 1 $ATTACK_MAGIC
	r_addeffect $STATUS_HEALTH -30 5000 (| $ATTACK_FIRE $ATTACK_MAGIC)

	r_interact [
		r_select $rpginteract
		r_pickup $rpgself
	]
]
Then just use what you need for your new spell
EDIT: I copied the fireball spell and added it beneath the magic arrow spell.

Code: Select all

spawn_spell3 = [
	r_type $ENT_SPELL
	r_icon magic
	r_description "Looses blast of magic at enemies. Effective at long range."
	r_name "Magic Blast"
	r_spell_type $STYPE_TARGET
	r_spell_range 85
	r_spell_gravity 20
	r_spell_cost 40
	r_addeffect $STATUS_HEALTH -50 1 $ATTACK_MAGIC
	r_addeffect $STATUS_HEALTH -10 5000 (| $ATTACK_MAGIC $ATTACK_MAGIC)

	r_interact [
		r_select $rpginteract
		r_pickup $rpgself
	]
]
This is my custom spell. If you look at it I just copied the fireball components and changed them.
NOTE: This didn't change the fireball animation!

Anyway, hope that helps you Leo

Arc :mrgreen:

Re: Creating Spells

Posted: March 7th, 2010, 4:52 pm
by Leo_V117
yeah, added it, nothing happened, it didnt even appear on my spell book menu. I think PAS hates me XD

Re: Creating Spells

Posted: March 7th, 2010, 4:55 pm
by arcones
could be :P

Are you in did you add the spell in rpg under data/game_rpg.cfg?

EDIT: ahhh, wait a sec.... did you add

Code: Select all

	r_additem spell3
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
]
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 spell3
]
Arc :mrgreen:

Re: Creating Spells

Posted: March 7th, 2010, 5:04 pm
by Leo_V117
wow, i forgot, i knew it would be obvious. Thanks Arc.

it works too.

Thanks again Arc.

- Leo

Re: Creating Spells

Posted: March 7th, 2010, 5:05 pm
by arcones
No problem! Glad to help :D

(I can now upgrade to this :geek: (YES! :D ))

Arc :geek:

Re: Creating Spells

Posted: March 7th, 2010, 8:30 pm
by Leo_V117
okay, heres a challenge, can you code some of this:

Code: Select all

spawn_morph = [
	r_type $ENT_SPELL
	r_name "Shapeshift"
	r_icon wolf
	r_spell_cost 10
	r_spell_range 2
	r_spell_type $STYPE_SELF
	r_description "A complex spell that allows the caster to change forms for a fixed time"

	r_interact [
		r_select $rpginteract
		r_pickup $rpgselect
	]
]
so that it allows the caster to change form to a wolf and still move?

Re: Creating Spells

Posted: March 8th, 2010, 12:35 pm
by arcones
I'll try it out but I don't know exactly how the making of a self-affecting spell works. I mean, there's the Ethreal's visage(or some such spell) and that makes you invisible to a certain character you fire the spell at.

but I'll definitely try it!

Arc :geek:

Re: Creating Spells

Posted: March 10th, 2010, 11:49 am
by arcones
Unfortunately Leo, I'm pretty sure it won't work for the following reason.
1. You would need an addeffect that would change you into a wolf

Code: Select all

spawn_eth_vis1 = [
	r_type $ENT_SPELL
	r_icon invis
	r_name "Ethereal Visage"
	r_description "There's no prank as grand as convincing others of your recent demise, and now it's easy with invisibility!^nLook like a ghost today!"
	r_spell_type $STYPE_SELF
	r_spell_cost 40
	r_spell_range 2
	r_addeffect $STATUS_INVIS 50 60000

	r_interact [
		r_select $rpginteract
		r_pickup $rpgself
	]
]
r_addeffect $STATUS_INVIS 50 60000
The developers would have to make some addeffects that would include STATUS_ for wolf, dragon, bear, etc.

Code: Select all

STATUS_HEALTH = 0
STATUS_MOVE = 1
STATUS_STRENGTH = 2
STATUS_INTELLIGENCE = 3
STATUS_CHARISMA = 4
STATUS_ENURANCE = 5
STATUS_AGILITY = 6
STATUS_LUCK = 7
STATUS_CRIT = 8
STATUS_HREGEN = 9
STATUS_MREGEN = 10
STATUS_FIRE = 11
STATUS_WATER = 12
STATUS_AIR = 13
STATUS_EARTH = 14
STATUS_MAGIC = 15
STATUS_SLASH = 16
STATUS_BLUNT = 17
STATUS_PIERCE = 18
STATUS_DISPELL = 19
STATUS_DOOM = 20
STATUS_REFLECT = 21
STATUS_INVIS = 22
STATUS_LIGHT = 23
STATUS_DEATH = 24
STATUS_INVIS = 22 That's the status they use as well
So you could probably ask the developers to put that on for the next sandbox update.
Sorry it wouldn't work... it would've been pretty cool!

Arc :geek:

Re: Creating Spells

Posted: March 23rd, 2010, 5:13 pm
by Leo_V117
Yeah, it would add a bit of a "Twilight" twist for the girls. ^^