Page 13 of 21

Re: New Spells >> show them off here

Posted: Sun Nov 18, 2012 2:21 pm
by AmiDARK
Just seen all those spells page and "wow" many interesting spells there :p
Maybe we could concentrate all in one LoG "tome of spells" ?

More to this, I have a simple question.

I'd like to have special spell like : cure disease, cure poison but, I don't want these spells to be "too easy" to use.
So, I had an idea : The spell caster need 1 item in a hand to make the spell work.
More to this, the item will be destroyed when doing the spell (or if amount of items, the amount will be decreased of 1)

Do you think it is possible to do this ?

Kindest Regards,
AmiDARK

Re: New Spells >> show them off here

Posted: Sun Nov 18, 2012 3:01 pm
by Neikun
I think that would be too much like a potion in terms of functionality.
But worse because it costs energy.

Re: New Spells >> show them off here

Posted: Sun Nov 18, 2012 3:46 pm
by flatline
AmiDARK wrote:Just seen all those spells page and "wow" many interesting spells there :p
Maybe we could concentrate all in one LoG "tome of spells" ?

More to this, I have a simple question.

I'd like to have special spell like : cure disease, cure poison but, I don't want these spells to be "too easy" to use.
So, I had an idea : The spell caster need 1 item in a hand to make the spell work.
More to this, the item will be destroyed when doing the spell (or if amount of items, the amount will be decreased of 1)

Do you think it is possible to do this ?

Kindest Regards,
AmiDARK
Yeah, been thinking of a spell system which requires different stones or food to cast, putting a new limit on how many spells you can cast. One stone could work for many different spells, meaning you'd have to choose carefully when to cast them, since they would be limited. No more resting and recasting.

Re: New Spells >> show them off here

Posted: Sun Nov 18, 2012 3:52 pm
by akroma222
amiDARK-
I have been tempted to make some cure (poison, disease, paralysis, everything) spells but I feel it will take too much importance away from the herb/potion system
.... but that's just my opinion... I am sure it is possible to do what you want to do, in fact I have heard it suggested elsewhere before (not sure where though)..
As far as the scripting goes, I think it is beyond my limited capabilities (I am learning by adapting other peoples scripts at the moment, evidently!!)

Grimwold, absolutely no hurry to answer, you must be extremely busy with the family :D
I have swapped most of my spell scripts over into the editor a while ago, as you and Crisman have suggested before
Yes, you are clear - I am trying to set up damageTiles for the area of effect spells - experimenting at the moment really
If I have not ironed out my issues in the next few days, I will get back to you ;)

Re: New Spells >> show them off here

Posted: Mon Nov 19, 2012 3:47 am
by Grimwold
Though not much use as is, or on it's own, I thought this function might be of interest regarding the Area of Effect spells... wherever the party is, it will print the co-ordinates of the 8 spaces around the party. The tables can easily be expanded too.
SpoilerShow
Early version

Code: Select all

