Page 1 of 1

Game Maker Discussions

Posted: Tue Feb 15, 2011 9:49 am
by Guppy Star
How do you make gmk recognize that a sprite has 2 or more subimages?
If anyone knows, please do it with my attachments...

Edited by tyteen: made this the topic for GM discussions

Posted: Tue Feb 15, 2011 1:39 pm
by Serlan
Guppy star: To use more than 1 image to make subimages you have to go to
"Edit Sprite/File/Create from strip"

Posted: Fri Feb 18, 2011 3:32 pm
by Guppy Star
Next question; answer please?

How to make save slots and load slots in a platform game in gmk8?
How to make gmk8 recognise what you did, each time you played the game?
How you can make life, health, inventory come in screen and not the titlewindow?

Posted: Fri Feb 18, 2011 4:26 pm
by Serlan
are you making a Game Maker game?

Edited by tyteen: merged post

Posted: Fri Feb 18, 2011 4:39 pm
by jozsefkoma
For fire,coins and last image is easy.
Just rename they like this.
name of image + "_" + "strip" + how much image are in the big image

Example:
fire_strip10.png

For diamonds I will edit your image to use it.

Posted: Sat Feb 19, 2011 2:33 am
by Emerald141

Posted: Sat Feb 19, 2011 2:51 am
by DEEMAN223344
Using the "1 out of _ preform this action" thingies and the Else action.

Posted: Sat Feb 19, 2011 5:02 am
by dlcs18
Emerald141 wrote:I have a question about Game Maker myself. I'm trying to do something where an object displays one out of 35 sprites randomly. If that's possible, how can I do it?
You could use something like

sprite_index = choose(sprite1,sprite2,sprite3,...)

The choose function chooses one of the options randomly but it can only have up to 16 options... I'm not sure if putting another choose function inside the choose function would work but you could try that for it to choose out of 35 sprites.

Posted: Sat Feb 19, 2011 5:48 am
by Guppy Star
If you have an object for 12 images in onne strip rename it as

object_strip12.png

it works for max 255, I hope so

Posted: Sat Feb 19, 2011 3:27 pm
by boywhoflies
Emerald141 wrote:I have a question about Game Maker myself. I'm trying to do something where an object displays one out of 35 sprites randomly. If that's possible, how can I do it?
This only works if they all only have 1 subimage.

Put them all into one sprite, all one subimage, then for the object you want it to happen on put this code in the create event:

image_speed=0;
image_index=random(35);

Posted: Mon Mar 21, 2011 7:49 am
by Guppy Star
How to make gmk detect a password to let you go to room no 10?

Posted: Mon Mar 21, 2011 8:25 am
by Blast!10
var passwd;
passwd = get_string("Type password:","");
if passwd = "hi" then room_goto(room10); else show_message("Incorrect password!");
In line 3, replace "hi" with the password you want the user to type. Don't forget to put quotes around it since it's a string.

Posted: Thu Apr 07, 2011 6:40 am
by Guppy Star
Thanks, but in where you write the code? Is it create event for password?

Next question, answer please:
How you make a player shoot in right direction?

Posted: Thu Apr 07, 2011 10:45 pm
by boywhoflies
We would need to know more of your engine. If you are using normal move actions (not warps) use create instance moving and put direction in the direction section. :P

Posted: Tue Apr 19, 2011 3:53 am
by Guppy Star
NEXT QUESTION?

How do make your player the main part and always stays in middle of screen like WA's main player?

Posted: Tue Apr 19, 2011 2:40 pm
by Serlan
Is easy, only use views, can't explain it too detaily now, I look tired.

Posted: Tue May 10, 2011 11:09 am
by Guppy Star
How to make powderkeg type objects without destroying the wall?

Posted: Sun May 29, 2011 11:56 pm
by Master Wonder Mage
What is the simplest way to make dialogues like in ET2, ET3, and ET4?

Posted: Mon May 30, 2011 2:25 pm
by jozsefkoma
For my new game I will try to make a rainbow-meter.
I need to find a way to make it stay in the left of screen all time.
How to do that?
Also I need to make the same thing with score.

Posted: Mon May 30, 2011 8:57 pm
by boywhoflies
Use the view_xview[0] and view_yview[0] varibles. Replace 0 with whatever view you are using. If you use view 0 don't change anything.

Draw it with "varible above+your normal posisions here".

Posted: Tue May 31, 2011 3:26 am
by Guppy Star
Master Wonder Mage wrote:What is the simplest way to make dialogues like in ET2, ET3, and ET4?
Make some 10 rectangles with words in it.
In the room, make a create event for object rectangle no 1
If you press any key, change rect.1 to rect.2 and so on until you finish the dialogue

Posted: Wed Jun 01, 2011 12:36 am
by boywhoflies
I think we wants to know how to make it type itself out. I know, but as I said, I don't know how to make the text difrent colors in the same text without having more than one text. Ask Kooky or Deeman(you can talk to him on my forums. He's quite nice now.).

Posted: Wed Jun 01, 2011 12:43 am
by Master Wonder Mage
Tell me what you know please.

Posted: Wed Jun 01, 2011 1:20 am
by boywhoflies
I'm too lazy to explain so here's the info on one of my text objects. It's The Apple saying "Nice Day." It's called 1. 2 is the next text. The first one causes a error, so set display error messages to off.

Sprite: Text Box
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
set variable type_varible to 1
execute code:

text="Nice day."
text_length=string_length(text)
next=false
step_passed=false


Step Event:
execute code:

speech=string_copy(text,1,type_varible);

if type_varible is not equal to text_length
set variable type_varible relative to 1
play sound Letter; looping: false
else
set variable next to true

End Step Event:
set variable step_passed to true

Draw Event:
set the drawing color to 0
set the font for drawing text to Name and align left
execute code:

draw_sprite(sprite_index,image_index,x,y)
draw_sprite(spr_theapple,image_index,x+4,y+4)
draw_text(x+36,y+4,"The Apple")

set the font for drawing text to Text and align left
execute code:

draw_text_ext(x+4,y+36,speech,16,252)

if type_varible is equal to text_length
at relative position (0,0) draw image -1 of sprite Text Arrow

Key Press Event for <Space> Key:
if step_passed is equal to false
exit this event
if next is equal to true
play sound New Bubble; looping: false
create instance of object 2 at relative position (0,0)
destroy the instance
else
set variable type_varible to text_length

Posted: Wed Jun 01, 2011 11:11 am
by dlcs18
Guppy Star wrote:How to make powderkeg type objects without destroying the wall?
You can make an object indestructible by putting

Code: Select all

instance_create&#40;x,y,object_index&#40;self&#41;&#41;
in the Destroy event. So when an object gets destroyed another instance of the object will be created at the same place.

Posted: Sun Jun 12, 2011 1:57 am
by MyNameIsKooky
Does anyone know how to colorize something so it's brown?

Posted: Sun Jun 12, 2011 2:12 am
by MyNameIsKooky
MyNameIsKooky wrote:Does anyone know how to colorize something so it's brown?
nvm, i just did it manually