Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Dissapearence. (https://forums.graalonline.com/forums/showthread.php?t=86585)

Unkownsoldier 06-28-2009 03:58 PM

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?

Gambet 06-28-2009 04:06 PM

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.

Unkownsoldier 06-28-2009 05:13 PM

Do you think you could give me gs1, so I could use in editor?

fowlplay4 06-28-2009 05:20 PM

I think this should work.. eww gs1..

PHP Code:

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



Crono 06-28-2009 05:27 PM

Gs1 looks so much easier and simpler to follow.

Unkownsoldier 06-28-2009 05:33 PM

Quote:

Originally Posted by fowlplay4 (Post 1502358)
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

DustyPorViva 06-28-2009 05:55 PM

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.

Unkownsoldier 06-28-2009 06:17 PM

Nah its a tv.

Robin 06-28-2009 09:34 PM

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?

Pelikano 07-01-2009 05:32 PM

Quote:

Originally Posted by Robin (Post 1502460)
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

LoneAngelIbesu 07-01-2009 06:32 PM

Quote:

Originally Posted by Pelikano (Post 1503337)
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! :rolleyes:

I don't know how you'd really explain this. "Look up strequals()"? That's not very helpful.

Frankie 07-01-2009 06:38 PM

Quote:

Originally Posted by Robin (Post 1502460)
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..

DustyPorViva 07-01-2009 06:48 PM

Quote:

Originally Posted by Frankie (Post 1503348)
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.

LoneAngelIbesu 07-01-2009 07:33 PM

Quote:

Originally Posted by DustyPorViva (Post 1503350)
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.

DustyPorViva 07-01-2009 07:37 PM

Quote:

Originally Posted by LoneAngelIbesu (Post 1503358)
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.

Unkownsoldier 07-01-2009 09:16 PM

Quote:

Originally Posted by DustyPorViva (Post 1503359)
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?

DustyPorViva 07-01-2009 09:54 PM

http://wiki.graal.net/index.php/Gscript

xXziroXx 07-01-2009 09:58 PM

I have no problem in helping people with their scripts, but that assumes they actually tried making it on their own first.

Skyld 07-01-2009 11:54 PM

Quote:

Originally Posted by LoneAngelIbesu (Post 1503358)
any good manual would have given the same information Gambet did.

http://wiki.graal.us/onPlayerChats

LoneAngelIbesu 07-02-2009 02:32 AM

Quote:

Originally Posted by DustyPorViva (Post 1503359)
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...

Hiro 07-02-2009 03:51 AM

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?

xXziroXx 07-02-2009 03:57 AM

Quote:

Originally Posted by Hiro (Post 1503451)
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).

Hiro 07-02-2009 04:08 AM

Quote:

Originally Posted by xXziroXx (Post 1503457)
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

Angel_Light 07-02-2009 07:50 AM

Quote:

Originally Posted by Hiro (Post 1503460)
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.


All times are GMT +2. The time now is 01:59 PM.

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