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 05-24-2004, 09:32 AM
KhaN's Avatar
KhaN
Dragon
 
Join Date: Mar 2004
Location: France, Bordeaux.
Posts: 677
Default PC Global variable ?

I would like to know if there is a way to flag/set a variable available for a PC. This variable is attribued to a character and available on all NPC.
__________________

Reply With Quote
  #2  
Old 05-24-2004, 10:30 AM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default

setglobal will do it (assuming qglobal is set for the npc to get the global)

setglobal(varname,value,options,duration)

use option 5 for all zones, 1 for just this zone. This table might help with the option values:

Code:
------------------------------------------------------------------
value  npcid    player    zone
------------------------------------------------------------------
0          this       this       this
1          all         this       this
2          this	     all         this
3          all         all          this
4          this       this        all
5          all         this        all
6          this	     all          all
7          all        all           all
__________________
Maybe I should try making one of these servers...
Reply With Quote
  #3  
Old 05-24-2004, 02:17 PM
Swampdog
Hill Giant
 
Join Date: May 2004
Posts: 106
Default

Aye.. Thats exactly what I posted in our forums a little bit ago for the one pet quest that I reserver a global for KhaN. :P

Great job on coding the quest::XXXglobals Scorp and Tark.. While we are on the subject, is there a function that you guys have set up where we can call a getglobals kinda function to check a variable setting for the current player? We are trying to set up a couple of quests which will create a static variable for that player upon completion of quest and the information would be pulled back.

I took a look at the code that is used by the NPCs up higher in parser.ccp. Basically looking to get a function done which will process the charID and for the existance of a specified variable name and if it exsists return the value. If this is something you guys have already and wouldn't mind sharing, it would be awesome! My sleep deprived state has me pulling hair out trying to figure it out. Sounds like it would be easy, but I haven't really dealt with handling the database interaction and not having a solid understanding of those functions I think is my downfall...
__________________
Kukthar
Discord Aftermath (alpha) LAN Party Server [Custom Legit] - Op/Dev
Temporarilly on hold due to time constraints
Damn rl interupting fun anyways.. :P
Reply With Quote
  #4  
Old 05-24-2004, 03:46 PM
animepimp
Dragon
 
Join Date: Jan 2004
Posts: 860
Default

Look at Tark's original post demonstrating this. When you store the variable you give it a name like "var1". Then you can access it with $var1 and in an if you can do define $var1 to see if it exists. So you have to use methods to create it but its accessed like any other variable in perl.
Reply With Quote
  #5  
Old 05-24-2004, 05:56 PM
Swampdog
Hill Giant
 
Join Date: May 2004
Posts: 106
Default

Yeah... I know how to access it within the perl quest code.. But there are some things we would like to set as permanent variables which are created through completion of a quest but accessed within the server code. So I'm trying to program a function that can retrieve the values from the quest_globals table and manipulate/compare against within different parts of the code. Does that make sense? Probably not.. Going on 48 hours without sleep..

I'll look at the code tomorrow after some sleep and try to post a better description then. Who knows, with sleep I might be able to figure it out as well... LOL
__________________
Kukthar
Discord Aftermath (alpha) LAN Party Server [Custom Legit] - Op/Dev
Temporarilly on hold due to time constraints
Damn rl interupting fun anyways.. :P
Reply With Quote
  #6  
Old 05-24-2004, 10:30 PM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default

Quest globals weren't really designed that way. They are supposed to appear like "magic", transparent to the quest script itself.

The bigger problem is in the perl implementation. It isn't really possible to pass a value back from the parser to the quest script. I'm looking at XS and will probably have something in to play with soon, which will eventually make it possible for the perl script to interact with the server functions.

Th quest global will still work for you though. Just use option 1 or 5 depending on if you want it world wide or zone specific, and the player specific variable will be available to NPCs you choose. Any NPC can change it, and those with qglobal set can check it.
__________________
Maybe I should try making one of these servers...
Reply With Quote
  #7  
Old 05-25-2004, 05:11 AM
Swampdog
Hill Giant
 
Join Date: May 2004
Posts: 106
Default

Thanks for the response Scorp.. What we are looking at doing with the current project is develop a quest which, once completed, will allow the player to permenantly name their pet. I'm going to be using the setglobal with option 5 so it is available to all NPCs in all zones and is player specific for each player.

So it will be saving the value in the quest_globals table where it should be available to pluck it out. My problem is plucking it out. I've looked at the code for GetRandPetName in spells.cpp and looked at your code in parser.cpp. I should be able to use the database query routine to grab the value and if it exsists to use it instead of grabbing a random name. I think I need to dig into the sql database interface and learn more about what the command structs you are using in the code for setglobal is doing when called so I can run a SELECT query and grab the value from quest_global.
__________________
Kukthar
Discord Aftermath (alpha) LAN Party Server [Custom Legit] - Op/Dev
Temporarilly on hold due to time constraints
Damn rl interupting fun anyways.. :P
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 -4. The time now is 01:55 PM.


 

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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3