Jump to content


Photo

Is There An Action For Doing Nothing?


  • Please log in to reply
7 replies to this topic

#1 jotarokujo1

jotarokujo1

    GMC Member

  • New Member
  • 160 posts

Posted 01 August 2009 - 08:00 PM

Okay I have a weapon in this game that I'm making but I only want the weapon to affect enemies when the weapon is in it's attack mode.
For this weapon which is a hammer it has indexes that are called mallet_left and malatt_left. The reason the other one is called mallat_left is because that's short for mallet attack.
See the hammer kills the monster when the hammer isn't supposed to hurt anything at all and that's because I have nothing to fill in for this.

Posted Image

I'd tried filling these two actions in with empty sound effects but that didn't work which puts me in a real fix. Any suggestions?
  • 0

#2 AdilFaQah

AdilFaQah

    Whiz Kid

  • GMC Member
  • 2744 posts

Posted 01 August 2009 - 08:09 PM

Did you try using this one: :lol: ?

Edited by AdilFaQah, 01 August 2009 - 08:12 PM.

  • 0

#3 kake_fisk

kake_fisk

    GMC Member

  • New Member
  • 2391 posts
  • Version:GM7

Posted 01 August 2009 - 08:21 PM

When you use an question action (blue ones), you have to wrap the actions you want to happen when the question is true inside code blocks.
That will fix everything and you don't have to check if the sprite is mallet_left or mallet_right.
  • 0

#4 jotarokujo1

jotarokujo1

    GMC Member

  • New Member
  • 160 posts

Posted 01 August 2009 - 08:21 PM

Did you try using this one: :lol: ?


Forgot to mention that. Yes I did use it and it had no effect.
  • 0

#5 kake_fisk

kake_fisk

    GMC Member

  • New Member
  • 2391 posts
  • Version:GM7

Posted 01 August 2009 - 08:40 PM

These two will not do anything, the problem lies an other place.
Putting code blocks under the if statements will probably do as you wanted.
  • 0

#6 Shadowrend

Shadowrend

    Master of Shadows

  • GMC Member
  • 1571 posts
  • Version:GM8

Posted 01 August 2009 - 09:17 PM

Man you seriously need to learn GML!!!

Here you go something usefull for learning GML
D&D to GML

Edited by Shadowrend, 01 August 2009 - 09:18 PM.

  • 0

#7 funlerz

funlerz

    GMC Member

  • New Member
  • 113 posts

Posted 01 August 2009 - 09:32 PM

Man you seriously need to learn GML!!!

Here you go something usefull for learning GML
D&D to GML


Shadow, you couldve told him he needs to learn GML in a nice way. Anyway, you could create a different object for when the hammer is attacking, and when the player presses the attack key, it turns into the attack hammer, then when the attack hammer's animation is over (other, animation end) it changes back into the hammer when it doesnt attack, that way only the attacking hammer object will hurt the enemy, that way you dont have to learn GML for this one little bug you have. But I still recomend you look at the link Shadowrend mentioned.
  • 0

#8 jotarokujo1

jotarokujo1

    GMC Member

  • New Member
  • 160 posts

Posted 02 August 2009 - 02:32 AM

Man you seriously need to learn GML!!!

Here you go something usefull for learning GML
D&D to GML


Shadow, you couldve told him he needs to learn GML in a nice way. Anyway, you could create a different object for when the hammer is attacking, and when the player presses the attack key, it turns into the attack hammer, then when the attack hammer's animation is over (other, animation end) it changes back into the hammer when it doesnt attack, that way only the attacking hammer object will hurt the enemy, that way you dont have to learn GML for this one little bug you have. But I still recomend you look at the link Shadowrend mentioned.


Thanks for all your help guys! I knew I should've turned the hammer attacking in a separate object instead of keeping the same.

It works great and no bugs since I programmed the hammer to stick to the character after he touches it.  Sweet stuff man!
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users