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

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

Reply
 
Thread Tools Display Modes
  #16  
Old 06-15-2013, 01:57 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 253
Default

Thanks Uleat!

I was wondering about that, after I clear it has no value. I did try zoning to a normal zone to make the global then did my test as well, got the same result.

On the way out will probably work better. or maybe change sub EVENT ENTERZONE to CONNECT?
Going to work on that now. Will update!!!
__________________
Reply With Quote
  #17  
Old 06-15-2013, 02:24 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 253
Default

Another update, by watching the globals table on the "PvPState row,
Value on the right was remaining empty. Still isnt pulling 1 or 0
Code:
quest::setglobal("PvPState",$client->GetPVP(),5,"F");
Code:
128	0	0	PvPState
__________________
Reply With Quote
  #18  
Old 06-15-2013, 02:35 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Code:
|| *charid* || *npcid* || *zoneid* || *name* || *value* || *expdate* ||
|| 224 || 0 || 0 || PvPState || 1 || _NULL_ ||

Working for me... thats my character zoning in PVP flagged so "Value" is set to 1



When i zone in while not flagged it gets set to nothing ... so thats why I was checking for PvPState==1
Reply With Quote
  #19  
Old 06-15-2013, 02:51 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 253
Default

Could it be a perl version difference? I copied your script directly from the post, deleted everything else but your version in global player. zoned to like 10 different zones in a row and value never gained 1 or 0. All it does is always make me pvp no matter what state I start with or zone I go to. is there something in your player.pl for the zones?
perl 5.10.1 build 1007


er wait, checking something
I tried zoning with and without pvp flag turned on initially. still stores no value for me. :/
__________________
Reply With Quote
  #20  
Old 06-15-2013, 03:01 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Without PVP it stores NO VALUE :p

with PVP it stores it as a 1

So when they zone back out if its 1 .. they are set back to PVP when zoning out... else it turns off PVP when they zone out... meaning that it had no value
Reply With Quote
  #21  
Old 06-15-2013, 03:15 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 253
Default

Thank you for clarifying that. I was noticing that the more I zoned back and forth. Its still not working properly for me but im widdling away. will post an update later. I think im getting close tho lol *hopes*

Thank you for all the help guys!

edit: As Uleat stated if you change pvp states and you zone. The qglobal doesn't get saved that you changed to a new state and then it will call the previous state from the last zone. That's my issue atm. So if your pvpoff and talk to npc and say pvpon, then zone, it just loads the global from the zone and your not pvp anymore.

Can you set a global in ENTERZONE and ZONE with the same name and it just auto overwrites? Like so when you ENTERZONE and sets value 1 pvpstate then you ZONE and make another global named pvpstate and just overwrites the previous to record a state change between ENTERZONE and ZONE? Or does it need to be deleted and refreshed per sub?
__________________
Reply With Quote
  #22  
Old 06-15-2013, 03:43 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 253
Default

This works almost. It saves the state change between zoning and applies it. I watch the state change to empty from 1 when zoning after changing from pvpon to pvpoff but then about 2 seconds pass and your name still turns read.
It even says the chat msg of "You no longer follow the ways of discord" but still turns back on after the couple seconds.
Possible hard coding conflict?
Edit : I don't think its hard coding, still blindly missing the correct order I guess. Because it does change the globals from 1 to Nothing to save the change after talking to NPC but when the name turns red after the couple seconds the pvpstatus value changes back to 1. So, its somewhere in the script always applying the change maybe. lol I envy you smart guys who know this stuff. I am learning through trial, error and eqemu forums

notice the del qglobals are # for testing purposes.

Code:
sub EVENT_ENTERZONE {
quest::setglobal("PvPState",$client->GetPVP(),5,"F");
	if(defined $qglobals{"PvPState"} && $qglobals{"PvPState"}==1)
	{
		$client->SetPVP(1);
		#quest::delglobal([PvPState]);
	}
	elsif($zonesn =~ /^mischiefplane$/) {
	$client->SetPVP(1);
	$client->Message(15, "It's time for some Mischief, kill or be killed");
	
	}
	else
	{
		$client->SetPVP(0);
		#quest::delglobal([PvPState]);
	}
}

