Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   Particle Editor (https://forums.graalonline.com/forums/showthread.php?t=85696)

xXziroXx 05-23-2009 02:01 PM

Particle Editor
 
1 Attachment(s)
Credits for the script goes to DrakilorP2P, permission to post on his behalf given by Darlene.

"I got tired of spamming RC whenever I wanted to tune a particle emitter, so I coded this." -DrakilorP2P


This code allows you to create, modify and generate code for particle effects, with an in-game editor.

If you're too lazy to download it to try it yourself, you can logon Maloria and say /openparticle to open it.


http://i42.tinypic.com/2vl2w6e.png

[email protected] 05-23-2009 03:23 PM

Nice job :D

Pelikano 05-23-2009 03:28 PM

very nice

Gambet 05-23-2009 05:47 PM

Great work, Drakilor. :)

cbk1994 05-23-2009 06:44 PM

Very cool, but it would be interesting to add another pane where you can preview the effect, with controls like "Start Emitting", and "Stop Emitting". You should be able to use a GuiShowImgCtrl for this.

Tigairius 05-23-2009 06:46 PM

Cool, I was going to make one of these but now I don't have to :D

napo_p2p 05-23-2009 07:51 PM

Quote:

Originally Posted by Tigairius (Post 1493408)
Cool, I was going to make one of these but now I don't have to :D

Same here.

Great stuff :).

salesman 05-23-2009 08:21 PM

I haven't used particles much and have been wanting to take a stab at it...this will definitely help me out, nice work.

cbk1994 05-23-2009 09:04 PM

I just noticed you're using degtorad in the actual code; the generator should instead just output it in radians, to prevent the work being done each time the particle is used. Radians are simple enough for just about anybody to understand anyway.

fowlplay4 05-24-2009 01:53 AM

Quote:

Originally Posted by cbk1994 (Post 1493440)
I just noticed you're using degtorad in the actual code; the generator should instead just output it in radians, to prevent the work being done each time the particle is used. Radians are simple enough for just about anybody to understand anyway.

The difference will go unnoticed, and from what I learned from people who aren't from scripting/programming backgrounds prefer to think in 0-360 than 0 to 2pi.

Will try my luck with particles, thanks!

DustyPorViva 05-24-2009 03:16 AM

Maybe have a preview button for the particle?

Seich 05-27-2009 04:45 AM

Woah, that's some amazing job you did there.....

Tigairius 05-27-2009 05:45 AM

I haven't had a chance to test it yet, but I was reading through the script and spotted this error on line 1351:
PHP Code:

  this.TVariableType.buildGuiControl = function()
  {
    
this.weaponNPC.reportError("TVariableTyoe.buildGuiControl - Not defined.");
  }; 

typo in the error report ;p obviously TVariableTyoe should be TVariableType

I also noticed at the bottom you left this comment:
PHP Code:

  //This doesn't work at all inside TStaticVar objects apparently.
  //this.dumpCallStack(temp.tempObject); 

Except, I don't think the dumpCallStack() function works due to callstacks not functioning on the clientside (am I wrong? Please tell me I am :()

Crow 05-27-2009 03:49 PM

Quote:

Originally Posted by Tigairius (Post 1494511)
Except, I don't think the dumpCallStack() function works due to callstacks not functioning on the clientside (am I wrong? Please tell me I am :()

Unfortunately, you are not.

Admins 05-27-2009 08:57 PM

The particle editor looks quite interesting (the idea with templates).

Callstacks work in the next Graal client version though.

Tigairius 05-27-2009 09:33 PM

Quote:

Originally Posted by Stefan (Post 1494669)
Callstacks work in the next Graal client version though.

That's great news.

DustyPorViva 05-27-2009 09:34 PM

Quote:

Originally Posted by Stefan (Post 1494669)
Callstacks work in the next Graal client version though.

There's lots of cool stuff in the next version... but about that...

i8bit 07-16-2013 08:39 PM

I have a question. This is a really neat tool, but can I change the particles startx and starty?

I want the starting.x to be 0 and the y to be int(random(0, screenheight))

I am trying to make clouds float by.

devilsknite1 07-16-2013 10:11 PM

under with (findimg(#)) { you can just assign x and y values for the image

i8bit 07-17-2013 12:23 AM

Quote:

under with (findimg(#)) { you can just assign x and y values for the image
PHP Code:

  with (findimg(200))
  {
    
spin degtorad(0);
    
rotation degtorad(0);
    
0;
    
0

Like that? not sure how to set the x and y by itself without adding it in a showImg()

devilsknite1 07-17-2013 07:13 PM

Quote:

Originally Posted by i8bit (Post 1720708)
PHP Code:

  with (findimg(200))
  {
    
spin degtorad(0);
    
rotation degtorad(0);
    
0;
    
0

Like that? not sure how to set the x and y by itself without adding it in a showImg()

Hint:

PHP Code:

with findImg200 ) ) { 

is functionally the same as:

PHP Code:

showImg200blah blah ); 

So yes, if you wanted to set the x/y to (29, 14). you would simply put:
PHP Code:

with findImg200 ) ) {
  
29;
  
14;


And that is technically the same as doing:

PHP Code:

showImg200"block.png"2914 ); 


DrakilorP2P 07-17-2013 07:44 PM

Quote:

Originally Posted by i8bit (Post 1720698)
I have a question. This is a really neat tool, but can I change the particles startx and starty?

I want the starting.x to be 0 and the y to be int(random(0, screenheight))

I am trying to make clouds float by.

You mean to start each individual particle on a random spot in the left side of the screen?

For that you want the code-equivalent of this:
PHP Code:

addLocalModifier("once"00"y""replace"0screenheight); 

With the editor you can get half-way there like this:
PHP Code:

scopelocal
timetype
once
rangemin
0
rangemax
0
variable
y
operator
replace
valuemin
0
valuemax
512 

Because the editor doesn't support variables, you have to manually replace the above 512 with screenheight in the generated code.
The modifier only happens once so if the player changes the size of the game's window, you'll have to reload the script, or remove and reapply all modifiers (complicated).

i8bit 07-18-2013 09:10 PM

Quote:

Originally Posted by devilsknite1 (Post 1720741)
Hint:

PHP Code:

with findImg200 ) ) { 

is functionally the same as:


And that is technically the same as doing:

PHP Code:

showImg200"block.png"2914 ); 


Yeah I know you can do (index, image, x, y)
but I tried the x= and the y= with the with(findimg(index)) and it didn't work.


All times are GMT +2. The time now is 03:28 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.