Graalians

Graalians (https://www.graalians.com/forums/index.php)
-   Creative Corner (https://www.graalians.com/forums/forumdisplay.php?f=17)
-   -   John's Scripts (https://www.graalians.com/forums/showthread.php?t=9528)

Johnaudi 08-25-2012 07:05 AM

Quote:

Posted by プリンセスさくら2 (Post 186007)
He dinosaur Lebanon hahaha

Uhm? I'm basically from the U.S but moved to Lebanon, and my last post was sarcasm lol.

Quote:

Posted by callimuc (Post 185958)
meh, newb times xD
forums.graalonline.com/forums/showthread.php?t=134263795

Ty <3

@Callimuc, so it mainly makes the particle movement or ,as it's said, "replace" the alpha to make it 0 smoothly without sudden death? I want more basically the creation of each particle as a sprite. Is that in a Gani editor or something?

プリンセスさくら2 08-25-2012 07:35 AM

Quote:

Posted by Johnaudi (Post 186148)
Uhm? I'm basically from the U.S but moved to ?

Well you dinosaur Lebanon
I can call you dinosaur Lebanon or America or Japan (i am free)
But I have a question
Do you tasted Homs or Flavell (Flavell and Homs food Arabic at what i think)

Johnaudi 08-25-2012 09:22 AM

Quote:

Posted by プリンセスさくら2 (Post 186157)
Do you tasted Homs or Flavell (Flavell and Homs food Arabic at what i think)

Don't want to go off topic, but yeah. Btw what does "Dinosaur" have to do with my country .-.? You people scare me.

Talon 08-25-2012 09:24 AM

I wish I knew how to script. I gave it a shot, but in the end, it wasn't for me. I commend you for going through with it and learning with the help of Emera and Callimuc. Good job.

callimuc 08-25-2012 10:44 AM

Quote:

Posted by Johnaudi (Post 186148)
@Callimuc, so it mainly makes the particle movement or ,as it's said, "replace" the alpha to make it 0 smoothly without sudden death? I want more basically the creation of each particle as a sprite. Is that in a Gani editor or something?

Yea. Without that the particles would only move to the angle you have setted (if you didnt set any its 0 so it would move to that angle). You can do different stuff with that, like reducing/rising the alpha of the particle after a certain ammount of seconds withing a certain ammount of seconds (like start lowering the alpha after 3 seconds from 1 to 0 within 0.5 seconds). same can be done with the movement (changing the x/y, angle, ...) and more.

An example for your alpha thing would be:
(SCRIPT and SCRIPTEND is because i prefer to do particle effects as gani scripts. simply put that into a gani and save it as something like "john_particletest.gani" and put that into the players/objects attribute/set it as an ani; can be done like player.attr[2] = "ganiname.gani"; or setAni("ganiname", params))
(the script is an old one of mine i practiced with when i first made particles so it might not be perfect. i barely make them :P)
PHP Code:

SCRIPT
function onPlayerEnters() {
  
onTimeOut();
}

function 
onTimeOut() {
  
with(findimg(200)) {
    
player.0.25//starting x
    
player.3.00//starting y
    
attachtoowner true//follow the object if it moves (like follow the player if you move?
    
layer 3//layer

    
with(emitter) {
      
delaymin 0.3//the minimum delay when they should spawn
      
delaymax 0.3//the maximum delay when they should spawn
      
maxparticles  20//how many particles will be spawned max. until its recalled (timeout in this case)
      
nrofparticles 1//how many particles will be spawned at once

      
with(particle) {
        
speed 10//particles movement speed
        
lifetime 4//how many seconds will you be able to see the particle?
        
image "g4_particle_bluex.png"//particles image; works with ani = "walk"; aswell I think (so you can also set ganis)
        
red   random(01); //red value
        
green random(01); //green value
        
blue  random(01); //blue value
        
alpha 1//alpha value
        
zoom  random(0.30.5); //the size of the particle (by default its always 1 - original size)
        
mode  0//mode effect of the particle
        
spin  random(12); //rotation of the particle
        
angle random(80); //particles angle (in which direction it will move)
      
}

      
continueafterdestroy true//if the particle is destroyed/removed from a script, should the particle be removed immediately aswell (false) or have the particles finish their lifetime (true)?
      
addLocalModifier("range"24"alpha""replace"10); //lower the alpha after 2 seconds to the 4th second (so within 2 seconds; 4 is also the lifetime so when the particle is alpha=0 it will be destroyed - avoids lag)      addLocalModifier("range", 0, 6, "angle", "replace", (pi*2)*4, 0); //rotation angle for the particle (from the second 0 to 6 because it will affect the size of the "ring")
    
}
  }
  
setTimer(4);
}
SCRIPTEND 

Quote:

Posted by Mark Sir Link
addlocalmodifier(type, rangemin, rangemax, variable, variable modification, valuemin, valuemax)

Types - once, impulse, range - modifies the particle one time, periodically or only in the given time range
rangemin - seconds, minimum delay until first modification or start of modification range (if modifier is "range")
rangemax - seconds, maximum delay until first modification or end of modification range (if modifier is "range")
variable - x,y,z,movex,movey,movez,angle,zangle,speed,rotatio n,spin,stretchx,stretchy,red,green,blue,alpha or zoom
variable modification type - replace,add or multiply (if modifier type is "range" then only "replace" and "add" are valid)
valuemin - range start of the random value or first value to set/add (if modifier is "range")
valuemax - range end of the random value or last value to set/add (if modifier is "range")

from http://wiki.graal.net/index.php/Part...icle_modifiers

All i can suggest you is to read the source Mark Sir Link posted. can help pretty much

Emera 08-25-2012 11:12 AM

Quote:

Posted by Talon (Post 186178)
I wish I knew how to script. I gave it a shot, but in the end, it wasn't for me. I commend you for going through with it and learning with the help of Emera and Callimuc. Good job.

Remember, we're here for anybody who wants help. If you really want to get into scripting, I'll be more than happy to help with any questions you have and so will callimuc.

callimuc 08-25-2012 11:20 AM

Quote:

Posted by Emera (Post 186244)
and so will callimuc

orlly?

sure :D

Era News 08-25-2012 12:09 PM

Quote:

Posted by Emera

Remember, we're here for anybody who wants help. If you really want to get into scripting, I'll be more than happy to help with any questions you have and so will callimuc.

But really, where did you start? Like where did you learn the basics. Do you have a tutorial? I would mor them happily plus rep you if you could re direct me. Learning to script has been on my bucket list for ages now, just never got time.

Emera 08-25-2012 12:15 PM

Quote:

Posted by Era News (Post 186263)
But really, where did you start? Like where did you learn the basics. Do you have a tutorial? I would mor them happily plus rep you if you could re direct me. Learning to script has been on my bucket list for ages now, just never got time.

This tutorial has been posted all over Graalians. I started with playing around on RC and finally read this. From there, I just practised every day and have been doing so for nearly 3 years.

Era News 08-25-2012 12:23 PM

Quote:

Posted by Emera

This tutorial has been posted all over Graalians. I started with playing around on RC and finally read this. From there, I just practised every day and have been doing so for nearly 3 years.

Alright cheers, should I practice on testbed?

Emera 08-25-2012 12:24 PM

Quote:

Posted by Era News (Post 186269)
Alright cheers, should I practice on testbed?

Practise anywhere.

Era News 08-25-2012 12:27 PM

Quote:

Posted by Emera

Practise anywhere.

Wait I do not get echoes, is it like copying your text into RC?

Emera 08-25-2012 12:30 PM

Quote:

Posted by Era News (Post 186274)
Wait I do not get echoes, is it like copying your text into RC?

An echo sends data to the RC. Example usage:
PHP Code:

echo("My name is bob and I like cheese"); 

You can use the Graal bible or the tutorial I gave you to figure this stuff out though.

Era News 08-25-2012 12:37 PM

Quote:

Posted by Emera

An echo sends data to the RC. Example usage:
echo("My name is bob and I like cheese");

You can use the Graal bible or the tutorial I gave you to figure this stuff out though.

But why would you need to send data to the RC? Wouldn't you just chat?

Emera 08-25-2012 12:44 PM

Quote:

Posted by Era News (Post 186278)
But why would you need to send data to the RC? Wouldn't you just chat?

I suggest you read the tutorial first man.


All times are GMT. The time now is 05:50 PM.

Powered by vBulletin/Copyright ©2000 - 2025, vBulletin Solutions Inc.