The Daily Click ::. Forums ::. Klik Coding Help ::. question about using same objects for multiple enemies...
 

Post Reply  Post Oekaki 
 

Posted By Message

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
9th April, 2011 at 09:03:43 -

so im using a basic custom movement engine thats based on the enemydetector's position

X position of zombie is lower than main character = set x position of zombie to x position of zombie at speed of zombie (speed of zombie being an alterable value)

i did that for both directions, and for keeping them out of the ground. it works perfectly fine, unless the 2 detectors of 2 zombies overlap, which then they plummet halfway into the floor, and the actually animation object for the zombie no longer stays with the detector and launches off.

anyone have a way to keep the detectors from touching using similar coding?

 
[Game design makes my brain feel like its gonna explode.]

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
10th April, 2011 at 19:35:19 -

Does no one know? i hate to double post but i really need to know, if i need to ill upload an MFA of the enemies ai ive been working on.

 
[Game design makes my brain feel like its gonna explode.]

Don Luciano

Heavy combat pancake

Registered
  25/10/2006
Points
  380

VIP Member
10th April, 2011 at 23:37:59 -

You should upload your problem, otherwise its hard to predict what might be the issue.

 
Code me a sausage!

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
11th April, 2011 at 20:08:15 -

alrighty, will do. the events for the zombies are under "this frame" than "zombies". the orange block that overlaps each zombie is the detector for the zombies.
http://www.mediafire.com/?uqqtw2ikpti58zo

 
[Game design makes my brain feel like its gonna explode.]

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
12th April, 2011 at 00:16:57 -

How about removing all the music, etc first?
It's a bit much expecting people to download a 26mb file, just to help you...

 
n/a

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
13th April, 2011 at 01:32:27 -

there is no music, most of the file size is due to the random gun generator and the movement for the character. i went threw and deleted all the events for everything else, and all the objects not needed for the zombies and the file size is still 23mb, im not sure whats causing its size.

 
[Game design makes my brain feel like its gonna explode.]

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
13th April, 2011 at 13:35:38 -

Okay. 45 minutes later, and it finally finished downloading...

Anyway, I'm not seeing the problem you described - there doesn't seem to be any problem with zombie detectors overlapping one another.

There's definitely an issue with lines 994 & 995 (pushing the enemies out of the ground). You're checking if a single enemy is overlapping the ground, and then running a fastloop, which pushes ALL enemies up - resulting in enemies floating in mid-air when one climbs a slope (why would you even have a fastloop that only runs one time, and only does one action?).
It's the same with lines 988 & 999 (gravity). You're checking if a single enemy is overlapping the ground, and then running a fastloop, which makes ALL enemies fall.
You just can't use fastloops that way.
Instead, you should be "always" running the fastloop, and then adding conditions to the "on loop" event, so it only affects the specific instances that you need it to (or just not using fastloops).

You shouldn't be comparing the Y position of the detector with the Y position of the ground - that's not going to work with slopes.

Why are you using giant active objects for the ground? Background objects would be better IMO (it probably doesn't really matter though).

You have a huge number of duplicate events - give all the weapon objects the same qualifier, and you only need 1/15th as many events.

 
n/a

GamesterXIII



Registered
  04/12/2008
Points
  1110

I am an April Fool
13th April, 2011 at 14:12:27 -

@Sketchy

I'm pretty sure stationary actives are treated as backdrops, but as soon as you start scrolling they become actives IIRC. I've tested it out and the performance impact from having lots of actives is huge. Better to swap to optimize.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
13th April, 2011 at 14:40:07 -

Background objects are certainly more efficient, but it's one of those things where if you're using HWA, it won't actually make any practical difference.
If you're making a game for Flash or something, then yeah, definitely use background objects wherever possible.

 
n/a

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
14th April, 2011 at 01:17:06 -

ooh ok that makes sense, sorry im kind of new to fast loops, that makes sense though, ill give it a try! one last question, any idea why the file size is so huge? and the objects in the background layers are backdrops, the only actives are the ground the characters collide with using the pmo.

 
[Game design makes my brain feel like its gonna explode.]
   

Post Reply



 



Advertisement

Worth A Click