New Spells >> show them off here

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: New Spells >> show them off here

Post by akroma222 »

TRANSMUTE SOUL
Here is a spell based on Flatline's Calignous Curse and Cromcrom's AOE scripts. This spell will damage the party and surrounding enemies (2 space radius) and then will restore energy for the whole party.
Easy set up:

1. Paste this into objects.lua (altering runes/skill/costs to your liking):
SpoilerShow

Code: Select all

 defineSpell{
   name = "transmute_soul",
   uiName = "Transmute Soul",
   skill = "spellcraft",
   level = 0,
   runes = "DEFH",
   manaCost = 5,
   onCast = function(champ, x, y, direction, skill)
   party:playScreenEffect("cold_glow_magicshield")
   playSoundAt("read_tome",party.level,party.x,party.y)
   hudPrint(champ:getName().." drains surrounding life force and transmutes it to pure energy")
   
 for i = x-2,x+2 do 
      for j = y-2,y+2 do
      damageTile(party.level, i,j, party.facing, 1, "physical", math.random(1,10)*(skill*2))
      end
end
      for i = 1,4 do
      party:getChampion(i):modifyStat("energy", math.random(1,10)*(skill*4))   
      end
   end, 
}
Hope you enjoy!! :D
EDIT: Cromcrom's new script replaced old one
Last edited by akroma222 on Sat Nov 17, 2012 1:51 pm, edited 1 time in total.
User avatar
cromcrom
Posts: 549
Joined: Tue Sep 11, 2012 7:16 am
Location: Chateauroux in a socialist s#!$*&% formerly known as "France"

Re: New Spells >> show them off here

Post by cromcrom »

Great, thanks for sharing. You could probably change this spell so that the amount of energy/health depends on the amount of monsters hit with the spell.
And if you want to damage the party in the process, the script could be much much cleaner than the one I told you.
Please consider this:
SpoilerShow

Code: Select all

 defineSpell{
   name = "transmute_soul",
   uiName = "Transmute Soul",
   skill = "spellcraft",
   level = 0,
   runes = "DEFH",
   manaCost = 5,
   onCast = function(champ, x, y, direction, skill)
   party:playScreenEffect("cold_glow_magicshield")
   playSoundAt("read_tome",party.level,party.x,party.y)
   hudPrint(champ:getName().." drains surrounding life force and transmutes it to pure energy")
   
 for i = x-2,x+2 do 
      for j = y-2,y+2 do
      damageTile(party.level, i,j, party.facing, 1, "physical", math.random(1,10)*(skill*2))
      end
end
      for i = 1,4 do
      party:getChampion(i):modifyStat("energy", math.random(1,10)*(skill*4))   
      end
   end, 
}
A trip of a thousand leagues starts with a step.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: New Spells >> show them off here

Post by akroma222 »

Yup! Works perfectly, I will replace the old script with your new version. Thanks again Cromcrom :D
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: New Spells >> show them off here

Post by Grimwold »

Excellent work on all your new spells. I have yet to try them, but sound really good.

Your Stat-buffing spells look like they function in a similar way to the ManaShield spell I helped write for Flatline... viewtopic.php?f=14&t=4108#p43041
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: New Spells >> show them off here

Post by Grimwold »

akroma222 wrote: 3. Create 3 timers next to "buffing_scripts", named ("timer_magicshield", "timer_reflexion" and "timer_repelmagic"). Set the timers for the period you wish the buffing spell to stay in place for (I find the spells stay in effect for roughly twice as long as the time I have set them to)... or maybe that is just my warped sense of time?
Just a quick note here on time... if the timers are on the same level as the party, they are updated every second, however if they are 1 level above or below they are done on alternate seconds (making timers last twice as long!).. higher or lower than that and they are done on an as and when basis.
For that reason, for any timed spells, I have been spawning the timers on the party level at the moment the spells are cast and destroying them... this reduces the chance that the timer will be on a different level of the dungeon than the party. (still open to abuse if players cast spells and then deliberately change levels, but without a lot of extra coding to move timers between levels, that's hard to fix)
User avatar
crisman
Posts: 305
Joined: Sat Sep 22, 2012 9:23 pm
Location: Italy

Re: New Spells >> show them off here

Post by crisman »

That's a thing I completely forgot when developing that...
I'll have to fix it asap.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: New Spells >> show them off here

Post by akroma222 »

Interesting indeed.. thanks Grimwold ;) (I will change explanation on the post)
EDIT - and yes!! the buffing spells are very very similar to the one outlined in that thread..

Just a couple of questions (that might be bleedingly obvious) regarding the damage tile/ EXP system..
-if our custom spells have to do physical damage through these tiles in order to get EXP, then a lot of monster magic immunities are going to become redundant, right??
also... does anyone know how to get burst spells and or the aforementioned area of effect spells to work with damage tiles? (I am currently experimenting....)
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: New Spells >> show them off here

Post by Grimwold »

The damageTile() doesn't have to do physical damage.. my Burn Monster spell does fire damage.. the important thing is that using damageTile() provides a link between Caster and target.

If I understand what your asking regarding burst spells... you could use damageTile to actually deal the damage, but spawn a particle effect separately to create the look of the spell. I was going to do that for Burn Monster, but because I was dealing fire damage with damageTile() it came with it's own flame effect on the monster, so looked alright without.
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: New Spells >> show them off here

Post by akroma222 »

Ahh yes Grimwold, of course! I now have the damageTiles doing what I need them to for projectile spells (for some reason I remember reading that it had to be physical damage - but clearly not!!)

I am still curious about spells like fan of knives and whipping rocks though... I am trying to use "spellCaster = caster:getOrdinal" to set up for the damageTile but upon casting those spells, the preview just stops? (is it because there are multiple projectiles?? or something else...? hmm)

Regarding the burst spells (specifically, spells like flame wind, sheet lightning - as above^^)- I am just unsure of how to set up a scripted function to get the damage tile going.... would I use an onDamage hook for the monster? (as I obviously would not use onProjectileHit).. and if so, how would I tell it to check for what kind of spell was doing the damage? I tried improvising on your burn monster tile damage set up but it isnt really the same thing... I am actually quite lost on this one :?
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: New Spells >> show them off here

Post by Grimwold »

Just so I'm clear.. the area effect spells target each of the 8 squares around the party e.g

Code: Select all

XXX
XPX
XXX
If so, you can simply call damageTile() on each of the 8 spaces and at the same time spawn an fx that uses the appropriate spell effect particle system. e.g.

Code: Select all

  spawn("fx", party.level, x+dx, y+dy, facing)
    :setParticleSystem("fireburst")
The particle system creates the look, and the damageTile() deals the damage.


If you're having trouble debugging spells because the editor is freezing/crashing, you are best to move all code into a script entity in the dungeon... that way the editor will take you to the line that is causing the problem instead of just crashing.


sorry I don't have more time to go in depth.. the kids are nagging me.. I'll try and write more later.
Post Reply