Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Attr serverside (https://forums.graalonline.com/forums/showthread.php?t=73676)

Chandler 04-26-2007 10:55 AM

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

Kristi 04-26-2007 04:52 PM

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.

Chandler 04-26-2007 05:18 PM

Quote:

Originally Posted by Kristi (Post 1303294)
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...

Inverness 04-26-2007 05:49 PM

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.

Chandler 04-26-2007 06:05 PM

Quote:

Originally Posted by Inverness (Post 1303306)
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?

Rapidwolve 04-26-2007 09:05 PM

You have the script in the gani clientsided, remove that and it should work fine

Skyld 04-26-2007 09:12 PM

Quote:

Originally Posted by Rapidwolve (Post 1303329)
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.

Kristi 04-26-2007 09:14 PM

Quote:

Originally Posted by Rapidwolve (Post 1303329)
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"

Rapidwolve 04-26-2007 09:15 PM

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.

Chompy 04-26-2007 09:34 PM

Quote:

Originally Posted by Rapidwolve (Post 1303335)
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 :p

Can't go serverside in ganises :[

Inverness 04-26-2007 09:42 PM

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 (Post 1303333)
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 :frown:. 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.

xXziroXx 04-26-2007 11:25 PM

Quote:

Originally Posted by Inverness (Post 1303349)
I'm in school, had to do something to alleviate my boredom.

Not really an excuse.. :rolleyes:

Inverness 04-27-2007 12:07 AM

Quote:

Originally Posted by xXziroXx (Post 1303376)
Not really an excuse.. :rolleyes:

I don't care. People who try to correct things without understanding them irritate me. Same with people who dodge questions.

Admins 04-27-2007 12:07 AM

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()

Chandler 04-27-2007 08:15 AM

Quote:

Originally Posted by Stefan (Post 1303397)
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

Kristi 04-27-2007 04:42 PM

Quote:

Originally Posted by Chandler (Post 1303544)
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.

Chandler 04-27-2007 07:27 PM

Quote:

Originally Posted by Kristi (Post 1303595)
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)

zokemon 04-27-2007 11:16 PM

Quote:

Originally Posted by Kristi (Post 1303333)
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).

Skyld 04-27-2007 11:52 PM

Quote:

Originally Posted by zokemon (Post 1303667)
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.

Chandler 04-28-2007 11:59 PM

Making it serverside didn't do ANYTHING.

Kristi 04-29-2007 05:05 AM

Quote:

Originally Posted by Chandler (Post 1303977)
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.

Chandler 04-29-2007 08:41 AM

Quote:

Originally Posted by Kristi (Post 1304077)
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 :p


All times are GMT +2. The time now is 11:18 AM.

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