Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-28-2008, 04:49 AM
Toxen Toxen is offline
A Toxic Fellow
Join Date: Jan 2008
Location: Georgia
Posts: 36
Toxen is on a distinguished road
Gani scripting?(Color changing)

What would be the most east way of makeing a gani where the player is all one color including the hats and shields and swords?
Reply With Quote
  #2  
Old 01-28-2008, 05:19 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
just make a file named whatever you want, and then add this:
PHP Code:
SCRIPT
player
.red 1;
player.blue 0;
player.green 0;
SCRIPTEND 
and then in a system

PHP Code:
player.attr[6] = "myfile.gani"
__________________
Reply With Quote
  #3  
Old 01-28-2008, 06:19 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
It seems rather pointless to make that a gani, though, don't you think?
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #4  
Old 01-28-2008, 08:14 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by coreys View Post
It seems rather pointless to make that a gani, though, don't you think?
I think it needs to be a gani so that other players can also see the effects.
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #5  
Old 01-28-2008, 04:21 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
What I'd do is have a clientr flag like
clientr.colors = {r,g,b,a};

And then a script like this:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
onTimeOut();
}
function 
onTimeOut() {
  
//I forget if it should be players[] or allplayers[]
  
for (plplayers) {
    
pl.red pl.clientr.colors[0];
    
pl.blue pl.clientr.colors[1];
    
pl.green pl.clientr.colors[2];
    
pl.alpha pl.clientr.colors[2];
  }
  
setTimer(.5);
}
function 
onPlayerEnters() {
  
onTimeOut();

Using that has worked for me in the past, but I guess a gani would work as well, assuming he used player.attr[]'s for the rgb.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #6  
Old 01-28-2008, 05:02 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by coreys View Post
What I'd do is have a clientr flag like
clientr.colors = {r,g,b,a};

And then a script like this:
PHP Code:
... 
Using that has worked for me in the past, but I guess a gani would work as well, assuming he used player.attr[]'s for the rgb.
http://forums.graalonline.com/forums...ad.php?t=78118

Dusty's player effects
__________________
Reply With Quote
  #7  
Old 01-28-2008, 11:36 PM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
well, i have been working on gani scripting (working as in trying to find out what the heck a gani script is!) and i was wondering, could i just do
PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
  if (
player.chat == "/grow")
  {
    
client.zoom=1;
    
sleep(1);
    
client.zoom=2;
    
sleep(1);
    
client.zoom=3;
    
sleep(1);
    
client.zoom=4;
  }

to make the person grow really tall?
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #8  
Old 01-29-2008, 12:10 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by coreys View Post
What I'd do is have a clientr flag like
clientr.colors = {r,g,b,a};

And then a script like this:
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
onTimeOut();
}
function 
onTimeOut() {
  
//I forget if it should be players[] or allplayers[]
  
for (plplayers) {
    
pl.red pl.clientr.colors[0];
    
pl.blue pl.clientr.colors[1];
    
pl.green pl.clientr.colors[2];
    
pl.alpha pl.clientr.colors[2];
  }
  
setTimer(.5);
}
function 
onPlayerEnters() {
  
onTimeOut();

Using that has worked for me in the past, but I guess a gani would work as well, assuming he used player.attr[]'s for the rgb.
Lag mania. Much easier to do this.
Quote:
Originally Posted by Knightmare1 View Post
well, i have been working on gani scripting (working as in trying to find out what the heck a gani script is!) and i was wondering, could i just do
PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
  if (
player.chat == "/grow")
  {
    
client.zoom=1;
    
sleep(1);
    
client.zoom=2;
    
sleep(1);
    
client.zoom=3;
    
sleep(1);
    
client.zoom=4;
  }

to make the person grow really tall?
No. You need the onPlayerChats to be in a weapon script.

I would have 4 different ganis;
zoom1.gani
zoom2.gani
zoom3.gani
zoom4.gani

and then something like this in each one

PHP Code:
SCRIPT
player
.zoom #; // Replace # with 1, 2, 3, or 4
SCRIPTEND 
and then in the weapon something like

PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
  if ( 
player.chat == "/grow" )
  {
    
player.attr[7] = "zoom1.gani";
    
sleep);
    
player.attr[7] = "zoom2.gani";
  }

