Spawn point help...

Non-platform specific questions.

Spawn point help...

Postby friedfish » Thu Mar 15, 2012 2:31 pm

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.
User avatar
friedfish
 
Posts: 75
Joined: Wed Mar 14, 2012 2:31 pm
Location: UK
Score: 7 Give a positive score

Re: Spawn point help...

Postby jimmynewguy » Thu Mar 15, 2012 4:56 pm

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
Attachments
spawner.zip
(1.08 KiB) Downloaded 92 times
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: Spawn point help...

Postby skydereign » Thu Mar 15, 2012 6:00 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Spawn point help...

Postby friedfish » Fri Mar 16, 2012 12:48 am

@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...
User avatar
friedfish
 
Posts: 75
Joined: Wed Mar 14, 2012 2:31 pm
Location: UK
Score: 7 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest