Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-10-2007, 08: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
gani params + player.attr[]

Well, this is what I am doing

PHP Code:
//#CLIENTSIDE
funciton onCreated()
{
  
player.attr10] = "";
  
player.attr10] = "chompy_float-text.gani,+12";

This is what I do to show the gani, now..

In the gani script I am using emitter to show some text at the players position, but it won't recieve params[ 0] (which should be +12)...
so the emitter is suppose to show +12 as text, but it doesn't show anything at all..

Anyone know what's not working?
__________________
Reply With Quote
  #2  
Old 02-10-2007, 08:54 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
Hmm, I got it to work, by using two attrs, BUT!

When I use emitters (emitter.particle.text) in the gani script, then only the client can see it, the text :[

Which is quite annoying..
__________________
Reply With Quote
  #3  
Old 02-10-2007, 11:12 PM
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
Quote:
Originally Posted by Chompy View Post
Hmm, I got it to work, by using two attrs, BUT!

When I use emitters (emitter.particle.text) in the gani script, then only the client can see it, the text :[

Which is quite annoying..
Is the text itsself assigned to an attr?
__________________
Reply With Quote
  #4  
Old 02-11-2007, 12:27 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 Kristi View Post
Is the text itsself assigned to an attr?
I did

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
player.attr10] = "";
  
player.attr10] = "chompy_float-text.gani";
  
player.attr11] = "";
  
player.attr11] = "+12";

When I do that, only I can see the '+12' text, and no others.. quite annoying
__________________
Reply With Quote
  #5  
Old 02-11-2007, 12:29 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Chompy View Post
I did

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
player.attr10] = "";
  
player.attr10] = "chompy_float-text.gani";
  
player.attr11] = "";
  
player.attr11] = "+12";

When I do that, only I can see the '+12' text, and no others.. quite annoying
Uhm, why are you making the attributes blank before assigning a value..?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 02-11-2007, 01:04 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 xXziroXx View Post
Uhm, why are you making the attributes blank before assigning a value..?
>_>

I know I don't need it for the attr 11, but I have to make it blank before assigning it to a gani..
__________________
Reply With Quote
  #7  
Old 02-11-2007, 01:45 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
Quote:
Originally Posted by Chompy View Post
I did

PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
player.attr10] = "";
  
player.attr10] = "chompy_float-text.gani";
  
player.attr11] = "";
  
player.attr11] = "+12";

When I do that, only I can see the '+12' text, and no others.. quite annoying
may i see the code in the gani?
__________________
Reply With Quote
  #8  
Old 02-11-2007, 02:15 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
PHP Code:
SCRIPT
function onCreated()
{
  
thiso.text player.attr11];
  
withfindimg20))
  {
    
attachtoowner true;
    
layer 2;
    
player.random( -0.5, -1);
    
player.random( -1, -0.1);

    
emitter.continueafterdestroy true;
    
emitter.nrofparticles 1;
    
emitter.emitautomatically false;

    
emitter.particle.lifetime 0.75;
    
emitter.particle.text thiso.text;
    
emitter.particle.mode 1;
    
    
emitter.particle.red 0;
    
emitter.particle.blue 0;
    
emitter.particle.green 1;
    
    
emitter.particle.style "b";
    
emitter.particle.alpha 1;
    
emitter.particle.zoom 0.95;

    
emitter.particle.angle pi 2;
    
emitter.particle.speed 1;

    
emitter.addlocalmodifier"range"0.3750.875"alpha""replace"10);
    
emitter.addlocalmodifier"range"0.10.75"speed""replace"42);
    
    
emitter.emit();
  }

SCRIPTEND 
__________________
Reply With Quote
  #9  
Old 02-11-2007, 10:30 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
HTML Code:
SCRIPT
function onPlayerEnters()
{
  temp.messageText = player.attr[11];
  with(findimg(10))
  {
    attachtoowner = true;
    layer = 2;
    x = player.x - random( -0.5, -1);
    y = player.y - random( -1, -0.1);

    with (emitter)
    {
      continueafterdestroy = true;
      nrofparticles = 1;
      emitautomatically = false;

      with (particle)
      {
        lifetime = 0.75;
        text = temp.messageText;
        mode = 1;
    
        red = 0;
        blue = 0;
        green = 1;
    
        style = "b";
        alpha = 1;
        zoom = 0.95;

        particle.angle = pi / 2;
        particle.speed = 1;
      }

      addlocalmodifier("range", 0.375, 0.875, "alpha", "replace", 1, 0);
      addlocalmodifier("range", 0.1, 0.75, "speed", "replace", 4, 2);
      emit();
    }
  }
} 
SCRIPTEND
Should work
Reply With Quote
  #10  
Old 02-11-2007, 11:13 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Chompy View Post
>_>

