Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-10-2002, 07:42 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Scripting language bug

NPC Code:

if(playerenters){
showcharacter;
if(1==1) message I work;
else message GScript is bugged;
}



It seems that anything before a == is always assumed to be a variable or a function. Hand it a plain number and it just throws up false.

But heck, if a new scripting engine is on the way then it hopefully won't matter.
__________________

Last edited by Kaimetsu; 02-10-2002 at 07:55 PM..
Reply With Quote
  #2  
Old 02-10-2002, 09:23 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
Holy moly.
Reply With Quote
  #3  
Old 02-10-2002, 11:07 PM
Bhala Bhala is offline
Disgruntled Monkey
Bhala's Avatar
Join Date: Mar 2001
Posts: 779
Bhala is on a distinguished road
Yea i noticed that last night too.... it made it a lot harder to make my script
Reply With Quote
  #4  
Old 02-10-2002, 11:09 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
[Squeaky!]
In the meanwhile you could just use if (true), just as long and it does exactly the same.
Who knows maybe even if (1) works.
[/Squeaky!]
__________________
Reply With Quote
  #5  
Old 02-11-2002, 12:30 AM
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 Kaimetsu
[Squeaky!]
In the meanwhile you could just use if (true), just as long and it does exactly the same.
Who knows maybe even if (1) works.
[/Squeaky!]
It's because I was using a defNPC. So I'd go:

NPC Code:

//#EDIT mode 1
//#CLIENTSIDE
blahblah;
if(mode==1){
whatever;
}



So then it'd get changed into "if(1==1){" by the editor, y'see?
__________________
Reply With Quote
  #6  
Old 02-11-2002, 01:44 AM
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
Arg optimization error, when comparing two
const values then it tries to merge, but two code
lines need to be exchanged. Fixed in next
version (the parsing engine doesn't do the optimizing
task so it was good to mention it :-) )
Reply With Quote
  #7  
Old 02-11-2002, 03:02 AM
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 Kaimetsu


It's because I was using a defNPC. So I'd go:

NPC Code:

//#EDIT mode 1
//#CLIENTSIDE
blahblah;
if(mode==1){
whatever;
}



So then it'd get changed into "if(1==1){" by the editor, y'see?
[Squeaky!]
Ok, that explains a lot. Though I fail to see it's actual use.
[/Squeaky!]
__________________
Reply With Quote
  #8  
Old 02-11-2002, 02:33 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 Kaimetsu
[Squeaky!]
Ok, that explains a lot. Though I fail to see it's actual use.
[/Squeaky!]
I had a magic fountain NPC that sprayed up light-effect particles, and it could originally be either Red, Green, Blue or a mixture of all. To define which colour it should be, the user entered a value into a "Colour" slot in the defNPC. Then when it came to assigning colours to the particles, it did something like this:

NPC Code:

for(i=0;i!=3;i++){
if(Colour==i||Colour==-1) particlecolour[i]=random(0,1);
}



Because -1 was the value used to represent 'use all colours'. So when the editor went through and replaced the slot variable things with numbers, it made it into:

NPC Code:

for(i=0;i!=3;i++){
if(-1==i||-1==-1) particlecolour[i]=random(0,1);
}



Which meant that the if condition always returned false.
__________________
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 10:40 AM.


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