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 01-24-2007, 02:23 AM
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
Textshadow serverside?

Hello, I've made a simple function which creates some text in the format I'm using:

PHP Code:
function puttext(id,imx,imy,font,style,text,vis) {
  
showtext(id,imx,imy,font,style,text);
  
changeimgvis(id,vis);
  
changeimgzoom(id,0.5);
  
findimg(id).textshadow true;
  
findimg(id).shadowcolor = {0,0,0};
  
findimg(id).shadowoffset = {2,2};


I'm supplying it with ids less than 200 so the text appears to all players.

The text appears fine, however the shadow only appears on the client who created the text. Everyone else can see the text but not the shadow.

Is textshadow supported serverside?

Thanks.
__________________

Coming soon (Hopefully:P)

Last edited by JkWhoSaysNi; 01-24-2007 at 02:23 AM.. Reason: fixing tags
Reply With Quote
  #2  
Old 01-24-2007, 09:30 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by JkWhoSaysNi View Post
Hello, I've made a simple function which creates some text in the format I'm using:

PHP Code:
function puttext(id,imx,imy,font,style,text,vis) {
  
showtext(id,imx,imy,font,style,text);
  
changeimgvis(id,vis);
  
changeimgzoom(id,0.5);
  
findimg(id).textshadow true;
  
findimg(id).shadowcolor = {0,0,0};
  
findimg(id).shadowoffset = {2,2};


I'm supplying it with ids less than 200 so the text appears to all players.

The text appears fine, however the shadow only appears on the client who created the text. Everyone else can see the text but not the shadow.

Is textshadow supported serverside?

Thanks.
I think you answered your own question
However, what is it that you're trying to show? Would it be anything directly connected to the player? If yes, use an attribute with a gani attached.
Reply With Quote
  #3  
Old 01-24-2007, 03:53 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
I have to use a gani to attach text to a player for all to see?

It's easier for me just to create another text image and place it offset from the first :P
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #4  
Old 01-24-2007, 05:15 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by JkWhoSaysNi View Post
I have to use a gani to attach text to a player for all to see?

It's easier for me just to create another text image and place it offset from the first :P
That's if you only wanted for yourself to see it
Reply With Quote
  #5  
Old 01-24-2007, 07:12 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Quote:
Originally Posted by JkWhoSaysNi View Post
It's easier for me just to create another text image and place it offset from the first :P
It still wouldn't show serverside. The reason being that images (including showtext) cannot display serverside in less than half tile intervals. (.5) Which means you can't place a serverside graphic at like -2.2 of a player and have it display.

I believe this is done to prevent lag or something. I really don't know.

edit: also before you point out that your shadowoffset is 2,2... it's because shadow offset goes by pixel. so it's more like +.2,+.2 which again, won't display serverside
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #6  
Old 01-24-2007, 09:35 PM
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
The best way to display such things is using attr[] - you can put scripts and variables in there.
The serverside sendtext() has just been added recently, the findimg() function is working but the variable that is returned currently doesn't have any attributes. Recent attributes like textshadow is not working for showimgs/findimgs below index 200 anyway - you should use attr[] instead because it is simple to use and gives unlimited possiblities.
Reply With Quote
  #7  
Old 01-24-2007, 11:11 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
I can't find any examples of attr[] usage.

Should I just use

player.attr[1] = findimg(id) ?


It doesn't seem to work. I'm using indexes over 200 and nobody can see text from anyone else.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #8  
Old 01-25-2007, 10:14 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by JkWhoSaysNi View Post
I can't find any examples of attr[] usage.

Should I just use

player.attr[1] = findimg(id) ?


It doesn't seem to work. I'm using indexes over 200 and nobody can see text from anyone else.
I'd use them above 3, as attr[1] is the hat, attr[2] is the shield and attr[3] is the head of the player. I'd place it on something like attr[9], or work your way up from three.
Reply With Quote
  #9  
Old 01-25-2007, 03:48 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
I'd use them above 3, as attr[1] is the hat, attr[2] is the shield and attr[3] is the head of the player. I'd place it on something like attr[9], or work your way up from three.
attr[2] isn't the shield, and attr[3] isn't the head of the player :]

They are listed in the player. vars
(player.headimg, player.bodyimg)
__________________
Reply With Quote
  #10  
Old 01-25-2007, 09:08 PM
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 Chompy View Post
attr[2] isn't the shield, and attr[3] isn't the head of the player :]

