Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Particle Attempt :D (https://forums.graalonline.com/forums/showthread.php?t=74701)

killerogue 06-18-2007 09:05 PM

Particle Attempt :D
 
PHP Code:

//#CLIENTSIDE
function onCreated() {
  
with (findimg(200)) {
    
layer 1;
    
player.x;
    
player.y;
    
    
emitter.delaymin 1;
    
emitter.delaymax 1;
    
emitter.nrofparticles 1;
    
emitter.maxparticles 1;
    
emitter.autorotation true;
    
emitter.emitautomatically true;
    
    
emitter.particle.lifetime 10;
    
emitter.particle.image "block.png";
    
emitter.particle.spin 10;
    
emitter.particle.speed 0;
    
    
emitter.emit();
  }


I've been trying to learn something about particles, but I can't even get it to spin! :P Even with the spin variable. What could I be doing wrong? :o

Chandler 06-18-2007 11:07 PM

PHP Code:

//#CLIENTSIDE
function onCreated() 
{

  
with (findimg(200)) 
  {
    
layer 3;
    
player.x;
    
player.y;

    
with (emitter
    {
      
delaymin 1;
      
delaymax 1;
      
nrofparticles 1;
      
maxparticles 1;

      
with (particle
      {
        
lifetime 10;
        
image "block.png";
        
spin 3;
        
speed 1;
      }

      
emit();
    }

  }


ya need speed i think

killerogue 06-18-2007 11:22 PM

Meh, I tried speed. Didn't work. I copy and pasted what you wrote. And then it works. XD

Well, thanks for the assistance. :D

Chompy 06-18-2007 11:24 PM

Oh, and Stan

emitautomatically is true by default I think, so you don't need emit()

When using emit() you should have emitautomatically set to false :O

theHAWKER 06-19-2007 12:10 AM

what dose this do?:
with (findimg(200)) {

and why 200?

killerogue 06-19-2007 12:14 AM

with() puts the current scope of the script inside the object in the parameters. When using findimg inside with, it first looks for an already created image with the index of 200. Then if there is not one, it creates one.

If you want the image to show to client only, give it an index of 200 or above. However if you want the image to be visible to everyone, give it an index lower than 200.

Inverness 06-19-2007 03:18 AM

I wonder why that number is 200 and not 255? :o

DustyPorViva 06-19-2007 04:24 AM

I think that only applies if you're trying to fit info into one byte, like a max to money or such.

Inverness 06-19-2007 04:40 AM

Yea I know, but it is computer scripting so it seems more fitting to use 255 :P

theHAWKER 06-20-2007 09:21 PM

Quote:

Originally Posted by killerogue (Post 1319581)
with() puts the current scope of the script inside the object in the parameters. When using findimg inside with, it first looks for an already created image with the index of 200. Then if there is not one, it creates one.

If you want the image to show to client only, give it an index of 200 or above. However if you want the image to be visible to everyone, give it an index lower than 200.

why not just use 1 or 2?

is there like a gradiance or something?

Chompy 06-20-2007 09:30 PM

Quote:

Originally Posted by theHAWKER (Post 1320267)
why not just use 1 or 2?

is there like a gradiance or something?

For some reason you quoted the answer of your question..

Quote:

Originally Posted by killerogue (Post 1319581)
If you want the image to show to client only, give it an index of 200 or above. However if you want the image to be visible to everyone, give it an index lower than 200.


zokemon 06-21-2007 12:44 AM

Quote:

Originally Posted by theHAWKER (Post 1320267)
why not just use 1 or 2?

is there like a gradiance or something?

An index is only an assignment much like you give something a variable assignment. Any showimg from 1 to 199 is exactly the same in all of it's properties same as any showimg 200 and up is exactly the same in it's properties. Of course this doesn't mean they aren't individual showimgs...

theHAWKER 06-21-2007 11:15 PM

Quote:

Originally Posted by zokemon (Post 1320403)
An index is only an assignment much like you give something a variable assignment. Any showimg from 1 to 199 is exactly the same in all of it's properties same as any showimg 200 and up is exactly the same in it's properties. Of course this doesn't mean they aren't individual showimgs...

so can you have findimg(13612895676293894687249) ??

Chompy 06-21-2007 11:26 PM

Quote:

Originally Posted by theHAWKER (Post 1320828)
so can you have findimg(13612895676293894687249) ??

bytes++

killerogue 06-21-2007 11:27 PM

pointlessness++

theHAWKER 06-21-2007 11:32 PM

Quote:

Originally Posted by Chompy (Post 1320837)
bytes++

Quote:

Originally Posted by killerogue (Post 1320838)
pointlessness++

i was just wondering xD

zokemon 06-21-2007 11:51 PM

Quote:

Originally Posted by theHAWKER (Post 1320828)
so can you have findimg(13612895676293894687249) ??

Yes, but as stated in posts #14 and #15, it would hog unnecessary memory on your computer and would also be rather pointless. Even putting 1 showimg on every tile in a 16x16 level gmap would probably not even come up to that number...

DustyPorViva 06-22-2007 12:10 AM

I do believe there is a limit, I can't check now and I don't quite remember.

Tolnaftate2004 06-22-2007 08:35 AM

Quote:

Originally Posted by theHAWKER (Post 1320828)
so can you have findimg(13612895676293894687249) ??

Quote:

Originally Posted by zokemon (Post 1320848)
Yes, but as stated in posts #14 and #15, it would hog unnecessary memory on your computer and would also be rather pointless.

Quote:

Originally Posted by DustyPorViva (Post 1320861)
I do believe there is a limit, I can't check now and I don't quite remember.

There's a cap at 2^31-1 as far as indexes go (in other words, no).


All times are GMT +2. The time now is 10:59 AM.

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