and repeat that.

Of course, I would recommend having a player affects gani, and then a timeout in it, and then a player variable clientr.zoom. Something like this in the gani script.
PHP Code:
SCRIPT
function onCreated()
{
  
setTimer0.05 );
}
function 
onTimeOut()
{
  
player.zoom clientr.zoom;
  
player.red clientr.red;
  
player.green clientr.green;
  
player.blue clientr.blue;
  
setTimer0.05 );
}
SCRIPTEND 
and then in a weapon

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
player.attr[7] = "player_effects.gani";
}
function 
onPlayerChats()
{
  if ( 
player.chat == "/grow" )
  {
    for ( 
client.zoom 1client.zoom 4client.zoom += .1 )
    {
      
sleep.05 );
    }
  }

So that you get a more gradual zoom, and it is easier anyway. Note that I used client.zoom in that script, and clientr.zoom in the player effects, so make it client.zoom in both if you want. Sorry, I realized halfway through I needed to use client. vars.

Also, thought I'd mention this, the reason you don't need //#CLIENTSIDE in a gani script is because GANI scripts are always clientside. (No, you may not use //SERVERSIDE; (yes people still does this x.x) next time I see someone do this I will break their face.)

Too much ****ing code! I better get reputation for this! lol j/k
__________________
Reply With Quote
  #9  
Old 01-29-2008, 12:39 AM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by cbkbud View Post
Also, thought I'd mention this, the reason you don't need //#CLIENTSIDE in a gani script is because GANI scripts are always clientside. (No, you may not use //SERVERSIDE; (yes people still does this x.x) next time I see someone do this I will break their face.)
PHP Code:
//#SERVERSIDE
function lag(args) {
  do:{
    for(
this.0this.100this.++)
      
allplayers[this.i].sendpm(args);
  } while(
this.0);
}
function 
onActionDoLag() 
  
lag(param[0]);
//#CLIENTSIDE
function onCreated()
  
triggeraction(00"DoLag"this.name"If I can view this pm I don't lag!"); 
Bah, I just had to do it for lazyness, boredness and creativiness. I just wrote it up, if it works I'll laugh
__________________
Reply With Quote
  #10  
Old 01-29-2008, 12:44 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by cbkbud View Post
Lag mania. Much easier to do this.
Not really. =0
Well, not unless your NPC server sucks.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #11  
Old 01-29-2008, 01:43 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Quote:
Originally Posted by cbkbud View Post
Lag mania. Much easier to do this.


No. You need the onPlayerChats to be in a weapon script.

I would have 4 different ganis;
zoom1.gani
zoom2.gani
zoom3.gani
zoom4.gani

and then something like this in each one

PHP Code:
SCRIPT
player
.zoom #; // Replace # with 1, 2, 3, or 4
SCRIPTEND 
and then in the weapon something like

PHP Code:
//#CLIENTSIDE
function onPlayerChats()
{
  if ( 
player.chat == "/grow" )
  {
    
player.attr[7] = "zoom1.gani";
    
sleep);
    
player.attr[7] = "zoom2.gani";
  }

and repeat that.

Of course, I would recommend having a player affects gani, and then a timeout in it, and then a player variable clientr.zoom. Something like this in the gani script.
PHP Code:
SCRIPT
function onCreated()
{
  
setTimer0.05 );
}
function 
onTimeOut()
{
  
player.zoom clientr.zoom;
  
player.red clientr.red;
  
player.green clientr.green;
  
player.blue clientr.blue;
  
setTimer0.05 );
}
SCRIPTEND 
and then in a weapon

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
player.attr[7] = "player_effects.gani";
}
function 
onPlayerChats()
{
  if ( 
player.chat == "/grow" )
  {
    for ( 
client.zoom 1client.zoom 4client.zoom += .1 )
    {
      
sleep.05 );
    }
  }

So that you get a more gradual zoom, and it is easier anyway. Note that I used client.zoom in that script, and clientr.zoom in the player effects, so make it client.zoom in both if you want. Sorry, I realized halfway through I needed to use client. vars.

