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
  #16  
Old 02-09-2007, 10:08 PM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
ah! You're right. It's being created serverside but destroyed clientside. I'll try destroying it serverside and see if it fixes it.

Edit: Thanks! That seems to have been my problem
__________________

Coming soon (Hopefully:P)

Last edited by JkWhoSaysNi; 02-09-2007 at 10:35 PM..
Reply With Quote
  #17  
Old 02-09-2007, 10:38 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
I'd recommend something like
HTML Code:
function onCreated()
{
  setTimer(5);
}
function onTimeout()
{
  this.destroy();
}
//#CLIENTSIDE
function onCreated()
{
  Yourclientsidepart...
}
Reply With Quote
  #18  
Old 02-09-2007, 10:43 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 Chompy View Post
Hmm, I've had this problem before (Float text), when the player is hurt, it places a gani at the players location with showani();
but sometimes they randomly appear around inside levels or on gmaps, like they
have just been hided or something.. anyone know how to destroy them (removing them from the level or something)?
Anyone can help me?
(Trying to destroy them from the gani)
__________________
Reply With Quote
  #19  
Old 02-09-2007, 10:51 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
Anyone can help me?
(Trying to destroy them from the gani)

Make the damage display a player.attribute. Remove the attribute once it's been used.
Reply With Quote
  #20  
Old 02-09-2007, 11:17 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
Make the damage display a player.attribute. Remove the attribute once it's been used.
Hmm, could you explain? :] I usually don't use player.attr for showing ganises :o
No experience at that area, the ganises with player.attrs :]
__________________
Reply With Quote
  #21  
Old 02-09-2007, 11:32 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, could you explain? :] I usually don't use player.attr for showing ganises :o
No experience at that area, the ganises with player.attrs :]
Sorry for the long reply. I had to chase six youths who have just thrown a snowball at my house. I did it back to theirs!

HTML Code:
function onActionclientside(curOption, curMessage)
{
  if (temp.curOption == "addAttr")
  {
    this.attrSize.add(temp.curMessage);
    this.onTimeout();
  }
}
function onTimeout()
{
  if (this.doCount > 0)
  {
    this.doCount -= 0.05;
    if (this.doCount <= 0)
    {
      this.attrSize.delete(0);
      this.doCount = 0;
    }
    setTimer(0.05);
    return true;
  }
  if (this.attrSize.size() > 0)
  {
    player.attr[3] = "myGani," @ this.attrSize[0];
    this.doCount = 5; //Alter this to how long the display lasts
    setTimer(0.05);
  }
}
Maybe something like this?
Reply With Quote
  #22  
Old 02-09-2007, 11: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
Sorry for the long reply. I had to chase six youths who have just thrown a snowball at my house. I did it back to theirs!

