Game Maker Discussions

For discussion of non-Wonderland topics - please read rules!

Moderators: ~xpr'd~, tyteen4a03, Stinky, Emerald141, Qloof234, jdl

Post Reply
User avatar
Guppy Star
Rainbow Master
Posts: 919
Joined: Sat Oct 16, 2010 7:20 am

Game Maker Discussions

Post by Guppy Star » Tue Feb 15, 2011 9:49 am

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
Attachments
Enemy Shooter.bmp
Enemy Shooter.bmp (6.05 KiB) Viewed 3658 times
Coin.PNG
Coin.PNG (10.73 KiB) Viewed 3658 times
Fire.PNG
Fire.PNG (17.08 KiB) Viewed 3658 times
Diamond.png
Diamond.png (10.52 KiB) Viewed 3658 times
HAPPY TO HELP!!!

My HubProject:Go
My Adventures:Go
User avatar
Serlan
Rainbow Seeker
Posts: 295
Joined: Sat Feb 07, 2009 3:12 pm

Post by Serlan » Tue Feb 15, 2011 1:39 pm

Guppy star: To use more than 1 image to make subimages you have to go to
"Edit Sprite/File/Create from strip"
Click here to go to WA:The Dark Abysm topic (Postponed until Wonderland Fangame is made).
User avatar
Guppy Star
Rainbow Master
Posts: 919
Joined: Sat Oct 16, 2010 7:20 am

Post by Guppy Star » Fri Feb 18, 2011 3:32 pm

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?
HAPPY TO HELP!!!

My HubProject:Go
My Adventures:Go
User avatar
Serlan
Rainbow Seeker
Posts: 295
Joined: Sat Feb 07, 2009 3:12 pm

Post by Serlan » Fri Feb 18, 2011 4:26 pm

are you making a Game Maker game?

Edited by tyteen: merged post
Click here to go to WA:The Dark Abysm topic (Postponed until Wonderland Fangame is made).
User avatar
jozsefkoma
Rainbow Star
Posts: 1460
Joined: Tue Dec 23, 2008 5:45 pm

Post by jozsefkoma » Fri Feb 18, 2011 4:39 pm

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.
Image
Image
Emerald141
Rainbow AllStar
Posts: 4548
Joined: Fri Dec 26, 2008 4:56 pm

Post by Emerald141 » Sat Feb 19, 2011 2:33 am

User avatar
DEEMAN223344
Rainbow MegaStar
Posts: 3145
Joined: Tue Dec 04, 2007 8:07 pm

Post by DEEMAN223344 » Sat Feb 19, 2011 2:51 am

Using the "1 out of _ preform this action" thingies and the Else action.
User avatar
dlcs18
Rainbow MegaStar
Posts: 3282
Joined: Sun Jul 09, 2006 9:44 pm

Post by dlcs18 » Sat Feb 19, 2011 5:02 am

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.
dlcs18
User avatar
Guppy Star
Rainbow Master
Posts: 919
Joined: Sat Oct 16, 2010 7:20 am

Post by Guppy Star » Sat Feb 19, 2011 5:48 am

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
HAPPY TO HELP!!!

My HubProject:Go
My Adventures:Go
User avatar
boywhoflies
Rainbow Spirit Chaser
Posts: 5510
Joined: Thu Jun 26, 2008 3:16 pm

Post by boywhoflies » Sat Feb 19, 2011 3:27 pm

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);
Mr. Robot never dies! :D

Chatroom
User avatar
Guppy Star
Rainbow Master
Posts: 919
Joined: Sat Oct 16, 2010 7:20 am

Post by Guppy Star » Mon Mar 21, 2011 7:49 am

How to make gmk detect a password to let you go to room no 10?
HAPPY TO HELP!!!

My HubProject:Go
My Adventures:Go
User avatar
Blast!10
Rainbow Star
Posts: 1738
Joined: Thu Nov 02, 2006 7:26 pm
Location: Tel Aviv

Post by Blast!10 » Mon Mar 21, 2011 8:25 am

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.
User avatar
Guppy Star
Rainbow Master
Posts: 919
Joined: Sat Oct 16, 2010 7:20 am

