Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Get particles to work

Author
Message
Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 14th Nov 2009 19:27
I have tried to add particles to my project, but they wont show up.

I made a test:
Quote: "Rem ***** Included Source File *****

sync on
sync rate 0

load image "fire.bmp",1
make particles 1,1,10,10
position particles 1,0,-10,0
position particle emissions 1,0,10,0
set particle emissions 1,1
set particle speed 1, 0.001
set particle gravity 1, 20

do



sync
loop"

This works exactly the way I want, but when I add it to my project they wont show up.

Should I put something inside the loop? Or is there anything else I should do?

Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 16th Nov 2009 10:36
If this is an included source file, as the comment at the top suggests, the code is essentially appended to the bottom of your main source file. Thus, if you have an end command before the end of your main source file, that code will never run.

That doesn't mean you should just take out the end command in your main source file, but it means you should figure out what each command in that code does, and then figure out how to work it into your main source file. Never expect good results from copy/paste.

Of course, everything I just said is all dependent on whether or not you've included that code as a separate file.
Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 16th Nov 2009 15:23
That code is a seperate file, nothing to do with the mainfile.

But this code works seperate, but when I put it into my main it wont show up.

Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 16th Nov 2009 15:26 Edited at: 16th Nov 2009 15:29
...which is what I assumed, and so my explanation as to why it wasn't showing up still holds true.

Edit: How do you mean putting it in your main? By attaching the file to the project? Or by copying and pasting the code into the main source file?
Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 16th Nov 2009 15:41 Edited at: 16th Nov 2009 15:42
Copying and paste it into the main.

[edit] If I offer some kind of compensation, would you be able to take a look at my code and get particles to work?

Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 16th Nov 2009 15:47
I dunno, I think it would be much more beneficial to you to get them working by yourself. If you get really stuck, perhaps I could look at it and nudge you in the right direction. Hm, my first thought is that the camera is not in a place from which it can see the particles.
Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 16th Nov 2009 15:49
I will try to hide everything except the particles.

Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 16th Nov 2009 15:53
This is just weird, copied and pasted the code I wrote... and now it works!

I dont know what I did but it works

Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 16th Nov 2009 15:56
Well alrighty then. A little weird...
Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 16th Nov 2009 15:57
Sent you an e-mail

Kira Vakaan
15
Years of Service
User Offline
Joined: 1st Dec 2008
Location: MI, United States
Posted: 16th Nov 2009 16:07 Edited at: 16th Nov 2009 16:45
Did you? I don't think I got it.

Edit:
I got it the second time. I'm out right now, but I'll take a look when I get back home.
Cyborg ART
17
Years of Service
User Offline
Joined: 14th Jan 2007
Location: Sweden - Sthlm
Posted: 16th Nov 2009 16:28 Edited at: 16th Nov 2009 17:23
Maybe in the spam?

Anyways, particles work. But now I try to move them around ingame.

I have a "player" which moves around, and I want the particles to move together with the player. But they move away from player instead.

I use this code:

position particles 1,(object position x(4),0,0

[edit] Fixed this by using "position particle emissions" instead

Login to post a reply

Server time is: 2024-11-16 09:19:52
Your offset time is: 2024-11-16 09:19:52