Page 2 of 3
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Posted: Sun Dec 16, 2012 5:39 am
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!
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Posted: Sun Dec 16, 2012 2:21 pm
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!
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Posted: Thu Jan 03, 2013 5:21 am
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
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Posted: Thu Jan 03, 2013 6:59 am
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\?
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Posted: Fri Jan 04, 2013 7:40 am
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.
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?
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Posted: Fri Jan 04, 2013 8:04 am
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.
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Posted: Fri Jan 04, 2013 8:09 am
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.
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Posted: Fri Jan 04, 2013 11:24 pm
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?
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Posted: Sat Jan 05, 2013 4:22 am
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.
Re: [SCRIPT] Goromorg Shield (v1.1 update)
Posted: Sun Feb 10, 2013 10:46 am
by akroma222
This is great news! Thanks