Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Quests

Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2004, 07:39 AM
cofruben
Old-EQEmu Developer
 
Join Date: Oct 2002
Location: Spain
Posts: 323
Default Working for variables.

News variables is going to be inserted here.Working for adding more at the moment.
in embparser:
Code:
		ExportVar(packagename.c_str(), "name", mob->GetName());
		ExportVar(packagename.c_str(), "race", GetRaceName(mob->GetRace()));
		ExportVar(packagename.c_str(), "class", GetEQClassName(mob->GetClass()));
		ExportVar(packagename.c_str(), "ulevel", itoa(mob->GetLevel()));
		ExportVar(packagename.c_str(), "userid", itoa(mob->GetID()));
		ExportVar(packagename.c_str(), "ugender", itoa(mob->GetGender()));//Cofruben:-my variables starts here
		ExportVar(packagename.c_str(), "uhp", itoa(mob->GetHP()));
	}
in embparser.cpp you will see this,add ugender:
Code:
	if (mob) {
		ExportVar(packagename.c_str(), "name", mob->GetName());
		ExportVar(packagename.c_str(), "race", GetRaceName(mob->GetRace()));
		ExportVar(packagename.c_str(), "class", GetEQClassName(mob->GetClass()));
		ExportVar(packagename.c_str(), "ulevel", itoa(mob->GetLevel()));
		ExportVar(packagename.c_str(), "userid", itoa(mob->GetID()));
		ExportVar(packagename.c_str(), "ugender", itoa(mob->GetGender()));
I will keep adding more.
Reply With Quote
  #2  
Old 04-26-2004, 09:27 AM
sandy
Hill Giant
 
Join Date: Oct 2002
Posts: 212
Default

you should not use the hps of the monster but its hpratio
=)
__________________
Sandy
Reply With Quote
  #3  
Old 04-26-2004, 11:13 AM
smogo
Discordant
 
Join Date: Jan 2004
Location: 47
Posts: 339
Default

just a hint imho :

setting variables gets them exported for ALL mobs, on MANY events. This can really be useless overhead. e.g. the $userid and $ugender beeing exported every EVENT_ATTACK is wasted CPU.

When in need of a variable, for a specific quest or situation or mob , it's advisable to use perl calling C functions, as submitted by m0oni9

Just my 2 copper.
__________________
EQEMu Quest Repository is down until something new :(
Reply With Quote
  #4  
Old 04-26-2004, 11:20 AM
m0oni9
Hill Giant
 
Join Date: Dec 2003
Posts: 166
Default

per Scorpicus2k, this change will be going in: http://www.eqemulator.net/forums/viewtopic.php?t=13920

meaning that we can start calling functions from the server. IMO we should move as many of these exported variables into getVariable functions on the server as possible. This will save some overhead. Once you have the userid exported (I'm assuming this is charid?.. haven't checked), you can use that to determine player level, inventory, race, gender, etc.

It just doesn't make sense to keep a lot of these variables the way they are with this new capability, so if you are thinking of adding new ones, please take a look at the perl/XS docs. The framework is now in to start adding functions. Briefly, the way I do it is:
  • create C function that we are going to be calling
    run h2xs in some directory to create a workspace (one-time thing)
    create .xs file, including C function or C function prototype (whatever you feel like doing)
    generate C code from .xs file
    insert original C function, and XS-generated C code into cperl.cpp, also adding in the appropriate newXS() call.

I had plans to add some new functions (to replace hasitem, etc), and also write a little tutorial.. I'm thinking I may not get around to it before I take off to school this week, though. :cry:
Reply With Quote
Reply

Thread Tools
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 -4. The time now is 06:15 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3