Pages: 1 [2] 3 4 ... 64
  Print  
Author Topic: Game Maker Help Thread!  (Read 187816 times)
Darkness3313
Mosskid
*
Posts: 710


That reminds me of a puzzle...


View Profile
« Reply #15 on: January 03, 2010, 06:24:36 PM »

Since you have pro, could you test it for me?(The code) I plan on using the Basketball in a mod I will be working on. And it would be nice to be Confident in knowing that the coding I'm using will work when the time for its first release comes around.(Thats when a Thread will be made)
Logged
Delver
Bean
*
Posts: 161



View Profile Email
« Reply #16 on: January 03, 2010, 06:24:59 PM »

Oh I see what's wrong with the poison code. Maybe.

Either your missing parentheses around the first if global.poison = true,

OR

I'm assuming that the whole thing is in the step event?
If so, then it's doing this:

Oh, I'm poisoned. Well let's see, I got poisoned now, so the time I got poisoned is now.
Since the time I got poisoned is now, I guess it's not time for me to get hurt yet.

Next frame:
Oh, I'm poisoned. Well let's see, I got poisoned now, so the time I got poisoned is now.
Since the time I got poisoned is (always and forever will be) now, I guess it's not time for me to get hurt yet.

And this happens EVERY frame.

Instead, use:
if (global.poison and global.time%30000=0)
{global.plife -= 1}

That's every 30 seconds, but not every 30 seconds from the point you get poisoned, it's every 30 seconds from 0 seconds.
So instead:

if (global.poison and not global.checkPoison)
{global.poisontime = global.time; global.checkPoison = true;}

if (global.poison and (global.time-global.poisontime)%30000=0)
{global.plife -= 1}


Make sure to set global.checkPoison to false wherever it is your creating it (and that wherever is definitely NOT in any step events).

thanks... got me on the right track ^^

if anyone needs to make a global timer, here's a pretty nice way (step event for oPoison):

y = oPlayer1.y;
x = oPlayer1.x;

if (global.poison and not global.checkPoison)
{global.poisontime = global.time; global.checkPoison = true;}

if (global.poison and (global.time-(global.poisontime+3000)>0))
{global.poisoncounter += 1;
global.checkPoison = false;
}

if global.poisoncounter = 10
{obj = instance_create(oPlayer1.x, oPlayer1.y, oBlackHeart);
global.plife -= 1;
global.poisonend += 1}

if global.poisoncounter >= 10
{global.poisoncounter = 0}

if global.poisonend = 4
{global.poison = false
instance_destroy()}

For some reason the timer will only work at intervals divided by 3.

if you are using an object make sure it follows the spelunker, otherwise it wouldn't work when in the frozen zone  Grin  
« Last Edit: January 03, 2010, 06:49:58 PM by Delver » Logged
Kegluneq
Big Bossy
Mossy
*
Posts: 2259



View Profile Email
« Reply #17 on: January 03, 2010, 06:47:10 PM »

Not bad!
A little more roundabout then what I would of done, but pretty good nonetheless.
Logged

A wild SHINY MOSSY appeared!
Sudonimus
Mossy
*
Posts: 2743


Stop staring.


View Profile
« Reply #18 on: January 03, 2010, 07:01:30 PM »

Could any of these codes be used in the Debugger?
Logged

How is there no such thing as non-existence?!
Kegluneq
Big Bossy
Mossy
*
Posts: 2259



View Profile Email
« Reply #19 on: January 03, 2010, 07:13:46 PM »

Technically, but it won't do anything except cause errors.

EDIT:
Hey Darkness I tested the code. It's put in the wrong spot.
Instead, put
else if (rand(1,60) == 1) obj = instance_create(chest.x, chest.y, oBasketball);
in oPlayer1 : step : Action
Scroll down a little and you'll see a
//crate
comment
that's where you put it.
« Last Edit: January 03, 2010, 08:02:41 PM by Kegluneq » Logged

A wild SHINY MOSSY appeared!
Darkness3313
Mosskid
*
Posts: 710


That reminds me of a puzzle...


