The Daily Click ::. Forums ::. Klik Coding Help ::. multipe object creation
 

Post Reply  Post Oekaki 
 

Posted By Message

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
24th January, 2011 at 21:00:44 -

yo man

i would like to create some of the same object, and place them in random positions.
like this:
http://kepfeltoltes.hu/110124/createobj_www.kepfeltoltes.hu_.png

but that's ain't no worken.

how can i solve this issue?

Edited by columbo borgi :C

 
:C

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
24th January, 2011 at 21:24:17 -

How exactly is it not working? Are they all going to the same place? Not being placed at all?

 

  		
  		

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
24th January, 2011 at 21:30:22 -

jop, they are at the same place.

i see at the debuggart that 4 object is created, but i only see one, that's why i think they are at the same place

 
:C

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
24th January, 2011 at 21:46:10 -

Are they at 320, 240?

Is there only one of the green box?

 

  		
  		

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
24th January, 2011 at 21:51:57 -

no, they created at random positions, every time this event runs

but all the 4 at the same position.

 
:C

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
24th January, 2011 at 22:26:03 -

Hmmm. Well, the issue is escaping me for now.

This is what I usually do in this kind of situation: http://jollycrouton.com/Uploads/TDC/Borgi.zip

Maybe someone else knows what's going on?

 

  		
  		

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
25th January, 2011 at 00:57:53 -

Try putting each create and randomise position event in a seperate line.

I often have trouble with creating then moving multiple objects in the same line. Usually with particle effects. Seperate lines always fixes the problem but I don't know why!

 
.

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
25th January, 2011 at 16:46:49 -

thanks for your advices MEN

i did not want to use more than one line. so i use some counters to create ranodm numbers, and i use them to place these object. i can create more ranodm number at one always event with this technique :C

 
:C

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
25th January, 2011 at 19:01:43 -

Don't separate it into multiple conditions.

Just remove all the randomizing code except the last and let all the create commands stack.

That'll work.

 
n/a

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
25th January, 2011 at 23:33:56 -

tanks for youradvice, but it happends one frame later. i can see the created objects at the spot without the random part.

 
:C

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
25th January, 2011 at 23:39:30 -

Ok, well do you have the latest build of mmf2?

IT works for me.
I do it like this
-Create object "blah" at (0,0)
-Create object "blah" at (0,0)
-Create object "blah" at (0,0)
-Create object "blah" at (0,0)
-Set x Position of "blah" to random(100)
-Set y Position of "blah" to random(100)

Then they all get put in a different random position
If I want more objects I just copy the create action.

It's easy!

 
n/a

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
26th January, 2011 at 01:19:02 -

oh thanks! in newer version works fine!

 
:C

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
26th January, 2011 at 07:06:50 -

yo dude, my name is all shrinky too.

 
n/a

columbo borgi :C



Registered
  07/12/2003
Points
  296

VIP Member
26th January, 2011 at 23:13:13 -

so do mine :C

 
:C

Mårten



Registered
  25/06/2002
Points
  769
1st February, 2011 at 13:55:12 -

Glad you solved it. A more scalable solution would be to use a loop though.

 
---
   

Post Reply



 



Advertisement

Worth A Click