The Daily Click ::. Forums ::. Klik Coding Help ::. yes im still using TGF
 

Post Reply  Post Oekaki 
 

Posted By Message

spliffy



Registered
  18/11/2006
Points
  22
24th November, 2006 at 13:35:54 -

loop trigger #0
+bullet over obstacle background

destroy bullet

/\ works fine

loop trigger #0
+bullet over enemy

destroy bullet, subtract 1 from counter1

/\ doesnt work whyyyyyyyyyyyyyyy?????????????????



 
n/a

Bibin

At least 9001

Registered
  01/07/2005
Points
  308

Silver Cup WinnerGOTW Winner!Has Donated, Thank You!VIP Member
24th November, 2006 at 13:37:05 -

Try reversing the order of destroying the bullet and adding to the counter.

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
24th November, 2006 at 13:46:39 -

He can't.

Bullet overlapping enemy - Turn Flag on

Bullet Flag on - Subtract one from counter
Bullet Flag on - Destroy bullet

You'll need TWO Bullet Flag on Events for this to work.

 
Craps, I'm an old man!

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
24th November, 2006 at 13:55:01 -

Most likely problem is you have multiple bullets overlapping multiple enemies.
Often times this will destroy ALL bullets while adding only 1 to the counter, or only destroy 1 bullet and add 1 to the counter while not affecting others during the loop, or depending on your phrasing, will destroy ALL bullets while only 1 overlaps an enemy.


The other problem is, code travels from top to bottom. If it detects a bullet over an enemy in the same loop as a bullet being over a background, it will destroy it without subtracting from the counter.

Try moving the first event below the second one. That will prevent the case of overlapping enemies and backdrops at the same time.

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

spliffy



Registered
  18/11/2006
Points
  22
24th November, 2006 at 14:12:12 -

flags didnt work : ( also i have done this with other games where it worked and it cant be a problem with many bullets over many enemies because the "bullet" is a railgun in a 1vs1 game

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
24th November, 2006 at 14:23:14 -

Errr, well; it should work. How do you have it structured? Cause the destroy bullet event needs to be below the subtract counter one.

 
Craps, I'm an old man!

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
24th November, 2006 at 14:24:09 -

The coding should be fairly simple...

1Press Ctrl
=Create Bullet at Gun (0,0)
=Start Loop #0 for 1000 loops

2Loop Trigger #0:
+Bullet set x/y to (bullet x/y + direction calculator thingy)

3Loop Trigger #0
+Bullet over enemy:
=Destroy Bullet
=Sub 1 to Counter
=Stop Loop #0

4Loop Trigger #0
+Bullet over obstacle background:
=Destroy Bullet
=Stop Loop #0


Should work pretty well. Just don't forget to STOP loop when bullet is destroyed.
edit- @shab, shouldn't make a difference which is above/below, since theres only 1 counter...


Image Edited by the Author.

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

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
24th November, 2006 at 14:27:37 -

if it's destroyed before it hits the "subtract 1 from counter" then the counter won't go down.

Not using fast loops mind you.

 
Craps, I'm an old man!

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
24th November, 2006 at 14:27:57 -

btw, how exactly does it "Not work"? does it collide with obstactles but not enemies, or with nothing at all, or are you even sure that the bullet is moving properly? Its possible that you're using too big of an offset with the direction calculator, and the bullet is traveling like 100 pixels at a time. This would make it appear to not do anything at all, since it would just travel offscreen.

I'm using a railgun effect exactly like this in my xmas compo game, and its been working fine...


Eh I'll test that out, but in TGF it should work in or out of fastloops. It only really matters if theres another event that references the bullet, since it might define it a a different bullet. Which would bug it out.
But I'd say yeah, do shabs idea just to be safe.

Image Edited by the Author.

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

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
24th November, 2006 at 14:30:15 -

Hell, is your counter set up correctly?

 
Craps, I'm an old man!

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
24th November, 2006 at 14:38:03 -

O_o

Also, it would be a better idea if you simply used 1 object as the "bullet", and never created/destroyed it.

Have a bullet object, and instead of the create event, have it get set to the position where it should originate. Instead of a destroy event, stop the loop.

That should solve all your problems if you do it right.

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

Bibin

At least 9001

Registered
  01/07/2005
Points
  308

Silver Cup WinnerGOTW Winner!Has Donated, Thank You!VIP Member
24th November, 2006 at 15:01:20 -

@if it's destroyed before it hits the "subtract 1 from counter" then the counter won't go down.

That's what I said Shab.

 
n/a

Hernan



Registered
  04/03/2003
Points
  707

VIP Member
24th November, 2006 at 15:28:41 -

If he placed the destroy action and the substract action in the same event, it shouldn't matter then, because the event was still true.

All i could think of is the same thing Shab said: is your counter set up correctly?

 
This space is for rent

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
24th November, 2006 at 15:29:43 -

thats what I was thinking.

Frankly, I think the problem is with creating/destroying the object. He should remake it as a single-object detector, where it simply is repositioned each time you fire. I'm using exactly that in my current project, and it works like a charm.

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

Peblo

Custom ratings must be 50 characters or less

Registered
  05/07/2002
Points
  185

Game of the Week WinnerVIP MemberI'm on a Boat360 OwnerAttention GetterThe Cake is a LieCardboard BoxHero of TimePS3 OwnerIt's-a me, Mario!
I'm a Storm TrooperSonic SpeedStrawberryI like Aliens!Wii OwnerMushroomGhostbuster!
24th November, 2006 at 18:47:51 -

Is your counter set up right?

 
"Isn't it always amazing how we characterize a person's intelligence by how closely their thinking matches ours?"
~Belgarath

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
24th November, 2006 at 19:02:26 -

Yeah, if the minimum value on the counter is 0, it won't be able to go into negative numbers.


But you still haven't addressed WHAT the problem is; are projectiles being destroyed when they hit walls/enemies, or is THAT not even happening. If the projectiles aren't even detecting walls, its most likely a problem with the looped movement; too big of a pixel offset from the direction calculator.

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

spliffy



Registered
  18/11/2006
Points
  22
28th November, 2006 at 06:56:33 -

i rewrote the code and its working now for some strange reason
the problem was nothing happend and i couldnt exaltcly see what because fastloops makes it too quick for my eyes ;p

 
n/a
   

Post Reply



 



Advertisement

Worth A Click