View Profile
« Reply #20 on: January 03, 2010, 08:22:08 PM »

Technically, but it won't do anything except cause errors.

EDIT:
Hey Darkness I tested the code. It's put in the wrong spot.
Instead, put
else if (rand(1,60) == 1) obj = instance_create(chest.x, chest.y, oBasketball);
in oPlayer1 : step : Action
Scroll down a little and you'll see a
//crate
comment
that's where you put it.

Thanks, still in the ScrGenerateitem right?
Logged
Kegluneq
Big Bossy
Mossy
*
Posts: 2259



View Profile Email
« Reply #21 on: January 03, 2010, 08:41:53 PM »

Technically, but it won't do anything except cause errors.

EDIT:
Hey Darkness I tested the code. It's put in the wrong spot.
Instead, put
else if (rand(1,60) == 1) obj = instance_create(chest.x, chest.y, oBasketball);
in oPlayer1 : step : Action
Scroll down a little and you'll see a
//crate
comment
that's where you put it.

EDIT:
My bad, the comment read "open crate", not just "crate"
Logged

A wild SHINY MOSSY appeared!
ipwnu1337
Guest
« Reply #22 on: January 07, 2010, 08:31:04 PM »

I've looked through the code for a bit, but, alas, I cannot find the area that contains the fire rate for the guns. (Ahem, attempting to make a gun mod, ahem.).

Can someone more coding-savvy here help me a tad?  I am not familiar with the gamemaker language.
Logged
Kegluneq
Big Bossy
Mossy
*
Posts: 2259



View Profile Email
« Reply #23 on: January 08, 2010, 12:22:24 AM »

It's in the create oPlayer1 code.

Look for firingPistolMax and firingShotgunMax.
« Last Edit: January 08, 2010, 12:24:31 AM by Kegluneq » Logged

A wild SHINY MOSSY appeared!
marsgreekgod
Big Bossy
Mossy
*
Posts: 9806


The will of the Galaxy.


View Profile WWW Email
« Reply #24 on: January 08, 2010, 12:49:50 AM »

hmm... having problems with keys opening doors, if you are holding they key the key in your hand goes away, but it's still "held", how can I fix that?
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!
Kegluneq
Big Bossy
Mossy
*
Posts: 2259



View Profile Email
« Reply #25 on: January 08, 2010, 12:52:05 AM »

Not quite sure, use the key for the Udjat Eye chest as a reference.
Logged

A wild SHINY MOSSY appeared!
marsgreekgod
Big Bossy
Mossy
*
Posts: 9806


The will of the Galaxy.


View Profile WWW Email
« Reply #26 on: January 08, 2010, 01:06:02 AM »


Quote
if (sprite_index == oMetalDoor)
{
    other.held = false;
    with oPlayer1
    {
        holdItem = 0;
        pickupItemType = "";
    }
    with other { instance_destroy(); }
    obj.xVel = rand(0,3) - rand(0,3);
    obj.yVel = -2;
    obj = instance_create(x, y, oPoof);
    with obj { xVel = -0.4; }
    obj = instance_create(x, y, oPoof);
    with obj { xVel = 0.4; }
    instance_destroy();
}
what seems to be the probelm? It just doesn't work..[/s]
and I figured it out.
« Last Edit: January 08, 2010, 01:38:03 AM by marsgreekgod » 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!
Kegluneq
Big Bossy
Mossy
*
Posts: 2259



View Profile Email
« Reply #27 on: January 08, 2010, 04:49:11 PM »

Whoo! Good job!
Logged

A wild SHINY MOSSY appeared!
ipwnu1337
Guest
« Reply #28 on: January 08, 2010, 11:02:22 PM »

Hrm, I've gotten the stuff to work, but how do you get the item to appear?  How do you get it to spawn?
Logged
marsgreekgod
Big Bossy
Mossy
*
Posts: 9806


The will of the Galaxy.


View Profile WWW Email
« Reply #29 on: January 08, 2010, 11:26:19 PM »

what do you mean?
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!
Pages: 1 [2] 3 4 ... 64
  Print  
 
Jump to: