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 03-26-2006, 12:37 AM
Coolkid77742 Coolkid77742 is offline
Registered User
Join Date: Aug 2005
Posts: 79
Coolkid77742 is an unknown quantity at this point
Question Err Help with this script

Im trying to get my Item loaded on a server and will be like once this is fixed but why wont this work?
//#CLIENTSIDE
function onWeaponFired() {
this.active = !this.active;
if(this.active) {
replaceani("idle", "caenon-idle");
replaceani("walk", "caenon-walk2");
setani("swim", NULL);
} else {
replaceani("idle", "idle");
replaceani("walk", "walk");
setani("idle", NULL);
}
}

Its supposed to replace the players idle with Caenon-Idle and there walk with Caenon-Walk2 and when its unfired it goes back to normal?
__________________
]
Reply With Quote
  #2  
Old 03-26-2006, 12:52 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Is gscript2 enabled on the server?
Are the GANIs downloading properly? (Press F2 ingame)
__________________
Skyld
Reply With Quote
  #3  
Old 03-26-2006, 12:56 AM
Coolkid77742 Coolkid77742 is offline
Registered User
Join Date: Aug 2005
Posts: 79
Coolkid77742 is an unknown quantity at this point
No gs2 isnt cant u convert it?
__________________
]
Reply With Quote
  #4  
Old 03-26-2006, 12:58 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Coolkid77742
No gs2 isnt cant u convert it?
You will need to submit a support ticket at http://support.graalonline.com/ and request it before using the new engine scripting.
__________________
Skyld
Reply With Quote
  #5  
Old 03-26-2006, 12:58 AM
PeptoB PeptoB is offline
Banned
PeptoB's Avatar
Join Date: Mar 2006
Location: Leominster, MA
Posts: 22
PeptoB is on a distinguished road
Send a message via AIM to PeptoB Send a message via MSN to PeptoB
GS1:
PHP Code:
//#CLIENTSIDE
if (weaponfired){
unset 
this.active;
if(
this.active) {
replaceani idle,caenon-idle;
replaceani walk,caenon-walk2;
setani swim,;
} else {
replaceani idle,idle;
replaceani walk,walk;
setani idle,;
}

Reply With Quote
  #6  
Old 03-26-2006, 12:58 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
That's GS2.
It only works online.
Reply With Quote
  #7  
Old 03-26-2006, 12:58 AM
Coolkid77742 Coolkid77742 is offline
Registered User
Join Date: Aug 2005
Posts: 79
Coolkid77742 is an unknown quantity at this point
thnxz
__________________
]
Reply With Quote
  #8  
Old 03-26-2006, 01:18 AM
Coolkid77742 Coolkid77742 is offline
Registered User
Join Date: Aug 2005
Posts: 79
Coolkid77742 is an unknown quantity at this point
got a gs1 vers
__________________
]
Reply With Quote
  #9  
Old 03-26-2006, 01:22 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by PeptoB
PHP Code:
unset this.active
Not quite.

this.active = !this.active; was used to toggle between true and false (!true == false, !false == true), not just to unset it.
__________________
Skyld
Reply With Quote
  #10  
Old 03-26-2006, 09:16 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Skyld
Not quite.

this.active = !this.active; was used to toggle between true and false (!true == false, !false == true), not just to unset it.
would be: this.active = 1 - this.active; or so.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #11  
Old 03-27-2006, 02:28 AM
protagonist protagonist is offline
Banned
protagonist's Avatar
Join Date: May 2003
Location: CAW
Posts: 5,586
protagonist is on a distinguished road
Send a message via AIM to protagonist Send a message via MSN to protagonist
Quote:
Originally Posted by ApothiX
would be: this.active = 1 - this.active; or so.
Or something.
Reply With Quote
  #12  
Old 03-28-2006, 12:59 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by protagonist
Or something.
Or yourmom. Kekeke, I can be witty too.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #13  
Old 03-28-2006, 02:43 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Quote:
Originally Posted by ApothiX
would be: this.active = 1 - this.active; or so.
I fail to see why this.active = !this.active wouldn't work? I'm actually rather impressed at the use of it, otherwise it's an annoying 4 line script or so to toggle.

Also instead of converting everything to the old engine, put in a support ticket and go for the new engine. It makes a lot more sense (plus it's more fun and a better learning experience) to do write everything in the new engine instead of converting it later.
__________________
Who has time for life these days?
Reply With Quote
  #14  
Old 03-28-2006, 02:52 AM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Quote:
Originally Posted by Projectshifter
I fail to see why this.active = !this.active wouldn't work? I'm actually rather impressed at the use of it, otherwise it's an annoying 4 line script or so to toggle.

Also instead of converting everything to the old engine, put in a support ticket and go for the new engine. It makes a lot more sense (plus it's more fun and a better learning experience) to do write everything in the new engine instead of converting it later.
this.active = !this.active; does not work in GS1, they asked for a GS1 version of it. They were merely stating that.
Reply With Quote
  #15  
Old 03-28-2006, 04:18 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Oh no! Projectshifter is getting old!
this.active = (this.active + 1) % 2;
4 lines? try 4 - 3.
__________________
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 09:10 AM.


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