Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 11-26-2011, 11:23 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default quest::itemlink(item_id)

I seem to be having trouble with this quest function throwing a segmentation fault.

A simple....

quest::itemlink(item_id)

quest::varlink(item id)

Either one, even just trying to do a say or shout with a cloth cap, 1001 will bring the zone down.
Reply With Quote
  #2  
Old 11-27-2011, 02:50 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

Both work fine for me when used like this:

Code:
sub EVENT_SAY
{
	my $cookieid = quest::varlink(19732);
	quest::say("Yum, [$cookieid]");
	quest::itemlink(19732);
}
Hard to say why it might be crashing for you. You'll probably need to debug it to see where it crashes for anyone to help you.
Reply With Quote
  #3  
Old 11-27-2011, 09:12 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Pretty easy what I was doing wrong, luckily you posted your entire subroutine and that helped me see what I was doing wrong.

I did not have mine in an EVENT_SAY routine. I was actually trying to get the npc to do random announces in the zone. If I try to put that command just anywhere, as soon as it fires the zone goes down. I guess it is crashing trying to figure out who the say is with ?

This sucks because I was trying to do an announce randomly, not just when someone hails them.
Reply With Quote
  #4  
Old 11-27-2011, 09:28 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

You can use a timer with a random time value.
Reply With Quote
  #5  
Old 11-27-2011, 09:29 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Oh, the timer is not an issue, I have that part perfected. What I am saying is if you use that item link code anywhere else, the zone goes down.
Reply With Quote
  #6  
Old 11-27-2011, 10:00 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

I'm getting at you can call your EVENT_SAY from a timer.
Reply With Quote
  #7  
Old 11-27-2011, 10:02 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

I figured that would crash the zone too ? I mean it popped in my head but I figured there were special variables associated with when the say calls the command ? I am about to give it a shot, and then report back.
Reply With Quote
  #8  
Old 11-27-2011, 10:03 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Yep, only took 30 seconds for the zone to crash.

I did a EVENT_SAY(); from my timer, crash.
Reply With Quote
  #9  
Old 11-27-2011, 10:47 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

It looks like the initiator causing the crash, i will report back when I have it fixed.
Reply With Quote
  #10  
Old 11-27-2011, 08:03 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

The functions that make item links require a client to do so since the generated link is different depending on the client version in use.
Reply With Quote
  #11  
Old 11-28-2011, 05:24 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yeah, the code just needs to do an if initiator check in the source for that function. Then, if no initiator, it would have to determine which version it wants to use. I was thinking of adding it to just send it out as a SoF+ itemlink by default if no initiator, but haven't made the change yet. Simple fix though. We could add an optional field to the quest command to let the admin decide if they want a Titanium link or SoF+.

I think KLS had some code that would fix all itemlinks to be correct for any client that sees them, but I don't remember what the exact changes were. Ultimately, that would be the best solution.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #12  
Old 11-28-2011, 09:19 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Slightly off topic, but since I have you here, so to speak.

Where did you learn to code, was it formal like in College ?

I am a hardware / network tech by trade. It has taken me quite a while to get there but I can at least read the code now and make heads or tails about what I am seeing. I am also finding it easier to switch between languages now (php, vb.net, c#, Perl, etc) and other than syntax, I can seem to switch easier than before. 4 years ago there was no way I could read c++, but at least now I can read it, compile it and make changes. I have a seriously long way to go before I am good at it.
Reply With Quote
  #13  
Old 11-28-2011, 12:35 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

LOL, no, I learned the same way you are learning. I started my server 4 years ago and shortly after, I started reading the source and making small changes here and there for things I could follow when reading the code. I learned almost completely by example from our source, which is why most stuff I do is just an altered version of something else that exists in the source. Once you have read through it enough and worked on things here and there, it is easier to know what you need to look at to find an example of what you might be wanting to do.

I am certainly not at the level of skill of most of our devs like KLS, Derision, or many of the others. I just have enough time invested in it that I can normally get done with what I need without too much trouble. I think they just tolerate my lower skill level because I am willing to spend lots of time on new client compatibility and adding new features and quest commands. And, I don't break stuff too often

My first big project was definitely to get EQEmu upgraded from Titanium so it could be compatible with SoF. That took an insane amount of time since I knew almost nothing about what I was doing when I first started on it lol. A little googling here and there, and reading the EQEmu wiki helped alot. Then KLS and Derision came in and helped finish the stuff that was a bit too far out of my scope of abilities (like completely rebuilding how items are sent to the client).
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #14  
Old 11-28-2011, 01:43 PM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

That is exactly what I am wanting to do.

My motivation is to work on my server for months, or maybe a year and get it to a solo playable level, with just a small amount of people. At some point I would want to open it to the public.
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 03:26 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3