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-03-2011, 03:46 AM
BboyEatsbacon BboyEatsbacon is offline
The Bacon Man
BboyEatsbacon's Avatar
Join Date: Feb 2011
Location: United States
Posts: 60
BboyEatsbacon will become famous soon enough
Smile A script I think EVERY server should have. :]

Hey everyone. Here is a pretty basic script I threw together... I know its not that much, but it's something.

Last edited by BboyEatsbacon; 03-03-2011 at 03:55 AM.. Reason: No PHP.
Reply With Quote
  #2  
Old 03-03-2011, 03:54 AM
BboyEatsbacon BboyEatsbacon is offline
The Bacon Man
BboyEatsbacon's Avatar
Join Date: Feb 2011
Location: United States
Posts: 60
BboyEatsbacon will become famous soon enough
Sorry, didn't make it a PHP code last time. Here!
PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/hug") {
    
setani("grab""");
    
player.chat "";
  }
  if (
player.chat == "/sit") {
    
setani("sit""");
    
player.chat "";
  }
  if (
player.chat == "/dance") {
    
setani("dance""");
    
player.chat "";
  }

__________________
Reply With Quote
  #3  
Old 03-03-2011, 04:16 AM
Shards-Of-Fate Shards-Of-Fate is offline
Mr. Blu
Shards-Of-Fate's Avatar
Join Date: Sep 2002
Location: Austin, TX, USA
Posts: 215
Shards-Of-Fate will become famous soon enough
Send a message via AIM to Shards-Of-Fate Send a message via MSN to Shards-Of-Fate Send a message via Yahoo to Shards-Of-Fate
You know, part of me was worried it would be staff boots. I'm actually kind of relieved.
__________________

Weee!~
Reply With Quote
  #4  
Old 03-03-2011, 04:33 AM
kia345 kia345 is offline
z0rbi 4 life 🤘
kia345's Avatar
Join Date: Dec 2006
Location: delteria
Posts: 6,737
kia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond reputekia345 has a reputation beyond repute
As long as you don't have a hat economy, otherwise they'll use hug on someone who traded nude pictures for hats and she'll cry and call it harassment and get it removed.
__________________
pojo
Reply With Quote
  #5  
Old 03-03-2011, 04:51 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
Quote:
Originally Posted by BboyEatsbacon View Post
PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/dance") {
    
setani("dance""");
    
player.chat ""

There's no default dance gani, though
__________________
Quote:
Originally Posted by Satoru Iwata
On the other hand, free-to-play games, if unbalanced, could result in some consumers paying extremely large amounts of money, and we can certainly not expect to build a good relationship with our consumers in this fashion. In order to have a favorable long-term relationship, we would like to offer free-to-play games that are balanced and reasonable.
Quote:
Originally Posted by Unximad
Eurocenter Games remains attached to the values of indies game developer and to the service our playerbase community.
Reply With Quote
  #6  
Old 03-03-2011, 05:09 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
Use ChatBar.onAction() for Chat Commands instead.

PHP Code:
//#CLIENTSIDE
function ChatBar.onAction() {
  switch (
ChatBar.text.trim()) {
    case 
"/hug":   temp.gani "grab";  break;
    case 
"/sit":   temp.gani "sit";   break;
    case 
"/dance"temp.gani "dance"; break;
  }
  if (
temp.gani.type() != -1) {
    
ChatBar.text "";
    
player.setani(temp.gani"");
  }

__________________
Quote:

Last edited by fowlplay4; 03-03-2011 at 05:21 AM..
Reply With Quote
  #7  
Old 03-03-2011, 05:13 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
Probably bad form to check if a variable exists with

if (var) {...}

because it's coercing the variable to an integer, which could technically coerce to 0 and make the if fail in certain cases where the variable does exist.

Perhaps if (var.type() != -1) {...} is the best way to do it.
Reply With Quote
  #8  
Old 03-03-2011, 02:24 PM
Vinka Vinka is offline
Banned
Join Date: Feb 2011
Posts: 169
Vinka has a spectacular aura aboutVinka has a spectacular aura about
Nice, I want this on my server.. But I´m pretty much a newb at this, how would I go about adding it to my server? I´m guessing by making it a weapon? and all the players who login will get that weapon? Or should I add this to classes?

Thanks in advance.
Reply With Quote
  #9  
Old 03-03-2011, 05:17 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Quote:
Originally Posted by BboyEatsbacon View Post
Sorry, didn't make it a PHP code last time. Here!
PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/hug") {
    
setani("grab""");
    
player.chat "";
  }
  if (
player.chat == "/sit") {
    
setani("sit""");
    
player.chat "";
  }
  if (
player.chat == "/dance") {
    
setani("dance""");
    
player.chat "";
  }

I don't understand why anybody would want this type of thing as a chat command, for a start it doesn't feel natural or that you're really controlling your character in the same way that you'd slash by pressing S, it doesn't look very professional, you also get alot of people expecting it to work on servers where it is not supported due to it not being a completely aparent feature (though the same applies to emoticons), and end up trying variations of it with ":" as a prefix for example, when it simply does not exist.

With something such as assigning hotkeys for this type of thing and even allowing players to customise which keys they would like to use you're not only removing delay of typing, but you'd also be providing a method inwhich for players to discover that the feature exists.
Even something simplistic and easy enough for a new developer to create such as firing a weapon could be more appropriate.
Reply With Quote
  #10  
Old 03-03-2011, 07:39 PM
callimuc callimuc is offline
callimuc's Avatar
Join Date: Nov 2010
Location: Germany
Posts: 1,015
callimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to beholdcallimuc is a splendid one to behold
Well thats a good idea maybe like on UN the skills
Reply With Quote
  #11  
Old 03-04-2011, 11:22 PM
BboyEatsbacon BboyEatsbacon is offline
The Bacon Man
BboyEatsbacon's Avatar
Join Date: Feb 2011
Location: United States
Posts: 60
BboyEatsbacon will become famous soon enough
@ffcmike: Now I feel like a noob for posting this....
__________________
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 04:21 PM.


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