Is there a way to make Ogres not use rush attack?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
vidarfreyr
Posts: 71
Joined: Sat Oct 20, 2012 4:40 am

Is there a way to make Ogres not use rush attack?

Post by vidarfreyr »

Is there a way to make Ogres not use rush attack? Say, if one wanted it to use spells as a ranged attack instead? Still using hammer on close range?
hyteria
Posts: 266
Joined: Sat Dec 29, 2012 8:22 pm

Re: Is there a way to make Ogres not use rush attack?

Post by hyteria »

sure it is , you have to copy/paste on your object lua the code from ogre and remove the line with rush attack

well i think if you remove those line

rushBegin = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_rush_begin.fbx",
rushContinue1 = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_rush_continue_right_step.fbx",
rushContinue2 = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_rush_continue_left_step.fbx",
rushHit1 = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_rush_hit_right_step.fbx",
rushHit2 = "assets/animations/monsters/tunnel_ogre/tunnel_ogre_rush_hit_left_step.fbx",
and

rushBeginSound = "ogre_rush_begin",

or if it not work , change brain to "Melee"
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: Is there a way to make Ogres not use rush attack?

Post by msyblade »

Alternatively you could put the vision to 1 so it can only see 1 square away.
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Is there a way to make Ogres not use rush attack?

Post by Neikun »

If you omit the lines for those animations, you will crash the game. Not sure about the brain = melee, though. worth a shot!
"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!
User avatar
undeaddemon
Posts: 157
Joined: Fri Mar 02, 2012 3:38 pm

Re: Is there a way to make Ogres not use rush attack?

Post by undeaddemon »

"invalid brain type" unless I did something else wrong.... hold

OK... Melee works.... no charge.... so... if i am tryin to have him cast spells... which brain......
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Is there a way to make Ogres not use rush attack?

Post by Neikun »

Can someone help us fix this script?

Code: Select all

onAttack = function(self)
     local dx, dy = getForward(self.facing)
     spawn("fireburst", self.level, self.x + dx, self.y + dy, self.facing)
     return false
end,
I don't understand scripting enough to know how to let it know about second parameters.

This is an attempt at making an ogre sling spells.
"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!
User avatar
vidarfreyr
Posts: 71
Joined: Sat Oct 20, 2012 4:40 am

Re: Is there a way to make Ogres not use rush attack?

Post by vidarfreyr »

Perhaps a script is needed that will change the monsters brain type depending on how far away the player is? For fireballs I suppose a uggardian brain and a onRangedAttack command might work. But for the Ogre to switch to melee then perhaps a script that measures the length between Ogre and party then switches brain type to melee. Sounds crazy enough to work.
hyteria
Posts: 266
Joined: Sat Dec 29, 2012 8:22 pm

Re: Is there a way to make Ogres not use rush attack?

Post by hyteria »

i think is "range" type if you want him to cast a spell and define his range attack as a spell

well in fact the real question is "it is possible to define a brain"?

if yes how?
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Is there a way to make Ogres not use rush attack?

Post by Komag »

Neikun wrote:Can someone help us fix this script?

Code: Select all

onAttack = function(self)
     local dx, dy = getForward(self.facing)
     spawn("fireburst", self.level, self.x + dx, self.y + dy, self.facing)
     return false
end,
I don't understand scripting enough to know how to let it know about second parameters.

This is an attempt at making an ogre sling spells.
I've never used getForward, but I know anytime something will return two values you need to variable to hold them. As far as I can see, that script looks fine. Maybe test with some other monsters?

You could test and see how the getForward works by changing the code to simply:

Code: Select all

print(getForward(self.facing))
or just add the line:

Code: Select all

print(dx,dy)
Finished Dungeons - complete mods to play
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: Is there a way to make Ogres not use rush attack?

Post by Grimwold »

Neikun wrote:Can someone help us fix this script?

Code: Select all

onAttack = function(self)
     local dx, dy = getForward(self.facing)
     spawn("fireburst", self.level, self.x + dx, self.y + dy, self.facing)
     return false
end,
I don't understand scripting enough to know how to let it know about second parameters.

This is an attempt at making an ogre sling spells.
Your script looks absolutely fine... and mirrors one of my own (granted mine's a range attack, but still should work for replacing the melee attack.)

Code: Select all

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