Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-19-2015, 08:41 PM
devilsknite1 devilsknite1 is offline
C:
devilsknite1's Avatar
Join Date: Jul 2006
Location: Florida, USA
Posts: 269
devilsknite1 has a spectacular aura about
Send a message via AIM to devilsknite1 Send a message via MSN to devilsknite1 Send a message via Yahoo to devilsknite1
Referencing Weapons Clientside

So I know from experience that referencing weapons clientside can be done in multiple ways, the easiest two probably being the following.

Method 1:
Weapon NPC Foo
PHP Code:
//#CLIENTSIDE
function onCreated() {
  ( @ 
"Bar" ).foobar();

Weapon NPC Bar
PHP Code:
//#CLIENTSIDE
public function foobar() {
  
// code

Method 2:
Weapon NPC Foo
PHP Code:
//#CLIENTSIDE
function onCreated() {
  
findWeapon"Bar" ).foobar();

Weapon NPC Bar
PHP Code:
//#CLIENTSIDE
public function foobar() {
  
// code

Which way is the "correct" way of referencing another object clientside? What are the differences between the two, if any? In the past I have always used method 1, but now I find myself most certainly wanting to use method 2 as it is an actual command loading an object (findweapon/findweaponnpc) rather than simply listing another weapon name. Might there be more functionality advantages to method 2 versus method 1 or vice versa that I might be missing?

Last edited by devilsknite1; 05-19-2015 at 11:20 PM..
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:12 AM.


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