Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gani Scripting Problem & fix (https://forums.graalonline.com/forums/showthread.php?t=25947)

Admins 03-19-2002 10:12 PM

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

mhermher 03-19-2002 10:17 PM

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 :rolleyes:


j/k



Stefan answer my PMs :( I want my account amde (Staff one)

Spanko 03-21-2002 12:05 AM

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.

Spanko 03-21-2002 12:44 AM

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.

thrashsoul 03-24-2002 12:15 AM

Hmm...
 
:confused: 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...

Spanko 03-24-2002 02:38 AM

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."

Spanko 03-24-2002 05:58 PM

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.

Saga2001 03-24-2002 08:16 PM

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...

03-25-2002 07:04 AM

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.

Spanko 03-25-2002 07:29 PM

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)

03-27-2002 08:43 AM

Oops, I forgot the Scipt and Script End when I did it, thanks Squeaky,


All times are GMT +2. The time now is 06:24 AM.

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