The Daily Click ::. Forums ::. Klik Coding Help ::. Infinite Bullets
 

Post Reply  Post Oekaki 
 

Posted By Message

cosbish



Registered
  07/12/2006
Points
  26
28th April, 2007 at 17:28:27 -

If I am making a player shoot an object (not actually using the "shoot an object" command) how do I make it so that the number of objects is infinite (instead of repositioning the one object every time a shot is fired)?

 
n/a

KetchupMaster!



Registered
  03/04/2007
Points
  9

I am an April Fool
28th April, 2007 at 17:30:14 -

use the create an object action to create another instance of the same object

 
n/a

cosbish



Registered
  07/12/2006
Points
  26
28th April, 2007 at 17:43:49 -

I'm unfamiliar with the create an object action...I've been playing around with it but can't seem to solve the problem. Is there something I'm missing?

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
28th April, 2007 at 17:49:44 -

The create an object action does exactly what it says, it creates another instance of a certain object.

What sort of problems are you having? How does your shooting system work? Can you give any examples or sample code? We can't read thoughts, you know.

 
n/a

cosbish



Registered
  07/12/2006
Points
  26
28th April, 2007 at 17:59:35 -

Basically when I press the action button, I position the bullet relative to the player and set its horizontal speed. It then "fires" from the player in whatever direction he's facing. What I want to do is to be able to fire multiple shots (within perhaps a second or so of each other) but the problem is that it only positions the original bullet back to the starting point. I tried to use the create an object command when I press the fire button, but the same thing happened.

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
28th April, 2007 at 18:15:48 -

That doesn't sound right? Are you sure you have removed the old action, that positioned the bullet over the player?

 
n/a

cosbish



Registered
  07/12/2006
Points
  26
28th April, 2007 at 18:23:44 -

Ah, that was the problem. Thanks.

 
n/a

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 April, 2007 at 19:58:58 -

Remember that be it MMF or TGF, events are executed not just top to bottom on the vertical, but on the horizontal level, it is based off WHAT ORDER IT WAS LAST MODIFIED, not left-right or anything.

So you need to think; If you first make a create-object command, then a modify object command:
-Create Object
Modify (said instance of) Object.

Since all actions will affect only objects that are specified in the "Events" on the left column, if 1 is specified. Meanwhile, if NO instance of an object is specified in your event, for example if its just "Player presses keyboard 1", then it will refer to ALL instances of that object. Also, if you have a create-object ACTION, it will now specify THAT particular instance of the object for all actions that follow after it.

So if you have the same command "Set horizontal speed of 'object' to 5", doing them in these orders gives different results:

"Set Horizontal speed of 'object' to 5": -sets ALL objects to speed 5
"Create- Object": -creates object

OR

"create- Object": -creates object
"Set Horizontal speed of 'object' to 5": -sets THAT 1 specific object to speed 5

In the event grid, these two scenario's look EXACTLY the same. Its different in the event list, and they play out completely differently in results.
So make sure your "Set position of bullet to player" action comes AFTER the create action, or ALL existing bullets will be placed on top of your player each time the event triggers.




Yeah, that was confusing

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

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 April, 2007 at 20:05:51 -

Wouldn't it be easier if you could expand events to show the order of actions, like this:
http://img247.imageshack.us/my.php?image=events3sl4.jpg

>.<

Image Edited by the Author.

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

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
29th April, 2007 at 03:10:21 -

Yes, that would be easier

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
29th April, 2007 at 04:11:12 -

Well, there's always the event list editor.

 
n/a

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
29th April, 2007 at 12:12:43 -

Yarr, but then we lose the happy advantage of klikin in the first place; the event grid :/

Well, I still do most of my crap in TGF anyway, so gg me

Image Edited by the Author.

 
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
29th April, 2007 at 15:27:53 -

Here. try this.

On fire button pressed:

-Create bullet object at -32,-32.

-position bullet object at player's position.

-set horizontal speed to whatever you want.

It must be in that order.

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
29th April, 2007 at 15:40:47 -

Problem already solved (8 posts back). GO HOME, PEOPLE.

 
n/a

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
29th April, 2007 at 19:14:31 -

THERES ALWAYS A MORE EFFICIENT ANSWER THO!

Lets get an example of instant 360 degree bullets that don't use any active objects and minimize runtime slowdown!

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

Post Reply



 



Advertisement

Worth A Click