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 02-05-2005, 05:36 AM
ChibiChibiLuc ChibiChibiLuc is offline
Cookie Monster. :3
Join Date: Jan 2005
Location: Nova Scotia, Canada
Posts: 111
ChibiChibiLuc is on a distinguished road
Send a message via AIM to ChibiChibiLuc Send a message via MSN to ChibiChibiLuc
Why would this crash Graal?

Alright, I've got this in a gani. It shows fading numbers.
When the gani shows, Graal takes a fit, gives me an error, and then says it has an error and crashes.
I'm using Graal v3, of course, and Gscript2.

NPC Code:
function onCreated() {
timeout = .05;
this.fade = 2;
}
function onTimeout() {
timeout = .05;
this.y -= .1;
this.fade -= .1;
showtext(5,x+(20/16),y+this.y,"Times New Roman","b","Oh my");
changeimgcolors(5,#p(1),#p(2),#p(3),this.fade);
}

Reply With Quote
  #2  
Old 02-05-2005, 05:47 AM
DarkShadows_Legend DarkShadows_Legend is offline
Cult of the Winky
DarkShadows_Legend's Avatar
Join Date: Apr 2003
Location: Florida
Posts: 614
DarkShadows_Legend is on a distinguished road
Send a message via AIM to DarkShadows_Legend
I think serverside timeouts are supposed to be no less than 0.1.
__________________
- Criminal X

"I rather be hated for being myself, than be liked for being what you like best. I go above the influence, not under." - Me
Reply With Quote
  #3  
Old 02-05-2005, 05:54 AM
goalieboy_01 goalieboy_01 is offline
Maloria Staff
Join Date: Dec 2004
Location: Toronto, Ontario, Canada
Posts: 80
goalieboy_01 is on a distinguished road
Send a message via MSN to goalieboy_01
Quote:
Originally Posted by DarkShadows_Legend
I think serverside timeouts are supposed to be no less than 0.1.
You are correct, sir.
__________________
//Shock
http://www.maloria.com/index.php <------Sign up foos
Reply With Quote
  #4  
Old 02-05-2005, 06:12 AM
Evil_Trunks Evil_Trunks is offline
Evil
Evil_Trunks's Avatar
Join Date: Dec 2004
Posts: 391
Evil_Trunks is on a distinguished road
Quote:
Originally Posted by DarkShadows_Legend
I think serverside timeouts are supposed to be no less than 0.1.
Then it's a good thing he isn't using it serverside.

__________________

Reply With Quote
  #5  
Old 02-05-2005, 07:17 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by DarkShadows_Legend
I think serverside timeouts are supposed to be no less than 0.1.
showtext and changeimgcolors cannot be used serverside, either

Quote:
Originally Posted by ChibiChibiLuc
timeout = .05;
This wouldn't crash your client, but the correct procedure for setting a timeout in the new engine is:
NPC Code:
setTimer(float);



Quote:
Originally Posted by ChibiChibiLuc
changeimgcolors(5,#p(1),#p(2),#p(3),this.fade);
Where are you getting these #p(1) etc from? (And don't use # anything in the new engine)
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")

Last edited by ApothiX; 02-06-2005 at 05:46 AM.. Reason: Wrong person in the quote xD
Reply With Quote
  #6  
Old 02-05-2005, 07:20 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by DarkShadows_Legend
I think serverside timeouts are supposed to be no less than 0.1.
Kindly refer to rule 4 of this forum.
Reply With Quote
  #7  
Old 02-05-2005, 07:20 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by goalieboy_01
You are correct, sir.
You too.
Reply With Quote
  #8  
Old 02-05-2005, 07:22 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by ApothiX
Where are you getting these #p(1) etc from?
It's a gani, dude.

Quote:
(And don't use # anything in the new engine)
Mixing code is not a good idea, but old scripts using old code (including the old message codes) will still work.
Reply With Quote
  #9  
Old 02-05-2005, 07:26 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Lance
It's a gani, dude.
Ah, sorry, I don't use those smelly gani parameters very often

Quote:
Originally Posted by Lance
Mixing code is not a good idea, but old scripts using old code (including the old message codes) will still work.
It's not a good idea, that's why I was trying to deter him from doing so.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #10  
Old 02-05-2005, 07:27 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by ChibiChibiLuc
Alright, I've got this in a gani. It shows fading numbers.
When the gani shows, Graal takes a fit, gives me an error, and then says it has an error and crashes.
I'm using Graal v3, of course, and Gscript2.

NPC Code:
function onCreated() {
timeout = .05;
this.fade = 2;
}
function onTimeout() {
timeout = .05;
this.y -= .1;
this.fade -= .1;
showtext(5,x+(20/16),y+this.y,"Times New Roman","b","Oh my");
changeimgcolors(5,#p(1),#p(2),#p(3),this.fade);
}

To answer your question, I'd need to know if clientside code for the new engine is enabled in ganiscripts.

If it is enabled for ganiscript: this.fade is fairly quickly going to become negative (in 2 seconds). Perhaps it does not like attempting to set a negative alpha? Please post the relevant error messages/console.log.
Reply With Quote
  #11  
Old 02-05-2005, 07:29 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by ApothiX
It's not a good idea, that's why I was trying to deter him from doing so.
Yeah, but you said not to use the old message codes. There's a difference between "Don't use the old message codes" and "Don't mix old and new scripting." The former just names one facet of the old scripting and could also be taken to mean that it's not good to use the message codes in old scripts either, whereas the latter actually provides folks with the advice you were trying to communicate..
Reply With Quote
  #12  
Old 02-05-2005, 07:38 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Lance
Yeah, but you said not to use the old message codes. There's a difference between "Don't use the old message codes" and "Don't mix old and new scripting." The former just names one facet of the old scripting and could also be taken to mean that it's not good to use the message codes in old scripts either, whereas the latter actually provides folks with the advice you were trying to communicate..
I believe I said not to use them in the new engine, I thought by saying that, I implied that it meant to not use it with new engine code. Sorry for any misconceptions.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #13  
Old 02-05-2005, 07:47 AM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by ApothiX
I believe I said not to use them in the new engine,
The new engine supports both old and new scripting, dude.

Quote:
I thought by saying that, I implied that it meant to not use it with new engine code. Sorry for any misconceptions.
As long as it's cleared up now, it's fine.
Reply With Quote
  #14  
Old 02-05-2005, 04:59 PM
ChibiChibiLuc ChibiChibiLuc is offline
Cookie Monster. :3
Join Date: Jan 2005
Location: Nova Scotia, Canada
Posts: 111
ChibiChibiLuc is on a distinguished road
Send a message via AIM to ChibiChibiLuc Send a message via MSN to ChibiChibiLuc
I've got other gani scripts, they all work fine.
And thanks, I forgot to convert the #p()'s.
I originally had it stopping itself when fade hit 0, but I took it out to test if that's what was causing the crash. It wasn't.

It's slightly better now; it doesn't crash Graal every time the gani is shown, but instead it only crashes Graal maybe 1/6 times. Unfortunately, the text won't show. The script, right now, is:

NPC Code:

function onCreated() {
setTimer(.05);
this.fade = 2;
this.damage = params[0];
}
function onTimeout() {
setTimer(.05);
this.y -= .1;
if (this.fade > 0) {
this.fade -= .1;
}
showtext(5,x,y+this.y,"Times New Roman","b",this.damage);
changeimgcolors(5,params[1],params[2],params[3],this.fade);
}



Anyhow, the script that shows the gani is hiding it before fade hits 0.

Edit: Oh yeah, the console doesn't have anything in it about the crash.

Last edited by ChibiChibiLuc; 02-05-2005 at 05:04 PM.. Reason: O.o
Reply With Quote
  #15  
Old 02-05-2005, 07:11 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
Quote:
Originally Posted by ChibiChibiLuc
I've got other gani scripts, they all work fine.
And thanks, I forgot to convert the #p()'s.
I originally had it stopping itself when fade hit 0, but I took it out to test if that's what was causing the crash. It wasn't.

It's slightly better now; it doesn't crash Graal every time the gani is shown, but instead it only crashes Graal maybe 1/6 times. Unfortunately, the text won't show.
Okay, without seeing the script that sets the ani, the steps I'd take to figure out what's wrong:

1) Is the first parameter (params[0]) being sent properly (i.e., is it sent as a string)?

2) Does the showtext work without a variable as the text (and/or without the changeimgcolors)?

3) Are the parameters for the changeimgcolors being sent the way you expect?
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:37 PM.


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