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 04-26-2007, 10:55 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Attr serverside

Well, it doesn't seem to display it correctly... It's showing it clientside, however it refuses to display it serverside.

Here's how I activate it, it removes the attr then re-assigns it. Which works fine

HTML Code:
      core.onremoveAttr(temp.par1[0]);
      core.assignAttr({temp.par1[0], temp.par1[1]}, true);
Here's how I trigger the code

HTML Code:
triggerclient("weapon", "-systemMain", "editAttr", {{4}, {"c_player-displaytext.gani, " @ temp.messageText}});
Here's the gani script:

HTML Code:
SCRIPT
//#CLIENTSIDE
function onPlayerEnters()
{
  temp.messageText = player.attr[4].tokenize()[1];
  this.imageIndex++;
  
  if (this.imageIndex > 5)
    this.onHideImage(0);

  with(findimg(this.imageIndex))
  {
    attachtoowner = true;
    layer = 3; 
    x = (player.x + 1);
    y = (player.y - 1);

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

      nrofparticles = 1;

      with (particle)
      {
        lifetime = 0.9;
        text = temp.messageText;
        mode = 0;
    
        red = (temp.messageText.starts("-")? 1: 0);
        blue = 0;
        green = (temp.messageText.starts("+")? 1: 0);
    
        style = "bi";
        alpha = 1;
        zoom = 1;

        angle = (pi / 1);
        speed = 4;
      }

      addlocalmodifier("range", 0.375, 0.875, "alpha", "replace", 1, 0);
      addlocalmodifier("range", 0.1, 0.75, "speed", "replace", 4, 1);
      
      this.emit();
    }
  }
  scheduleevent(0.9, "HideImage", this.imageIndex); 
} 

function onHideImage(messageIndex)
{
  hideimg(temp.messageIndex);
  this.imageIndex--;
}
SCRIPTEND
Anyone have any ideas? thanks
Reply With Quote
  #2  
Old 04-26-2007, 04:52 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
You only init the particle engine once, so its stuck with the text you init it at.
You need to change the emitters text in some event.
__________________
Reply With Quote
  #3  
Old 04-26-2007, 05:18 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Kristi View Post
You only init the particle engine once, so its stuck with the text you init it at.
You need to change the emitters text in some event.
No, it's displaying all that fine.
It isn't displaying any text serverside...
Reply With Quote
  #4  
Old 04-26-2007, 05:49 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
People seem to try to fix things with other people's scripts that aren't broken all too often.

Anyhow, whats this serverside part you speak of? I don't get quite what you're talking about.
__________________
Reply With Quote
  #5  
Old 04-26-2007, 06:05 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Inverness View Post
People seem to try to fix things with other people's scripts that aren't broken all too often.

Anyhow, whats this serverside part you speak of? I don't get quite what you're talking about.
When playerA hits a playerB, playerB can only see the effect. Shouldn't playerA also see it?
Reply With Quote
  #6  
Old 04-26-2007, 09:05 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
You have the script in the gani clientsided, remove that and it should work fine
Reply With Quote
  #7  
Old 04-26-2007, 09:12 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Rapidwolve View Post
You have the script in the gani clientsided, remove that and it should work fine
I.. don't think that's the solution. You should always have GANI scripting working clientside.
__________________
Skyld
Reply With Quote
  #8  
Old 04-26-2007, 09:14 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 Rapidwolve View Post
You have the script in the gani clientsided, remove that and it should work fine
all gani scripts are clientsided -.- to the gani thats just a comment.

No chandler, on player enters only occurs to another player at the moment they first see you since login, after that the onPlayerEnters will not trigger again for that person. therefore, whatever you initilized the text in the emitter to will stay that way in their eyes.

Inverness, stop with the unneccessary attacking. It gets old.

if you are removing the ani then resetting it (with either set ani or an attribute) within the same cycle, that wont get sent out ot the other players, just locally. the other players get updated with new information at the end of the cycle. if you set a players attr to 3 then "hi" then 2 then "ho" whatever, and then the cycle ends, they will only update it with "ho"
__________________
Reply With Quote
  #9  
Old 04-26-2007, 09:15 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Well I was just saying because I work with GANI scripts all the time and everything Chandler is doing looks fine to me. The only thing I noticed that his had that mine didnt was the clientside.
Reply With Quote
  #10  
Old 04-26-2007, 09:34 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 Rapidwolve View Post
Well I was just saying because I work with GANI scripts all the time and everything Chandler is doing looks fine to me. The only thing I noticed that his had that mine didnt was the clientside.
Because gani scripts are clientside-only, so it doesn't matter if you have that little line or not