function eightCoords()
  local coords = {xcoord = {-1,-1,-1,0,0,1,1,1},ycoord = {-1,0,1,-1,1,-1,0,1}}
  local coord_pairs = math.min(#coords["xcoord"],#coords["ycoord"])
  for i = 1,coord_pairs do
    print(tostring(party.x + coords["xcoord"][i] .. "," .. party.y + coords["ycoord"][i]))
  end
end
Revised function that now spawns appropriate FX in each of the eight spaces AND does damageTile in each space... function is called with a champion ordinal, a type of attack - fire, cold, shock or poison and a damage value

Code: Select all

function eightCoords(ordinal, effect,damage)
  local originator = 2 ^ (ordinal+1) 
  local effects_table = {fire = "fireburst", cold = "frostburst", shock = "shockburst", poison = "poison_cloud" }
  local effect_translation_table = {fire = 1 , cold = 1, shock = 1, poison = 1 }
  local coords = {xcoord = {-1,-1,-1,0,0,1,1,1},ycoord = {-1,0,1,-1,1,-1,0,1}}
  local coord_pairs = math.min(#coords["xcoord"],#coords["ycoord"])
  for i = 1,coord_pairs do
    print(tostring(party.x + coords["xcoord"][i] .. "," .. party.y + coords["ycoord"][i]))
    spawn("fx", party.level, party.x + coords["xcoord"][i], party.y + coords["ycoord"][i], party.facing)
      :setParticleSystem(effects_table[effect])
      :translate(0, effect_translation_table[effect], 0)
    damageTile(party.level, party.x + coords["xcoord"][i], party.y + coords["ycoord"][i], party.facing, originator , effect, damage)
  end
end

eightCoords(1,"shock",50)

Re: New Spells >> show them off here

Posted: Mon Nov 19, 2012 4:35 am
by LordYig
Grimwold wrote:Though not much use as is, or on it's own, I thought this function might be of interest regarding the Area of Effect spells... wherever the party is, it will print the co-ordinates of the 8 spaces around the party. The tables can easily be expanded too. (...)
Very nice Grimwold !
When I'll get some time, I'd love to test this with "Cone" or "Line" shaped spells.

It is kind of iritating that some effect such as the "Ice Shards" can't be replicated easily with the Dungeon editor.
But this is definitely a step forward for this kind of spells.

Re: New Spells >> show them off here

Posted: Mon Nov 19, 2012 4:52 am
by Grimwold
LordYig wrote:
Grimwold wrote:Though not much use as is, or on it's own, I thought this function might be of interest regarding the Area of Effect spells... wherever the party is, it will print the co-ordinates of the 8 spaces around the party. The tables can easily be expanded too. (...)
Very nice Grimwold !
When I'll get some time, I'd love to test this with "Cone" or "Line" shaped spells.
For line (and cone) spells you will need to find the co-ordinates in the direction the party is facing, using:

Code: Select all

dx,dy = getForward(party.facing)
and build the xcoord and ycoord tables using those values.


EDIT - Actually for cone spells you could use something like:

Code: Select all

dx,dy = getForward(party.facing) -- forward
ldx,ldy = getForward((party.facing+3)%4) -- left
rdx,rdy = getForward((party.facing+1)%4) -- right
local coords = {xcoord = {dx,2*dx,2*dx+ldx,2*dx+rdx,3*dx,3*dx+2*ldx,3*dx+ldx,3*dx+rdx,3*dx+2*rdx},ycoord = {dy,2*dy,2*dy+ldy,2*dy+rdy,3*dy,3*dy+2*ldy,3*dy+ldy,3*dy+rdy,3*dy+2*rdy}}
EDIT 2 - You could even have coords for a few predefined shapes configured in the function and call the function with a shape variable.. e.g. line; cone; box; bigbox etc.

Re: New Spells >> show them off here

Posted: Mon Nov 19, 2012 9:00 am
by akroma222
Grimwold wrote:Though not much use as is, or on it's own, I thought this function might be of interest regarding the Area of Effect spells... wherever the party is, it will print the co-ordinates of the 8 spaces around the party. The tables can easily be expanded too.
SpoilerShow
Early version

Code: Select all

function eightCoords()
  local coords = {xcoord = {-1,-1,-1,0,0,1,1,1},ycoord = {-1,0,1,-1,1,-1,0,1}}
  local coord_pairs = math.min(#coords["xcoord"],#coords["ycoord"])
  for i = 1,coord_pairs do
    print(tostring(party.x + coords["xcoord"][i] .. "," .. party.y + coords["ycoord"][i]))
  end
end
Revised function that now spawns appropriate FX in each of the eight spaces AND does damageTile in each space... function is called with a champion ordinal, a type of attack - fire, cold, shock or poison and a damage value

Code: Select all

function eightCoords(ordinal, effect,damage)
  local originator = 2 ^ (ordinal+1) 
  local effects_table = {fire = "fireburst", cold = "frostburst", shock = "shockburst", poison = "poison_cloud" }
  local effect_translation_table = {fire = 1 , cold = 1, shock = 1, poison = 1 }
  local coords = {xcoord = {-1,-1,-1,0,0,1,1,1},ycoord = {-1,0,1,-1,1,-1,0,1}}
  local coord_pairs = math.min(#coords["xcoord"],#coords["ycoord"])
  for i = 1,coord_pairs do
    print(tostring(party.x + coords["xcoord"][i] .. "," .. party.y + coords["ycoord"][i]))
    spawn("fx", party.level, party.x + coords["xcoord"][i], party.y + coords["ycoord"][i], party.facing)
      :setParticleSystem(effects_table[effect])
      :translate(0, effect_translation_table[effect], 0)
    damageTile(party.level, party.x + coords["xcoord"][i], party.y + coords["ycoord"][i], party.facing, originator , effect, damage)
  end
end

eightCoords(1,"shock",50)
OR!! You could do an amazing job of it extremely quickly! :shock:
Wow... Thanks so much for scripting that up, I would never have come up with that. And my computer would probably have become the victim of a gruesome murder/homocide :cry:

I have adapted the script to hit everything within a 2 space radius (except the party.. for now) and have also added sound effects in where necessary.
Further, I have spawned poison clouds on top of what was already happening for Deadly Vapors (as minute poison damage is unlikely to kill off any monsters by themselves and the monsters will still be hit by the powerful damage tile) I did this because the spawned fx for poison cloud did not last very long at all (I am sure there is a way to change that - just not aware of it atm)
Also, I kept the (cromcrom's) script for Flash Freeze as the spell is not meant to damage - only freeze :)

Just a question though - I did not change anything as far the originator goes - when the spells go off, it seems ordinal = 1 is receiving the bulk of EXP - not the caster! :?
Maybe I am missing something here... I will show you an example of the scripting:
SpoilerShow

Code: Select all

defineSpell{
  name = "flame_wind", 
  uiName = "Flame Wind", 
  skill = "fire_magic",
  level = 0,
  runes = "ABC",
  manaCost = 45,
  onCast = function(caster, x, y, direction, skill)
  	return aoe_scripts.eightCoordsFlameWind(1, "fire", 80)
  end,
}
function eightCoordsFlameWind(ordinal, effect,damage)
  local originator = 2 ^ (ordinal+1) 
  local effects_table = {fire = "fireburst", cold = "frostburst", shock = "shockburst", poison = "poison_cloud" }
  local effect_translation_table = {fire = 1 , cold = 1, shock = 1, poison = 1 }
  local coords = {xcoord = {-2,-2,-2,-2,-2,-1,-1,-1,-1,-1,0,0,0,0,1,1,1,1,1,2,2,2,2,2},ycoord = {-2,-1,0,1,2,-2,-1,0,1,2,-2,-1,1,2,-2,-1,0,1,2,-2,-1,0,1,2}}
  local coord_pairs = math.min(#coords["xcoord"],#coords["ycoord"])
  for i = 1,coord_pairs do
    print(tostring(party.x + coords["xcoord"][i] .. "," .. party.y + coords["ycoord"][i]))
    spawn("fx", party.level, party.x + coords["xcoord"][i], party.y + coords["ycoord"][i], party.facing)
      :setParticleSystem(effects_table[effect])
      :translate(0, effect_translation_table[effect], 0)
	  playSoundAt("fireburst",party.level,party.x,party.y)
    damageTile(party.level, party.x + coords["xcoord"][i], party.y + coords["ycoord"][i], party.facing, originator , effect, damage)
  end
end


Is there something I am not doing correctly as far as getting the caster goes??

..... Thanks again Grimwold, you guys leave me in the dust when it comes to this sort of thing!

Re: New Spells >> show them off here

Posted: Mon Nov 19, 2012 12:24 pm
by Grimwold
akroma222 wrote: Is there something I am not doing correctly as far as getting the caster goes??

..... Thanks again Grimwold, you guys leave me in the dust when it comes to this sort of thing!
No problem.. hope you don't feel like I'm taking over, that was not my intention, I just enjoy this kind of coding.

so anyway the ordinal thing is my fault.. I hadn't written the whole spell definition and therefore didn't have a value for "caster", so I fudged the ordinal value in this line:

Code: Select all

     return aoe_scripts.eightCoordsFlameWind(1, "fire", 80)
To correct it you will need something like

Code: Select all

     return aoe_scripts.eightCoordsFlameWind(caster:getOrdinal(), "fire", 80)

NOTE - it might be worth noting that the way this spell is set up does not respect walls.. so some monsters on the other sides of walls(or doors) will also get damaged.

Re: New Spells >> show them off here

Posted: Tue Nov 20, 2012 5:02 am
by akroma222
No problem at all Grimwold, not taking over at all, just providing some (much needed) help!! hehehe
I thought I might need to place caster:getOrdinal() in somewhere, just wasn't sure where so I thought I'd ask ;)

It is unfortunate about being able to blast across/through doors, but a small price to pay... I think if the spells are tweaked the right way then using them to get at a single monster that is behind a door will be a (energy) costly venture, and if the party is also damaged by the spell then it would not be wise at all to do this...