Script

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
Gamemaker
Posts: 266
Joined: Fri Aug 08, 2008 3:00 pm
Location: Estonia
Contact:

Script

Post by Gamemaker » Mon Aug 23, 2010 4:37 pm

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.

User avatar
Gamemaker
Posts: 266
Joined: Fri Aug 08, 2008 3:00 pm
Location: Estonia
Contact:

Re: Script

Post by Gamemaker » Mon Aug 23, 2010 5:52 pm

Problem solved now... My bad. I really didn't notice, I had a tiny mistake in pawn setup. You can close this tread. Sorry!

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: Script

Post by megatop » Wed Jun 22, 2011 2:48 am

what does console(true); do. i usaly turn it off

User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Re: Script

Post by QuestOfDreams » Wed Jun 22, 2011 8:18 am

console(true); does nothing
Console(true); activates the console for deubg messages.

Please, read the manual. :!:

megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: Script

Post by megatop » Wed Jun 22, 2011 1:56 pm

thanks quest sorry my bad

User avatar
Nighthawk_0973
Posts: 234
Joined: Tue Apr 19, 2011 2:08 am
Location: In front of my computer.

Re: Script

Post by Nighthawk_0973 » Mon Jun 27, 2011 4:22 am

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.
https://sites.google.com/site/theneverendinguniverse/ <-- Infinite Universe Website. It's a 2D MMORPG I'm releasing into beta near the late summer (I hope :D) note: RF isn't an MMO maker. Not yet anyways.

Post Reply