Can't go serverside in ganises :[
__________________
Reply With Quote
  #11  
Old 04-26-2007, 09:42 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Its odd the onPlayerEnters() is triggered only once in the gani, is there a reason for it?
Can't say much though since I rarely mess with Gani scripts.
Quote:
Originally Posted by Kristi View Post
Inverness, stop with the unneccessary attacking. It gets old.
I'm in school, had to do something to alleviate my boredom. Though I still didn't get my problem fixed . It doesn't really matter so much now that I'm no longer working on that project due to limitations in the engine but I would still like to get that engine bug checked out, and I know its an engine bug.
__________________
Reply With Quote
  #12  
Old 04-26-2007, 11:25 PM
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 Inverness View Post
I'm in school, had to do something to alleviate my boredom.
Not really an excuse..
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #13  
Old 04-27-2007, 12:07 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by xXziroXx View Post
Not really an excuse..
I don't care. People who try to correct things without understanding them irritate me. Same with people who dodge questions.
__________________
Reply With Quote
  #14  
Old 04-27-2007, 12:07 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
When you change the attr[] on serverside then it should correctly invoke the onPlayerEnters() event on the clientside (also make sure the gani is not CONTINUOUS)
When it doesnt display the text eventually also try to echo() the text in onPlayerEnters()
Reply With Quote
  #15  
Old 04-27-2007, 08:15 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Stefan View Post
When you change the attr[] on serverside then it should correctly invoke the onPlayerEnters() event on the clientside (also make sure the gani is not CONTINUOUS)
When it doesnt display the text eventually also try to echo() the text in onPlayerEnters()
It's changing it clientside, maybe that's the problem?


Kristi: Thanks, however I did ''remove'' the attr from the player when I wanted a new message to show.

Thanks everyone for the replys
Reply With Quote
  #16  
Old 04-27-2007, 04:42 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 Chandler View Post
It's changing it clientside, maybe that's the problem?


Kristi: Thanks, however I did ''remove'' the attr from the player when I wanted a new message to show.

Thanks everyone for the replys
yeah, you cant just remove and reset, because that means you removed it and set it again, but to everyone else when you updated it, the ani stayed the same since it only sends out the last value.
__________________
Reply With Quote
  #17  
Old 04-27-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 Kristi View Post
yeah, you cant just remove and reset, because that means you removed it and set it again, but to everyone else when you updated it, the ani stayed the same since it only sends out the last value.
(Should I make it serverside? lol)
Reply With Quote
  #18  
Old 04-27-2007, 11:16 PM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
Quote:
Originally Posted by Kristi View Post
No chandler, on player enters only occurs to another player at the moment they first see you since login, after that the onPlayerEnters will not trigger again for that person. therefore, whatever you initilized the text in the emitter to will stay that way in their eyes.
Really? In my gani scripts, onPlayerEnters() always seems to be called more then once... That is why I have a problem with emitters usually since the addlocalmodifier functions and such are often recalled (when placed in the onPlayerEnters).
__________________
Do it with a DON!
Reply With Quote
  #19  
Old 04-27-2007, 11:52 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by zokemon View Post
Really? In my gani scripts, onPlayerEnters() always seems to be called more then once... That is why I have a problem with emitters usually since the addlocalmodifier functions and such are often recalled (when placed in the onPlayerEnters).
In GANI scripts, onPlayerEnters() is tied to the attr[]s I think.
__________________
Skyld
Reply With Quote
  #20  
Old 04-28-2007, 11:59 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Making it serverside didn't do ANYTHING.
Reply With Quote
  #21  
Old 04-29-2007, 05:05 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 Chandler View Post
Making it serverside didn't do ANYTHING.
that wouldnt work, youd either have to remove the gani as attr, wait some time, and then set it, isntead of setting it in the same cycle.

the way i suggest around it is that have a timeout in the gani script check if the text attr has changed, and if it has, update it with findimg in the timeout.
__________________
Reply With Quote
  #22  
Old 04-29-2007, 08:41 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by Kristi View Post
that wouldnt work, youd either have to remove the gani as attr, wait some time, and then set it, isntead of setting it in the same cycle.

the way i suggest around it is that have a timeout in the gani script check if the text attr has changed, and if it has, update it with findimg in the timeout.
Ahhh, a timeout!
Sucks, thanks

Last edited by Chandler; 04-29-2007 at 11:26 AM..
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:02 PM.


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