Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-13-2014, 06:48 PM
Tim_Rocks Tim_Rocks is offline
a true gentlemen
Tim_Rocks's Avatar
Join Date: Aug 2008
Location: USA
Posts: 1,863
Tim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to beholdTim_Rocks is a splendid one to behold
Maybe this is what you're looking for.

DB_test:
PHP Code:
function onCreated() {
  
this.item_100 "test";
}

public function 
findItem(temp.id) {
  return 
this.(@ "item_" temp.id);

Script:
PHP Code:
function onCreated() {
  
this.id 100;
}

function 
onPlayerTouchsMe() { 
  
player.chat DB_test.findItem(this.id);

__________________
Reply With Quote
  #2  
Old 02-15-2014, 05:14 AM
iDigzy iDigzy is offline
Registered User
Join Date: Apr 2013
Posts: 44
iDigzy is on a distinguished road
Quote:
Originally Posted by Tim_Rocks View Post
Maybe this is what you're looking for.

DB_test:
PHP Code:
function onCreated() {
  
this.item_100 "test";
}

public function 
findItem(temp.id) {
  return 
this.(@ "item_" temp.id);

Script:
PHP Code:
function onCreated() {
  
this.id 100;
}

function 
onPlayerTouchsMe() { 
  
player.chat DB_test.findItem(this.id);

Thanks for the reply, but I still can't get anything to work. Does it matter what level the npc database is in? It keeps making the chat 0, I have tried altering it a bit still can't figure it out .
__________________
Reply With Quote
  #3  
Old 02-15-2014, 06:08 AM
Torankusu Torankusu is offline
Elite Member
Torankusu's Avatar
Join Date: Jun 2001
Posts: 10,065
Torankusu is a jewel in the roughTorankusu is a jewel in the rough
Quote:
Originally Posted by iDigzy View Post
Thanks for the reply, but I still can't get anything to work. Does it matter what level the npc database is in? It keeps making the chat 0, I have tried altering it a bit still can't figure it out .
i understand you are trying to learn how to use DBNPCs properly, but it would help us troubleshoot if you gave us an idea on exactly what you are trying to do.

I understand you might be trying to go off of my previous examples, but could you give us some code examples ?
__________________
Quote:
Originally posted by Spark910
Think befreo you type.
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 07:57 AM.


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