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 04-03-2011, 01:53 AM
k_killar k_killar is offline
graal veteran
k_killar's Avatar
Join Date: Aug 2007
Posts: 243
k_killar is infamous around these parts
Send a message via AIM to k_killar
plz help me wtih this noob script plz

plz plz i beg.. im tryin to make it so if the hat is on it changes the speed and if its off it goes back to normal, but so far it is only turning on and staying on and wont go off

Quote:
//#CLIENTSIDE
function onCreated()
{
join("hatsys");
this.hatimg = "ha2.png";
}
function onWeaponFired()
{
triggerserver( "weapon", "-System/Movement", "setSpeed", 2.9 );
}
Reply With Quote
  #2  
Old 04-03-2011, 02:14 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by NPC Scripting Forum Rules
1. Be clear on your ability level. In other words, do not post asking for scripts, or asking people to fix scripts that are above your ability level. If you are writing a script to aid learning, then try writing a simpler script. If you are looking for a script for a server, then the best solution is probably to hire a scripter.
...
__________________
Quote:
Reply With Quote
  #3  
Old 04-03-2011, 02:36 AM
Demisis_P2P Demisis_P2P is offline
Kanto League Champion
Demisis_P2P's Avatar
Join Date: Jan 2005
Posts: 2,357
Demisis_P2P has much to be proud ofDemisis_P2P has much to be proud ofDemisis_P2P has much to be proud ofDemisis_P2P has much to be proud ofDemisis_P2P has much to be proud ofDemisis_P2P has much to be proud ofDemisis_P2P has much to be proud of
Can you post the contents of -System/Movement
__________________
Reply With Quote
  #4  
Old 04-03-2011, 04:59 AM
nullify nullify is offline
Registerd Abuser
nullify's Avatar
Join Date: May 2004
Location: The cheese state.
Posts: 851
nullify has a spectacular aura about
I honestly hate this subforum 95% of the time.
Reply With Quote
  #5  
Old 04-03-2011, 05:14 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Wouldn't it make more sense to give this guy a tutorial?
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #6  
Old 04-03-2011, 05:38 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Fulg0reSama View Post
Wouldn't it make more sense to give this guy a tutorial?
An old thread of his:
http://forums.graalonline.com/forums...ad.php?t=79612

If he really wanted to get help and learn he would have done it by now, so if he's not even going to make the effort why should he be given the how-to.

Not to mention the way he's going about things is the wrong way, and is only going to lead to terrible habits and entirely broken systems down the line.
__________________
Quote:
Reply With Quote
  #7  
Old 04-03-2011, 05:46 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
Quote:
Originally Posted by fowlplay4 View Post
wow i'm an ass
__________________
Reply With Quote
  #8  
Old 04-03-2011, 06:26 AM
MattKan MattKan is offline
the KattMan
Join Date: Aug 2010
Location: United States
Posts: 1,325
MattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to beholdMattKan is a splendid one to behold
Send a message via AIM to MattKan
Meh, in the future use PHP tags instead of QUOTE...

Also do indents, please!

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
join("hatsys");
  
this.hatimg "ha2.png";
}

function 
onWeaponFired() {
  
triggerserver"weapon""-System/Movement""setSpeed"2.9 );

This may or may not be the problem, but it says "ha2.png". Is this supposed to be "hat2.png"?

Quote:
Originally Posted by Demisis_P2P View Post
Can you post the contents of -System/Movement
That would probably be your best bet.

Quote:
Originally Posted by cbk1994 View Post
wow i'm an ass
If you go through life without being one at one point in time, then you are probably a horrible person.
Reply With Quote
  #9  
Old 04-03-2011, 07:22 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
...

The problem is that there's absolutely no logic!

There are two blatantly obvious scenarios that need to be addressed:

1. Player changes hat
2. Player is wearing hat already

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
// Check if player is wearing hat
  
if (player.attr[1] == "hat.png") {
    
speedUP();
  }
}

function 
onWeaponFired() {
  
// Check if player is wearing the hat already
  
if (player.attr[1] == "hat.png") {
    
// Remove hat
    
player.attr[1] = "nohat.png";
    
speedDOWN();
  } else {
    
// Put on hat
    
player.attr[1] = "hat.png";
    
speedUP();
  }

That being said the problem is that the speed changing is being done primarily in each hat weapon (and the obvious security issue with the triggerserver). This work would be better off calculated in the movement system or through a "buff" system that the movement system interacts with.

Please also read and search through:
http://wiki.graal.net/index.php/Creation/Dev/GScript
__________________
Quote:
Reply With Quote
  #10  
Old 04-03-2011, 07:34 PM
k_killar k_killar is offline
graal veteran
k_killar's Avatar
Join Date: Aug 2007
Posts: 243
k_killar is infamous around these parts
Send a message via AIM to k_killar
omg fowl play it work!! u pro..

i am no worthy

Reply With Quote
  #11  
Old 04-03-2011, 08:30 PM
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
Quote:
Originally Posted by k_killar View Post
omg fowl play it work!! u pro..

i am no worthy
I think you should focus more on learning to script instead of trying to make people on this forum script stuff for you.

Continue down your current path long enough and eventually no one will answer you, even though people on this subforum are pretty damn nice.
Reply With Quote
  #12  
Old 04-03-2011, 09:11 PM
k_killar k_killar is offline
graal veteran
k_killar's Avatar
Join Date: Aug 2007
Posts: 243
k_killar is infamous around these parts
Send a message via AIM to k_killar
Quote:
Originally Posted by WhiteDragon View Post
I think you should focus more on learning to script instead of trying to make people on this forum script stuff for you.

Continue down your current path long enough and eventually no one will answer you, even though people on this subforum are pretty damn nice.
l0l stfu b4 i pwn u 3zly wif my lvl 60 m0nk
Reply With Quote
  #13  
Old 04-03-2011, 09:27 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by k_killar View Post
l0l stfu b4 i pwn u 3zly wif my lvl 60 m0nk
...

Please don't post such nonsense. This is a scripting forum: not a forum for your spam.
Reply With Quote
  #14  
Old 04-03-2011, 09:42 PM
k_killar k_killar is offline
graal veteran
k_killar's Avatar
Join Date: Aug 2007
Posts: 243
k_killar is infamous around these parts
Send a message via AIM to k_killar
Quote:
Originally Posted by Twinny View Post
...

Please don't post such nonsense. This is a scripting forum: not a forum for your spam.
l0l i pwn u 2 n00b
Reply With Quote
  #15  
Old 04-04-2011, 05:35 AM
swimdude swimdude is offline
SWIMGHOSTPURRP
swimdude's Avatar
Join Date: Mar 2011
Posts: 135
swimdude will become famous soon enough
Lmao killer is the biggest troll i ever seen since lavaman
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:21 PM.


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