Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Chemical reactions/pyrotechnics

Monkey Edge
Registered User
Join date: 23 Apr 2005
Posts: 69
03-29-2007 18:29
How could i create chemicals to behave realistically.

Like say potassium Nitrate would create oxygen and then have other things able to burn based on taht anount of oxygen?

like say 60% potassium Nitrate and 40% sugar would create a powerful smoke bomb, but it would also work with a 50%/50%

Is this even possible?
_____________________
What do today what you can put off till tommorrow
But.......
What is today but yesterday's tommorrow
Kenn Nilsson
AeonVox
Join date: 24 May 2005
Posts: 897
03-29-2007 19:25
I would imagine that you could do such a thing, though it would be so insanely complex that I wouldn't want to try...

...you would create a certain list of values for each 'chemical'...

...then have the combination of chemicals interact with a master script to create a reaction...

So...technically...totally possible.

Realistically...wayyyyyy too complex a relationship for me to try to tackle through scripting.

I'd rather just make a couple of prims, call 'em x and y...and say if both x and y are in a master prim, then make explosion.
_____________________
--AeonVox--

Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms chasing ghosts, eating magic pills, and listening to repetitive, addictive, electronic music.
Monkey Edge
Registered User
Join date: 23 Apr 2005
Posts: 69
03-29-2007 19:42
lol, i geuss you could do say: list chemicals=[Oxygen,(density),(weight),([properties]),dieInto,PotassiumNitrate,(density),(weight),([properties]),dieInto,etc])

and then see how much of each, multiply by param, then check if there is enough oxygen to burn, see if the ingrediant actually do somethng, and way to much of a headache for 1 person :P
_____________________
What do today what you can put off till tommorrow
But.......
What is today but yesterday's tommorrow
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-30-2007 00:14
OK I know enough chemistry to half fill the back of a postage stamp but...

If each prim knows its own chemical components and they are scripted with a short range sensor or collision detection then they can always interogate any others that are in the immediate area.

Then you would need some form of database which would return the possible reaction based on the chemicals available. The biggest problem would be encoding all of the possible reactions for all of the possible input circumstances. And how 'real' you wanted the simulation to be.

Using a list for the internal composition would allow combining to build more complex items. You could possibly even have some form of rezzer or use the create link capability to build new chemical bonds (getting into real complexity now!)
Monkey Edge
Registered User
Join date: 23 Apr 2005
Posts: 69
03-30-2007 09:45
lol, i know nothing about chemistry, just potassium nitrate and sugar create a smoke bomb, but see i dont want an if then statement like: if (pottasuimNitrate==50% && sugar==10%)
because that compleatly removes the chance to be creative and test the different effects, so for this to work i would need to have every chemical possible coded with every single thing that is can do, size,shape, and density and then base the reaction off of that.

for instance with potassium nitrate have one of its parameters is create oxygen, which things need to burn in an oxygen-less environment, unfortunatly there is no such thing as oxygen in SL so i need a varible for that. Also i need to figure out how to make things react realistically liek say you drop pure sodium in H2O then you create sparks/fire, but i dont know how to do anything like this.
_____________________
What do today what you can put off till tommorrow
But.......
What is today but yesterday's tommorrow
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
03-30-2007 09:51
That kinda sounds like a fairly serious project, Monkey. I think this may be beyond the capabilities of LSL.

Consider how much money drug and other chemical companies put into researching how new compounds will react with each other..
Monkey Edge
Registered User
Join date: 23 Apr 2005
Posts: 69
03-30-2007 10:41
lol true, so if i wanted a chemical simulator then i need to find one/make one elsewhere
_____________________
What do today what you can put off till tommorrow
But.......
What is today but yesterday's tommorrow
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
03-30-2007 10:52
I would think so..

It just seems like the kind of thing that they usually put supercomputers up against. This really isn't my gig, though - I could be totally wrong.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
03-31-2007 02:05
Pottassium Nitrate is a compound, KNO3, so we can see it does contain oxygen.

Like I said in my original reply the problem is the database.
You'd need a listing of the actual chemical components and the base reactions.
It does fall out to a big if tree or at least a table look up, but at a lower level than you are currently thinking.

To be truely accurate you would 'need' to take into account pressure and temprature, both of which are also unavailabe within SL as values.
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
04-01-2007 00:24
From: Newgate Ludd
To be truely accurate you would 'need' to take into account pressure and temprature, both of which are also unavailabe within SL as values.


llAirPressure
llGetTemperature
_____________________
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-01-2007 01:06



ROFL, damm
I've never noticed them!!!
Deanna Trollop
BZ Enterprises
Join date: 30 Jan 2006
Posts: 671
04-01-2007 13:20
Err... these are user-created functions, not ll functions.
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
04-01-2007 15:21
From: Deanna Trollop
Err... these are user-created functions, not ll functions.


ahhh thats why I've never noticed them!

Looking at the calculations its using ISA conditions which is good enough for SL.
Cid Jacobs
Theoretical Meteorologist
Join date: 18 Jul 2004
Posts: 4,304
04-02-2007 19:40
From: Newgate Ludd
Looking at the calculations its using ISA conditions which is good enough for SL.

Thanks :}
_____________________