Post by Guppy Star » Thu Apr 07, 2011 6:40 am

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?
HAPPY TO HELP!!!

My HubProject:Go
My Adventures:Go
User avatar
boywhoflies
Rainbow Spirit Chaser
Posts: 5510
Joined: Thu Jun 26, 2008 3:16 pm

Post by boywhoflies » Thu Apr 07, 2011 10:45 pm

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
Mr. Robot never dies! :D

Chatroom
User avatar
Guppy Star
Rainbow Master
Posts: 919
Joined: Sat Oct 16, 2010 7:20 am

Post by Guppy Star » Tue Apr 19, 2011 3:53 am

NEXT QUESTION?

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

My HubProject:Go
My Adventures:Go
User avatar
Serlan
Rainbow Seeker
Posts: 295
Joined: Sat Feb 07, 2009 3:12 pm

Post by Serlan » Tue Apr 19, 2011 2:40 pm

Is easy, only use views, can't explain it too detaily now, I look tired.
Click here to go to WA:The Dark Abysm topic (Postponed until Wonderland Fangame is made).
User avatar
Guppy Star
Rainbow Master
Posts: 919
Joined: Sat Oct 16, 2010 7:20 am

Post by Guppy Star » Tue May 10, 2011 11:09 am

How to make powderkeg type objects without destroying the wall?
HAPPY TO HELP!!!

My HubProject:Go
My Adventures:Go
User avatar
Master Wonder Mage
Rainbow SuperStar
Posts: 2124
Joined: Sat Jan 08, 2011 5:26 pm

Post by Master Wonder Mage » Sun May 29, 2011 11:56 pm

What is the simplest way to make dialogues like in ET2, ET3, and ET4?
User avatar
jozsefkoma
Rainbow Star
Posts: 1460
Joined: Tue Dec 23, 2008 5:45 pm

Post by jozsefkoma » Mon May 30, 2011 2:25 pm

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.
Image
Image
User avatar
boywhoflies
Rainbow Spirit Chaser
Posts: 5510
Joined: Thu Jun 26, 2008 3:16 pm

Post by boywhoflies » Mon May 30, 2011 8:57 pm

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".
Mr. Robot never dies! :D

Chatroom
User avatar
Guppy Star
Rainbow Master
Posts: 919
Joined: Sat Oct 16, 2010 7:20 am

Post by Guppy Star » Tue May 31, 2011 3:26 am

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
HAPPY TO HELP!!!

My HubProject:Go
My Adventures:Go
User avatar
boywhoflies
Rainbow Spirit Chaser
Posts: 5510
Joined: Thu Jun 26, 2008 3:16 pm

Post by boywhoflies » Wed Jun 01, 2011 12:36 am

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.).
Mr. Robot never dies! :D

Chatroom
User avatar
Master Wonder Mage
Rainbow SuperStar
Posts: 2124
Joined: Sat Jan 08, 2011 5:26 pm

Post by Master Wonder Mage » Wed Jun 01, 2011 12:43 am

Tell me what you know please.
User avatar
boywhoflies
Rainbow Spirit Chaser
Posts: 5510
Joined: Thu Jun 26, 2008 3:16 pm

Post by boywhoflies » Wed Jun 01, 2011 1:20 am

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
Mr. Robot never dies! :D

Chatroom
User avatar
dlcs18
Rainbow MegaStar
Posts: 3282
Joined: Sun Jul 09, 2006 9:44 pm

Post by dlcs18 » Wed Jun 01, 2011 11:11 am

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.
dlcs18
User avatar
MyNameIsKooky
Rainbow Spirit Master
Posts: 9711
Joined: Mon Dec 01, 2008 10:18 pm

Post by MyNameIsKooky » Sun Jun 12, 2011 1:57 am

Does anyone know how to colorize something so it's brown?
User avatar
MyNameIsKooky
Rainbow Spirit Master
Posts: 9711
Joined: Mon Dec 01, 2008 10:18 pm

Post by MyNameIsKooky » Sun Jun 12, 2011 2:12 am

MyNameIsKooky wrote:Does anyone know how to colorize something so it's brown?
nvm, i just did it manually
Post Reply