Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-23-2006, 03:34 AM
Coolkid77742 Coolkid77742 is offline
Registered User
Join Date: Aug 2005
Posts: 79
Coolkid77742 is an unknown quantity at this point
Unhappy Please help finish my script

Ok I need my script so it will always be active

//#CLIENTSIDE
if (weaponfired) {
for (i=1;i!=0;i++) {
playermp=i*1;
sleep .95;
}}

Thats what I got
__________________
]
Reply With Quote
  #2  
Old 04-23-2006, 03:41 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
This should be in the GS1 area really. But, use a timeout.
__________________
Deep into the Darkness peering...
Reply With Quote
  #3  
Old 04-23-2006, 03:43 AM
Coolkid77742 Coolkid77742 is offline
Registered User
Join Date: Aug 2005
Posts: 79
Coolkid77742 is an unknown quantity at this point
uh can u show me im so confsued
__________________
]
Reply With Quote
  #4  
Old 04-23-2006, 03:47 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
Quote:
Originally Posted by Coolkid77742
uh can u show me im so confsued
If you're so confused, start with something easier.
And "Please help finish my script"? Bad title. No we will not help you finish it. If you want us to help you understand it, sure.
This is what you have so far:
PHP Code:
//#CLIENTSIDE
if (weaponfired) {  // if the wNPC is fired
for (i=1;i!=0;i++) {  // a for loop that is apparently ever increasing
playermp=i*1;  // setting playermp to i * 1, no idea why you'd multiply by 1 plus playermp can't be set clientside
sleep .95;  // sleeping for .95 seconds.
}}  // bad styling btw 
__________________
Reply With Quote
  #5  
Old 04-23-2006, 04:56 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
A timeout:


NPC Code:

if (timeout) {
timeout = #; // Replace # with a number
}

__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #6  
Old 04-23-2006, 05:39 AM
Bl0nkt Bl0nkt is offline
Era Developer
Bl0nkt's Avatar
Join Date: Mar 2005
Location: Pennsylvania
Posts: 1,589
Bl0nkt will become famous soon enough
Send a message via AIM to Bl0nkt
***** @ i*1;

Just by looking at what you're doing, it looks like you're trying to make a sliding effect. That would look like this:

NPC Code:
//#CLIENTSIDE
if (weaponfired) {
for (i=playermp;i<100;i++) {
sleep 0.1;
playermp=i;
}
}



But in your case, you probably want to do this:

NPC Code:
//#CLIENTSIDE
if (created) timeout = 0.05;

if (timeout) {
playermp = 100;
timeout = 0.05;
}

Reply With Quote
  #7  
Old 04-23-2006, 01:31 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
//#CLIENTSIDE
if (created) {
timeout = 0.05;
}


if (timeout) {
playermp = 100;
timeout = 0.05;
}

-_- Use brackets right
__________________
Deep into the Darkness peering...
Reply With Quote
  #8  
Old 04-23-2006, 02:08 PM
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
playermp cannot be set clientside. You had might as well do something like this on the serverside:
PHP Code:
if (created)
{
  
timeout 0.5;
}

if (
timeout)
{
  if (
playermp 100)
  {
    
playermp ++;
  }
 
  
timeout 0.5;

__________________
Skyld
Reply With Quote
  #9  
Old 04-23-2006, 06:49 PM
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
Quote:
Originally Posted by Angel_Light
//#CLIENTSIDE
if (created) {
timeout = 0.05;
}


if (timeout) {
playermp = 100;
timeout = 0.05;
}

-_- Use brackets right
You don't need brackets after the if (created). I normally do the same when it's just one command following the statement. i.e.
PHP Code:
if (playerchatssetplayerprop #c,omg!; 
Adding brackets to just one line when it's already easily understood is just a waste of time and space.
__________________
Reply With Quote
  #10  
Old 04-24-2006, 01:17 PM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
Meh, it looks better Zelph. ;o Also you use a triggeraction on the clientside to server for the MP
__________________
Deep into the Darkness peering...
Reply With Quote
  #11  
Old 04-24-2006, 01:39 PM
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 Angel_Light
Meh, it looks better Zelph. ;o Also you use a triggeraction on the clientside to server for the MP
It's quite inefficient to send however many triggeractions from the clientside, when you could just run the operation serverside.
__________________
Skyld
Reply With Quote
  #12  
Old 04-24-2006, 07:08 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
I'm currently wondering why you've chosen to use the timeout feature.
A 'for()' loop works the same...?
Reply With Quote
  #13  
Old 04-24-2006, 08:40 PM
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 xAndrewx
I'm currently wondering why you've chosen to use the timeout feature.
A 'for()' loop works the same...?
A for () loop needs an initiator, making it just as easy to use a timeout.
__________________
Skyld
Reply With Quote
  #14  
Old 04-25-2006, 03:31 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
All... hail... Skyld... o.o;

anyways... He might have some clientside only actions or stuff of the such. That's why suggested that.
__________________
Deep into the Darkness peering...
Reply With Quote
  #15  
Old 04-26-2006, 04:03 PM
Raeiphon Raeiphon is offline
I never asked for this.
Join Date: Jun 2005
Posts: 855
Raeiphon is on a distinguished road
On the subject of triggeractions, couldn't you locate a function above the //#CLIENTSIDE statement and when called, it would run serverside?
__________________

I hope for nothing. I fear nothing. I am free.
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 06:13 PM.


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