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 03-19-2002, 10:12 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
Gani Scripting Problem & fix

There is something in gani scripts which can
slow down the game a lot if used wrong:

never use normal variables as loop counter
like for (i=0; i<2; i++) ...

The problem is that gani scripts are not allowed
to read or change normal variables, only
this. variables. So the i++ will never change i
and the loop will go 10000 times (internal
protection against bad scripters . So better use
for (this.i=0; this.i<2; this.i++) ...

I have seen that problem in some ganis we used
in Graal2002 (torch and lamp) and fixed it, now
some places don't lag so much when walking around
/ entering the level
Reply With Quote
  #2  
Old 03-19-2002, 10:17 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
Quote:
Originally posted by Kaimetsu
Aha!!!

NOW I know why my gani script didn't work! I tried everything to fix it, and I must've missed that nuance >.<
lol, youre late


j/k



Stefan answer my PMs I want my account amde (Staff one)
Reply With Quote
  #3  
Old 03-21-2002, 12:05 AM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Quote:
Originally posted by Kaimetsu
Aha!!!

NOW I know why my gani script didn't work! I tried everything to fix it, and I must've missed that nuance >.<
Now I'm glad I always use this. variables anyway.
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #4  
Old 03-21-2002, 12:44 AM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Quote:
Originally posted by Kaimetsu


Ah, but that's slightly inefficient in some cases. It means every NPC keeps track of an i variable, even if its value doesn't need to be preserved.
Yeah, but it also means I never have to think about naming variables in the rare case they shouldn't have a this. prefix.
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #5  
Old 03-24-2002, 12:15 AM
thrashsoul thrashsoul is offline
Unregistered User
Join Date: Jan 2002
Posts: 595
thrashsoul is on a distinguished road
Send a message via AIM to thrashsoul
Question Hmm...

Well im getting a different screw up whenever im make
a gani it shows on graal shop,but when i go to graal it doesn't show the image i just shows the player.I saved the image to the Graal folder..hmmm...
Reply With Quote
  #6  
Old 03-24-2002, 02:38 AM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Re: Re: Hmm...

Quote:
Originally posted by Kaimetsu


This isn't related to gani scripting, is it?
You should sticky + lock this thread, it might spare a few a questions and a few times saying "Use the search option."
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #7  
Old 03-24-2002, 05:58 PM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Re: Re: Re: Re: Hmm...

Quote:
Originally posted by Kaimetsu


I dunno, I've never seen anybody post about gani scripts before. Most people who post questions here are still at the "WFT MY DOOR NOT WORK" stage.
Yes, but in a years time they'll be asking "WFT MY GANI SCRIPT NOT WORK" stage, and it'd be pain to normally find this post then.
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #8  
Old 03-24-2002, 08:16 PM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
Re: Re: Re: Re: Hmm...

Quote:
Originally posted by Kaimetsu


I dunno, I've never seen anybody post about gani scripts before. Most people who post questions here are still at the "WFT MY DOOR NOT WORK" stage.
hahahaha....thats funny. hahaha...don't sticky this thread about this. things in ganis, because that IS what the search feature is for...st00pid grim...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #9  
Old 03-25-2002, 07:04 AM
Guest
Posts: n/a
Can anyone explain to me how to work Gani scripting, I have tried scripting in the editor itself, and in notepad. In both cases it doesn't work. If it matters, I was trying to script light effects in a gani.
Reply With Quote
  #10  
Old 03-25-2002, 07:29 PM
Spanko Spanko is offline
Squeaker of Soles
Spanko's Avatar
Join Date: Nov 2001
Location: The Netherworl...lands
Posts: 1,366
Spanko is on a distinguished road
Send a message via ICQ to Spanko Send a message via AIM to Spanko Send a message via Yahoo to Spanko
Quote:
Originally posted by Frolic_rc9
Can anyone explain to me how to work Gani scripting, I have tried scripting in the editor itself, and in notepad. In both cases it doesn't work. If it matters, I was trying to script light effects in a gani.
You'll have to open the Gani with notepad, then go to it's bottom, add a SCRIPT and SCRIPTEND line, and put the script in between those two.
(You could check lamp_idle.gani for an example)
__________________

ICQ: 125283920
MSN: [email protected]
AIM: Squeax0r
Squeaker seems unable to access the forum using this account.. tis a sad day.
Now with occasional Asuka flavour! Ooops a bit too much...
Asuka should be king of Dustari!

"Y'know, some days even my lucky rocketship underpants don't even help."
Reply With Quote
  #11  
Old 03-27-2002, 08:43 AM
Guest
Posts: n/a
Oops, I forgot the Scipt and Script End when I did it, thanks Squeaky,
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:25 PM.


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