I know I don't need it for the attr 11, but I have to make it blank before assigning it to a gani..
No you dont..
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #11  
Old 02-11-2007, 11:22 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 Chandler View Post
HTML Code:
SCRIPT
function onPlayerEnters()
{
  temp.messageText = player.attr[11];
  with(findimg(10))
  {
    attachtoowner = true;
    layer = 2;
    x = player.x - random( -0.5, -1);
    y = player.y - random( -1, -0.1);

    with (emitter)
    {
      continueafterdestroy = true;
      nrofparticles = 1;
      emitautomatically = false;

      with (particle)
      {
        lifetime = 0.75;
        text = temp.messageText;
        mode = 1;
    
        red = 0;
        blue = 0;
        green = 1;
    
        style = "b";
        alpha = 1;
        zoom = 0.95;

        particle.angle = pi / 2;
        particle.speed = 1;
      }

      addlocalmodifier("range", 0.375, 0.875, "alpha", "replace", 1, 0);
      addlocalmodifier("range", 0.1, 0.75, "speed", "replace", 4, 2);
      emit();
    }
  }
} 
SCRIPTEND
Should work
Hmm, still only shows it for the client (myself), I can't see it on other players;

I am testing this with two players (myself and the gani maker),
we both have the same wnpc which trigger the attr's.
But, when I update the wnpc, only I, as the client can see the emitter text?

Is it me, should I use emitter.particle.text? I could use particle.emitter.code... hmm.. I gotta test the code one




Quote:
Originally Posted by xXziroXx View Post
No you dont..
I just tested it at my server; without clearing the attr before assigning it to a gani result in that it will only show the gani once (that happened to me), and with clearing the attr before assigning it to a gani will allow it to show everytime I update the wnpc (that happened to me..)
__________________
Reply With Quote
  #12  
Old 02-11-2007, 07:23 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Chompy View Post
Hmm, still only shows it for the client (myself), I can't see it on other players;

I am testing this with two players (myself and the gani maker),
we both have the same wnpc which trigger the attr's.
But, when I update the wnpc, only I, as the client can see the emitter text?

Is it me, should I use emitter.particle.text? I could use particle.emitter.code... hmm.. I gotta test the code one
Shouldn't really effect it.
Make it display random integers and then check if you see the same text?
Reply With Quote
  #13  
Old 02-12-2007, 04:21 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 Chandler View Post
Shouldn't really effect it.
Make it display random integers and then check if you see the same text?
I see the text, whatever I change the player.attr[ 11] to..
Its just that, only I can see the text, whatever I do, only I can see the emitter text.. quite annoying
__________________
Reply With Quote
  #14  
Old 02-12-2007, 07:27 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Chompy View Post
I see the text, whatever I change the player.attr[ 11] to..
Its just that, only I can see the text, whatever I do, only I can see the emitter text.. quite annoying
Ahh, I see. Instead of the emitter, try making it showtext? just as a test for now
Reply With Quote
  #15  
Old 02-12-2007, 08:38 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 Chandler View Post
Ahh, I see. Instead of the emitter, try making it showtext? just as a test for now
That's what I did before, but then the text went flying around (the anis were flying around, randomly appearing), but then I used showani.. hmm
__________________
Reply With Quote
  #16  
Old 02-12-2007, 11:36 PM
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
its because the ani is already created. "" doesnt unset it in other players eyes, and also, it doesnt update that fast. setting it in a timeout however would cause some major slowage.

i came up with this, its a slight modification to your gani
PHP Code:
SCRIPT
function onCreated()
{
  
withfindimg(202))
  {
    
attachtoowner true;
    
layer 2;
    
player.random( -0.5, -1);
    
player.random( -1, -0.1);

    
emitter.continueafterdestroy true;
    
emitter.nrofparticles 1;
    
emitter.emitautomatically false;

    
emitter.particle.lifetime 0.75;
    
emitter.particle.text player.attr[11];
    
emitter.particle.mode 1;
    
    
emitter.particle.red 0;
    
emitter.particle.blue 0;
    
emitter.particle.green 1;
    
    
emitter.particle.style "b";
    
emitter.particle.alpha 1;
    
emitter.particle.zoom 0.95;

    
emitter.particle.angle pi 2;
    
emitter.particle.speed 1;

    
emitter.addlocalmodifier"range"0.3750.875"alpha""replace"10);
    
emitter.addlocalmodifier"range"0.10.75"speed""replace"42);

  }
  
onTimeout();


function 
onTimeout() {
    if(
player.attr[17] != thiso.currentinstruction) {
      
thiso.currentinstruction player.attr[17];
      
with(findimg(202)) {
        
emmiter.particle.text player.attr[11];
        
emitter.emit();
      }
   }
   
setTimer(.05);
}
SCRIPTEND 
you keep the ani set as attr whatever (10 is which youre doing), then, you update player.attr[17] to something it wasnt before (anything really), and it will emit a new particle with whatever is stored in 11. Example weapon.
PHP Code:
//#CLIENTSIDE
function onCreated() 

  
player.attr[18] = "hellraventest15.gani";
  
player.attr[17] = "ab";


function 
onPlayerchats() {
  if(
player.chat == "greenytest") {
    
this.teststring player.attr[17] @ player.attr[17];
    
player.attr[17] = this.teststring.substring(1,2);
    
player.chat player.attr[17];
  }
  
player.attr[11] = "+12";

in that case, 17 is flipping between "ab" and "ba".

This method works best if youre constantly using this.
__________________
Reply With Quote
  #17  
Old 02-13-2007, 07:29 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
Thanks I made some small modifications and it now works perfectly
Thanks Kristi! Rep ++;
__________________
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 12:33 AM.


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