Making Spiders Shoot! (Solved)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Mal85
Posts: 92
Joined: Fri Nov 16, 2012 10:56 am

Making Spiders Shoot! (Solved)

Post by Mal85 » Thu Nov 22, 2012 12:24 pm

Hey new here! Been working on a few maps lately and have been making some great progress but I seem to be stuck on something silly.

I need my custom "spider" to shoot "poison_bolts" and act as a ranged unit. I have tried all the obvious stuff to no avail, he tries to attack at range but doesn't fire projectiles. So it seems I'm having trouble getting monsters that are melee to use projectile attacks. Thanks in advance!

(Edited the title so its easier for others to find this)
Last edited by Mal85 on Thu Nov 22, 2012 2:09 pm, edited 1 time in total.

User avatar
Kuningas
Posts: 268
Joined: Wed Apr 11, 2012 10:29 pm
Location: Northern Finland

Re: Hi, stuck on Monster Script!

Post by Kuningas » Thu Nov 22, 2012 12:41 pm

That's odd... It certainly doesn't take ranged attacks very well. I'm investigating this, but to be frank I have no idea why either... It might have something to do with the animation events, but that is no more than a hunch.

EDIT: Woah, I think I just tried to make a spider walk sideways and it crashed the editor. Note to self: be wary with the Skeleton Archer Brain. : P

EDIT2: Okay, the spider has two animation events, spider_bite and spider_bite_jump. Why? I see no other reference to the spider_bite_jump animation anywhere. I'm not a master of animation events, though, so I don't know if this is relevant. Another observation is that the spider still does it's melee damage if I stand next to it, curious.

EDIT3: Ooohhh, this is getting more interesting by the moment... I switched the spider's attack animation to spider_bite_jump, and now it can jump one square forward as it attacks... It seems very buggy, though, the movement is not exactly fluid. Still no nearer to the answer to the original question, though.

EDIT: I concede defeat -- no idea why it doesn't work. : / But shooting spiders would be cool, so I hope someone has an idea how to implement them.
Last edited by Kuningas on Thu Nov 22, 2012 12:57 pm, edited 1 time in total.
BASILEUS

User avatar
Mal85
Posts: 92
Joined: Fri Nov 16, 2012 10:56 am

Re: Hi, stuck on Monster Script!

Post by Mal85 » Thu Nov 22, 2012 12:56 pm

Vexing isnt it? Those are the same problems I ran into. I thought perhaps it was an animation problem as well. But that's about as far as I got.

EDIT: Perhaps using CloneObject instead of making a new monster may be causing problems? I'm going to try and change the graphics and models for a cloned archer to a spider and see what happens.

User avatar
Grimwold
Posts: 508
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Hi, stuck on Monster Script!

Post by Grimwold » Thu Nov 22, 2012 1:07 pm

I'm pretty sure it is to do with the animation events. If you've downloaded the official asset pack (Which is just for reference and isn't actually required by the game/editor) and take a look in: assets\scripts\animation_events.lua

You will see that the spider has two "attack" events defined (though I don't think the spider_bite_jump animation is used).
Whereas the Uggardian has a "ranged_attack" event defined.
SpoilerShow

Code: Select all

-------------------------------------------------------
-- Spider
-------------------------------------------------------

defineAnimationEvent{
	animation = "assets/animations/monsters/spider/spider_bite.fbx",
	event = "attack",
	frame = 11,
}

defineAnimationEvent{
	animation = "assets/animations/monsters/spider/spider_bite_jump.fbx",
	event = "attack",
	frame = 12,
}

Code: Select all

-------------------------------------------------------
-- Uggardian
-------------------------------------------------------

defineAnimationEvent{
	animation = "assets/animations/monsters/uggardian/uggardian_attack.fbx",
	event = "ranged_attack",
	frame = 9,
}
SO.. I expect you will need to define a new animation event for your ranged spider and link it to the animation file you use for the ranged attack... in fact you may want to copy the animation from the asset pack into your mod folder, instead of using the original spider one. then there's no risk of the basic spider trying to make ranged attacks too
Last edited by Grimwold on Thu Nov 22, 2012 1:24 pm, edited 1 time in total.

User avatar
Komag
Posts: 3602
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Hi, stuck on Monster Script!

Post by Komag » Thu Nov 22, 2012 1:15 pm

shooting spiders sound extremely unpleasant, yikes!
Finished Dungeons - complete mods to play

User avatar
Soaponarope
Posts: 180
Joined: Thu Oct 04, 2012 3:21 am

Re: Hi, stuck on Monster Script!

Post by Soaponarope » Thu Nov 22, 2012 1:16 pm

Beat me to it Grimwold, I was just playing with custom monsters and making this very thing happen. Let the newbie have his moment and have the answer for once :D

User avatar
Grimwold
Posts: 508
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Hi, stuck on Monster Script!

Post by Grimwold » Thu Nov 22, 2012 1:17 pm

I just got it to work!

Code available if anyone wants.. but happy to let others have at it... ;)

Image

User avatar
Mal85
Posts: 92
Joined: Fri Nov 16, 2012 10:56 am

Re: Hi, stuck on Monster Script!

Post by Mal85 » Thu Nov 22, 2012 1:28 pm

Phew, this seems like its going be a bit more work than I had expected. I guess I have a night full of experimentation ahead of me.

@grimwold Hmm, I think I get what your saying, I'll give that a try. Thanks!

@komag That was exactly the reaction I was going for ;)

User avatar
Komag
Posts: 3602
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Hi, stuck on Monster Script!

Post by Komag » Thu Nov 22, 2012 1:30 pm

That's why Grimwold is the master around here, let us students watch and learn!
Finished Dungeons - complete mods to play

User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Hi, stuck on Monster Script!

Post by Neikun » Thu Nov 22, 2012 1:35 pm

Almost Human were planning leaping spiders? :o That would be dangerous!
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!

Post Reply