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 05-03-2008, 04:58 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
disableweapons() is certainly the best way to go that I can think of if you want to stick with the default movement system. Though, I think some people have made very nice replicas, perhaps check the code gallery.

What I recommend is making a custom Q-Menu and then using disableweapons(); You actually wouldn't even need a custom Q menu, just a script like this:

PHP Code:
//#CLIENTSIDE
function onKeyPressedcodekey )
{
  if ( 
key == "d" )
  {
    ( @ 
player.weapon ).trigger"onWeaponFired""" );
  }

__________________

Last edited by Darlene159; 05-03-2008 at 07:41 PM.. Reason: stop arguing
Reply With Quote
  #2  
Old 05-03-2008, 05:02 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by cbkbud View Post
PHP Code:
//#CLIENTSIDE
function onKeyPressedcodekey )
{
  if ( 
key == "d" )
  {
    ( @ 
player.weapon ).trigger"onWeaponFired""" );
  }

Should actually look like this:

PHP Code:
//#CLIENTSIDE
function onKeyPressed(codekey) {
  if (
key == "d") {
    
findWeapon(player.weapon.name).trigger("WeaponFired"nil);
  }

Well, some things are preference, but trigger("Event", nil) triggers "onEvent", not "Event", and I had some problem triggering weapons when not using findWeapon() before, might have been me back then though.
Reply With Quote
  #3  
Old 05-03-2008, 05:05 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 Crow View Post
Should actually look like this:

PHP Code:
//#CLIENTSIDE
function onKeyPressed(codekey) {
  if (
key == "d") {
    
findWeapon(player.weapon.name).trigger("WeaponFired"nil);
  }

Well, some things are preference, but trigger("Event", nil) triggers "onEvent", not "Event", and I had some problem triggering weapons when not using findWeapon() before, might have been me back then though.
Fair enough, I just posted a rough example. I haven't used trigger() for a while.

Also, you don't need findWeapon, you can just do ( @ player.weapon.name ).trigger( ... ); last I checked.
__________________
Reply With Quote
  #4  
Old 05-03-2008, 05:06 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by cbkbud View Post
Fair enough, I just posted a rough example. I haven't used trigger() for a while.

Also, you don't need findWeapon, you can just do ( @ player.weapon.name ).trigger( ... ); last I checked.
I stated why I did it, I guess it's also preference ;P
Reply With Quote
  #5  
Old 05-03-2008, 05:36 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by cbkbud View Post
Also, you don't need findWeapon, you can just do ( @ player.weapon.name ).trigger( ... ); last I checked.
That's a bad habit though I think, because then you should be able to do
(@ player.account).chat or Chompy.chat which you can't ;o
__________________
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:17 PM.


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