The Daily Click ::. Forums ::. Klik Coding Help ::. Problem with My Final Project
 

Post Reply  Post Oekaki 
 

Posted By Message

Gamemaker2010



Registered
  22/10/2008
Points
  31
22nd October, 2008 at 07:54:01 -

I'm making a game with mmf2 for a final project in an online game desgin class. Im making a sidescrolling zombie shooter. Anyways i need help with something very important. I have only been using this software for about a month so i dont know much. My problem is my guns will shoot as fast as you can press the spacebar. Can someone please help me with a simple way to limit how fast your guns shoot and how much bullets are in a clip? My pistol will have unlimited ammo but i want 7 bullets in a clip can someone please help me?

 
Whats a goon to a GOBLIN?

DakaSha



Registered
  21/10/2008
Points
  32
22nd October, 2008 at 08:05:45 -

never done this but im guessing you can just set a counter... every time u shoot the counter goes +1. when it reaches 7 u make a reload event or whatever.

and for the timing of the shots u could probably use a timer. never have used one so im not sure they work like that... again u could prob use a counter though

i didnt think much about it but it should be quit simple

 
n/a

]Alpha[



Registered
  19/09/2003
Points
  245
22nd October, 2008 at 09:00:31 -

You can do like this.
Create a counter and call it "Timer".
Set initial value of Timer to 50.

Then, write this code :
+ When Timer is <50
° Add 1 to Timer

+ When "Space Bar" is pressed
+ When Timer is = 50
° Shot the Bullet
° Set Timer to 0

So.. you begin with your weapon ready to shot.
Every time you shot, the counter will be set to 0 and so you have to wait until it reach 50 to shot again.
If you think think that the gun is still shooting too fast, then you can replace the number 50 with an higher number.
If you think that the gun is now shooting too slow, you have to replace number 50 with a low number.
Obviously you don't have to rename your counter as Timer if you don't like it.
You can choose any name.. it doesn't matter

And for the reload thing, Daka system should work well


Image Edited by the Author.

 
All that I see is the years...

Lönnemyr



Registered
  30/06/2008
Points
  69
22nd October, 2008 at 21:17:45 -

Ok, I`m not sure about this so correct me if I`m wrong but can´t you just add a "every XX" condition to your event were "XX" is the delay time you want in between each shot? ..that is if you have a "while key is being pressed down" event.

 
-

Gamemaker2010



Registered
  22/10/2008
Points
  31
22nd October, 2008 at 21:52:14 -


Originally Posted by ]Alpha[
You can do like this.
Create a counter and call it "Timer".
Set initial value of Timer to 50.

Then, write this code :
+ When Timer is <50
° Add 1 to Timer

+ When "Space Bar" is pressed
+ When Timer is = 50
° Shot the Bullet
° Set Timer to 0

So.. you begin with your weapon ready to shot.
Every time you shot, the counter will be set to 0 and so you have to wait until it reach 50 to shot again.
If you think think that the gun is still shooting too fast, then you can replace the number 50 with an higher number.
If you think that the gun is now shooting too slow, you have to replace number 50 with a low number.
Obviously you don't have to rename your counter as Timer if you don't like it.
You can choose any name.. it doesn't matter

And for the reload thing, Daka system should work well


Image Edited by the Author.


THANK YOU SO MUCH!!! it worked, i set it to 25 though. What is the daka system

 
Whats a goon to a GOBLIN?

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1960

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
22nd October, 2008 at 21:54:19 -

// fire if there's enough ammo loaded
+ repeat while <fire button> is pressed
+ restrict actions for <insert delay between shots here>
+ ammo_counter > 0
-> subtract 1 from ammo_counter

// when out of ammo, add a delay while reloading
+ ammo_counter = 0
-> add 1 to reload_delay_counter

// finish reloading after this delay
+ reload_delay_counter = <whatever delay you want>
-> set reload_delay_counter to 0
-> set ammo_counter to 7




Lönnemyr: You usually don't want to use the "every..." condition. In most cases "restrict actions for..." is better.

The difference is this - "every" events are repeated at regular intervals after the start of the frame. As a result, the actual delay between the conditions being true and the action occurring, is not always constant.
"Restrict actions" events are repeated at an interval after they last occurred.

 
n/a

Lönnemyr



Registered
  30/06/2008
Points
  69
22nd October, 2008 at 22:17:00 -

Sketchy

Ah, now when you say it, that`s true. At least I was running in the right direction

Image Edited by the Author.

 
-

Gamemaker2010



Registered
  22/10/2008
Points
  31
13th November, 2008 at 00:31:26 -

thanks for all the help. I have been working on it some more and encountered several more problems. I tried to fix it myself but i can't figure it out so i'll ask here again since last time was so helpful. Okay so im making a 2d sidescrollin zombie shooter for a final project in my game design class and i would really appreciate some help. I'm gonna try to make this as detailed as possible.

1) I made a H.U.D of 2 active objects and 2 counters. One counter is the health, its a bar with a gradient that goes green to red. One counter is the bullet counter, just numbers. One active object is the moon, not really part of the hud but i want the moon to scroll with it. And one active object is the bullet icon. The hud is in the top left corner of the screen. Now when the player reaches the middle of the screen the screen starts to scroll with the player because i set it to always>scrollings> scroll to Player 1> 0,0 relative or something like that. The problem is the counters scroll with the player and screen but the bullet icon and moon are left behind. They are active objects that are static. How can i make it scroll with the player?

2) When the reload animation starts i want it to play the reload sound as the player is reloading. So i make a new condition that says player1 is in the reload animation. then in the sound box i select play sample sound and i choose the reload sound. When i test this in the game the sound goes all crazy and messed up and the music stopps playing and all the sound in the game just changes terribly, it kindof sounds like when your tv has no reception. But when i put the sound to play anywhere else like after he is done reloading it plays fine. Can anyone help me out with this?

3) I'm not sure how to do the a certain part of the combat. The zombie is bouncing ball motion and the main character is platform movement. I'm not sure what to do when the main character gets hit by the zombie. right now the main character plays a little animation of getting hit and he gets pushed back a little bit. It looks really awkward though because it looks like he disappears and reappears a little further back. Does anyone know how to make the combat between the character and zombie better?

i might post a youtube video showing this if noone understands me. I've only been using this for about a month so im sorrry for asking so many questions but if i can fix these few but irritating problems i don't see anything else that can stop the production of my game.Any help at all is appreciated thanks. (Sorry for such a long post)



 
Whats a goon to a GOBLIN?

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2976

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
13th November, 2008 at 01:07:26 -

1.) Go to the objects properties tab and find a new tab named "scrolling" or "display" (or something like that), tick or untick (I don't remember which) the "Follow the Frame" box.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1960

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
13th November, 2008 at 01:30:51 -

2.) This is probably because your event is repeating continuously while the animation is playing. This causes your game to start playing another instance of the sound effect every 1/50th of a second. You need to insert a "only one action when event loops" condition into the event, and that should fix it.

Image Edited by the Author.

 
n/a

Gamemaker2010



Registered
  22/10/2008
Points
  31
13th November, 2008 at 02:16:57 -

thannk you so much it worked. 2 of my three biggest problems with this game solved in one hour. Thanks

 
Whats a goon to a GOBLIN?

Gamemaker2010



Registered
  22/10/2008
Points
  31
1st December, 2008 at 22:07:21 -

i finished the first level already. Is there a way to copy and paste everything from the first level and paste it into the second level? I want to just copy everything and paste it into the second level and edit it from there to save time because im running out of time but when i copy and paste into level 2 it looks the same but doesn't act the same is there a way i could copy and paste without having to reprogram the whole thing again and again?

 
Whats a goon to a GOBLIN?

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
1st December, 2008 at 23:08:17 -

In the storyboard editor, right click the level you made and choose copy. Then left click on it (or any other frame) and press Ctrl+V.

 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364

Gamemaker2010



Registered
  22/10/2008
Points
  31
1st December, 2008 at 23:38:30 -


Originally Posted by Jon Lambert
In the storyboard editor, right click the level you made and choose copy. Then left click on it (or any other frame) and press Ctrl+V.



Thank you so much. My main character has platform movement and i suck at animating so it looks weird when zombies attack him. Do you know a way to push the character back As if i jumped and went backwards ?

 
Whats a goon to a GOBLIN?

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
2nd December, 2008 at 00:07:59 -

Are you using the default platform movement, the platform movement object (PMO), or your own engine? That would make a difference.

 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364

Gamemaker2010



Registered
  22/10/2008
Points
  31
2nd December, 2008 at 04:15:46 -

i use the default. i adjust a few sliders like gravity and jump strength though.

 
Whats a goon to a GOBLIN?

Gamemaker2010



Registered
  22/10/2008
Points
  31
8th December, 2008 at 02:02:47 -

I really appreciate the help ive been getting but i got more problems.
1) So does anyone know how to "Push" my character up and back when he gets hit. Im using default platform movement.
2) I have a health pack feature in the game but i have problems with that too. Here is what i've got. YOu get 3 packs. When youuse one you get a health boost. How do i make it so that when you have zero you cant get anymore health. Right now i have it working but if you press the button and you have none left you still get health. Someone help please!


 
Whats a goon to a GOBLIN?

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
8th December, 2008 at 02:48:43 -

2) Just add a condition to the event that says "Number of Health Packs > 0"

I moved away from the default platform movement, because of this specific issue. I don't know how to help you.

 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364

Gamemaker2010



Registered
  22/10/2008
Points
  31
8th December, 2008 at 22:06:40 -


Originally Posted by Jon Lambert
2) Just add a condition to the event that says "Number of Health Packs > 0"
I moved away from the default platform movement, because of this specific issue. I don't know how to help you.






Here is what i have for my helathpack. Im a bit confused

Healthpack > 0 then Global value D =1
Global Value D= 1, Upon pressing"0" then Subract 1 from health counter, and add 1 to player 1 health.
Healthpacks = 0 then Global value D = 0
Global Value D= 0 then This is where im stuck

 
Whats a goon to a GOBLIN?

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
8th December, 2008 at 22:23:46 -

Why are you using a global value? Is this some sort of flag to tell MMF that there are either some or none at all? I don't see why this can't be done with just one event.

Event: Player presses "Use healthpack key"
Condition: Healthpack counter > 0
Action: Subtract 1 from healthpack counter, add 1 to player health.

It's saying, if the player presses the key and there is actually more than zero healthpacks, then the player can use one and it will subtract one of the healthpacks for you. If there is 0 left, the condition is void and therefore the event is useless and the action will not take place.

 
n/a

Gamemaker2010



Registered
  22/10/2008
Points
  31
9th December, 2008 at 04:13:25 -


Originally Posted by jthongbai
Why are you using a global value? Is this some sort of flag to tell MMF that there are either some or none at all? I don't see why this can't be done with just one event.

Event: Player presses "Use healthpack key"
Condition: Healthpack counter > 0
Action: Subtract 1 from healthpack counter, add 1 to player health.

It's saying, if the player presses the key and there is actually more than zero healthpacks, then the player can use one and it will subtract one of the healthpacks for you. If there is 0 left, the condition is void and therefore the event is useless and the action will not take place.


Thanks i guess i just made it more complicated than it should have been

 
Whats a goon to a GOBLIN?

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
9th December, 2008 at 06:05:03 -

It's easy to do that
When I first started using TGF and MMF, it took me a long time to become competent at using less events to achieve more actions. After a while I just got used to the way the program works and you try to cram as much as you can into events. (Sometimes biting off more than you can chew )

 
n/a

Gamemaker2010



Registered
  22/10/2008
Points
  31
10th December, 2008 at 01:10:26 -

In my game i have an event to destroy the bullet it goes like this.
When bullet exits screen to the right then destroy bullet.
The problem is the bullet keeps on going and kills enemies you aren't supposed to see yet. Is there another way?

 
Whats a goon to a GOBLIN?

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
10th December, 2008 at 05:00:22 -

Theoretically, that sounds correct. Maybe try just "Bullet leaves the play area" and destroy it.

 
n/a

RedEnchilada

formerly RedEchidna

Registered
  01/08/2008
Points
  301

VIP MemberWii OwnerThe Cake is a LiePicture Me This Round 24 Winner!
10th December, 2008 at 23:41:50 -

That doesn't just check the window, though. Use "Bullet is -5 pixels from the edge of the window" instead.

 
http://www.youtube.com/watch?v=WYrSD35vHo4
woooooooooooooooooaah maaaaaaaaaaaaaaaaaaaaan

Gamemaker2010



Registered
  22/10/2008
Points
  31
11th December, 2008 at 03:09:35 -


Originally Posted by RedEchidna
That doesn't just check the window, though. Use "Bullet is -5 pixels from the edge of the window" instead.


okay cool but how do i test that it is 5 pixels from the game's window?

 
Whats a goon to a GOBLIN?

Gamemaker2010



Registered
  22/10/2008
Points
  31
16th December, 2008 at 01:21:31 -

Is it possible to make a backdrop scroll, i know with an active object you just check the "Follow The Frame" box but a backdrop doesn't have that. There is an awesome backdrop of a sunset in the multimedia disc library but it cant scroll with the game. I tried copying the image and then pasting it as an active object but that makes it look weird and distorts it. Can Somebody Please Help?


 
Whats a goon to a GOBLIN?

RedEnchilada

formerly RedEchidna

Registered
  01/08/2008
Points
  301

VIP MemberWii OwnerThe Cake is a LiePicture Me This Round 24 Winner!
16th December, 2008 at 17:42:53 -


Originally Posted by Gamemaker2010

Originally Posted by RedEchidna
That doesn't just check the window, though. Use "Bullet is -5 pixels from the edge of the window" instead.


okay cool but how do i test that it is 5 pixels from the game's window?



Condition: Object: Position - Is Object getting close to window's edge

Put -5 in the box.

 
http://www.youtube.com/watch?v=WYrSD35vHo4
woooooooooooooooooaah maaaaaaaaaaaaaaaaaaaaan
   

Post Reply



 



Advertisement

Worth A Click