Setting Goromorg spells

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Eightball
Posts: 48
Joined: Thu Jan 09, 2014 8:21 am

Setting Goromorg spells

Post by Eightball »

How do I restrict a goromorg to using only one school of magic (say, ice magic only)? I think I've figured out how to make them immune to certain schools (nope, failed at this too) but nothing about how to access their spellcasting behavior.

I've been trying to use "cloneObject" in monsters.lua to make a special goromorg utilizing the rangedAttack and immunities code but to no avail. I'm sure I'm missing some significant syntax.

Code: Select all

cloneObject{
 name="Master of Sea",
 baseObject = "goromorg",
 onDie = function(monster)
	spawn("note", monster.level, monster.x, monster.y, 	monster.facing, "Sea_note")
	Sea_note:setScrollText("spoiler censored here.")
 immunities = "cold"
 rangedAttack = "frostbolt_greater"
 end
}
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Setting Goromorg spells

Post by Dr.Disaster »

According to scripting reference "frostbolt_greater" is not listed as a possible/allowed option:
rangedAttack: the ranged attack to perform when “ranged_attack” animation event is triggered. Must be one of the following: “lightning_bolt”, “lightning_bolt_greater”, “ice_shards”, “fireball”, “fireball_greater”, “poison_bolt”, “frost_arrow”.
There sure is a way around this but i'm not aware how to pull it off. Maybe with the onAttack hook.
User avatar
Eightball
Posts: 48
Joined: Thu Jan 09, 2014 8:21 am

Re: Setting Goromorg spells

Post by Eightball »

Thanks, I just noticed that too in testing it. I've got it casting one ice spell now, but need to have it choose frostbolt at times too. typing 'rangedAttack = "ice_shards", "improved_frostbolt",' doesn't seem to work. I also had to place the last two lines before the onDie lines.

Doh, even "improved_frostbolt" as it is stated for spawners isn't a viable option from the list you gave and returns an error as "unknown rangedAttack". hmmm, so just ice_shards then??
User avatar
Eightball
Posts: 48
Joined: Thu Jan 09, 2014 8:21 am

Re: Setting Goromorg spells

Post by Eightball »

How does this work with a burst spell, or say "poison cloud"? I was able to alter monsters' "rangedAttack", but I don't know how to get monsters to cast the up-close-and-personal spells like the bursts or cloud. Is it "meleeAttack"? I can't figure out how to check out the big_herder's lua scripts, so I'm asking here.

Also, I wonder is there a way to make a goromorg without a shield spell? Is that just in the AI and I have to deal with it, or can I make a "novice goromorg" who doesn't know his shield spell yet?
User avatar
LocalFire
Posts: 261
Joined: Thu Feb 21, 2013 1:16 am
Location: Auckland, New Zealand

Re: Setting Goromorg spells

Post by LocalFire »

Actually if you clone a goromorg it should loose its shield spell so it would be very easy to make this! Putting it back on is more complicated but if you need to there's a method in the editing super thread (also lets you add the shield to other monsters)

As for setting up spells you should download and look at Neikuns Laguardian since it attacks with a custom waterbolt spell, that should show you how its done. http://www.nexusmods.com/grimrock/mods/178/?
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
User avatar
Eightball
Posts: 48
Joined: Thu Jan 09, 2014 8:21 am

Re: Setting Goromorg spells

Post by Eightball »

oh cool, I hadn't noticed that my clone goromorg lost his shield. lol. Thanks for pointing that out!
User avatar
Eightball
Posts: 48
Joined: Thu Jan 09, 2014 8:21 am

Re: Setting Goromorg spells

Post by Eightball »

As for setting up spells you should download and look at Neikuns Laguardian since it attacks with a custom waterbolt spell, that should show you how its done.
LocalFire, thanks. I've been taking a look at the laguardian. Fun stuff! Only one problem, I've noticed when a player tries to cast Water Bolt (not the laguardian mind you. He knows his spells) Grimrock returns an error.

"warning! unknown built-in spell: waterBolt"

Another forum post cites the same error but no one has cleared it up yet. Just wondering if you or others knew anything about fixing it. If I figure out the solution by trial and error, I'll post it here :D Now I'm off to read the spell maker's manual in the EDITING SUPERTHREAD.

Edit: Found out from a post by Grimwold that the "defineObject" part of a spell should be in "object.lua" (which makes sense) not "spell.lua" as it was in the download of the Laguardian. But even after I moved it to the proper .lua, I get the same exact error about "waterBolt" being an unknown spell. There must be a line missing or typo somewhere that defines "waterBolt"?
(note: waterBolt is the onCast. Everything else is named "water_bolt", but I've seen similar things with the vanilla spells. I'll keep tinkering.)
User avatar
LocalFire
Posts: 261
Joined: Thu Feb 21, 2013 1:16 am
Location: Auckland, New Zealand

Re: Setting Goromorg spells

Post by LocalFire »

Try this

Code: Select all

onCast = function(caster, x, y, direction, skill)
        local dx,dy = getForward(party.facing)
        local x,y = party.x + dx, party.y + dy
        if party.facing == 0 then
            spawn("water_bolt", party.level, x, y, party.facing)
        elseif party.facing == 1 then
            spawn("water_bolt", party.level, x, y, party.facing)
        elseif party.facing == 2 then
            spawn("water_bolt", party.level, x, y, party.facing)
        else
            spawn("water_bolt", party.level, x, y, party.facing)
        end
    end
}
I just quickly grabbed this from the spell forum so I haven't tested it
My Dungeons
Paths of the Earth: viewtopic.php?f=14&t=5136
Beneath the Sands: viewtopic.php?f=14&t=5216
Videos: viewtopic.php?f=11&t=5443
User avatar
Eightball
Posts: 48
Joined: Thu Jan 09, 2014 8:21 am

Re: Setting Goromorg spells

Post by Eightball »

I added that to the spells.lua definition of waterbolt in place of the line that seems to be the source of the error.

That script pretty much defines verbatim what it has to do! So having no errors now. Thank you.
User avatar
Eightball
Posts: 48
Joined: Thu Jan 09, 2014 8:21 am

Re: Setting Goromorg spells

Post by Eightball »

Dr.Disaster wrote:According to scripting reference "frostbolt_greater" is not listed as a possible/allowed option:
rangedAttack: the ranged attack to perform when “ranged_attack” animation event is triggered. Must be one of the following: “lightning_bolt”, “lightning_bolt_greater”, “ice_shards”, “fireball”, “fireball_greater”, “poison_bolt”, “frost_arrow”.
There sure is a way around this but i'm not aware how to pull it off. Maybe with the onAttack hook.
Yes, there is and it is an onAttack hook. I found it accidentally when I was looking at Neikun's isgardian. "onRangedAttack" is called and then spawns whatever you wanna put in there, like frostbolt or even Neikun's "water_bolt". I haven't yet figured out how to get more than one "onRangedAttack" for a single monster (probably with some kind of table with percentages that decide which spell is cast), but that's where I'd like to head next. For those interested, here's the line of code for the onRangedAttack of the isgardian. Put it in your monsters.lua somewhere within the section of script that makes the monster that you want to define or clone.

Code: Select all

onRangedAttack = function(self)
     local dx, dy = getForward(self.facing)
     spawn("improved_frostbolt", self.level, self.x + dx, self.y + dy, self.facing)
     return false
end,
Post Reply