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 08-23-2008, 02:28 AM
Deathborn123 Deathborn123 is offline
Owner of Dev Deathborn123
Deathborn123's Avatar
Join Date: Aug 2008
Location: Germany
Posts: 21
Deathborn123 is on a distinguished road
Need Help with a "Homestone" Script

Hey NAT Community,

I'd need help with my script which is basicly porting you to the onlinestartlocal after 10secs and playing a gani in this time. After you used it, you'd have a Cooldown for 6minutes. Quite simply you may think but i tried and tried and asked some people but they coulnd't help me, maybe you can?!

Oh yea and please keep those "My Ass whats that for a dumb script" for yourself please

Here is what i did so far:


//This will be the Homestone porting you to the Onlinestartlocal
function onActionServerside(action){
if (action == "warp"){
setlevel2("onlinestartlocal.graal",30,30);
player.chat="passed!";
}
}


//#CLIENTSIDE
function onCreated() {
client.cooldown = false;

}
function onWeaponfired() {
if (client.pause<=0&&client.cooldown=false) {
setani Homestone,NULL;
player.freezetime = 10.0;
client.cooldown = true;

setTimer(0.10);


}
else {
player.chat="Your Homestone is not Ready yet! You need to wait atleast " @client.pause@ " seconds!";

}
}

function onTimeout() {
triggeraction(0,0,serverside,warp,warpout,null);
player.chat="Warped!";
for (client.pause=>0; client.pause <=600; client.pause-1{
sleep 1.0;


}
if (client.pause=0) {
client.cooldown = false;
}
}


Regards,
Zab
__________________
You cannot Prevent and Prepare for War at the same Time.
Reply With Quote
  #2  
Old 08-23-2008, 02:46 AM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
You're using a mix of GS1 and GS2 which is very bad.
Also, try using triggerserver("gui", name, "warpout");

Also, you should be doing

for (client.pause = 0; client.pause <= 600; client.pause -= 1)
Reply With Quote
  #3  
Old 08-23-2008, 04:28 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
PHP Code:
function onActionserverside(action) {
  switch (
action) {
    case 
"warp":
      if (
timevar2 player.local.waittime 60) {
        
setlevel2("onlinestartlocal.nw"3030);
        
player.local.waittime timevar2;
      }else
        
player.chat "Not ready yet. Wait" SPC int(player.local.waittime timevar2SPC "seconds.";
     break;
  }
}
//#CLIENTSIDE
function onWeaponFired() {
  
triggerserver("gui"this.name"warp");

Why don't you try something like this?
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #4  
Old 08-23-2008, 04:31 AM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Tigairius View Post
PHP Code:
function onActionserverside(action) {
  switch (
action) {
    case 
"warp":
      if (
timevar2 player.local.waittime 60) {
        
setlevel2("onlinestartlocal.nw"3030);
        
player.local.waittime timevar2;
      }else
        
player.chat "Not ready yet.";
     break;
  }
}
//#CLIENTSIDE
function onWeaponFired() {
  
triggerserver("gui"this.name"warp");

Why don't you try something like this?
A very basic version but he also wants a cool down period, which would be easily implemented using you code
Reply With Quote
  #5  
Old 08-23-2008, 04:35 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Codein View Post
A very basic version but he also wants a cool down period, which would be easily implemented using you code
It has a cooldown of 60 seconds like his script
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #6  
Old 08-23-2008, 04:39 AM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by Tigairius View Post
It has a cooldown of 60 seconds like his script
Oh yeah. I didn't notice
Reply With Quote
  #7  
Old 08-23-2008, 04:47 AM
WhiteDragon WhiteDragon is offline
Banned
Join Date: Feb 2007
Posts: 1,002
WhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to beholdWhiteDragon is a splendid one to behold
Well, they could mash the D button and trigger the server a ton. Might be better to do the checking clientside. Pretty easy to change anyways.
Reply With Quote
  #8  
Old 08-23-2008, 04:50 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by WhiteDragon View Post
Well, they could mash the D button and trigger the server a ton. Might be better to do the checking clientside. Pretty easy to change anyways.
It would be very hard to send enough triggers by mashing down the D key to even lag the server, especially with the checks that are being done serverside. On the other hand, if it were to loop through a bunch of players, that's another story.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #9  
Old 08-23-2008, 05:08 AM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
I think clientside checking would be the best bet here, to be quite honest. I would always try and avoid making triggers to serverside as much as possible unless needed.
Reply With Quote
  #10  
Old 08-23-2008, 05:25 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Check first on clientside, then later on serverside (to be sure they aren't, for some reason, changing the data).
__________________
Reply With Quote
  #11  
Old 08-23-2008, 03:26 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
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
Quote:
Originally Posted by cbk1994 View Post
Check first on clientside, then later on serverside (to be sure they aren't, for some reason, changing the data).
What he said.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #12  
Old 08-23-2008, 05:15 PM
TheStan TheStan is offline
Stan?
Join Date: May 2008
Location: U.S.
Posts: 100
TheStan is on a distinguished road
Send a message via AIM to TheStan Send a message via MSN to TheStan
I noticed Tig used...

PHP Code:
player.local.waittime timevar2
I hope the local object is something you just threw on there and not another thing I don't know about.
Reply With Quote
  #13  
Old 08-23-2008, 05:33 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by TheStan View Post
I noticed Tig used...

PHP Code:
player.local.waittime timevar2
I hope the local object is something you just threw on there and not another thing I don't know about.
Well local flags exist, but after you pointed that out I noticed I should have just used a flag without a prefix. (player.waittime)
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #14  
Old 08-23-2008, 05:57 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Tigairius View Post
Well local flags exist, but after you pointed that out I noticed I should have just used a flag without a prefix. (player.waittime)
What's the advantage to something like player.waittime as opposed to clientr.waittime?
__________________
Reply With Quote
  #15  
Old 08-23-2008, 06:06 PM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by cbk1994 View Post
What's the advantage to something like player.waittime as opposed to clientr.waittime?
Well, you can use almost any flag type you want for this procedure. A flag with no lead is saved on the player's account and can only be accessed server-side. Clientr. sends the strings to client as well, which is sort of unnecessary since we'll probably never use waittime client-side as there is no timevar or timevar2 clientside. If you do player.waittime client-side it won't be able to be read by the NPC-Server.
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #16  
Old 08-23-2008, 07:05 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
player variables aren't converted to and from strings like client variables, so you can use objects on them and have large string sizes without them being cut off.
__________________
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 02:50 AM.


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