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 09-13-2003, 07:42 PM
Androk Androk is offline
Registered User
Androk's Avatar
Join Date: Apr 2003
Posts: 614
Androk is on a distinguished road
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?
__________________

Name: Androk
Reply With Quote
  #2  
Old 09-13-2003, 08:56 PM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
Mh maybe because they both use i? though i doubt it. Also Check if it's both in SCRIPT and SCRIPTEND.
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #3  
Old 09-13-2003, 09:41 PM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
always use this.i.

"i" can be used by other npcs where as a this.var cannot.
__________________
Former Global Scripting Team Member


Reply With Quote
  #4  
Old 09-13-2003, 09:48 PM
Androk Androk is offline
Registered User
Androk's Avatar
Join Date: Apr 2003
Posts: 614
Androk is on a distinguished road
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
__________________

Name: Androk
Reply With Quote
  #5  
Old 09-13-2003, 11:01 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
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.
__________________
Reply With Quote
  #6  
Old 09-14-2003, 08:35 AM
GoZelda GoZelda is offline
Mister 1,000,000
GoZelda's Avatar
Join Date: Jan 2003
Location: Brussels, capital of Europe.
Posts: 5,396
GoZelda will become famous soon enough
Send a message via AIM to GoZelda Send a message via MSN to GoZelda
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?
__________________

Quote:
Originally Posted by Lance
stefan is satan
I am the best.
[URL removed]Music or aural pollution?
Reply With Quote
  #7  
Old 09-14-2003, 03:15 PM
Ningnong Ningnong is offline
Registered User
Ningnong's Avatar
Join Date: Nov 2002
Location: < -- way
Posts: 262
Ningnong is on a distinguished road
Kaimetsu, of course i has a use. I was advising him to use this.i so this doesn't happen in the future.
__________________
Former Global Scripting Team Member


Reply With Quote
  #8  
Old 09-14-2003, 03:59 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
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.
__________________
Reply With Quote
  #9  
Old 09-14-2003, 04:07 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura aboutadam has a spectacular aura about
Send a message via AIM to adam
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.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #10  
Old 09-14-2003, 04:22 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
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.
__________________
Reply With Quote
  #11  
Old 09-14-2003, 05:22 PM
Androk Androk is offline
Registered User
Androk's Avatar
Join Date: Apr 2003
Posts: 614
Androk is on a distinguished road
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?
__________________

Name: Androk
Reply With Quote
  #12  
Old 09-14-2003, 07:07 PM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by Androk


Ganis as params? Care to expand?
I think he means ganis as attributes

setplayerprop #P(#),name.gani;
Reply With Quote
  #13  
Old 09-14-2003, 07:18 PM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
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.
__________________
Kat
Reply With Quote
  #14  
Old 09-15-2003, 05:49 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Params, attributes, meh. When I invented them like two years ago they were called 'complimentary ganis'.
__________________
Reply With Quote
  #15  
Old 09-19-2003, 03:34 PM
Androk Androk is offline
Registered User
Androk's Avatar
Join Date: Apr 2003
Posts: 614
Androk is on a distinguished road
I was wondering, can you join a class through a gani?

NPC Code:

SCRIPT
join gani-script
SCRIPTEND

__________________

Name: Androk
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 04:47 PM.


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