They are listed in the player. vars
(player.headimg, player.bodyimg)
Still, I would probably use higher attr values because attr[2] and attr[3] are commonly used by ganis.
__________________
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
  #11  
Old 01-25-2007, 09:11 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
attr[2] isn't the shield, and attr[3] isn't the head of the player :]

They are listed in the player. vars
(player.headimg, player.bodyimg)
Ah yes, I am mistaken!
HTML Code:
DEFAULTHEAD head19.png
DEFAULTBODY body.png
I was doing gani's the other day too, slipped my mind! Thanks
Reply With Quote
  #12  
Old 01-25-2007, 09:53 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
I tried putting it in attr[9]

Still only the person who's clientside script created the image can see it.

Should I use IDs below 200?
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #13  
Old 01-25-2007, 11:06 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
I tried putting it in attr[9]

Still only the person who's clientside script created the image can see it.

Should I use IDs below 200?
Of course, otherwise its clientsided (unless the image is shown serverside).
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #14  
Old 01-25-2007, 11:46 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
I've tried with indexes less than 200, the text shows but the shadow doesn't.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #15  
Old 01-26-2007, 01:46 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
Like I said the new attributes like textshadow are not sent. You need to use attr[] and gani scripts, like
PHP Code:
player.attr[1] = "myscript.gani";
player.attr[2] = "mytext"
And in the myscript.tgani you put something like this:
PHP Code:
SCRIPT
function onPlayerEnters() {
  
with (findimg(200)) {
    
player.x;
    
player.y;
    
text player.attr[2];
    
textshadow true;
  }
}
SCRIPTEND 
That gani script is executed on each client, so everyone will see it.
Reply With Quote
  #16  
Old 01-26-2007, 02:16 AM
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, i see.

Thanks
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #17  
Old 01-26-2007, 03:32 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Wait so I'm a little confused attr[] can be used outside of gani's?

so for example:
PHP Code:
player.attr[1] = showtext(); //with valid params and arguments 
is valid?
Reply With Quote
  #18  
Old 01-26-2007, 03:36 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 Rapidwolve View Post
Wait so I'm a little confused attr[] can be used outside of gani's?
.. of course. They could back in gs1 aswell.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #19  
Old 01-26-2007, 08:21 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
is there any way to call a function from a gani?

I tried:

player.attr[2] = "my.gani";
player.attr[2].te****nction();

te****nction is declared as public in the gani. Is there any way to do this?


Also, doing as Stefan suggests and using with (findimg(200)) { (i had to change it to findweapon("name").findimg(200) for it to work)...

I have many people with this text attached to them, every time the action is triggered it updates them all, even though I only want it to update the text for the player that triggered it and not everyone elses.
__________________

Coming soon (Hopefully:P)

Last edited by JkWhoSaysNi; 01-26-2007 at 10:02 PM..
Reply With Quote
  #20  
Old 01-27-2007, 09:13 AM
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 JkWhoSaysNi View Post
is there any way to call a function from a gani?

I tried:

player.attr[2] = "my.gani";
player.attr[2].te****nction();

te****nction is declared as public in the gani. Is there any way to do this?


Also, doing as Stefan suggests and using with (findimg(200)) { (i had to change it to findweapon("name").findimg(200) for it to work)...

I have many people with this text attached to them, every time the action is triggered it updates them all, even though I only want it to update the text for the player that triggered it and not everyone elses.
What is the point? From what it sounds like you are explaining, there is a much easier way to do this.
__________________
Do it with a DON!
Reply With Quote
  #21  
Old 01-27-2007, 05:07 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
you can even use triggerserver(); in gani scripts, so I think functions should work to?
__________________
Reply With Quote
  #22  
Old 01-28-2007, 04:05 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
you can even use triggerserver(); in gani scripts, so I think functions should work to?
You can? Why would you want to?
Reply With Quote
  #23  
Old 01-28-2007, 10: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 Chandler View Post
You can? Why would you want to?
Why? Maybe for one-use gani scripts maybe?
I just said it because it works :]
__________________
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 07:12 PM.


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