Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Server Code Submissions

Reply
 
Thread Tools Display Modes
  #1  
Old 07-20-2008, 09:09 AM
CodeMephit
Fire Beetle
 
Join Date: Oct 2006
Posts: 18
Default

/shrug

Maybe I am missing something, but all I can find in the rules is:

Character:ConsumpionMultiplier = 200

There is no comment or description. How is one to know what to set the value at to achieve a live-like consumption rate without trial and error? I understand that some folks want characters to eat more. This is perfectly fine. However, not everybody has that same desire. I believe that 'fast' or 'slow' eating should be the exception to the rule, and 'regular' eating should be the default.

The change I am proposing will not stop a custom server from doing what the Admin wants it to do. They can still set the rule, and it will still take effect. Character will eat slower or faster.

But for all the other folks, who simply want a like-like server, to me, this is a viable offering to the code-base.

Another issue: I don't see how the Character:ConsumptionMultiplier handles the issues of small or large characters needing less or more food respectively. I also do not see it handling a mount's hunger. I know the code I have posted so far does not do these things either, but I am currently witting code that does. I am still learning C++ (teaching myself) so I can't churn a whole block of code out over night. It takes a little while.

Here is the psuedo-code of what I am trying to accomplish:

Code:
NutritionValue = 10
If Race = Small, Then NutritionValue = (NutritionValue + 2.5)
If Race = Large, Then NutritionValue = (NutritionValue - 2.5)
For Each SpellIcon
 If SpellIcon = Mount, Then NutritionValue = (NutritionValue - 2.5)
Next SpellIcon
m_pp.hunger_level += eat_item->CastTime*cons_mod*NutritionValue;
m_pp.thirst_level += eat_item->CastTime*cons_mod*NutritionValue;
This will set a 'base' rate for a medium sized character, and make each food item worth more to a small character, worth less to a large character and worth less if you have a mount summoned. I am currently working on what variables are available to me to test for a character's race, and then I can write out the actual if/thens or cases. Then I will tackle figuring out which spells are active on a character. But the code above gives a quick idea of my goals.

-Codemephit
Reply With Quote
  #2  
Old 07-20-2008, 01:19 PM
ChaosSlayer
Demi-God
 
Join Date: May 2007
Posts: 1,032
Default

Quote:
Originally Posted by CodeMephit View Post
/shrug

Maybe I am missing something, but all I can find in the rules is:

Character:ConsumpionMultiplier = 200

There is no comment or description. How is one to know what to set the value at to achieve a live-like consumption rate without trial and error?
thats would be a valid question to a person who prabobly forgot to add the description =) (and it wasn't me =)

anyway, the higher the number the longer it takes your char to get hungry.

as far as diffirent races eating at diffirent rate - if you going to code it in, please make sure to include a rule to turn it off =)

otherwise when food cost a 100 plat, soem race will be spendign way more than others wihout any benefit (its all back from the day when each race had diffirent XP gain modifier)
Balance wise, Ogres, Trolls, and Iksar should be the only races who eat more due to their inherited racial bonus which actualy decently strong (given they actualy coded in)
Reply With Quote
  #3  
Old 07-22-2008, 08:09 AM
CodeMephit
Fire Beetle
 
Join Date: Oct 2006
Posts: 18
Default

I could use a little guidance on variable usage please.

I have added the following line to \EQEmu-0.7.0-1118\zone\client_packet.cpp just before a character eats:
Code:
Message(13, "My current race is: ");
This will print a message in the client chat window.

I then began changing it to print the 'race' variable. I have tried:
Code:
Message(13, m_pp.race);
Message(13, pp.race);
Message(13, race);
In hopes of printing the 'race' variable to the chat window. The pourpose of this is so that I have an idea what to test for. At the present, I don't know if race is stored as a number (ie. Human=1, Elf=2, Dwarf=3) or if it is stored as a string (ie. Human="HUMAN", Elf="ELF", Dwarf="DWARF"). I also don't exactly know the name of the variable that holds the race value.

None of the above attempts would work. I have also seen in other code where things like the following were used:
Code:
scs->zone_id
zone->GetZoneID()
Maybe I need to use the -> thing to point to where the race variable is?

If anyone happens to know and can point me in the right direction, I would be *very* appreciative.

Thanks
-Codemephit
Reply With Quote
  #4  
Old 07-22-2008, 08:33 AM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Try:

Code:
Message(13, "My race is %d", m_pp.race);
%d means there is an integer argument following to substitute into the string. Lookup the C printf function for other types you can use.
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 11:29 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