Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   NPCs and Classes (https://forums.graalonline.com/forums/showthread.php?t=74448)

killerogue 06-07-2007 10:17 PM

NPCs and Classes
 
Just how limited is communication between them?

Chompy 06-07-2007 10:22 PM

Npcs as in level npcs, database npcs?

Angel_Light 06-07-2007 10:41 PM

Not very, anything possible, haha.

Inverness 06-07-2007 11:06 PM

Classes aren't their own objects, just scripts joined to other objects, I don't see what you're getting at.

Rapidwolve 06-08-2007 02:53 AM

Doesn't matter if one is joined to an NPC or a weapon, classes are classes. Unless I misunderstood and if you meant NPC is a db-npc, level-npc, or a weapon script.

killerogue 06-08-2007 03:23 AM

Sorry, I never clarified what I posted this for. I was calling a public function in a DB from a weapon, that places a class, once the class is created it's supposed to call a public function from the same DB. I tried to echo a variable through this manner but it didn't work. :O


Something like his for example:

PHP Code:

function onCreated() {
  
this.npcPlace putnpc2(3030"").join("mud_npc_genericenemytest");
  
with (this.npcPlace) {
    
this.eName "Shadow";
  }


PHP Code:

function onCreated() {
  
temp.file;
  echo (
this.eName);


isn't working.

Rapidwolve 06-08-2007 03:29 AM

DB-NPC:
PHP Code:

function onCreated()
{
  
this.join("functions");
  
echo2("Success");


functions Class
PHP Code:

public function echo2(message)
{
  
this.echo(temp.message);


Would work, just an example though.

killerogue 06-08-2007 03:56 AM

...I know that would work. What I need is what I posted above for example.

Rapidwolve 06-08-2007 04:01 AM

PHP Code:

function onCreated() {
  
with (putnpc2(3030""))
  {
    
this.join("mud_npc_getgenericenemytest");
    
this.eName "Shadow";
  }


PHP Code:

function onCreated() {
  
temp.file;
  echo (
this.eName);


Oh sorry, didn't read up. That should work.

killerogue 06-08-2007 04:09 AM

Edit: Inver helped me solve my problem. Thanks tho guys.

xAndrewx 06-08-2007 08:53 AM

I don't think you can call putNPC2 in the created function.

Inverness 06-09-2007 03:39 AM

putnpc2() just needs to be called in something that has a level and on the serverside. Those are only requirements to my knowledge. Trying to call it from a TStaticVar failed spectacularly.

Kristi 06-11-2007 02:09 PM

Quote:

Originally Posted by killerogue (Post 1316097)
Edit: Inver helped me solve my problem. Thanks tho guys.

So post your solution for the betterment of others...

killerogue 06-13-2007 02:21 AM

Well, it was the way the DB was named. :O I was using too common a named (Test was the name of it) DB and apparently it was conflicting. :O

Inverness 06-13-2007 03:32 AM

This is why I had asked long time ago for a list of global variables.

Actually, I would like an allobjects array that represents all the objects active in that space (your client or the server).


All times are GMT +2. The time now is 05:43 PM.

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