Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
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 08-21-2008, 08:11 PM
The_Kez The_Kez is offline
N-Pulse Asst. Manager
The_Kez's Avatar
Join Date: Dec 2007
Posts: 106
The_Kez is on a distinguished road
Send a message via MSN to The_Kez
Object transfering

I've heard of this problem before but I've never actually had to deal with this before until now; I have a mudlib that I'm creating and I'm having problems transferring the info from the server to the client.

I've tried a couple ways to get around this: setting the object as a player.attr which didn't work. I've tried saving the object vars to an array and transfering the array, but for some reason that didn't work either, maybe it was something wrong with my coding.

This is my function which returns a player's mud file:

PHP Code:
public function loadMudFileacct ) {
  
temp.e.loadvarsgetAccountPath(acct) );
  for ( 
temp.e.getDynamicVarNames() ) {
    if ( 
i.tokenize("_")[2] > 9999 || i.starts("spells_") ) {
      
temp.objnum++;
      
makevar"temp.obj" objnum ) = new TStaticVar();
      
makevar"temp.obj" objnum ).loadvarsfromarray(e.( @ ));
      
temp.("obj" objnum).addtemp.playeritems );
    }
  }
  
temp.= new TStaticVar();
  for ( 
temp.i=1temp.i<=objnumtemp.i++ ) {
    
makevar"temp.e.item" ) = makevar"temp.obj" );
  }
  return 
e;

So it loads each item into a tstaticvar, then creates a tstaticvar that holds each item as a subvariable. So to return an item stat I can say:

PHP Code:
temp.items loadMudFileplayer );
echo( 
items.item1.displayname );
echo( 
items.item4.range ); 
The problem like I said is just taking the info and getting it to the clientside. To do that I tried this:

PHP Code:
  temp.items loadMudFileplayer.account );
  for ( 
temp.items.getDynamicVarNames() ) {
    
temp.objnum++;
    
makevar"temp.arry" objnum ) = makevar"temp.items." ).savevarstoarray(0);
    
temp.("arry" objnum).addtemp.itemxfer );
    echo( 
temp.("arry" objnum) );
  }
  
triggerClient"gui" name "pullMUDclientside" itemxfer ); 
savevarstoarray is woking just fine. But when I take the arrays and add them into itemxfer, the info just seems to get lost. If anyone has any ideas on what's wrong or a better way to do it that'd be great
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 12:32 AM.


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