[SCRIPT] Goromorg Shield (v1.1 update)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: [SCRIPT] Goromorg Shield (v1.1 update)

Post by Diarmuid »

Hi everyone,

Thanks to some very helpful input from Roman42, I've updated the Goromorg Shield script to version 1.1 (first post). The major change is that the shield now properly moves with the monster if the monster is hit while in movement.

Note that I've updated the way you define monsters in the script, much cleaner (replace white_goromorg with whatever you want, add any amount of monsters in the table):

Code: Select all

monstersTable = {
	white_goromorg = {
		shield = 300,
		immunity = "cold",
		shieldVAlign = 0,
		shieldSize = 1,
		moveSpeed = 1,
	},
}
Also, immunity can be "none" now.

As usual, enjoy!
Last edited by Diarmuid on Sun Dec 16, 2012 3:45 pm, edited 1 time in total.
User avatar
Roman42
Posts: 42
Joined: Tue Dec 11, 2012 11:38 am

Re: [SCRIPT] Goromorg Shield (v1.1 update)

Post by Roman42 »

Yeah, working perfectly! Now we can clone perfect Goromorgs! They are the coolest monsters in Grimrock IMHO. :)

If someone wants to see it in action: :)

http://grimrock.nexusmods.com/mods/146/

BTW: The GrimWiki states, that this can't be archieved! :)
User avatar
vidarfreyr
Posts: 71
Joined: Sat Oct 20, 2012 4:40 am

Re: [SCRIPT] Goromorg Shield (v1.1 update)

Post by vidarfreyr »

LOG crashes every time I try and hit my shielded critter.

I'm not entirely sure in which .lua I should put the longest code. I tried a few, monsters.lua, init.lua, same effect.

This is what I done in monsters.lua

Code: Select all

cloneObject{
	name = "ShieldArcher",
	baseObject = "skeleton_archer",
	uiName = "Shield Archer",

   onDamage = function(self,damage,type)
      return damageTracker.shield(self,damage)
   end,
   
   onMove = function(self, direction)
      return damageTracker.createMoveTimer(self, direction)
   end,
   
   onDie = function(self)
      return damageTracker.clear(self)
   end,
}
Thanks for any help. Look forward to seeing this working :)
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: [SCRIPT] Goromorg Shield (v1.1 update)

Post by Diarmuid »

Hi vidarfreyr,

Your monsters.lua seems fine. Did you copy the main script to a script_entity named "damageTracker"? And also, did you define your ShieldArcher in the monstersTable table in that script, replacing the "white_goromorg" example? Like that:

Code: Select all

monstersTable = {
   shieldArcher = {
      shield = 300,
      immunity = "none",
      shieldVAlign = 0,
      shieldSize = 1,
      moveSpeed = 1,
   },
}
Other points... Did you copy the particles script somewhere in an .lua file? And did you put the .dds texture file in mod_assets\textures\particles\?
User avatar
vidarfreyr
Posts: 71
Joined: Sat Oct 20, 2012 4:40 am

Re: [SCRIPT] Goromorg Shield (v1.1 update)

Post by vidarfreyr »

Diarmuid wrote:Did you copy the main script to a script_entity named "damageTracker"?
Nope. Thats what I missed. I put that code in a .lua file. Works fine now. And looks very impressive. :D Only thing is that the shield lags a bit behind the skeletal archer as it moves when damaged. Perhaps I can tweak the script a bit to make the shield move faster as the skeleton moves?
User avatar
vidarfreyr
Posts: 71
Joined: Sat Oct 20, 2012 4:40 am

Re: [SCRIPT] Goromorg Shield (v1.1 update)

Post by vidarfreyr »

It all works fine in the editor, but when I export the dungeon and open up ingame I get: "File not found: mod_assets/textures/particles/goromorg_shield_particle.dds"
Me and Grimrock seem to differ on whether the file is there or not. But somehow it is not compiled during export, I suppose, since I can see the file exactly where it is supposed to be and I can see the shield working when I run the dungeon in editor.
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: [SCRIPT] Goromorg Shield (v1.1 update)

Post by Diarmuid »

Great, I'm happy it works :).

For the lag, that's exactly what moveSpeed variable is for when you define your archer in the script entity. Put it above 1 for a faster moving shield, a few trial and errors and you should get it right.

That's weird for the particle... I'll see what happends on my end.
User avatar
Diarmuid
Posts: 807
Joined: Thu Nov 22, 2012 6:59 am
Location: Montreal, Canada
Contact:

Re: [SCRIPT] Goromorg Shield (v1.1 update)

Post by Diarmuid »

vidarfreyr wrote:It all works fine in the editor, but when I export the dungeon and open up ingame I get: "File not found: mod_assets/textures/particles/goromorg_shield_particle.dds"
Me and Grimrock seem to differ on whether the file is there or not. But somehow it is not compiled during export, I suppose, since I can see the file exactly where it is supposed to be and I can see the shield working when I run the dungeon in editor.
Hi, I really have no idea what's going on, I've tried it after export and it works fine here, I think it worked for Roman42 as well... :?: :?
Maybe someone else would know?
User avatar
vidarfreyr
Posts: 71
Joined: Sat Oct 20, 2012 4:40 am

Re: [SCRIPT] Goromorg Shield (v1.1 update)

Post by vidarfreyr »

Perhaps it is a mac error as I am editing on a mac. I will forward the error to Almost Human. Thanks for your help. The shield really adds a lot.

EDIT: It works now. I didn't change any script settings regarding the shield, permissions or file locations. I was working on other parts of the dungeon and after exporting again the shield works flawlessly. Guess it was just a glitch. :mrgreen:
User avatar
akroma222
Posts: 1029
Joined: Thu Oct 04, 2012 10:08 am

Re: [SCRIPT] Goromorg Shield (v1.1 update)

Post by akroma222 »

This is great news! Thanks :D
Post Reply