Pages: 1 2 3 [4] 5 6 ... 64
  Print  
Author Topic: Game Maker Help Thread!  (Read 310916 times)
hyperme
Mosskid
*
Posts: 888



View Profile
« Reply #45 on: January 09, 2010, 02:00:11 PM »

How would I check if an idol has been picked up?
Logged
marsgreekgod
Big Bossy
Mossy
*
Posts: 9806


The will of the Galaxy.


View Profile WWW Email
« Reply #46 on: January 09, 2010, 02:04:27 PM »

Not sure,

Something to do with holdItem

what are you trying to do?
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
ipwnu1337
Guest
« Reply #47 on: January 09, 2010, 02:06:48 PM »

I'm thinking he's trying to recreate the idol traps from the main game.
Logged
hyperme
Mosskid
*
Posts: 888



View Profile
« Reply #48 on: January 09, 2010, 02:09:44 PM »

Yep.  I think I can do it by duplicating the TikiHead, and changing the alarm event to a trigger.
Logged
gummybears123
Mossy
*
Posts: 5785


Yummy Gummy!


View Profile
« Reply #49 on: January 09, 2010, 07:11:51 PM »

Make sure you make ALL of the traps
Logged

I made a rap.
It sounds dumb, like reading a map
I really should stop this thing before it goes too far
But I don't really car as long as I stay below the radar
Those big companies won't get me no
I'll get away before the fuzz show

-Most famous rapper of Mossmouth
Kirbylord
Kitoari
Bulb
*
Posts: 72


Behold, the awesomeness that is BOMBROPE!


View Profile
« Reply #50 on: January 10, 2010, 02:11:56 PM »

I'm trying to find the script/code section that handles adding collectibles, but I can't find it. Any help?
Logged
marsgreekgod
Big Bossy
Mossy
*
Posts: 9806


The will of the Galaxy.


View Profile WWW Email
« Reply #51 on: January 10, 2010, 02:16:02 PM »

Where are you trying to add it?
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
Kitoari
Bulb
*
Posts: 72


Behold, the awesomeness that is BOMBROPE!


View Profile
« Reply #52 on: January 10, 2010, 02:21:53 PM »

Nowhere, I want to find where it was originally so I can keep things organized.
Logged
marsgreekgod
Big Bossy
Mossy
*
Posts: 9806


The will of the Galaxy.


View Profile WWW Email
« Reply #53 on: January 10, 2010, 02:33:36 PM »

... I am not sure what you are asking
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
ipwnu1337
Guest
« Reply #54 on: January 10, 2010, 05:07:16 PM »

Is there any way to change the amount of recoil that a gun gives?

Because I'm making another gun that has extremely high recoil, so I want it to be able to push the spelunker back a bit more.

In addition, for some reason, the gun I'm making always drops to the floor when the spelunker goes through a level, as in I'm holding the gun when I go through the door, and when I exit the door, the gun drops to the ground at the spelunker's feet.

Help please?
Logged
marsgreekgod
Big Bossy
Mossy
*
Posts: 9806


The will of the Galaxy.


View Profile WWW Email
« Reply #55 on: January 10, 2010, 05:09:16 PM »

Heavy=false
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
ipwnu1337
Guest
« Reply #56 on: January 10, 2010, 05:24:25 PM »

I mean, when the spelunker goes through a level, the gun drops to his feet in the NEXT level.

So in other words:

Level 1:

I have my gun, I walk through door.

Level 2:

I don't have my gun in my hands, it's on the floor next to me.

In addition, how do you decrease teh bullet damage?
Logged
marsgreekgod
Big Bossy
Mossy
*
Posts: 9806


The will of the Galaxy.


View Profile WWW Email
« Reply #57 on: January 10, 2010, 06:32:30 PM »

ah,,, right. Give me a while
Logged

Show your power, Gun Del Hell! Show them their fate! Yes! Yes! Yes! Yes! Yes! Here we go! Let's go, go, go, go, Django! Light and Dark! It comes down to this! Be afraid, Sun!
DariusK
Bulb
*
Posts: 97



View Profile WWW
« Reply #58 on: January 11, 2010, 09:03:05 AM »

How would I check if an idol has been picked up?
Here's how the idol works.

If you want to know when the player actually triggers the trap for the gold idol being picked up the first time, you need to look in the oPlayer1 object, in the Step event, in the second Action, around line 830. You'll see the folliwing code, as part of the generic code for what happens when you press down and attack and there's an item on the ground:

Code:
                if (holdItem.type == "Gold Idol" and holdItem.trigger and not isRoom("rLoadLevel"))
                {
                    global.idolsGrabbed += 1;
                    // INSERT CODE TO RUN THE FIRST TIME YOU PICK UP ANY IDOL
                    if (global.levelType == 0)
                    {
                        trap = instance_nearest(x, y-64, oGiantTikiHead);
                        with trap { alarm[0] = 100; }
                        scrShake(100);
                        holdItem.trigger = false;
                    }
                    else if (global.levelType == 1)
                    {
                        if (global.cemetary and not global.ghostExists)
                        { 
                            if (oPlayer1.x > room_width / 2)
                               instance_create(view_xview[0]+view_wview[0]+8,
                               view_yview[0]+floor(view_hview[0] / 2), oGhost);
                            else instance_create(view_xview[0]-32,
                               view_yview[0]+floor(view_hview[0] / 2), oGhost);
                            global.ghostExists = true;
                        }
                        with oTrapBlock
                        {
                            dist = distance_to_object(oCharacter);
                            if (dist < 90)
                            {
                                dying = true;
                                //instance_destroy();
                            }
                        }
                    }
                    else if (global.levelType == 3)
                    {
                        if (instance_exists(oCeilingTrap))
                        {
                            with oCeilingTrap
                            {
                                status = 1;
                                yVel = 0.5;
                            }
                            scrShake(20);
                            trap = instance_nearest(x-64, y-64, oDoor);
                            trap.status = 1;
                            trap.yVel = 1;
                            trap = instance_nearest(x+64, y-64, oDoor);
                            trap.status = 1;
                            trap.yVel = 1;
                        }
                        else
                        {
                            with oTrapBlock
                            {
                                dist = distance_to_object(oCharacter);
                                if (dist < 90)
                                {
                                    instance_destroy();
                                }
                                playSound(global.sndThump);
                                scrShake(10);
                            }
                        }
               
                        holdItem.trigger = false;
                    }
                }
You probably only care about the holdItem.trigger variable. The opening IF statement means, "if the item you just picked up and are now holding (holdItem) is set to be a trigger, and you're not in a custom level, then set off all these traps depending on what area of the game you're in."

So if you wanted to trigger something when you pick up the Idol for the first time, you would want to put the code right after the IF statement open bracket. If you want something different to happen in each area (such as modifying the way the traps work), you can modify what happens in each of the following IF statements where they check for global.LevelType.

Now if you just want to check and see if the player is holding the item, that's easy, it's just a matter of checking if holdItem.type == "Gold Idol" in the oPlayer1 object.
Logged

DrSakuyaPhD
Seedling
*
Posts: 1


Blaaastoise.

kirbyfan95@gmail.com
View Profile Email
« Reply #59 on: January 16, 2010, 11:46:42 AM »

I'm trying to add in a radar type items that locates objects of interest and draws in on the screen (like the compass, but instead of the exit stuff like enemies, damsels, traps, etc.) I can do the finding and drawing code, but there's one part I can't find. In what section of code does it handle the picking up of items, and setting the variable that tells the HUD to draw the item, e.g. global.hasCompass?
Logged
Pages: 1 2 3 [4] 5 6 ... 64
  Print  
 
Jump to: