Making Spiders Shoot! (Solved)
Re: Hi, stuck on Monster Script!
Ya, still having exact same problem.
Code is not my forte sadly.
Code is not my forte sadly.
My slow going projects...
viewtopic.php?f=14&t=4538&p=59753#p59753
viewtopic.php?f=14&t=4538&p=59753#p59753
- Soaponarope
- Posts: 180
- Joined: Thu Oct 04, 2012 3:21 am
Re: Hi, stuck on Monster Script!
Oh here is my full script for monster.
cloneObject{
name = "fire_spider",
baseObject = "spider",
model = "mod_assets/models/fire_spider.fbx",
meshName = "spider_mesh",
health = 300,
sight = 3,
attackPower = 27,
accuracy = 15,
movementCoolDown = 1,
noRecoilInterval = { 0.1, 0.4 },
exp = 400,
healthIncrement = 50,
attackPowerIncrement = 5,
brain = "Ranged",
immunities = { "fire" },
onRangedAttack = function(self)
local dx, dy = getForward(self.facing)
spawn("fireball", self.level, self.x + dx, self.y + dy, self.facing)
return false
end,
}
defineAnimationEvent{
animation = "assets/animations/monsters/spider/spider_bite.fbx",
event = "ranged_attack",
frame = 11,
}
Just replace spawn with poison bolt and works nicely.
cloneObject{
name = "fire_spider",
baseObject = "spider",
model = "mod_assets/models/fire_spider.fbx",
meshName = "spider_mesh",
health = 300,
sight = 3,
attackPower = 27,
accuracy = 15,
movementCoolDown = 1,
noRecoilInterval = { 0.1, 0.4 },
exp = 400,
healthIncrement = 50,
attackPowerIncrement = 5,
brain = "Ranged",
immunities = { "fire" },
onRangedAttack = function(self)
local dx, dy = getForward(self.facing)
spawn("fireball", self.level, self.x + dx, self.y + dy, self.facing)
return false
end,
}
defineAnimationEvent{
animation = "assets/animations/monsters/spider/spider_bite.fbx",
event = "ranged_attack",
frame = 11,
}
Just replace spawn with poison bolt and works nicely.
Re: Hi, stuck on Monster Script!
For comparison then, here's my solution.
SpoilerShow
From the official asset pack copy the spider_bite.animation file to your mod_assets folder. I saved it in mod_assets/animations/monsters/shooting_spider/
Copy the following code into your monsters.lua file. This is the definition of the shooting_spider as well as the animation_event definition.
Finally load up your dungeon and add a shooting_spider monster... happy dodging!
Copy the following code into your monsters.lua file. This is the definition of the shooting_spider as well as the animation_event definition.
Code: Select all
defineObject{
name = "shooting_spider",
class = "Monster",
model = "assets/models/monsters/spider.fbx",
meshName = "spider_mesh",
animations = {
idle = "assets/animations/monsters/spider/spider_idle.fbx",
moveForward = "assets/animations/monsters/spider/spider_walk.fbx",
turnLeft = "assets/animations/monsters/spider/spider_turn_left.fbx",
turnRight = "assets/animations/monsters/spider/spider_turn_right.fbx",
attack = "mod_assets/animations/monsters/shooting_spider/spider_bite.fbx",
getHitFrontLeft = "assets/animations/monsters/spider/spider_get_hit_front_left.fbx",
getHitFrontRight = "assets/animations/monsters/spider/spider_get_hit_front_right.fbx",
getHitBack = "assets/animations/monsters/spider/spider_get_hit_back.fbx",
getHitLeft = "assets/animations/monsters/spider/spider_get_hit_left.fbx",
getHitRight = "assets/animations/monsters/spider/spider_get_hit_right.fbx",
fall = "assets/animations/monsters/spider/spider_get_hit_front_left.fbx",
},
moveSound = "spider_walk",
attackSound = "spider_attack",
hitSound = "spider_hit",
dieSound = "spider_die",
hitEffect = "hit_goo",
capsuleHeight = 0.2,
capsuleRadius = 0.8,
health = 160,
sight = 3,
attackPower = 23,
accuracy = 10,
movementCoolDown = 1,
noRecoilInterval = { 0.1, 0.4 },
exp = 175,
healthIncrement = 30,
attackPowerIncrement = 5,
rangedAttack = "poison_bolt",
brain = "Ranged",
}
defineAnimationEvent{
animation = "mod_assets/animations/monsters/shooting_spider/spider_bite.fbx",
event = "ranged_attack",
frame = 11,
}
Puzzle Frameworks - http://www.grimrock.net/forum/viewtopic.php?f=14&t=4564
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Magic Pack - https://www.nexusmods.com/grimrock/mods/70
Area of Effect Spell System - http://www.grimrock.net/forum/viewtopic ... 150#p44382
Re: Hi, stuck on Monster Script!
Yes! Thanks all of you for helping out! I was so close just not quite there! Thanks again guys! Now I can get back to work again!
Edit: Wow they are quite nasty too boot, should be fun!
Edit: Wow they are quite nasty too boot, should be fun!
My slow going projects...
viewtopic.php?f=14&t=4538&p=59753#p59753
viewtopic.php?f=14&t=4538&p=59753#p59753
- Soaponarope
- Posts: 180
- Joined: Thu Oct 04, 2012 3:21 am
Re: Hi, stuck on Monster Script!
Hmm, didn't know you could just use a normal ranged attack script for melee monster. I thought I tried that and it didn't work, hence the on ranged attack function added. Grimwold's easier then.
Re: Hi, stuck on Monster Script!
Thats how I was doing it but I didnt realize I had to do the DefineAnimationEvent as well
My slow going projects...
viewtopic.php?f=14&t=4538&p=59753#p59753
viewtopic.php?f=14&t=4538&p=59753#p59753
Re: Making Spiders Shoot! (Solved)
This is worthwhile stuff! I've added it to the superthread
Finished Dungeons - complete mods to play
Re: Making Spiders Shoot! (Solved)
Ah! I feel like an idiot, I was playing around with the uggardian a while ago and I should have remembered this. Good thing Grimwold saved the day as usual. : D
When I tried it in the editor I was honestly startled, even though I could have expected it. : SNeikun wrote:Almost Human were planning leaping spiders? That would be dangerous!
BASILEUS
- SpiderFighter
- Posts: 789
- Joined: Thu Apr 12, 2012 4:15 pm
Re: Making Spiders Shoot! (Solved)
Dang, I wish I'd seen this early enough to jump in on the fun. Great work everyone, and extremely useful.
My favorite moments in here are when someone says,"What if...?"
My favorite moments in here are when someone says,"What if...?"
Re: Making Spiders Shoot! (Solved)
Quick, everyone start rummaging through the monster animations! There's bound to be more!