Graal Kingdoms

Graal Kingdoms Forums

  • November 17, 2018, 10:32:39 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome!

Author Topic: Example of a Gani Script  (Read 310 times)

Rice2k

  • Senior Warrior Member
  • Administrator
  • Elite Graalian
  • *****
  • Graalian Juice: +35/-0
  • Offline Offline
  • Posts: 325
  • REPORTED
    • View Profile
    • Graal Kingdoms
Example of a Gani Script
« on: January 22, 2018, 08:11:38 PM »

Here is just a small example of a gani script once a gani has been made
Code: [Select]
if (created){
thiso.tu = 0;
onTimeout();
}
function onTimeout()
{
//thiso.tu is incremented at the very end.
if(thiso.tu < 5) thiso.tmod = 10*(1/3);
else if(thiso.tu < 9) thiso.tmod = 10*(2/3);
else if(thiso.tu == 10) thiso.tmod = 10;
with (findimg(200))
{
spin = degtorad(0);
rotation = degtorad(0);

with (emitter)
{
delaymin = 0.2-((0.1/10)*thiso.tmod);
delaymax = 0.2-((0.1/10)*thiso.tmod);
nrofparticles = 1+int(random(0,1)+.5);
emitautomatically = true;
autorotation = false;
firstinfront = true;
emissionoffset = {0,1.5,0};
attachposition = false;
checkbelowterrain = false;
continueafterdestroy = true;
attachtoowner = true;
maxparticles = 100000;

particleTypes = 1;

// Leaf
with (particles[0])
{
image = "zod-j7energything.png";
zoom = 1;
red = 1;
green = 1-(0.1*thiso.tmod);
blue = 0;
alpha = 0;
mode = 0;
lifetime = 0.6 - ((0.2/10)*thiso.tu);
angle = degtorad(90);
zangle = degtorad(0);
speed = 5+thiso.tu;
rotation = degtorad(0);
spin = degtorad(0);
partx = 0;
party = 0;
partw = 0;
parth = 0;
stretchx = 0.8;
stretchy = 1.8;
sound = "";
layer = 2;
}

addlocalmodifier("once", 0, 0, "x", "replace", player.x-1+1, player.x+1+1); // [Insert Name]
addlocalmodifier("once", 0, 0, "y", "replace", player.y+3, player.y+3); // [Insert Name]

addlocalmodifier("range", 0, 0.25, "alpha", "replace", 0, 0.5+((.5/10)*thiso.tmod)); // [Insert Name]
addlocalmodifier("range", 0.25, 0.6 - ((0.2/10)*thiso.tu), "alpha", "replace", 0.5+((.5/10)*thiso.tmod),0); // [Insert Name]

}
}

with (findimg(202))
{
spin = degtorad(0);
rotation = degtorad(0);
layer = 0;

with (emitter)
{
delaymin = 0;
delaymax = 0;
nrofparticles = 1;
emitautomatically = true;
autorotation = false;
firstinfront = true;
emissionoffset = {0,0,0};
attachposition = false;
checkbelowterrain = false;
continueafterdestroy = false;
attachtoowner = true;
maxparticles = 1;

particleTypes = 1;

// Leaf
with (particles[0])
{
image = "g4_particle_yellowlight.png";
zoom = 2;
red = 1;
green = 1 - (0.1 * thiso.tu);
blue = 0;
alpha = 1;
mode = 0;
lifetime = .1;
angle = degtorad(32);
zangle = degtorad(0);
speed = 0;
rotation = degtorad(0);
spin = degtorad(0);
partx = 0;
party = 0;
partw = 0;
parth = 0;
stretchx = 1;
stretchy = 1;
sound = "";
layer = 2;
}

addlocalmodifier("once", 0, 0, "x", "replace", player.x-.5, player.x-.5); // [Insert Name]
addlocalmodifier("once", 0, 0, "y", "replace", player.y+.5, player.y+.5); // [Insert Name]
}
}
setTimer(.1);
if (thiso.tu < 10) thiso.tu++;
}
Logged