The Daily Click ::. Forums ::. Klik Coding Help ::. FastLoops and how it pwns me
 

Post Reply  Post Oekaki 
 

Posted By Message

Tauman



Registered
  15/09/2004
Points
  129
28th April, 2005 at 15:49:45 -

I am using FastLoops for the AI of a generic enemy in a game. It works perfectly when there is only one in the level, but any more than that and they fall through the floor and rain down on my head at random times throughout the game.

'Lil help? I just need to know how to make it automatically work for each one individually or something...Do I need a copy of the fastloops object for each enemy?

 
For great justice, and indeed pie.

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
28th April, 2005 at 16:18:06 -

THEN YOU SHOULD GET MAGIC GLASSES!

 
n/a

Fifth

Quadruped

Registered
  07/05/2003
Points
  5818

VIP MemberGOTW JULY 2010 WINNER!Kliktober Special Award TagGOTW HALLOWEEN 2011 WINNERPicture Me This Round 51 Winner!
28th April, 2005 at 16:18:47 -

Ooh, this kind of thing can be tricky.

It's usually possible to make it work, but it takes a lot of finagling. You have to make sure the condition is specific enough to refer to a single object, yet generic enough to affect them all.
...That doesn't help, does it?

One thing to note: if you're giving your objects values and starting a fastloop on the same action, split it into two separate ones. That sometimes helps.

...and if all else fails, you can resort to putting the code in your objects' "Behavior #1" actions.

 
Go Moon!

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
28th April, 2005 at 19:04:19 -

Putting them into behaviours doesn't work, since behaviour code is appended to the main event list.

From the sounds of it you're not using fastloops the 'other' useful way, which is to create events that only affect one object and have all objects affected too. In one event, spread value 0 in the object's Alterable Value A (or any free space), and in another SEPARATE event (with the same conditions!) run a fastloop for the number of objects on the playfield. In this fastloop's event, you then select objects by comparing their Alterable Value A to the current loop index. This goes through each object one by one and the world is saved.

 
n/a

Tauman



Registered
  15/09/2004
Points
  129
28th April, 2005 at 19:57:14 -

I think I understand that...but wouldn't it still limit you to 30 enemies? (the number of #s FastLoops is limited to)
The reason I can't just have each one have its own loop thingy is 'cuz this game is in one massive level so I'll certainly have more than 30 enemies. (6000x3000 pixels and still expanding...player size is 30x34 pixels)

 
For great justice, and indeed pie.

Tauman



Registered
  15/09/2004
Points
  129
28th April, 2005 at 20:43:22 -

>_0
Then...I don't think I'm understanding it quite right. I'm using this- http://www.create-games.com/download.asp?id=4796 as the basis for the enemy AI, but with wall detectors added and tweaked a bit. Uhh, please pardon my stupidity but could you please explain with a little more detail Chris?

 
For great justice, and indeed pie.
   

Post Reply



 



Advertisement

Worth A Click