The Daily Click ::. Forums ::. Klik Coding Help ::. Two zombie attack
 

Post Reply  Post Oekaki 
 

Posted By Message

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
24th December, 2007 at 20:03:34 -

How do I get only one zombie to attack? Meaning that only one is in range while the other is quite far. When they reach that certain range, they are supposed to attack. But when I copy the zombie, both of them attack at the same time. The rest is pretty much okay.

Image

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
24th December, 2007 at 20:40:40 -

I take it you are probably comparing general values or using some sort of general condition. What you have to do is use a condition which will compare each of the actives seperately. One good way to do this would to have the condition:

Always set Alterable Value A of the Zombie to the distance between the player and the zombie (calcualted with maths or an extension.)

Then have the condition:
If Alterable Value A is less than 200, make them attack.

This will check each zombie individiually to see if its Alterable Value A is less than 200.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
27th December, 2007 at 19:22:45 -

Ahhh, its not working. I've done what you asked me to do as in make the conditions based on alt values of the zombie but they still attack at the same time.

Image Edited by the Author.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

Pixelthief

Dedicated klik scientist

Registered
  02/01/2002
Points
  3419

Game of the Week WinnerWeekly Picture Me This Winner!You've Been Circy'd!VIP MemberI like Aliens!Evil klikerThe SpinsterI donated an open source project
28th December, 2007 at 01:52:39 -

Klikteam products (MMF/TGF) work on a difficult to predict principles for the event editor.


In the event editor list, on the left hand side, you see a column of actions, followed by the row of events that occur during that action. For example, and action might be

"X" collides with "Y"


What you need to understand is; actions that take place after these conditions will be automatically happening restricted to objects defined in the event on the left.

So for example, if you write:

Value A of "X" = 1
"X" collides with "Y"

in the same action-
First, it will limit the selection of "X" objects it will check to just ones with value A of 1, then it will check for "X" objects overlapping "Y" objects. You need to remember the editor will read these qualifiers TOP TO BOTTOM, so the selection of objects to check will be narrowed down accordingly.

Nextly, objects that the actions occur upon, for example if you add a "SET VALUE A TO 100" event, will apply to ALL objects of that type unless otherwise restricted in the qualifiers. So if you have an event:

"ALWAYS: SET OBJECT 'X" VALUE A TO 100"

it will set the value of EVERY object "X", not just a single copy of it.

However, if you have:
"OBJECT 'X" VALUE A = 1: DESTROY OBJECT X"

it will only destroy object "X"'s that have a value of 1.

Thus, if you want to limit an event, for example "Zombie Animation --> Attack" into only affecting a single zombie at a time, you need to have some reference to these zombies in your qualifier for the action. For example:

if "X of Zombie < X of Player + 100"
then "Zombie --> Attack"

Will only affect the zombie in range, because you singled it out in the event qualifier.

 
Gridquest V2.00 is out!!
http://www.create-games.com/download.asp?id=7456
   

Post Reply



 



Advertisement

Worth A Click