HTML Code:
function onActionclientside(curOption, curMessage)
{
  if (temp.curOption == "addAttr")
  {
    this.attrSize.add(temp.curMessage);
    this.onTimeout();
  }
}
function onTimeout()
{
  if (this.doCount > 0)
  {
    this.doCount -= 0.05;
    if (this.doCount <= 0)
    {
      this.attrSize.delete(0);
      this.doCount = 0;
    }
    setTimer(0.05);
    return true;
  }
  if (this.attrSize.size() > 0)
  {
    player.attr[3] = "myGani," @ this.attrSize[0];
    this.doCount = 5; //Alter this to how long the display lasts
    setTimer(0.05);
  }
}
Maybe something like this?
Hmm, can you explain what it does?
Still not getting the player.attr[] stuff :[

Got any easier examples?
__________________
Reply With Quote
  #23  
Old 02-09-2007, 11:44 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, can you explain what it does?
Still not getting the player.attr[] stuff :[

Got any easier examples?
Sure
HTML Code:
//#CLIENTSIDE
function onCreated()
{
  player.attr[3] = "bombermad_bomb.gani";
}
Would make the bombermad gani display over your graal character. Well, if you were to have that gani that is.

HTML Code:
//#CLIENTSIDE
function onPlayerChats()
{
  if (player.chat == ":setAttr")
  {
    temp.curAttr = player.chat.substring(8, 1);
    temp.curGani = player.chat.substring(9).trim();
    player.( @ "attr[" @ temp.curAttr @ "]") = (temp.curGani.ends(".gani")? temp.curGani: temp.curGani @ ".gani");
  }
}
:setAttr 3 myGani.gani
choose a gani from inside of your graal folder, which is a solid object for example.

Edit: I'll write a few documents explaining the advantages to using player attributes.

Last edited by Chandler; 02-09-2007 at 11:56 PM..
Reply With Quote
  #24  
Old 02-10-2007, 12:06 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
Sure
HTML Code:
//#CLIENTSIDE
function onCreated()
{
  player.attr[3] = "bombermad_bomb.gani";
}
Would make the bombermad gani display over your graal character. Well, if you were to have that gani that is.

HTML Code:
//#CLIENTSIDE
function onPlayerChats()
{
  if (player.chat == ":setAttr")
  {
    temp.curAttr = player.chat.substring(8, 1);
    temp.curGani = player.chat.substring(9).trim();
    player.( @ "attr[" @ temp.curAttr @ "]") = (temp.curGani.ends(".gani")? temp.curGani: temp.curGani @ ".gani");
  }
}
:setAttr 3 myGani.gani
choose a gani from inside of your graal folder, which is a solid object for example.

Edit: I'll write a few documents explaining the advantages to using player attributes.
Got it to work Thanks (btw, the :setattr stuff didn't work, made it into tokenize and had obj.starts(), but didn't work, but first example did, thanks!)

hmm, just one more thing.. on my server some weapons are faster, so alot of flaot texts will come..
so must I use a new player.attr for each flaot text, or can I use an existing attr more ganises?
__________________
Reply With Quote
  #25  
Old 02-10-2007, 12:57 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
Hmmm on Kingdoms we do it so that on serverside we set some player.attr[] to the gani script which displays the hp loss / damage taken. In the gani script onPlayerEnters() it emits a particle with "emitter.continueafterdestroy = true;" so the particle is continuing to move even if the gani script is deleted or restarted. To get several effects using the same gani script there are probably two says:
1. make the gani script being restarted, this can be done by setting the attr[] to "" and then setting the value again (it should be sent again and restart the script if it's not a CONTINUOUS gani, although I have not tested this fully yet)
2. store the actual data that should be displayed into another attr[] and in the gani script check if that data is changed and display another text or effect, let the gani script check for new data until it is removed (by using a 0.05 seconds timeout or so)
Reply With Quote
  #26  
Old 02-10-2007, 03:28 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 JkWhoSaysNi View Post
ah! You're right. It's being created serverside but destroyed clientside. I'll try destroying it serverside and see if it fixes it.

Edit: Thanks! That seems to have been my problem
You're welcome.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #27  
Old 02-10-2007, 06: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 Stefan View Post
Hmmm on Kingdoms we do it so that on serverside we set some player.attr[] to the gani script which displays the hp loss / damage taken. In the gani script onPlayerEnters() it emits a particle with "emitter.continueafterdestroy = true;" so the particle is continuing to move even if the gani script is deleted or restarted. To get several effects using the same gani script there are probably two says:
1. make the gani script being restarted, this can be done by setting the attr[] to "" and then setting the value again (it should be sent again and restart the script if it's not a CONTINUOUS gani, although I have not tested this fully yet)
2. store the actual data that should be displayed into another attr[] and in the gani script check if that data is changed and display another text or effect, let the gani script check for new data until it is removed (by using a 0.05 seconds timeout or so)
Can you display text with emitters? If so, how then?
__________________
Reply With Quote
  #28  
Old 02-12-2007, 03:27 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 Chompy View Post
Can you display text with emitters? If so, how then?
No ... that'd be weird.
Why would you want to do that?
__________________
Reply With Quote
  #29  
Old 02-12-2007, 04:12 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 cbkbud View Post
No ... that'd be weird.
Why would you want to do that?
I actualy you can display text with emitters ..

emitter.particle.text or emitter.particle.code
__________________
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 03:16 AM.


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