Page 1 of 2

Spawning Stuff, For Dummies

PostPosted: Tue Sep 29, 2009 5:50 am
by niffirg1
Since Dez already made a tutorial about Water spawning. This is about Circle Boxs Exc.
Circle Spawning
-Create a Box
-In the Oncollide Menu of that box type something like
Code: Select all
Scene.addcircle({pos := e.pos; Color :=              [0,0,0,1]; radius := 0.1; vel := e.normal * 50})

-That will spawn a balll with forward motion
-By the Way the E.normal means that it will spawn the ball with the velocity of the objest that hit it (In Short it is just forward Motion
Box Spawning
-Create another box
-In the oncollide menu of the Box type something like
Code: Select all
Scene.addbox({size := [1,2]; pos := e.pos; color := [0,0,0,1]})

-This will spawn a box that is black and is 2 by 1 or something
spawning Pens
- First off you need to have one of the Spawner above first
- in the script of the original Spawner Type the code that will come out to say
Code: Select all
Scene.addcircle({pos := e.pos; Color := [0,0,0,1]; radius := 0.1; vel := e.normal * 50}); scene.addpen ({pos := e.pos; color := [0,0,0,1]; size := 0.9})

-That will Spawn a ball with a tracer attached
Spawning Lasers
-Okay so you can type this into a script menu (oncollide) of a Box or something
Code: Select all
scene.addlaserpen({pos := e.pos; Size := 1; color := [1,1,1,1]; Cutter := true})

-That spawns a Laser that is a cutter.
I am Going to add more later

Re: Spawning Stuff, For Dummies

PostPosted: Tue Sep 29, 2009 5:39 pm
by Sonic
Here's a good example for circle spawning:
Rating: rated 6.5
Filesize: 64.18 kB
Comments: 5
Ratings: 4
download

Re: Spawning Stuff, For Dummies

PostPosted: Tue Sep 29, 2009 6:00 pm
by Sniperkasa
What 'bout polygon spawning ( I know how its done but all may not )

Re: Spawning Stuff, For Dummies

PostPosted: Tue Sep 29, 2009 8:47 pm
by KarateBrot
Sniperkasa wrote:( I know how its done but all may not )


i know it too ;)
a lot of people know this i guess. but for newbies it would be cool to post a polygon spawning tut

Re: Spawning Stuff, For Dummies

PostPosted: Tue Sep 29, 2009 8:58 pm
by standardtoaster
To spawn a polygon you have to give it all of the vertexes it needs. IMHO It's easiest to see what I'm talking about by looking at this scene and studying the scripts.
Rating: rated 7.2
Filesize: 6.39 kB
Comments: 6
Ratings: 7
download

Re: Spawning Stuff, For Dummies

PostPosted: Tue Sep 29, 2009 11:06 pm
by niffirg1
I will Add some more stuff like Polygon Hold on

Re: Spawning Stuff, For Dummies

PostPosted: Wed Sep 30, 2009 7:21 am
by Sniperkasa
:thumbup:
Hope you manage to do an good one on polygons, cause it took me a few hours figuring it out myself without a proper guide :D

Re: Spawning Stuff, For Dummies

PostPosted: Wed Sep 30, 2009 12:59 pm
by Mystery
I love it :D
But now your kind of taking away a ton of dezzeron's thunder. Well at least its nice to see some for dummies tut's coming about.

Re: Spawning Stuff, For Dummies

PostPosted: Mon Oct 05, 2009 8:24 pm
by Dezzeron
Mystery wrote:I love it :D
But now your kind of taking away a ton of dezzeron's thunder. Well at least its nice to see some for dummies tut's coming about.


Oh, well. I still have my lightning! :lol:

Re: Spawning Stuff, For Dummies

PostPosted: Fri Oct 16, 2009 5:42 pm
by simey j dude
how do you change the collision menu of the thing that your spawning?

Re: Spawning Stuff, For Dummies

PostPosted: Fri Oct 16, 2009 5:46 pm
by standardtoaster
when spawning it put collideSet := number you want

A = 1
B = 2
C = 4
D = 8
E = 16
F = 32
G = 64

Play around with the numbers. Add them together to get different collision layers.

Re: Spawning Stuff, For Dummies

PostPosted: Sat Oct 17, 2009 3:56 pm
by simey j dude
awesome thanks! :clap:

Re: Spawning Stuff, For Dummies

PostPosted: Wed Dec 16, 2009 8:06 pm
by davidz40
is there any way to spawn multiple circles/boxes other than copying whole spawn script x times?

Re: Spawning Stuff, For Dummies

PostPosted: Wed Dec 16, 2009 8:13 pm
by standardtoaster
Type it out instead? Other than that, not really. You could make a function to do it though.

Re: Spawning Stuff, For Dummies

PostPosted: Thu Dec 17, 2009 12:58 am
by KarateBrot
davidz40 wrote:is there any way to spawn multiple circles/boxes other than copying whole spawn script x times?


yes there is.

Code: Select all
for(20, (i)=>{ your spawn script here })

this example loops the script 20 times. 48 times is the limit (and only about 40 times for big scripts) but you can chain for-functions for example:

Code: Select all
for(5, (i)=>{ for(20, (i)=>{ your spawn script here }) })

this chain loops your script 5*20 = 100 times

Re: Spawning Stuff, For Dummies

PostPosted: Thu Dec 17, 2009 4:13 pm
by davidz40
thanks! :)

Re: Spawning Stuff, For Dummies

PostPosted: Wed Dec 23, 2009 9:11 pm
by Imaginer1
How can you give the circle different attraction?

Re: Spawning Stuff, For Dummies

PostPosted: Wed Dec 23, 2009 9:30 pm
by standardtoaster
When spawning it put attraction := x, where "x" is any number you want, whether it be negative or positive. By default it is set to zero when spawned.

Re: Spawning Stuff, For Dummies

PostPosted: Mon Jan 18, 2010 6:48 am
by niffirg1
As promised i added stuff to this tutorial. It only took me 4 and 1/2 months to do it.

Re: Spawning Stuff, For Dummies

PostPosted: Fri Feb 19, 2010 8:03 pm
by Rrobba
Thanks, helpful.

...

PostPosted: Sat May 29, 2010 3:38 am
by simey j dude
...

Re: Spawning Stuff, For Dummies

PostPosted: Sat May 29, 2010 6:22 am
by Mystery
Dude wtf. You just bumped a three month old topic all all you had to say was
simey j dude wrote::thumbup:

Even if this was't 3 months old that is still against the rules, if you not going to contribute anything to to topic don't post at all.

Re: Spawning Stuff, For Dummies

PostPosted: Tue Feb 08, 2011 4:14 am
by jrderksen
How do you get it so the circles delete themselves after a while?

Re: Spawning Stuff, For Dummies

PostPosted: Tue Feb 08, 2011 4:51 am
by TC42
jrderksen wrote:How do you get it so the circles delete themselves after a while?


Depends. Do you want them to delete on one collide? On two collides? Or do you want them to delete on a timer, so they don't have to collide with anything?

Also, does anyone know how to spawn distant-hinges?

Re: Spawning Stuff, For Dummies

PostPosted: Tue Feb 08, 2011 7:54 am
by jrderksen
I was wanting them to delete on a timer.