Page 1 of 2

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

Posted: Wed Jan 16, 2013 8:00 pm
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?

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

Posted: Wed Jan 16, 2013 8:07 pm
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"

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

Posted: Wed Jan 16, 2013 11:01 pm
by msyblade
Alternatively you could put the vision to 1 so it can only see 1 square away.

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

Posted: Thu Jan 17, 2013 2:57 am
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!

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

Posted: Thu Jan 17, 2013 3:48 am
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......

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

Posted: Thu Jan 17, 2013 4:51 am
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.

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

Posted: Thu Jan 17, 2013 5:37 am
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.

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

Posted: Thu Jan 17, 2013 9:42 am
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?

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

Posted: Thu Jan 17, 2013 1:41 pm
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)

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

Posted: Thu Jan 17, 2013 1:53 pm
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,