Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Gani Script, Problem (Still a script) (https://forums.graalonline.com/forums/showthread.php?t=47939)

Androk 09-13-2003 07:42 PM

Gani Script, Problem (Still a script)
 
I am having this strange problem. I made a script and implemented it into 2 ganis (Walking and idle), the script is identical, yet in idle state it does not work properly, but in walking one it does.

here is the part of the script that doesn't work properly:

NPC Code:

for (i=0;i<this.lines;i++) {
showtext 2001+i,playerx+3,playery-1-this.lines*.5+.5*i,Comic Sans MS,,#p(1+i);
changeimgcolors 2001+i,0,0,0,1;
changeimgzoom 2001+i,.6;
changeimgvis 2001+i,3;
}



In idle state it displays only 1 show text, instead of 2-4 (depending on this.lines variable). Does anyone know what's wrong?

GoZelda 09-13-2003 08:56 PM

Mh maybe because they both use i? though i doubt it. Also Check if it's both in SCRIPT and SCRIPTEND.

Ningnong 09-13-2003 09:41 PM

always use this.i.

"i" can be used by other npcs where as a this.var cannot.

Androk 09-13-2003 09:48 PM

Quote:

Originally posted by Ningnong
always use this.i.

"i" can be used by other npcs where as a this.var cannot.

I just changed it to that and it works 0.o I am freaked out.

I really didn'tthink it matterd, because of the way scripting works. i is usually bound withing a for loop so it is discarded after it has been used, and no NPC/Script etc works at the same time as another, Graal rather goes through all of them, or has them under events.
Again the above paragrpah is just an assumption based on my knowledge.

In any case problem is solved

Kaimetsu 09-13-2003 11:01 PM

Quote:

Originally posted by Ningnong
always use this.i.

"i" can be used by other npcs where as a this.var cannot.

TERRIBLE advice.

If the variable's value doesn't need to be preserved between frames, a non-prefixed name is fine. Part of being a scripter is knowing that everything has a use, and learning the situations in which to utilise each tool ¬_¬

Androk, your problem is almost certainly the result of another factor. Either way, if the effect is one that should be applied to multiple ganis then it should use the ganis-as-params feature.

GoZelda 09-14-2003 08:35 AM

Quote:

Originally posted by Ningnong
always use this.i.

"i" can be used by other npcs where as a this.var cannot.

I said that too.

Quote:

Originally posted by gozelda
Mh maybe because they both use i?

Ningnong 09-14-2003 03:15 PM

Kaimetsu, of course i has a use. I was advising him to use this.i so this doesn't happen in the future.

Kaimetsu 09-14-2003 03:59 PM

Quote:

Originally posted by Ningnong
Kaimetsu, of course i has a use. I was advising him to use this.i so this doesn't happen in the future.
Right. Except that's stupid advice, because i should always be used in such situations.

adam 09-14-2003 04:07 PM

Quote:

Originally posted by Kaimetsu


Right. Except that's stupid advice, because i should always be used in such situations.

Well, teach him to do something better.

Kaimetsu 09-14-2003 04:22 PM

Quote:

Originally posted by adam


Well, teach him to do something better.

What do you want from me? I just told him how it should be.

Androk 09-14-2003 05:22 PM

Quote:

Originally posted by Kaimetsu


TERRIBLE advice.

If the variable's value doesn't need to be preserved between frames, a non-prefixed name is fine. Part of being a scripter is knowing that everything has a use, and learning the situations in which to utilise each tool ¬_¬

Androk, your problem is almost certainly the result of another factor. Either way, if the effect is one that should be applied to multiple ganis then it should use the ganis-as-params feature.

Ganis as params? Care to expand?

Python523 09-14-2003 07:07 PM

Quote:

Originally posted by Androk


Ganis as params? Care to expand?

I think he means ganis as attributes

setplayerprop #P(#),name.gani;

-Ramirez- 09-14-2003 07:18 PM

Quote:

Originally posted by Androk
Ganis as params? Care to expand?
Yeah... I also think he's referring to player parameters. Make a simple gani that contains that script and set it as a parameter. Then all ganis will use that script. If you only wanted it for certain ganis, I'm guessing checking #m would work. I don't have a whole lot of experience with gani scripts, however.

Kaimetsu 09-15-2003 05:49 AM

Params, attributes, meh. When I invented them like two years ago they were called 'complimentary ganis'.

Androk 09-19-2003 03:34 PM

I was wondering, can you join a class through a gani?

NPC Code:

SCRIPT
join gani-script
SCRIPTEND



All times are GMT +2. The time now is 12:47 AM.

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