sub EVENT_ZONE {
quest::setglobal("PvPState",$client->GetPVP(),5,"F");
	if(defined $qglobals{"PvPState"} && $qglobals{"PvPState"}==1)
	{
		$client->SetPVP(1);
		#quest::delglobal([PvPState]);
		
	}
	else
	{
		$client->SetPVP(0);
		#quest::delglobal([PvPState]);
		
	}
}
__________________
Reply With Quote
  #23  
Old 06-15-2013, 04:07 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

wait are you doing this in the global_player.pl ??

(since you are checking the zone shortname)


If so then my script would have to be changed I could help ya more when I get back =p
Reply With Quote
  #24  
Old 06-15-2013, 04:19 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 253
Default

Ya lol the global_player. I think I got the closed loop working to save state changes between zone in and out. but it doesn't clear mischiefplanes direct set of pvpon. worken on that now.
__________________
Reply With Quote
  #25  
Old 06-15-2013, 11:15 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Why not just use the player.pl for the zone that is a PVP zone? Or do you have multiple pvp zones?
Reply With Quote
  #26  
Old 06-15-2013, 11:39 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

If you need to use it as a gloab file you might look at the code or add some logging. It's possible when more than one zone is involved that the events overlap and aren't processed in the order you might expect.
Reply With Quote
  #27  
Old 06-15-2013, 11:57 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 253
Default

I do plan on having multiple zones that are considered "contested" plane of mischief is one of them. So the point being able to turn u pvp when u zone in and turn you back on or off depending what u were before u zoned in.

I butted heads with this for hours today, I got it to save the pvp state for the most part bbut when you hit a contested zone it screws it up. I tried making a global for the contested zones but that's where I stopped at, needed a break lol.
__________________
Reply With Quote
  #28  
Old 06-16-2013, 12:42 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

Well, if you have it global it would seem you only need to handle the enter zone event and do the right thing there. If it's a zone where they should be pvp then save the current state and set pvp on. If it isn't one of those zones then restore the old state.
Reply With Quote
  #29  
Old 06-16-2013, 05:05 PM
Figback65
Discordant
 
Join Date: Aug 2009
Location: 2131231231
Posts: 253
Default

Quote:
Originally Posted by lerxst2112 View Post
Well, if you have it global it would seem you only need to handle the enter zone event and do the right thing there. If it's a zone where they should be pvp then save the current state and set pvp on. If it isn't one of those zones then restore the old state.
that covers everything except the optional pvp change between zones.

Parts of everything we have tried work but not as a whole in the script meaning sometimes it will save the change but not load it or forcing pvp from zones messes up the global rotation. Still working on it. I am getting closer though.

Just gotta have the recall of globals at the right time. And I gotta figure out how to call the global after exiting a specific zone. Like with code listed above, when you zone into mischief, I call short name and force pvp, but when you zone out, its not calling the preset global. I think I may have to copy the shortname call to EVENT_ZONE as well, if that will work. going to play with that today. Orignally I was just trying to recall the global at ALL zone ins but I cant get that to work. In theory when you read the script, it should work but its not lol. Sometimes it looks like its working and changes the correct pvp state but then it will change a few seconds later lol. This math of words is crazy!!! lol
__________________
Reply With Quote
  #30  
Old 06-16-2013, 06:38 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,743
Default

Like I said before, if the events happen in a different order than you think they do the logic of the script will be broken.

I haven't looked at the code, but consider if you got EVENT_ZONE for the old zone after you got ENTER_ZONE for the new zone.

I don't see anything in your existing script that can't be handled by the single ENTER_ZONE event. There is nothing optional in your script, just force pvp on in mischief and set it to the old state for everything else.
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 12:49 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