Page 1 of 1

Script

Posted: Mon Aug 23, 2010 4:37 pm
by Gamemaker
Hey. There's a metal grate in my level, and I want it to remove, when a bomb near it explodes. And I also want player not to be able to "kill" that grate with its weapons. So I made two scripts.

Code: Select all

{

Spawn[()
{
Console(true);
BoxWidth(30);
BoxHeight(3);

	if(GetAttribute("metal_grate_event", "Player") = 1)
	{
	NewOrder("Die");
	}
	else
	{
	RestartOrder();
	}
}]

Die[()
{
Remove(true);
}]


}

And for bomb:

Code: Select all

{

	HEALTH		[10]
	HEALTHATTRIBUTE	[enemy_health]
	BOOM		[Barrelboom]





Spawn[ ()
{
Console(true);
AttributeOrder(HEALTHATTRIBUTE, HEALTH, "Death");
IsPushable(false);
LowLevel("Idle");
} ]




	Death[ ()
	{
	FadeOut(2, 0);
	Remove(true);
	} ]

//LowLevel routines


Idle[ ()
{
if (self.health = 0)
{
ModifyAttribute("metal_grate_event", 1, "Player");
AddExplosion("GeneralExplosion", "", 0, 0, 0);
DamageArea(30, 200, "health");
DamageArea(65, 200, "enemy_health");
HighLevel("Death");
}
} ]



}


But I guess the problem is in first script. I changed the "metal_grate_event" attribute to initial = 1, and the metal grate was still there.

Re: Script

Posted: Mon Aug 23, 2010 5:52 pm
by Gamemaker
Problem solved now... My bad. I really didn't notice, I had a tiny mistake in pawn setup. You can close this tread. Sorry!

Re: Script

Posted: Wed Jun 22, 2011 2:48 am
by megatop
what does console(true); do. i usaly turn it off

Re: Script

Posted: Wed Jun 22, 2011 8:18 am
by QuestOfDreams
console(true); does nothing
Console(true); activates the console for deubg messages.

Please, read the manual. :!:

Re: Script

Posted: Wed Jun 22, 2011 1:56 pm
by megatop
thanks quest sorry my bad

Re: Script

Posted: Mon Jun 27, 2011 4:22 am
by Nighthawk_0973
QuestOfDreams wrote:console(true); does nothing
Console(true); activates the console for deubg messages.

Please, read the manual. :!:
lol nobody reads the instruction manual for anything. Even if they need help getting it to work. They just turn to the web.