Hello
i made a custom poison cloud spell. but it does not give party xp if the monster is killed by it.
I know this has been solved in the past, but i cant find anything about it.
Can someone help me what i have to do to give the party xp?
Thanks!
Custom Poison Cloud spell-No Xp gain
- JohnWordsworth
- Posts: 1397
- Joined: Fri Sep 14, 2012 4:19 pm
- Location: Devon, United Kingdom
- Contact:
Re: Custom Poison Cloud spell-No Xp gain
I assume you are using the "damageTile" function to dish out the damage from the poison cloud?
If so, then I think you just need to make sure you pass in suitable "DamageFlags" for parameter 6 which are basically a bunch of switches that give you some extra options. When you cast the spell, you will need to figure out the champion that cast it (there might be a handy function to do this for you?) and then set the appropriate flag(s).
If so, then I think you just need to make sure you pass in suitable "DamageFlags" for parameter 6 which are basically a bunch of switches that give you some extra options. When you cast the spell, you will need to figure out the champion that cast it (there might be a handy function to do this for you?) and then set the appropriate flag(s).
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
Re: Custom Poison Cloud spell-No Xp gain
this is what I use to get xp, Minmay posted it on the forum:
you have to put the
in the tileDamager class.
like this custom spell:
you have to put the
Code: Select all
-- Award experience.
self:setDamageFlags(DamageFlags.Champion1)
end
like this custom spell:
SpoilerShow
Code: Select all
defineObject{
name = "magma_meteor_blast2bow",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "magma_blast",
destroyObject = true,
},
{
class = "Light",
color = vec(0.25, 0.5, 1),
brightness = 40,
range = 10,
fadeOut = 0.5,
disableSelf = true,
fillLight = true,
},
{
class = "TileDamager",
name = "damager1",
attackPower = 300,
damageType = "physical",
sound = "fireball_hit",
onInit = function(self)
-- Award experience.
self:setDamageFlags(DamageFlags.Champion1)
end
},
},
}
Re: Custom Poison Cloud spell-No Xp gain
you don't need to set it in the onInit hook, you can just add damageFlags = DamageFlags.Champion1 to the component definition
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Custom Poison Cloud spell-No Xp gain
Ah thank you!
That was easier then i thought
That was easier then i thought

Re: Custom Poison Cloud spell-No Xp gain
Sorry for necro-ing this thread
But testing my mod after a long time i saw that the
damageFlags = DamageFlags.Champion1
works on the tile damager class but not on the "CloudSpell" class.
So the poison cloud spell still does not give xp. Is there a way to set up a poison cloud with the "TileDamager" class? So that i can use the damageflag?
Or is there another way to give the "CloudSpell" class a damage flag that works?
This is the script without a damage flag
If i use
onInit = function(self)
self:setDamageFlags(DamageFlags.Champion1)
end
it gives an error when i cast the spell
If i use
damageFlags = DamageFlags.Champion1
It does nothing. But this works on other spells.
But testing my mod after a long time i saw that the
damageFlags = DamageFlags.Champion1
works on the tile damager class but not on the "CloudSpell" class.
So the poison cloud spell still does not give xp. Is there a way to set up a poison cloud with the "TileDamager" class? So that i can use the damageflag?
Or is there another way to give the "CloudSpell" class a damage flag that works?
This is the script without a damage flag
Code: Select all
defineObject{
name = "giftwolkeklein",
baseObject = "base_spell",
components = {
{
class = "Particle",
particleSystem = "poison_cloud_small",
offset = vec(0, 1.5, 0),
},
{
class = "Light",
offset = vec(0, 1.5, 0),
color = vec(0.5, 0.5, 0.25),
brightness = 7,
range = 5,
fadeOut = 13,
disableSelf = true,
},
{
class = "CloudSpell",
attackPower = 5,
damageInterval = 1,
damageType = "poison",
duration = 6,
sound = "poison_cloud",
},
},
}
onInit = function(self)
self:setDamageFlags(DamageFlags.Champion1)
end
it gives an error when i cast the spell
If i use
damageFlags = DamageFlags.Champion1
It does nothing. But this works on other spells.
Re: Custom Poison Cloud spell-No Xp gain
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Re: Custom Poison Cloud spell-No Xp gain
Thanks minmay. That worked now 
