Page 1 of 1

Spawn point help...

PostPosted: Thu Mar 15, 2012 2:31 pm
by friedfish
I've been working on gameEditor for a few weeks now and I'm loving it. This is awesome. I need some help on setting up the spawn points. Here's what I have at the moment.

Actors:
spawntimer - an 8 second countdown when the next spawn will be.
spawnpoint - a point in the level where the enemy will spawn.
enemy - the enemy that will spawn.

Global Script:
int secleft = 8;
int frame = 0;

currently I have a draw actor event for the spawnpoint that checks if the seconds left is 0. if it is then create actor enemy.

I was able to create an enemy every 8 seconds on 1 spawn point but then I want to create enemies on more than 1 spawn point. I tried cloning my spawnpoint actor but the enemy only spawns on 1 of the spawnpoints and not on the other 1.

I also tried to create another actor and named it spawnpoint2 (not a clone) with the same event and action as the spawnpoint actor but it still did not create the enemy.

any other ideas I can use? or am i doing something wrong? Thanks community.

Re: Spawn point help...

PostPosted: Thu Mar 15, 2012 4:56 pm
by jimmynewguy
I'd have to actually see the code in order to tell you what the problem is. But this here is a cloned spawner that creates enemies every 1 second (or 30 frames in this game, which is where the if(timer % 30 ==0) comes in, in case that confuses you) You can post an example of yours, or the entire code if you don't like this and I can help you from there

Re: Spawn point help...

PostPosted: Thu Mar 15, 2012 6:00 pm
by skydereign
Just from what you posted, it sounds like you are dealing with the issue of global versus actor variables (which is something jimmynewguy uses/fixed in his ged). So, chances are if you change your global variables to be actor variables, each spawn actor will work independently of the others, and all spawn enemies.

Re: Spawn point help...

PostPosted: Fri Mar 16, 2012 12:48 am
by friedfish
@jimmynewguy: woah! that was much simpler than I thought... you're awesome... I was able to find a solution to my problem but it wasn't cloned spawnpoints.. its only 1 spawnpoint spawning enemies on different positions using a for loop.. but now that there's a much simple one...

would you mind if i borrow or use your code on my game? I'll give proper credit. thanks... :D

@skydereign: it was actually the global and actor variable which i do not know about until now...