How do I...?

About advanced scenes, and the Thyme scripting language used in Algodoo.

How do I...?

Postby ligglo » Mon Mar 22, 2010 1:43 am

How do i spawn phunlets? I saved a bullet and i want to make a compact gun, so i need to spawn the bullets
onlaserhit, but i dont know how :cry: . So tell me what i need to put in the script box please.
ligglo
 
Posts: 16
Joined: Thu Feb 11, 2010 5:00 am

Re: How do I...?

Postby ligglo » Mon Mar 22, 2010 4:13 am

Anyone?
ligglo
 
Posts: 16
Joined: Thu Feb 11, 2010 5:00 am

Re: How do I...?

Postby Mr_Stabby » Mon Mar 22, 2010 8:09 am

from what i remember the command is called scene.importphunlet("name") or something similar, the problem is they spawn at your mouse not where the laser hits so the command is pretty useless. the best you can do for spawning complicated objects is to script the entire contraption (alltho a little advanced trigonometry is involved when spawning stuff at an angle+distance)
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am

Re: How do I...?

Postby Mystery » Mon Mar 22, 2010 8:32 am

Or you could just select what you want Save it with Ctrl + C and then put it into an object oncollide code.
User avatar
Mystery
 
Posts: 2802
Joined: Thu Sep 03, 2009 1:16 pm
Location: Southern Australia

Re: How do I...?

Postby Mr_Stabby » Mon Mar 22, 2010 10:44 am

which wont help you a single bit when you try to spawn stuff at an angle
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am

Re: How do I...?

Postby ligglo » Mon Mar 22, 2010 10:47 am

Thanks guys!
ligglo
 
Posts: 16
Joined: Thu Feb 11, 2010 5:00 am

Re: How do I...?

Postby Rideg » Mon Mar 22, 2010 11:22 pm

I did exactly this! might help you ( I spawned a scene insdead )
Rating: rated 8.2
Filesize: 332.19 kB
Comments: 31
Ratings: 14
download
JUst dig though to a black trasparent boxes at the clip ;P
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: How do I...?

Postby ligglo » Tue Mar 23, 2010 12:23 am

Thanks.. Can you please teach me how to spawn a polygon then? Oh and btw i like taking things aparte and i did to ur gun and found the spawner :P . To me, even after a long time, thyme is still prety hard for me to understand . ill take anything i can :P . I can do custon varables, spawn circles, squares, lasers, tracers, change colors,density, and other simple things. I do still need to figure out a lot of stuff :cry: .
Thanks in advance :!: :!: :!:
ligglo
 
Posts: 16
Joined: Thu Feb 11, 2010 5:00 am

Re: How do I...?

Postby Mr_Stabby » Tue Mar 23, 2010 4:06 pm

scene.addpolygon({pos:=e.pos; vecs:=[[-1, 0], [0, 1], [1, 0]]}) spawns a triangle, basically the vecs attribute follows the format of [ [x1, y1], [x2, y2], [x3, y3], [etc..] ] which tells algodoo to draw a polygon in connect the dots method, the coordinates you give it in vecs modifier are local meaning you dont have to specify their location in worldspace and it will automatically calculate its center and place it to pos
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am

Re: How do I...?

Postby canadian joe » Mon Apr 05, 2010 10:12 pm

but to get those points you must create the polygon, copy it using ctrl-c, then you have to paste it onto a word document, copy the points on that(not the whole thing, just the points), and plug those in on the script code that mr.stabby wrote out...
canadian joe wrote:im just writing this so i can sig it


RicH wrote:Phun's Army.
User avatar
canadian joe
 
Posts: 115
Joined: Wed Feb 10, 2010 9:42 pm

Re: How do I...?

Postby Chronos » Tue Apr 06, 2010 3:54 am

So what? :| That isn't very difficult.
TheWinkits wrote:They both looks of cuking amazing
User avatar
Chronos
[Most Active Member 2010]
 
Posts: 4457
Joined: Mon Aug 31, 2009 6:00 pm
Location: Californania

Re: How do I...?

Postby ligglo » Sun Apr 11, 2010 8:39 am

So what is wrong with this:

Scene.addPolygon {
surfaces := [[[0.08333337, 0.83333325], [-0.030303001, 0.71969676], [-0.14393938, 0.60606074], [-0.2575757, 0.49242425], [-0.37121212, 0.37878776], [-0.4848485, 0.26515126], [-0.5984848, 0.151515], [-0.7121211, 0.03787875], [-0.82575756, -0.07575774], [-0.9393939, -0.189394], [-1.0530303, -0.3030305], [-1.1666666, -0.41666675], [-1.0059524, -0.41666675], [-0.84523803, -0.41666675], [-0.68452376, -0.41666675], [-0.52380943, -0.41666675], [-0.36309516, -0.41666675], [-0.2023809, -0.41666675], [-0.041666627, -0.41666675], [0.11904776, -0.41666675], [0.2797619, -0.41666675], [0.4404763, -0.41666675], [0.60119045, -0.41666675], [0.76190484, -0.41666675], [0.922619, -0.41666675], [1.0833334, -0.41666675], [0.98333323, -0.29166675], [0.88333356, -0.16666675], [0.7833333, -0.041666746], [0.6833334, 0.083333254], [0.5833334, 0.20833325], [0.48333335, 0.33333325], [0.38333333, 0.45833325], [0.28333342, 0.58333325], [0.1833334, 0.70833325]]];
color := [0.8443222, 0.045043554, 0.90388143, 1.0];
Pos:=e.pos;

It is directly from the word document. I dont see the prob b/c im soo new to spawning these polygons.. and thx for all the help so far.. just a lil more till my project is over.. i was testing it with a triangle to see if i could get it right.
Density:=2
ligglo
 
Posts: 16
Joined: Thu Feb 11, 2010 5:00 am

Re: How do I...?

Postby Chronos » Sun Apr 11, 2010 10:20 am

It looks like you didn't copy the whole code. :?
TheWinkits wrote:They both looks of cuking amazing
User avatar
Chronos
[Most Active Member 2010]
 
Posts: 4457
Joined: Mon Aug 31, 2009 6:00 pm
Location: Californania

Re: How do I...?

Postby KarateBrot » Sun Apr 11, 2010 2:05 pm

You forgot to copy the } bracket at the end
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: How do I...?

Postby Mr_Stabby » Sun Apr 11, 2010 2:08 pm

jeesh. surfaces IS NOT the same thing as vecs, vecs are the ideal shape of the thing your making which you need to make a poly, surfaces is the garbled up shit that comes out which is generated automatically. While you can use existing surfaces info as vecs to spawn a poly its generally a bad idea because the thing that comes out the other end is yet another step further from what u originally wanted, srsly just try and visualize the shape then type in the vecs manually its not that hard.
Mr_Stabby
 
Posts: 155
Joined: Wed Dec 16, 2009 12:16 am

Re: How do I...?

Postby ligglo » Mon Apr 12, 2010 5:10 am

i dont get it =[
ligglo
 
Posts: 16
Joined: Thu Feb 11, 2010 5:00 am


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 4 guests