|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
06-15-2013, 01:57 PM
|
Discordant
|
|
Join Date: Aug 2009
Location: 2131231231
Posts: 255
|
|
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!!!
__________________
|
06-15-2013, 02:24 PM
|
Discordant
|
|
Join Date: Aug 2009
Location: 2131231231
Posts: 255
|
|
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");
__________________
|
06-15-2013, 02:35 PM
|
|
Developer
|
|
Join Date: Dec 2012
Posts: 515
|
|
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
|
06-15-2013, 02:51 PM
|
Discordant
|
|
Join Date: Aug 2009
Location: 2131231231
Posts: 255
|
|
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. :/
__________________
|
06-15-2013, 03:01 PM
|
|
Developer
|
|
Join Date: Dec 2012
Posts: 515
|
|
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
|
|
|
|
06-15-2013, 03:15 PM
|
Discordant
|
|
Join Date: Aug 2009
Location: 2131231231
Posts: 255
|
|
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?
__________________
|
|
|
|
|
|
|
06-15-2013, 03:43 PM
|
Discordant
|
|
Join Date: Aug 2009
Location: 2131231231
Posts: 255
|
|
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]);
}
}
__________________
|
|
|
|
06-15-2013, 04:07 PM
|
|
Developer
|
|
Join Date: Dec 2012
Posts: 515
|
|
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
|
06-15-2013, 04:19 PM
|
Discordant
|
|
Join Date: Aug 2009
Location: 2131231231
Posts: 255
|
|
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.
__________________
|
06-15-2013, 11:15 PM
|
|
Developer
|
|
Join Date: Dec 2012
Posts: 515
|
|
Why not just use the player.pl for the zone that is a PVP zone? Or do you have multiple pvp zones?
|
06-15-2013, 11:39 PM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,743
|
|
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.
|
06-15-2013, 11:57 PM
|
Discordant
|
|
Join Date: Aug 2009
Location: 2131231231
Posts: 255
|
|
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.
__________________
|
06-16-2013, 12:42 AM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,743
|
|
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.
|
|
|
|
06-16-2013, 05:05 PM
|
Discordant
|
|
Join Date: Aug 2009
Location: 2131231231
Posts: 255
|
|
Quote:
Originally Posted by lerxst2112
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
__________________
|
|
|
|
06-16-2013, 06:38 PM
|
Demi-God
|
|
Join Date: Aug 2010
Posts: 1,743
|
|
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.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 12:03 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|