Noob Question About Loops

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Krazzikk
Posts: 37
Joined: Sat Mar 16, 2013 11:30 pm

Noob Question About Loops

Post by Krazzikk »

I want to make the spawner activate on a loop, so it keeps spawning the fireball over and over. This is what I have so far, but even that, without the loop, won't work.

Code: Select all

function loopSpawner()
	if PressurePlate:isDown() then
		loopSpawnerOne:activate()
	end
end
User avatar
Allanius2
Posts: 124
Joined: Mon Apr 14, 2014 10:12 pm

Re: Noob Question About Loops

Post by Allanius2 »

Krazzikk wrote:I want to make the spawner activate on a loop, so it keeps spawning the fireball over and over. This is what I have so far, but even that, without the loop, won't work.

Code: Select all

function loopSpawner()
	if PressurePlate:isDown() then
		loopSpawnerOne:activate()
	end
end
What you should do is add a two connectors to the pressure plate to a timer so the "Activate" of the plate activates the timer, and the "Deactivate" deactivates the timer. Then just set the delay time on the timer, and have it activate the spawner.
User avatar
Krazzikk
Posts: 37
Joined: Sat Mar 16, 2013 11:30 pm

Re: Noob Question About Loops

Post by Krazzikk »

Thanks ^_^
User avatar
Allanius2
Posts: 124
Joined: Mon Apr 14, 2014 10:12 pm

Re: Noob Question About Loops

Post by Allanius2 »

You're welcome.
User avatar
Chimera005ao
Posts: 187
Joined: Sun Jun 29, 2014 8:34 am

Re: Noob Question About Loops

Post by Chimera005ao »

Scripts put in a function won't do anything unless that script is triggered somewhere.

Pressure plates, buttons, and other scripts can trigger them.

You can make a repeating fireball launcher with just a timer and spawner.
Though scripts called by timers can do other cool things that spawners can't, like doors that toggle every couple seconds.
Post Reply