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 01-24-2009, 12:34 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
ganicheck&teamhelp

I've got a anyoning problem.
I wanna have a script like this:
if (player.ani == "swim.gani") {hide;}

I've tryed a LOT to fix this but nothing worked,
someone can help me?


I've also got a problem with making a team, like
if (playertouchsme) {player.guild == "Blue Team"}

ive got NO idea so I just wrote this

someone can help?
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #2  
Old 01-24-2009, 01:32 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Schetti View Post
I've got a anyoning problem.
I wanna have a script like this:
if (player.ani == "swim.gani") {hide;}

I've tryed a LOT to fix this but nothing worked,
someone can help me?


I've also got a problem with making a team, like
if (playertouchsme) {player.guild == "Blue Team"}

ive got NO idea so I just wrote this

someone can help?
Firstly, you don't include the .gani suffix.

Secondly, you're mixing GS1 with GS2. A big no no.

Thirdly, I think setting player.guild is serverside only, in my experience. Plus, == is a comparison operator. You probably want to do player.guild = "Blue Team"

I could help you better if you detailed your exact problem and posted the full code.
Reply With Quote
  #3  
Old 01-24-2009, 02:12 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
where I mixed GS1 and 2?
player.guild "Blue Team" NO
I could help you better if you detailed your exact problem and posted the full code.
thats all I got... I never got teached by someone how to write those LOOONG scripts
I actually didnt get teached by anyone
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #4  
Old 01-24-2009, 02:17 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Schetti View Post
where I mixed GS1 and 2?
player.guild "Blue Team" NO
I could help you better if you detailed your exact problem and posted the full code.
thats all I got... I never got teached by someone how to write those LOOONG scripts
I actually didnt get teached by anyone
Yes. if (playertouchsme) is a GS1 event. The GS2 equivilent would be function onPlayerTouchsMe()
Reply With Quote
  #5  
Old 01-24-2009, 05:23 PM
cyan3 cyan3 is offline
Registered User
cyan3's Avatar
Join Date: Nov 2005
Location: England
Posts: 2,919
cyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant future
Quote:
Originally Posted by Schetti View Post
where I mixed GS1 and 2?
player.guild "Blue Team" NO
This is how it would work attached to an NPC.

