The Daily Click ::. Forums ::. Klik Coding Help ::. Help (cant explain in title ) ) ... and sky dragon the post you commented on was not finished yet )
 

Post Reply  Post Oekaki 
 

Posted By Message

Aptennap



Registered
  23/04/2004
Points
  916
7th November, 2006 at 13:03:35 -

Oke, I'm making a beatemup game. For the enemy i have 3 objects : enemy,shadow,shadow detector.(im using tgf btw)
events of interest :
+Always
- xpos(shadow) to xpos(enemy)
- set position(detector) to 0,30 from (enemy)

+(enemy)flag 0=on
- xpos(shadow) to xpos(enemy)

+always
+(enemy)flag 0=off
+(enemy) animation hit isn't playing
- set position(shadow) to 0,40 from (enemy)

Players can upperslash the enemy and then the enemy goes in the air, flag 0=on enemy goes in air, flag 0=off enemy is on the ground.

When i copy the enemy (+ the shadow and detector), it all turns in a mess : all shadows and detectors go to one enemy.

Then i tryed spreading value thing
I added these events:
+start of level
- start loop 0 for 2 loops(start loop(enemy) for (numberenemies)loops)
- start loop 1 for 2 loops(start loop(shadow)for (numberenemies)loops)
- start loop 2 for 2 loops(startloop(detector)for(numberenemies)loops)

+on loop 0
- spread value 0 in value B (enemy) (value A was already taken.)

+on loop 1
- spread value 0 in value A (shadow)

+on loop 2
- spread value 0 in value A (detector)

and changed the old events to:
+valueB(enemy)=valueA(shadow)
+valueB(enemy)=valueA(detector)
- xpos(shadow) to xpos(enemy)
- set position(detector) to 0,30 from (enemy)

+(enemy)flag 0=on
+valueB(enemy)=valueA(shadow)
+valueB(enemy)=valueA(detector)
+valueB(enemy)=valueB(enemy)
- xpos(shadow) to xpos(enemy)

+always
+(enemy)flag 0=off
+(enemy) animation hit isn't playing
+valueB(enemy)=valueA(shadow)
+valueB(enemy)=valueA(detector)
+valueB(enemy)=valueB(enemy)
- set position(shadow) to 0,40 from (enemy)

but it still isn't working, 1 of the 2 enemies work (when i add more, only 1 works every time) when i upperslash the enemie on the working one the other shadows go to this enemie too. When i hit and not working enemie the shadow goed to the only working one :S help...

 
Oh sweet mary.

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
7th November, 2006 at 13:45:51 -

Agh, no! It's NOT necessary to use fastloops to spread values! Didn't we already cover that?

http://www.create-games.com/forum_post.asp?id=172628

 
n/a

Aptennap



Registered
  23/04/2004
Points
  916
7th November, 2006 at 13:52:34 -

Well, I tryed without fastloops too, but that didn't work too.

 
Oh sweet mary.

Deleted User
7th November, 2006 at 14:53:27 -

Sorry, hehe
I wont do it again ;P

 

Aptennap



Registered
  23/04/2004
Points
  916
7th November, 2006 at 15:05:49 -

Well i posted it accendently when it wasn't finished yet. And i couldn't edit it anymore. So i deletedd the old one and posted this one. But I need help !

 
Oh sweet mary.

Tim

I'm on here way too much

Registered
  25/08/2006
Points
  132

You've Been Circy'd!Clickzine StaffSilverNova MemberVIP MemberTurtle Power!Evil klikerWii OwnerHero of TimeGhostbuster!Pokemon Ball!
7th November, 2006 at 18:03:43 -

Why do you alternate in using the spellings "enemy" and "enemie" ?!

"For the enemy i have 3 objects"
"when i upperslash the enemie"

.. anyway I didn't bother reading all your code but try not to use fastloops and use .. alterable values or something? Or a counter. Yeah ok - that was brief.

 
http://www.SilverNova.co.uk


DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
7th November, 2006 at 18:06:46 -

Correct me if I'm wrong, but shouldn't you be spreading a value of 1?
The logic I'm thinking behind value spreading is the first object will have the value 1, the next one 2, the next one 3 etcetera. With 0 this would become 0, 0, 0, 0... Right?

 
Old member (~2004-2007).

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
7th November, 2006 at 18:15:35 -

No, it's the number it should start from.

So if you spread value 0, it would do it like: 0,1,2,3,4,5...
And if you spread value 1: 1,2,3,4,5...

 
n/a

Aptennap



Registered
  23/04/2004
Points
  916
8th November, 2006 at 01:20:03 -

So should i spread 1?

 
Oh sweet mary.

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
8th November, 2006 at 02:57:06 -

Always worth a shot, I say.

I see that you're setting the shadow's positions multiple times in multiple events. You also do that once in an event in which it isn't clear which of the enemies you're talking about, so that could make the things go wrong.

What about removing the following, seemingly useless part?
+(enemy)flag 0=on
+valueB(enemy)=valueA(shadow)
+valueB(enemy)=valueA(detector)
+valueB(enemy)=valueB(enemy)
-xpos(shadow) to xpos(enemy)

And remove the positioning of the shadow objects at all events, placing it only at the following part?
+valueB(enemy)=valueA(shadow)
+valueB(enemy)=valueA(detector)

 
Old member (~2004-2007).

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
8th November, 2006 at 08:05:06 -

I havn't bothered to read all your code, but why do you have

+(enemy)flag 0=on
- xpos(shadow) to xpos(enemy)

when you have that in the always even above it anyway???

 
n/a

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
8th November, 2006 at 08:07:41 -

Best title ever

 
a/n

SoldjahBoy



Registered
  25/10/2006
Points
  100
8th November, 2006 at 09:20:45 -

Totally off-topic, but hey...

Klikmaster, I love ;your sig.... any chance I can "steal" it from you? I would like to do something similar but I don't want to make anyone mad at me

 
What's wrong with pillow shading? O.o

Aptennap



Registered
  23/04/2004
Points
  916
8th November, 2006 at 10:48:05 -

You actually need to see the full code to understand the things i did, but i dont know if i will post it here maybe someone steals it from me, so if you want to take a look just dc-mail k?

 
Oh sweet mary.

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
8th November, 2006 at 11:19:15 -

If you have MMF2, you can group your code, and password protect the code you don't want to show.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click