Jump to content


Faygris

Member Since 18 Mar 2012
Offline Last Active Apr 17 2013 08:14 PM

Posts I've Made

In Topic: Newbie Here, Character Getting Suck In Wall

17 February 2013 - 07:25 PM

@TheouAegis
Well, that was really helpful for me, so thanks for that! ;)
But I think it's way too advanced for a newbie to game maker. OP might even still be using
drag and drop and collision events, which I think is good enough to get started in Game Maker.

In Topic: water noise repeat.

15 August 2012 - 06:13 PM

I think, you'll have a decent result, if you create a variable playsound = 1; (or whatever) in the create event of the water object.
Then in the collision event with the player, put this:
if (playsound == 1) {
sound_play(snd_splash);
playsound = 0;
alarm[0] = 30; }

This will play the sound only once for each water object. However, you'll want to have the sound played again, quite regularly while the player is in the water. So you activate the sound again after some time with alarm[0] = 30; (or which timespan you would prefer). You could also use a random number to make it a little bit more lively.

In the alarm[0] event, you wanna put
playsound = 1;
so the sound plays again once for each water object the player is touching.

There are better methods with collision functions, but maybe this simpler method might already be good enough.

In Topic: Do you like my short storyline ?

13 August 2012 - 07:17 PM

I think your story is a decent starting point for a nice little game. Games don't always have to have very innovative, elaborate storylines to work, as long as they have other strengths.
But, well...

Get 16 wood and kill every monster in there.

Hey, Blizzard called. They want their meaningless, bland side quest back.

Okay, sorry for the sarcasm, just felt like it. ;)
But seriously: I hope you won't really use something like this in the game. Or is it going to be an MMORPG?

In Topic: Alarm in Script Event

10 August 2012 - 11:04 AM

This is a card game. I'm clicking on an object, and it's then calling a script. The script is not connected to an object, or a create event, or an alarm event or anything. It's just a script.


But a script is always connected with the object that calls it. So you click on this object and it calls the script as an action of itself. So you can also refer to local variables of this object in the script, and also call other events like alarm[1].
By the way: you can also call an alarm event of another object by using objectname.alarm[1] = 60, if that is of any help.

In Topic: Alarm in Script Event

09 August 2012 - 11:46 PM

SCRIPT

p1cardattack1.visible=true;
alarm[1] = 60;
p1cardattack2.visible=true;
I made an alarm event in another object and set it to 2 steps. While the script is being called, I want to make two seconds go by before the next object becomes visible.



I don't know if I get you right (the other replies are getting more and more confusing), but if I do, I think you should do this:

In the create event of the object your script is in, define a new variable, e.g. alarm_visible = 0; or whatever you wanna call it.
Now, in your script (I suppose it's in a step event), put this:

if (alarm_visible == 0) {
p1cardattack1.visible=true;
alarm[1] = 60; }

if (alarm_visible == 1) {
p1cardattack2.visible=true;
alarm_visible = -1; }

And in the alarm[1] event of that same object, put this:

alarm_visible = 1;

So that script will only continue if the alarm_visible variable turns 1, which happens after those 2 seconds in the alarm event. I think you can figure out why it works.