PHP Code:
// NPC made by Felix Lionheart
if (created) {
  
showcharacter;
  
setcharprop #3,khead12.png;
  
setcharprop #n,Dude;
  
setcharprop #8,kmabody106.png;
  
setcharprop #P4,bshield23.png;
  
setcharprop #P(1),khairs33.png;
  
setcharprop #P(3),bsword28.png;
  
setcharprop #P(5),klegs33.png;
  
setcharprop #P(6),kmarms117.png;
  
setcharprop #P7,gk_cloak7.gif;
  
dir 2;
  
setcharani human2_sword_idle,;
  
ap 100;

function 
onPlayerTouchsMe() {
  
player.guild "Blue Team";
 }

Quote:
Originally Posted by Schetti View Post
thats all I got... I never got teached by someone how to write those LOOONG scripts
I actually didnt get teached by anyone
I myself didn't get taught scripting by anyone. I researched the graal bible and other scripts to find the functions ect.

Last edited by cyan3; 01-24-2009 at 05:37 PM..
Reply With Quote
  #6  
Old 01-24-2009, 06:19 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by cyan3 View Post
This is how it would work attached to an NPC.

PHP Code:
// NPC made by Felix Lionheart
if (created) {
  
showcharacter;
  
setcharprop #3,khead12.png;
  
setcharprop #n,Dude;
  
setcharprop #8,kmabody106.png;
  
setcharprop #P4,bshield23.png;
  
setcharprop #P(1),khairs33.png;
  
setcharprop #P(3),bsword28.png;
  
setcharprop #P(5),klegs33.png;
  
setcharprop #P(6),kmarms117.png;
  
setcharprop #P7,gk_cloak7.gif;
  
dir 2;
  
setcharani human2_sword_idle,;
  
ap 100;

function 
onPlayerTouchsMe() {
  
player.guild "Blue Team";
 }



I myself didn't get taught scripting by anyone. I researched the graal bible and other scripts to find the functions ect.
Don't put functions inside of other functions, even if you are mixing GS1 with GS2 it's bad practice.

PHP Code:
// NPC made by Felix Lionheart
if (created) {
  
showcharacter;
  
setcharprop #3,khead12.png;
  
setcharprop #n,Dude;
  
setcharprop #8,kmabody106.png;
  
setcharprop #P4,bshield23.png;
  
setcharprop #P(1),khairs33.png;
  
setcharprop #P(3),bsword28.png;
  
setcharprop #P(5),klegs33.png;
  
setcharprop #P(6),kmarms117.png;
  
setcharprop #P7,gk_cloak7.gif;
  
dir 2;
  
setcharani human2_sword_idle,;
  
ap 100;
}

function 
onPlayerTouchsMe() {
  
player.guild "Blue Team";

__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #7  
Old 01-24-2009, 06:53 PM
cyan3 cyan3 is offline
Registered User
cyan3's Avatar
Join Date: Nov 2005
Location: England
Posts: 2,919
cyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant future
Quote:
Originally Posted by Tigairius View Post
Don't put functions inside of other functions, even if you are mixing GS1 with GS2 it's bad practice.
Oh, I didn't notice that they were mixed.
Reply With Quote
  #8  
Old 01-24-2009, 06:57 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
COOL! ^thanks, now ill try to make all my scripts like this.
nows just the other problem with water
but THANKS ANYWAY u helped me a lot
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #9  
Old 01-24-2009, 07:12 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
PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
setImg("block.png");
  
setTimer(.05);
}

function 
onTimeOut()
{
  if (
player.ani == "swim"hide;
  
  if (
visiblesetTimer(.05);

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #10  
Old 01-24-2009, 07:41 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
Huy!
Thanks!
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #11  
Old 01-24-2009, 08:22 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
umm...
a last question
is there a list where I can find many
function on...
commands listed?
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #12  
Old 01-24-2009, 08:40 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 Schetti View Post
umm...
a last question
is there a list where I can find many
function on...
commands listed?
You can just check functions from your GraalEditor in GS1 and convert them to GS2 yourself.

if (playerenters) { ... } > function onPlayerEnters() { ... }
if (timeout) { ... } > function onTimeOut() { ... }
if (created) { ... } > function onCreated() { ... }

Etcetera.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #13  
Old 01-24-2009, 08:48 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
if (carriesvase) { ... } > function onCarriesVase?
if (carriessign) { ... } > function onCarriessign?
?
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #14  
Old 01-24-2009, 08:49 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Schetti View Post
if (carriesvase) { ... } > function onCarriesVase?
if (carriessign) { ... } > function onCarriessign?
?
They're flags and not events, I believe, so it's perfectly fine to use if (carriessign). I'm not sure though.
Reply With Quote
  #15  
Old 01-24-2009, 08:52 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
kk
thanks
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #16  
Old 01-24-2009, 09:11 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
//#CLIENTSIDE
function onCreated()
{
setImg("block.png");
setTimer(.05);
}

function onTimeOut()
{
if (player.ani == "swim") hide;

if (visible) setTimer(.05);
}



lol, now its broken
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #17  
Old 01-24-2009, 10:24 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
Define broken.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #18  
Old 01-24-2009, 10:31 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
not working anymore
as I added this script into a NPC and touched water, he hided
I dont know what I did, but as I tryed again, nothing
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #19  
Old 01-25-2009, 01:05 AM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by Chompy View Post
The flag visible isn't true, so it won't carry on with the timeout.
PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
setImg("block.png");
  
setTimer(.05);
}

function 
onTimeOut()
{
  if (
player.ani == "swim") {
    
hide();
  } else 
show();
  if (
visiblesetTimer(.05);

use else
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #20  
Old 01-25-2009, 08:16 AM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
YAA
thanks!
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #21  
Old 01-25-2009, 03:23 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 Deas_Voice View Post
PHP Code:
//#CLIENTSIDE
function onCreated()
{
  
setImg("block.png");
  
setTimer(.05);
}

function 
onTimeOut()
{
  if (
player.ani == "swim") {
    
hide();
  } else 
show();
  if (
visiblesetTimer(.05);

use else
It makes no sense to check if visible equals true in your script.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #22  
Old 01-25-2009, 04:14 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
Quote:
Originally Posted by xXziroXx View Post
It makes no sense to check if visible equals true in your script.
yah i know, i just added else show();
btw it's your script
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #23  
Old 01-25-2009, 05:34 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 Deas_Voice View Post
yah i know, i just added else show();
btw it's your script
No it's not, the second you added that else show() it became YOUR script, since I would never script something that poorly. I don't think you were/are even aware of that else show() will never be triggered since if (visible) setTimer(.05) prevents that check to ever be triggered after it hides.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #24  
Old 01-25-2009, 05:38 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
that hide/show doesnt matter
I am going to change it into setlevel2 ...
its planned for potrace.
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #25  
Old 01-25-2009, 09:26 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 Schetti View Post
that hide/show doesnt matter
I am going to change it into setlevel2 ...
its planned for potrace.
setlevel2() won't work clientside.
__________________
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 08:06 AM.


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