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
  #1  
Old 06-28-2009, 03:58 PM
Unkownsoldier Unkownsoldier is offline
Ignorance has no future
Join Date: Sep 2008
Posts: 1,287
Unkownsoldier is on a distinguished road
Dissapearence.

I am not a scripter, however I get by. I just need help on one little thing. This is for a level not an npc. I need a script or I would like a script, that would make a graphic disappear, when I say /off and re-appear when I say /on. Can anyone help me?
__________________
Look beyond the monitor.
Reply With Quote
  #2  
Old 06-28-2009, 04:06 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
hide() makes an image disappear, show() makes it reappear. To read a player's chat you would do
if (player.chat == "stuffHere"), so in your case:

PHP Code:
function onPlayerChats() {
  if (
player.chat == "/on") {
    
//Stuff
  
} else if (player.chat == "/off") {
    
//More Stuff
  
}


But if you're doing it in the offline editor then you won't be able to use GS2. Either way, you might have to play with it a bit so that it doesn't just hide for you but it hides for everyone else as well. There are block-type stuff posted around this section of the forums that already does similar things to what you want, just use the search function and search for hide() or dontBlock()/blockAgain() since it's similar concepts.
Reply With Quote
  #3  
Old 06-28-2009, 05:13 PM
Unkownsoldier Unkownsoldier is offline
Ignorance has no future
Join Date: Sep 2008
Posts: 1,287
Unkownsoldier is on a distinguished road
Do you think you could give me gs1, so I could use in editor?
__________________
Look beyond the monitor.
Reply With Quote
  #4  
Old 06-28-2009, 05:20 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
I think this should work.. eww gs1..

PHP Code:
if (playerchats) {
  if (
strequals(#c,/on)) {
    
show;
  }
  else if (
strequals(#c,/off)) {
    
hide;
  }

__________________
Quote:
Reply With Quote
  #5  
Old 06-28-2009, 05:27 PM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Gs1 looks so much easier and simpler to follow.
__________________
Reply With Quote
  #6  
Old 06-28-2009, 05:33 PM
Unkownsoldier Unkownsoldier is offline
Ignorance has no future
Join Date: Sep 2008
Posts: 1,287
Unkownsoldier is on a distinguished road
Quote:
Originally Posted by fowlplay4 View Post
I think this should work.. eww gs1..

PHP Code:
if (playerchats) {
  if (
strequals(#c,/on)) {
    
show;
  }
  else if (
strequals(#c,/off)) {
    
hide;
  }

Thanks that works ++rep
__________________
Look beyond the monitor.
Reply With Quote
  #7  
Old 06-28-2009, 05:55 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
If this is a block you might want to take interest in setshape, or else players can just manipulate the images to bypass the blocks.
Reply With Quote
  #8  
Old 06-28-2009, 06:17 PM
Unkownsoldier Unkownsoldier is offline
Ignorance has no future
Join Date: Sep 2008
Posts: 1,287
Unkownsoldier is on a distinguished road
Nah its a tv.
__________________
Look beyond the monitor.
Reply With Quote
  #9  
Old 06-28-2009, 09:34 PM
Robin Robin is offline
The secret of NIMH
Robin's Avatar
Join Date: Apr 2005
Location: Wales, UK
Posts: 515
Robin will become famous soon enough
Send a message via AIM to Robin
Sigh,

If Kaimetsu was here he'd be throwing around the ban hammer.

When was it okay to just script something for someone? Isn't it our responsibility to help people learn rather than just do it for them?
__________________

Reply With Quote
  #10  
Old 07-01-2009, 05:32 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano has a little shameless behaviour in the past
Quote:
Originally Posted by Robin View Post
Sigh,

If Kaimetsu was here he'd be throwing around the ban hammer.

When was it okay to just script something for someone? Isn't it our responsibility to help people learn rather than just do it for them?
It wasn't, but Darlene's rules on the forums are:

"Pretend you love everyone"

that's it
Reply With Quote
  #11  
Old 07-01-2009, 06:32 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by Pelikano View Post
It wasn't, but Darlene's rules on the forums are:

"Pretend you love everyone"

that's it
Complaining about Darlene, even though the thread is in no way related to her! How original!

I don't know how you'd really explain this. "Look up strequals()"? That's not very helpful.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #12  
Old 07-01-2009, 06:38 PM
Frankie Frankie is offline
xChugxLifex
Frankie's Avatar
Join Date: Feb 2008
Location: New York
Posts: 1,610
Frankie is a jewel in the roughFrankie is a jewel in the rough
Send a message via AIM to Frankie Send a message via MSN to Frankie
Quote:
Originally Posted by Robin View Post
Sigh,

If Kaimetsu was here he'd be throwing around the ban hammer.

When was it okay to just script something for someone? Isn't it our responsibility to help people learn rather than just do it for them?
when wasn't it okay to help someone?

besides, Gambet very well explained how the script worked.
fowlplay simply converted it into gs1.

I don't see the problem here..
__________________
*Sum41Freeeeek
*Frankie
Reply With Quote
  #13  
Old 07-01-2009, 06:48 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Frankie View Post
when wasn't it okay to help someone?

besides, Gambet very well explained how the script worked.
fowlplay simply converted it into gs1.

I don't see the problem here..
The rules is there because before the rule, this whole section was just spammed with script requests. "Can some1 plz give me draisine????" about x20 a week.
Reply With Quote
  #14  
Old 07-01-2009, 07:33 PM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by DustyPorViva View Post
The rules is there because before the rule, this whole section was just spammed with script requests. "Can some1 plz give me draisine????" about x20 a week.
Yeah, we understand why the rule is there. But, this is something incredibly elementary. It's not a draisine script, it's onPlayerChats()... any good manual would have given the same information Gambet did.
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #15  
Old 07-01-2009, 07:37 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by LoneAngelIbesu View Post
Yeah, we understand why the rule is there. But, this is something incredibly elementary. It's not a draisine script, it's onPlayerChats()... any good manual would have given the same information Gambet did.
And yet it's still here... so...

However, the point stands that this would be one of those slippery-slope scenarios. If this is okay, why wouldn't the next be? What if it's 10 very simple posts, or 50? The problem is it seems like most people who posts for these scripts have absolutely no interest in learning and just want to use this section to get whatever scripts they want/need. Some people are willing to help, some art not. The problem is when the small request here and there end up giving the impression it's okay, and everyone starts doing it.
Reply With Quote
  #16  
Old 07-01-2009, 09:16 PM
Unkownsoldier Unkownsoldier is offline
Ignorance has no future
Join Date: Sep 2008
Posts: 1,287
Unkownsoldier is on a distinguished road
Quote:
Originally Posted by DustyPorViva View Post
And yet it's still here... so...

However, the point stands that this would be one of those slippery-slope scenarios. If this is okay, why wouldn't the next be? What if it's 10 very simple posts, or 50? The problem is it seems like most people who posts for these scripts have absolutely no interest in learning and just want to use this section to get whatever scripts they want/need. Some people are willing to help, some art not. The problem is when the small request here and there end up giving the impression it's okay, and everyone starts doing it.
That's not true, I am trying to learn, but I like to view other scripts to see what works and why it works, instead of making my own, because it is easier to learn when I have an example in front of me. Btw, is there a page that has the vocabulary for gs2?
__________________
Look beyond the monitor.
Reply With Quote
  #17  
Old 07-01-2009, 09:54 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
http://wiki.graal.net/index.php/Gscript
Reply With Quote
  #18  
Old 07-01-2009, 09:58 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
I have no problem in helping people with their scripts, but that assumes they actually tried making it on their own first.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #19  
Old 07-01-2009, 11:54 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 LoneAngelIbesu View Post
any good manual would have given the same information Gambet did.
http://wiki.graal.us/onPlayerChats
__________________
Skyld
Reply With Quote
  #20  
Old 07-02-2009, 02:32 AM
LoneAngelIbesu LoneAngelIbesu is offline
master of infinite loops
LoneAngelIbesu's Avatar
Join Date: May 2007
Location: Toldeo, Ohio
Posts: 1,049
LoneAngelIbesu has a spectacular aura aboutLoneAngelIbesu has a spectacular aura about
Send a message via AIM to LoneAngelIbesu
Quote:
Originally Posted by DustyPorViva View Post
And yet it's still here... so...

However, the point stands that this would be one of those slippery-slope scenarios. If this is okay, why wouldn't the next be? What if it's 10 very simple posts, or 50? The problem is it seems like most people who posts for these scripts have absolutely no interest in learning and just want to use this section to get whatever scripts they want/need. Some people are willing to help, some art not. The problem is when the small request here and there end up giving the impression it's okay, and everyone starts doing it.
I see what you're saying... I don't disagree, but I do think we could easily cross that bridge when it comes to it; we aren't that shy to just post a link to one of the wikis. I just thought the Darlene snipe was immature, and that
Quote:
hide() makes an image disappear, show() makes it reappear. To read a player's chat you would do
if (player.chat == "stuffHere")
is no different than giving the code. It could very well be the example on GScript Wiki. In fact, I get asked all the time how to make something disappear via chat command, so it might be more useful of an example than the current ones...
__________________
"We are all in the gutter, but some of us are looking at the stars."
— Oscar Wilde, Lady Windermere's Fan
Reply With Quote
  #21  
Old 07-02-2009, 03:51 AM
Hiro Hiro is offline
\(^∀^)メ(≧∇≦)ノ
Hiro's Avatar
Join Date: Jan 2005
Posts: 1,965
Hiro has a spectacular aura aboutHiro has a spectacular aura about
Send a message via AIM to Hiro
honestly the wiki is too confusing for just anyone to go on it and learn how to script. it acts as if you already know the basics to scripting beforehand, and doesn't go in depth as to why such functions work or why using one command is better than the other. it doesn't tell you where to start when making a NPC, and it hardly describes all the functions and scripts i have seen being used. it's fractured, and asking on the forums for an answer is easier and quicker than looking at the wiki and "hoping" it works

i mean, you can't even test out much GS2 to see if you even did it correctly assuming you did learn it from the wiki. are people forced to post threads of "DID I DO THIS RIGHT?" instead of "HOW DO I DO THIS RIGHT?" when they are essentially the same thing?
Reply With Quote
  #22  
Old 07-02-2009, 03:57 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 Hiro View Post
i mean, you can't even test out much GS2 to see if you even did it correctly assuming you did learn it from the wiki.
Yes you can, anyone not blacklisted is given free access to Testbed Server if they contact Tig or any of the other administrator(s).
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #23  
Old 07-02-2009, 04:08 AM
Hiro Hiro is offline
\(^∀^)メ(≧∇≦)ノ
Hiro's Avatar
Join Date: Jan 2005
Posts: 1,965
Hiro has a spectacular aura aboutHiro has a spectacular aura about
Send a message via AIM to Hiro
Quote:
Originally Posted by xXziroXx View Post
Yes you can, anyone not blacklisted is given free access to Testbed Server if they contact Tig or any of the other administrator(s).
well that's nice, because i know the editor didn't support GS2
Reply With Quote
  #24  
Old 07-02-2009, 07:50 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Quote:
Originally Posted by Hiro View Post
well that's nice, because i know the editor didn't support GS2
true, but there are a few programs that highlight the syntax for you. Gonstruct for example.
__________________
Deep into the Darkness peering...
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 01:58 PM.


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