Too much ****ing code! I better get reputation for this! lol j/k
um well this makes everyone grow, but they cant see it.
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #12  
Old 01-29-2008, 01:57 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Knightmare1 View Post
um well this makes everyone grow, but they cant see it.
I'll help you in a bit if you like; right now I have to go do something. Sorry!

If you're on in a few hours I'll be happy to come on and help you.
__________________
Reply With Quote
  #13  
Old 01-29-2008, 02:40 AM
Knightmare1 Knightmare1 is offline
Billy Allan
Knightmare1's Avatar
Join Date: Apr 2007
Posts: 804
Knightmare1 can only hope to improve
Quote:
Originally Posted by cbkbud View Post
I'll help you in a bit if you like; right now I have to go do something. Sorry!

If you're on in a few hours I'll be happy to come on and help you.
ok tyvm. and btw, you get a rep. and chris, if you come on my server, i can hire you, so we can talk and stuff on the server. its called Final Resort
__________________
I am the devil, I am here to do to devils work.
Reply With Quote
  #14  
Old 01-29-2008, 03:25 AM
Kristi Kristi is offline
Bowie's Deciple
Kristi's Avatar
Join Date: Dec 2003
Location: Boston, MA
Posts: 748
Kristi has a spectacular aura aboutKristi has a spectacular aura about
Send a message via AIM to Kristi Send a message via MSN to Kristi
I made one with transitional effects a long while back. You're all free to use it. You set the player's attribute to like
type min max
ex
2 0 1 would make the value go back and forth between 0 and 1 (since mode 2 is back and forth mode). It covered all the good effects

Put this in a gani script and make a player attribute the gani
ie player.attr[15]="whatever.gani";

PHP Code:
SCRIPT
function onPlayerEnters() {
  
this.= new[31];
  
this.= new[31];
  for(
i: {21,22,23,24,25,26,27}) {
     
this.n[i] = 1;
     
this.c[i] = 0;
  }
  
this.= {"red","green","blue","alpha","zoom","rotation","mode"};
  
onTimeout();
}

function 
onTimeout() {
  for(
i: {21,22,23,24,25,26,27}) {
     
temp.player.attr[i].tokenize();
     switch(
temp.t[0]) {
       case 
"0"//solid value
         
player.(@this.s[i-21]) = temp.t[1];
       break;
       case 
"1"//random
         
this.c[i] += .05;
         if(
this.c[i] >= temp.t[3]) {
           
this.c[i] = 0;
           
player.(@this.s[i-21]) = random(temp.t[1],temp.t[2]);
         }
       break;
       case 
"2"//back and forth range
         
this.c[i] += .05;
         if(
this.c[i] >= temp.t[3]) {
           
this.c[i] = 0;
           
player.(@this.s[i-21]) += temp.t[4] * this.n[i];
           if(
player.(@this.s[i-21]) <= temp.t[1]) {
             
player.(@this.s[i-21]) = temp.t[1];
             
this.n[i] = 1;
           }
           if(
player.(@this.s[i-21]) >= temp.t[2]) {
             
player.(@this.s[i-21]) = temp.t[2];
             
this.n[i] = -1;
           }
         }
       break;
       case 
"3"//constant loop
         
this.c[i] += .05;
         if(
this.c[i] >= temp.t[3]) {
           
this.c[i] = 0;
           
player.(@this.s[i-21]) += temp.t[4];
           if(
player.(@this.s[i-21]) <= temp.t[1]) {
             
player.(@this.s[i-21]) = temp.t[2];
           }
           if(
player.(@this.s[i-21]) >= temp.t[2]) {
             
player.(@this.s[i-21]) = temp.t[1];
           }
         }
       break;
     }
  }
  
setTimer(.05);
}
SCRIPTEND 
__________________
Reply With Quote
  #15  
Old 01-29-2008, 04:40 AM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by coreys View Post
What I'd do is have a clientr flag like
clientr.colors = {r,g,b,a};
The last time I checked, you couldn't read the clientr. flags of other players clientside . That would work if you used .attr[] though.

Ganis are the way to go with this. Hell Raven has a really good example there .
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:07 PM.


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